From 4b80c3456ac2d0da695e0fb7fa0fb9dc72459bd9 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Feb 2022 00:27:08 +0100 Subject: [PATCH 01/30] Add --KVS option for examples/platform/linux in order to specify where the kvs store will be created (#14832) --- examples/platform/linux/AppMain.cpp | 12 ++++++++++++ examples/platform/linux/Options.cpp | 11 ++++++++++- examples/platform/linux/Options.h | 1 + scripts/tests/chiptest/test_definition.py | 3 --- src/app/server/Server.cpp | 7 ------- src/platform/Darwin/CHIPPlatformConfig.h | 4 ++++ src/platform/Darwin/KeyValueStoreManagerImpl.mm | 2 +- src/platform/Linux/KeyValueStoreManagerImpl.h | 2 +- 8 files changed, 29 insertions(+), 13 deletions(-) diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index f3aa990ee80a6f..556adf14cbcdec 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -122,6 +122,18 @@ int ChipLinuxAppInit(int argc, char ** argv) err = Platform::MemoryInit(); SuccessOrExit(err); +#ifdef CHIP_CONFIG_KVS_PATH + if (LinuxDeviceOptions::GetInstance().KVS == nullptr) + { + err = DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); + } + else + { + err = DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(LinuxDeviceOptions::GetInstance().KVS); + } + SuccessOrExit(err); +#endif + err = DeviceLayer::PlatformMgr().InitChipStack(); SuccessOrExit(err); diff --git a/examples/platform/linux/Options.cpp b/examples/platform/linux/Options.cpp index b637a264253662..920757541b0935 100644 --- a/examples/platform/linux/Options.cpp +++ b/examples/platform/linux/Options.cpp @@ -47,7 +47,8 @@ enum kDeviceOption_SecuredCommissionerPort = 0x100b, kDeviceOption_UnsecuredCommissionerPort = 0x100c, kDeviceOption_Command = 0x100d, - kDeviceOption_PICS = 0x100e + kDeviceOption_PICS = 0x100e, + kDeviceOption_KVS = 0x100f }; constexpr unsigned kAppUsageLength = 64; @@ -74,6 +75,7 @@ OptionDef sDeviceOptionDefs[] = { { "unsecured-commissioner-port", kArgumentRequired, kDeviceOption_UnsecuredCommissionerPort }, { "command", kArgumentRequired, kDeviceOption_Command }, { "PICS", kArgumentRequired, kDeviceOption_PICS }, + { "KVS", kArgumentRequired, kDeviceOption_KVS }, {} }; @@ -129,6 +131,9 @@ const char * sDeviceOptionHelp = "\n" " --PICS \n" " A file containing PICS items.\n" + "\n" + " --KVS \n" + " A file to store Key Value Store items.\n" "\n"; bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue) @@ -213,6 +218,10 @@ bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier, LinuxDeviceOptions::GetInstance().PICS = aValue; break; + case kDeviceOption_KVS: + LinuxDeviceOptions::GetInstance().KVS = aValue; + break; + default: PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); retval = false; diff --git a/examples/platform/linux/Options.h b/examples/platform/linux/Options.h index 8bb086c1b184c0..5be6667ce52e2a 100644 --- a/examples/platform/linux/Options.h +++ b/examples/platform/linux/Options.h @@ -40,6 +40,7 @@ struct LinuxDeviceOptions uint32_t unsecuredCommissionerPort = CHIP_UDC_PORT; const char * command = nullptr; const char * PICS = nullptr; + const char * KVS = nullptr; static LinuxDeviceOptions & GetInstance(); }; diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index d94478292dad68..71020b0eae4736 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -66,9 +66,6 @@ def reboot(self, discriminator): def factoryReset(self): storage = '/tmp/chip_kvs' - if platform.system() == 'Darwin': - storage = str(Path.home()) + '/Documents/chip.store' - if os.path.exists(storage): os.unlink(storage) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index eb76a55b8de02b..230a0b52132542 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -113,13 +113,6 @@ CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint // handler. SetAttributePersistenceProvider(&mAttributePersister); -#if CHIP_DEVICE_LAYER_TARGET_DARWIN - err = DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init("chip.store"); - SuccessOrExit(err); -#elif CHIP_DEVICE_LAYER_TARGET_LINUX - DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); -#endif - InitDataModelHandler(&mExchangeMgr); err = mFabrics.Init(&mDeviceStorage); diff --git a/src/platform/Darwin/CHIPPlatformConfig.h b/src/platform/Darwin/CHIPPlatformConfig.h index 6b99d01dc8277c..c4cd33c1efa8e3 100644 --- a/src/platform/Darwin/CHIPPlatformConfig.h +++ b/src/platform/Darwin/CHIPPlatformConfig.h @@ -74,3 +74,7 @@ // TODO - Fine tune MRP default parameters for Darwin platform #define CHIP_CONFIG_MRP_DEFAULT_INITIAL_RETRY_INTERVAL (15000) #define CHIP_CONFIG_MRP_DEFAULT_ACTIVE_RETRY_INTERVAL (2000_ms32) + +#ifndef CHIP_CONFIG_KVS_PATH +#define CHIP_CONFIG_KVS_PATH "/tmp/chip_kvs" +#endif // CHIP_CONFIG_KVS_PATH diff --git a/src/platform/Darwin/KeyValueStoreManagerImpl.mm b/src/platform/Darwin/KeyValueStoreManagerImpl.mm index 44ca337782578b..6cf59b349fa84f 100644 --- a/src/platform/Darwin/KeyValueStoreManagerImpl.mm +++ b/src/platform/Darwin/KeyValueStoreManagerImpl.mm @@ -165,7 +165,7 @@ - (instancetype)initWithContext:(nonnull NSManagedObjectContext *)context key:(n url = [NSURL URLWithString:[NSString stringWithUTF8String:fileName] relativeToURL:documentsDirectory]; } else { - url = [NSURL URLWithString:[NSString stringWithUTF8String:fileName]]; + url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:fileName]]; } ReturnErrorCodeIf(url == nullptr, CHIP_ERROR_NO_MEMORY); diff --git a/src/platform/Linux/KeyValueStoreManagerImpl.h b/src/platform/Linux/KeyValueStoreManagerImpl.h index a8a9b73a8a7e94..77912c359bc0ce 100644 --- a/src/platform/Linux/KeyValueStoreManagerImpl.h +++ b/src/platform/Linux/KeyValueStoreManagerImpl.h @@ -36,7 +36,7 @@ class KeyValueStoreManagerImpl : public KeyValueStoreManager * @brief * Initalize the KVS, must be called before using. */ - void Init(const char * file) { mStorage.Init(file); } + CHIP_ERROR Init(const char * file) { return mStorage.Init(file); } CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size = nullptr, size_t offset = 0); CHIP_ERROR _Delete(const char * key); From b99ce47f31367df731b828a98c7ab93f2218c46c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 7 Feb 2022 18:29:53 -0500 Subject: [PATCH 02/30] Ensure buff size constraints in chip logging module name fetch (#14844) * Update logging logic a bit * Enforce buffer size at compile time * Place more logging bits into anon namespace to make them static. Help the linker out a bit --- src/lib/support/logging/CHIPLogging.cpp | 97 +++++++++++++------------ src/lib/support/logging/CHIPLogging.h | 6 -- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/src/lib/support/logging/CHIPLogging.cpp b/src/lib/support/logging/CHIPLogging.cpp index 57dacbe3f1b9f0..4b3a5142b8d524 100644 --- a/src/lib/support/logging/CHIPLogging.cpp +++ b/src/lib/support/logging/CHIPLogging.cpp @@ -45,8 +45,6 @@ namespace { std::atomic sLogRedirectCallback{ nullptr }; -} - /* * Array of strings containing the names for each of the chip log * modules. @@ -57,57 +55,64 @@ std::atomic sLogRedirectCallback{ nullptr }; * necessary. * */ -static const char ModuleNames[] = "-\0\0" // None - "IN\0" // Inet - "BLE" // BLE - "ML\0" // MessageLayer - "SM\0" // SecurityManager - "EM\0" // ExchangeManager - "TLV" // TLV - "ASN" // ASN1 - "CR\0" // Crypto - "CTL" // Controller - "AL\0" // Alarm - "SC\0" // SecureChannel - "BDX" // BulkDataTransfer - "DMG" // DataManagement - "DC\0" // DeviceControl - "DD\0" // DeviceDescription - "ECH" // Echo - "FP\0" // FabricProvisioning - "NP\0" // NetworkProvisioning - "SD\0" // ServiceDirectory - "SP\0" // ServiceProvisioning - "SWU" // SoftwareUpdate - "TP\0" // TokenPairing - "TS\0" // TimeServices - "HB\0" // Heartbeat - "CSL" // chipSystemLayer - "EVL" // Event Logging - "SPT" // Support - "TOO" // chipTool - "ZCL" // Zcl - "SH\0" // Shell - "DL\0" // DeviceLayer - "SPL" // SetupPayload - "SVR" // AppServer - "DIS" // Discovery - "IM\0" // InteractionModel - "TST" // Test - "ODP" // OperationalDeviceProxy - "ATM" // Automation +const char ModuleNames[] = "-\0\0" // None + "IN\0" // Inet + "BLE" // BLE + "ML\0" // MessageLayer + "SM\0" // SecurityManager + "EM\0" // ExchangeManager + "TLV" // TLV + "ASN" // ASN1 + "CR\0" // Crypto + "CTL" // Controller + "AL\0" // Alarm + "SC\0" // SecureChannel + "BDX" // BulkDataTransfer + "DMG" // DataManagement + "DC\0" // DeviceControl + "DD\0" // DeviceDescription + "ECH" // Echo + "FP\0" // FabricProvisioning + "NP\0" // NetworkProvisioning + "SD\0" // ServiceDirectory + "SP\0" // ServiceProvisioning + "SWU" // SoftwareUpdate + "TP\0" // TokenPairing + "TS\0" // TimeServices + "HB\0" // Heartbeat + "CSL" // chipSystemLayer + "EVL" // Event Logging + "SPT" // Support + "TOO" // chipTool + "ZCL" // Zcl + "SH\0" // Shell + "DL\0" // DeviceLayer + "SPL" // SetupPayload + "SVR" // AppServer + "DIS" // Discovery + "IM\0" // InteractionModel + "TST" // Test + "ODP" // OperationalDeviceProxy + "ATM" // Automation ; #define ModuleNamesCount ((sizeof(ModuleNames) - 1) / chip::Logging::kMaxModuleNameLen) -void GetModuleName(char * buf, uint8_t bufSize, uint8_t module) +void GetModuleName(char (&buf)[chip::Logging::kMaxModuleNameLen + 1], uint8_t module) { - const char * moduleNamePtr = ModuleNames + ((module < ModuleNamesCount) ? module * chip::Logging::kMaxModuleNameLen : 0); - snprintf(buf, bufSize, "%s", moduleNamePtr); - buf[chip::Logging::kMaxModuleNameLen] = 0; + const char * module_name = ModuleNames; + if (module < ModuleNamesCount) + { + module_name += module * chip::Logging::kMaxModuleNameLen; + } + + memcpy(buf, module_name, chip::Logging::kMaxModuleNameLen); + buf[chip::Logging::kMaxModuleNameLen] = 0; // ensure null termination } +} // namespace + void SetLogRedirectCallback(LogRedirectCallback_t callback) { sLogRedirectCallback.store(callback); @@ -183,7 +188,7 @@ void LogV(uint8_t module, uint8_t category, const char * msg, va_list args) } char moduleName[chip::Logging::kMaxModuleNameLen + 1]; - GetModuleName(moduleName, sizeof(moduleName), module); + GetModuleName(moduleName, module); LogRedirectCallback_t redirect = sLogRedirectCallback.load(); diff --git a/src/lib/support/logging/CHIPLogging.h b/src/lib/support/logging/CHIPLogging.h index fa48aa487c2041..491e139388d407 100644 --- a/src/lib/support/logging/CHIPLogging.h +++ b/src/lib/support/logging/CHIPLogging.h @@ -204,7 +204,6 @@ static constexpr uint16_t kMaxMessagePadding = (chip::Logging::kMaxPrefixLen + c chip::Logging::kMaxSeparatorLen + chip::Logging::kMaxTrailerLen); void GetMessageWithPrefix(char * buf, uint8_t bufSize, uint8_t module, const char * msg); -void GetModuleName(char * buf, uint8_t bufSize, uint8_t module); #else @@ -213,11 +212,6 @@ static inline void GetMessageWithPrefix(char * buf, uint8_t bufSize, uint8_t mod return; } -static inline void GetModuleName(char * buf, uint8_t bufSize, uint8_t module) -{ - return; -} - #endif // _CHIP_USE_LOGGING bool IsCategoryEnabled(uint8_t category); From b5776dfad6ff02cf938d37b6e442517c5d54c89e Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 8 Feb 2022 01:13:30 +0100 Subject: [PATCH 03/30] Enable Media Struct Atributes on chip tool (#14841) * Enable attributes & fix unnecessary value in zapt * Run zap regen script --- .../data_model/controller-clusters.matter | 21 ++ .../data_model/controller-clusters.zap | 19 +- .../java/templates/partials/decode_value.zapt | 1 - .../CHIPAttributeTLVValueDecoder.cpp | 226 +++++++++++++++--- .../java/zap-generated/CHIPCallbackTypes.h | 8 + .../zap-generated/CHIPInvokeCallbacks.cpp | 7 - .../java/zap-generated/CHIPReadCallbacks.cpp | 30 --- .../python/chip/clusters/CHIPClusters.py | 28 +++ .../CHIPAttributeTLVValueDecoder.mm | 75 ++++++ .../zap-generated/cluster/Commands.h | 125 +++++++++- .../cluster/logging/DataModelLogger.cpp | 20 ++ 11 files changed, 471 insertions(+), 89 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index aef5495dbe1b61..b29008d68230fa 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -176,12 +176,18 @@ client cluster ApplicationLauncher = 1292 { kLineupInfo = 0x2; } + struct ApplicationEP { + Application application = 0; + CHAR_STRING endpoint = 1; + } + struct Application { INT16U catalogVendorId = 0; CHAR_STRING applicationId = 1; } readonly attribute INT16U applicationLauncherList[] = 0; + attribute ApplicationEP applicationLauncherApp = 1; readonly global attribute command_id serverGeneratedCommandList[] = 65528; readonly global attribute command_id clientGeneratedCommandList[] = 65529; readonly global attribute attrib_id attributeList[] = 65531; @@ -567,7 +573,16 @@ client cluster Channel = 1284 { CHAR_STRING<32> affiliateCallSign = 4; } + struct LineupInfo { + CHAR_STRING operatorName = 0; + CHAR_STRING lineupName = 1; + CHAR_STRING postalCode = 2; + LineupInfoTypeEnum lineupInfoType = 3; + } + readonly attribute ChannelInfo channelList[] = 0; + attribute LineupInfo channelLineup = 1; + attribute ChannelInfo currentChannel = 2; readonly global attribute command_id serverGeneratedCommandList[] = 65528; readonly global attribute command_id clientGeneratedCommandList[] = 65529; readonly global attribute attrib_id attributeList[] = 65531; @@ -2291,9 +2306,15 @@ client cluster MediaPlayback = 1286 { kSeekOutOfRange = 5; } + struct PlaybackPosition { + INT64U updatedAt = 0; + INT64U position = 1; + } + readonly attribute PlaybackStateEnum playbackState = 0; readonly attribute epoch_us startTime = 1; readonly attribute int64u duration = 2; + attribute PlaybackPosition position = 3; readonly attribute single playbackSpeed = 4; readonly attribute int64u seekRangeEnd = 5; readonly attribute int64u seekRangeStart = 6; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 0a81a168a01744..d7583dabb2d8e5 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -8015,7 +8015,7 @@ ], "attributes": [ { - "name": "groupKeyMap", + "name": "GroupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -8030,7 +8030,7 @@ "reportableChange": 0 }, { - "name": "groupTable", + "name": "GroupTable", "code": 1, "mfgCode": null, "side": "server", @@ -8045,7 +8045,7 @@ "reportableChange": 0 }, { - "name": "maxGroupsPerFabric", + "name": "MaxGroupsPerFabric", "code": 2, "mfgCode": null, "side": "server", @@ -8060,7 +8060,7 @@ "reportableChange": 0 }, { - "name": "maxGroupKeysPerFabric", + "name": "MaxGroupKeysPerFabric", "code": 3, "mfgCode": null, "side": "server", @@ -14085,7 +14085,7 @@ "code": 1, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -14100,7 +14100,7 @@ "code": 2, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -14560,7 +14560,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -15624,7 +15624,7 @@ "code": 1, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -17946,5 +17946,6 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index b19a0ac21c95ea..348386f232d50d 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -35,7 +35,6 @@ if ({{source}}.IsNull()) { ChipLogError(Zcl, "Could not find class ChipStructs${{cluster}}Cluster{{asUpperCamelCase type}}"); return {{earlyReturn}}; } - chip::JniClass structJniClass({{asLowerCamelCase type}}StructClass); jmethodID {{asLowerCamelCase type}}StructCtor = env->GetMethodID({{asLowerCamelCase type}}StructClass, "" , "({{#zcl_struct_items_by_struct_name type}}{{asJniSignature type null ../cluster true}}{{/zcl_struct_items_by_struct_name}})V"); if ({{asLowerCamelCase type}}StructCtor == nullptr) { diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 6c3329fe5028c0..422b5263df882e 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -158,7 +158,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterTarget"); return nullptr; } - chip::JniClass structJniClass(targetStructClass); jmethodID targetStructCtor = env->GetMethodID(targetStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V"); if (targetStructCtor == nullptr) @@ -181,7 +180,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntry"); return nullptr; } - chip::JniClass structJniClass(accessControlEntryStructClass); jmethodID accessControlEntryStructCtor = env->GetMethodID( accessControlEntryStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); @@ -234,7 +232,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterExtensionEntry"); return nullptr; } - chip::JniClass structJniClass(extensionEntryStructClass); jmethodID extensionEntryStructCtor = env->GetMethodID(extensionEntryStructClass, "", "(Ljava/lang/Integer;[B)V"); if (extensionEntryStructCtor == nullptr) @@ -667,7 +664,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationBasicApplication"); return nullptr; } - chip::JniClass structJniClass(applicationBasicApplicationStructClass); jmethodID applicationBasicApplicationStructCtor = env->GetMethodID(applicationBasicApplicationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); if (applicationBasicApplicationStructCtor == nullptr) @@ -852,6 +848,67 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::ApplicationLauncherApp::Id: { + using TypeInfo = Attributes::ApplicationLauncherApp::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_application; + jobject value_application_catalogVendorId; + std::string value_application_catalogVendorIdClassName = "java/lang/Integer"; + std::string value_application_catalogVendorIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_application_catalogVendorIdClassName.c_str(), value_application_catalogVendorIdCtorSignature.c_str(), + cppValue.application.catalogVendorId, value_application_catalogVendorId); + jobject value_application_applicationId; + value_application_applicationId = env->NewStringUTF( + std::string(cppValue.application.applicationId.data(), cppValue.application.applicationId.size()).c_str()); + + jclass applicationStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication", applicationStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplication"); + return nullptr; + } + jmethodID applicationStructCtor = + env->GetMethodID(applicationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (applicationStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplication constructor"); + return nullptr; + } + + value_application = env->NewObject(applicationStructClass, applicationStructCtor, value_application_catalogVendorId, + value_application_applicationId); + jobject value_endpoint; + value_endpoint = env->NewStringUTF(std::string(cppValue.endpoint.data(), cppValue.endpoint.size()).c_str()); + + jclass applicationEPStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEP", applicationEPStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEP"); + return nullptr; + } + jmethodID applicationEPStructCtor = + env->GetMethodID(applicationEPStructClass, "", + "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplication;Ljava/lang/String;)V"); + if (applicationEPStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEP constructor"); + return nullptr; + } + + value = env->NewObject(applicationEPStructClass, applicationEPStructCtor, value_application, value_endpoint); + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -988,7 +1045,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfo"); return nullptr; } - chip::JniClass structJniClass(outputInfoStructClass); jmethodID outputInfoStructCtor = env->GetMethodID(outputInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V"); if (outputInfoStructCtor == nullptr) @@ -2026,7 +2082,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$BridgedActionsClusterActionStruct"); return nullptr; } - chip::JniClass structJniClass(actionStructStructClass); jmethodID actionStructStructCtor = env->GetMethodID(actionStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" @@ -2098,7 +2153,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$BridgedActionsClusterEndpointListStruct"); return nullptr; } - chip::JniClass structJniClass(endpointListStructStructClass); jmethodID endpointListStructStructCtor = env->GetMethodID(endpointListStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); @@ -2545,7 +2599,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo"); return nullptr; } - chip::JniClass structJniClass(channelInfoStructClass); jmethodID channelInfoStructCtor = env->GetMethodID( channelInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); @@ -2562,6 +2615,98 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::ChannelLineup::Id: { + using TypeInfo = Attributes::ChannelLineup::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_operatorName; + value_operatorName = env->NewStringUTF(std::string(cppValue.operatorName.data(), cppValue.operatorName.size()).c_str()); + jobject value_lineupName; + value_lineupName = env->NewStringUTF(std::string(cppValue.lineupName.data(), cppValue.lineupName.size()).c_str()); + jobject value_postalCode; + value_postalCode = env->NewStringUTF(std::string(cppValue.postalCode.data(), cppValue.postalCode.size()).c_str()); + jobject value_lineupInfoType; + std::string value_lineupInfoTypeClassName = "java/lang/Integer"; + std::string value_lineupInfoTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_lineupInfoTypeClassName.c_str(), value_lineupInfoTypeCtorSignature.c_str(), + static_cast(cppValue.lineupInfoType), value_lineupInfoType); + + jclass lineupInfoStructClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfo", + lineupInfoStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfo"); + return nullptr; + } + jmethodID lineupInfoStructCtor = env->GetMethodID( + lineupInfoStructClass, "", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V"); + if (lineupInfoStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfo constructor"); + return nullptr; + } + + value = env->NewObject(lineupInfoStructClass, lineupInfoStructCtor, value_operatorName, value_lineupName, + value_postalCode, value_lineupInfoType); + return value; + } + case Attributes::CurrentChannel::Id: { + using TypeInfo = Attributes::CurrentChannel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_majorNumber; + std::string value_majorNumberClassName = "java/lang/Integer"; + std::string value_majorNumberCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_majorNumberClassName.c_str(), + value_majorNumberCtorSignature.c_str(), + cppValue.majorNumber, value_majorNumber); + jobject value_minorNumber; + std::string value_minorNumberClassName = "java/lang/Integer"; + std::string value_minorNumberCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_minorNumberClassName.c_str(), + value_minorNumberCtorSignature.c_str(), + cppValue.minorNumber, value_minorNumber); + jobject value_name; + value_name = env->NewStringUTF(std::string(cppValue.name.data(), cppValue.name.size()).c_str()); + jobject value_callSign; + value_callSign = env->NewStringUTF(std::string(cppValue.callSign.data(), cppValue.callSign.size()).c_str()); + jobject value_affiliateCallSign; + value_affiliateCallSign = + env->NewStringUTF(std::string(cppValue.affiliateCallSign.data(), cppValue.affiliateCallSign.size()).c_str()); + + jclass channelInfoStructClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfo", + channelInfoStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo"); + return nullptr; + } + jmethodID channelInfoStructCtor = + env->GetMethodID(channelInfoStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + if (channelInfoStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfo constructor"); + return nullptr; + } + + value = env->NewObject(channelInfoStructClass, channelInfoStructCtor, value_majorNumber, value_minorNumber, value_name, + value_callSign, value_affiliateCallSign); + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -3702,7 +3847,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceType"); return nullptr; } - chip::JniClass structJniClass(deviceTypeStructClass); jmethodID deviceTypeStructCtor = env->GetMethodID(deviceTypeStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); if (deviceTypeStructCtor == nullptr) @@ -4950,7 +5094,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); return nullptr; } - chip::JniClass structJniClass(labelStructStructClass); jmethodID labelStructStructCtor = env->GetMethodID(labelStructStructClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); if (labelStructStructCtor == nullptr) @@ -5259,7 +5402,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo"); return nullptr; } - chip::JniClass structJniClass(basicCommissioningInfoStructClass); jmethodID basicCommissioningInfoStructCtor = env->GetMethodID(basicCommissioningInfoStructClass, "", "(Ljava/lang/Integer;)V"); if (basicCommissioningInfoStructCtor == nullptr) @@ -5460,7 +5602,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterfaceType"); return nullptr; } - chip::JniClass structJniClass(networkInterfaceTypeStructClass); jmethodID networkInterfaceTypeStructCtor = env->GetMethodID( networkInterfaceTypeStructClass, "", "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/lang/Integer;)V"); @@ -5751,7 +5892,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); return nullptr; } - chip::JniClass structJniClass(groupKeyMapStructStructClass); jmethodID groupKeyMapStructStructCtor = env->GetMethodID( groupKeyMapStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (groupKeyMapStructStructCtor == nullptr) @@ -5828,7 +5968,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); return nullptr; } - chip::JniClass structJniClass(groupInfoMapStructStructClass); jmethodID groupInfoMapStructStructCtor = env->GetMethodID(groupInfoMapStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;)V"); @@ -7109,7 +7248,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfo"); return nullptr; } - chip::JniClass structJniClass(inputInfoStructClass); jmethodID inputInfoStructCtor = env->GetMethodID(inputInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V"); @@ -7282,6 +7420,45 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::Position::Id: { + using TypeInfo = Attributes::Position::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_updatedAt; + std::string value_updatedAtClassName = "java/lang/Long"; + std::string value_updatedAtCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_updatedAtClassName.c_str(), value_updatedAtCtorSignature.c_str(), cppValue.updatedAt, value_updatedAt); + jobject value_position; + std::string value_positionClassName = "java/lang/Long"; + std::string value_positionCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_positionClassName.c_str(), value_positionCtorSignature.c_str(), cppValue.position, value_position); + + jclass playbackPositionStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPosition", playbackPositionStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPosition"); + return nullptr; + } + jmethodID playbackPositionStructCtor = + env->GetMethodID(playbackPositionStructClass, "", "(Ljava/lang/Long;Ljava/lang/Long;)V"); + if (playbackPositionStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPosition constructor"); + return nullptr; + } + + value = env->NewObject(playbackPositionStructClass, playbackPositionStructCtor, value_updatedAt, value_position); + return value; + } case Attributes::PlaybackSpeed::Id: { using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; TypeInfo::DecodableType cppValue; @@ -7477,7 +7654,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); return nullptr; } - chip::JniClass structJniClass(modeOptionStructStructClass); jmethodID modeOptionStructStructCtor = env->GetMethodID(modeOptionStructStructClass, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V"); if (modeOptionStructStructCtor == nullptr) @@ -7682,7 +7858,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfo"); return nullptr; } - chip::JniClass structJniClass(networkInfoStructClass); jmethodID networkInfoStructCtor = env->GetMethodID(networkInfoStructClass, "", "([BLjava/lang/Boolean;)V"); if (networkInfoStructCtor == nullptr) { @@ -7967,7 +8142,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); return nullptr; } - chip::JniClass structJniClass(providerLocationStructClass); jmethodID providerLocationStructCtor = env->GetMethodID( providerLocationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V"); if (providerLocationStructCtor == nullptr) @@ -8587,7 +8761,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); return nullptr; } - chip::JniClass structJniClass(NOCStructStructClass); jmethodID NOCStructStructCtor = env->GetMethodID(NOCStructStructClass, "", "(Ljava/lang/Integer;[B[B)V"); if (NOCStructStructCtor == nullptr) { @@ -8659,7 +8832,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptor"); return nullptr; } - chip::JniClass structJniClass(fabricDescriptorStructClass); jmethodID fabricDescriptorStructCtor = env->GetMethodID( fabricDescriptorStructClass, "", "(Ljava/lang/Integer;[BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;)V"); @@ -10175,7 +10347,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetrics"); return nullptr; } - chip::JniClass structJniClass(threadMetricsStructClass); jmethodID threadMetricsStructCtor = env->GetMethodID(threadMetricsStructClass, "", "(Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); @@ -10538,7 +10709,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfo"); return nullptr; } - chip::JniClass structJniClass(targetInfoStructClass); jmethodID targetInfoStructCtor = env->GetMethodID(targetInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); if (targetInfoStructCtor == nullptr) @@ -11250,7 +11420,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterTestListStructOctet"); return nullptr; } - chip::JniClass structJniClass(testListStructOctetStructClass); jmethodID testListStructOctetStructCtor = env->GetMethodID(testListStructOctetStructClass, "", "(Ljava/lang/Long;[B)V"); if (testListStructOctetStructCtor == nullptr) @@ -11513,7 +11682,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return nullptr; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -11592,7 +11760,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return nullptr; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -11687,7 +11854,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return nullptr; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/" @@ -11789,7 +11955,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterNullablesAndOptionalsStruct"); return nullptr; } - chip::JniClass structJniClass(nullablesAndOptionalsStructStructClass); jmethodID nullablesAndOptionalsStructStructCtor = env->GetMethodID( nullablesAndOptionalsStructStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/" @@ -11881,7 +12046,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return nullptr; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -12714,7 +12878,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return nullptr; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -13586,7 +13749,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTable"); return nullptr; } - chip::JniClass structJniClass(neighborTableStructClass); jmethodID neighborTableStructCtor = env->GetMethodID(neighborTableStructClass, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/" @@ -13691,7 +13853,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTable"); return nullptr; } - chip::JniClass structJniClass(routeTableStructClass); jmethodID routeTableStructCtor = env->GetMethodID( routeTableStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" @@ -14498,7 +14659,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); return nullptr; } - chip::JniClass structJniClass(securityPolicyStructClass); jmethodID securityPolicyStructCtor = env->GetMethodID(securityPolicyStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (securityPolicyStructCtor == nullptr) @@ -14628,7 +14788,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); return nullptr; } - chip::JniClass structJniClass(operationalDatasetComponentsStructClass); jmethodID operationalDatasetComponentsStructCtor = env->GetMethodID(operationalDatasetComponentsStructClass, "", "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" @@ -15022,7 +15181,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); return nullptr; } - chip::JniClass structJniClass(labelStructStructClass); jmethodID labelStructStructCtor = env->GetMethodID(labelStructStructClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); if (labelStructStructCtor == nullptr) diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 4c936c79a936c3..77924fc27e5fc7 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -93,6 +93,8 @@ typedef void (*CHIPApplicationLauncherClusterLauncherResponseCallbackType)( typedef void (*CHIPApplicationLauncherClusterApplicationLauncherListAttributeCallbackType)( void *, const chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherList::TypeInfo::DecodableType &); +typedef void (*CHIPApplicationLauncherClusterApplicationLauncherAppAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherApp::TypeInfo::DecodableArgType); typedef void (*CHIPApplicationLauncherClusterServerGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::ApplicationLauncher::Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPApplicationLauncherClusterClientGeneratedCommandListAttributeCallbackType)( @@ -270,6 +272,10 @@ typedef void (*CHIPChannelClusterChangeChannelResponseCallbackType)( typedef void (*CHIPChannelClusterChannelListAttributeCallbackType)( void *, const chip::app::Clusters::Channel::Attributes::ChannelList::TypeInfo::DecodableType &); +typedef void (*CHIPChannelClusterChannelLineupAttributeCallbackType)( + void *, chip::app::Clusters::Channel::Attributes::ChannelLineup::TypeInfo::DecodableArgType); +typedef void (*CHIPChannelClusterCurrentChannelAttributeCallbackType)( + void *, chip::app::Clusters::Channel::Attributes::CurrentChannel::TypeInfo::DecodableArgType); typedef void (*CHIPChannelClusterServerGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::Channel::Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPChannelClusterClientGeneratedCommandListAttributeCallbackType)( @@ -799,6 +805,8 @@ typedef void (*CHIPMediaPlaybackClusterStartTimeAttributeCallbackType)( void *, chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableArgType); typedef void (*CHIPMediaPlaybackClusterDurationAttributeCallbackType)( void *, chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterPositionAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::Position::TypeInfo::DecodableArgType); typedef void (*CHIPMediaPlaybackClusterPlaybackSpeedAttributeCallbackType)( void *, chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType); typedef void (*CHIPMediaPlaybackClusterSeekRangeEndAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 450b27f118ae9f..775a5958a30659 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -237,7 +237,6 @@ void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo"); return; } - chip::JniClass structJniClass(channelInfoStructClass); jmethodID channelInfoStructCtor = env->GetMethodID(channelInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); @@ -638,7 +637,6 @@ void CHIPDoorLockClusterGetUserResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterDlCredential"); return; } - chip::JniClass structJniClass(dlCredentialStructClass); jmethodID dlCredentialStructCtor = env->GetMethodID(dlCredentialStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (dlCredentialStructCtor == nullptr) @@ -1437,7 +1435,6 @@ void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeySetStruct"); return; } - chip::JniClass structJniClass(groupKeySetStructStructClass); jmethodID groupKeySetStructStructCtor = env->GetMethodID(groupKeySetStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;[BLjava/lang/Long;[BLjava/lang/Long;[BLjava/lang/Long;)V"); @@ -2158,7 +2155,6 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterWiFiInterfaceScanResult"); return; } - chip::JniClass structJniClass(wiFiInterfaceScanResultStructClass); jmethodID wiFiInterfaceScanResultStructCtor = env->GetMethodID(wiFiInterfaceScanResultStructClass, "", "(Ljava/lang/Integer;[B[BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); @@ -2240,7 +2236,6 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterThreadInterfaceScanResult"); return; } - chip::JniClass structJniClass(threadInterfaceScanResultStructClass); jmethodID threadInterfaceScanResultStructCtor = env->GetMethodID(threadInterfaceScanResultStructClass, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" @@ -3235,7 +3230,6 @@ void CHIPScenesClusterViewSceneResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ScenesClusterSceneExtensionFieldSet"); return; } - chip::JniClass structJniClass(sceneExtensionFieldSetStructClass); jmethodID sceneExtensionFieldSetStructCtor = env->GetMethodID(sceneExtensionFieldSetStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (sceneExtensionFieldSetStructCtor == nullptr) @@ -3474,7 +3468,6 @@ void CHIPTestClusterClusterSimpleStructResponseCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/" "String;Ljava/lang/Integer;Ljava/lang/Float;Ljava/lang/Double;)V"); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 22f8516e54f838..a68cee119fb7c0 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -833,7 +833,6 @@ void CHIPAccessControlAclAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterTarget"); return; } - chip::JniClass structJniClass(targetStructClass); jmethodID targetStructCtor = env->GetMethodID(targetStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V"); if (targetStructCtor == nullptr) @@ -856,7 +855,6 @@ void CHIPAccessControlAclAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntry"); return; } - chip::JniClass structJniClass(accessControlEntryStructClass); jmethodID accessControlEntryStructCtor = env->GetMethodID( accessControlEntryStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;)V"); @@ -954,7 +952,6 @@ void CHIPAccessControlExtensionAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterExtensionEntry"); return; } - chip::JniClass structJniClass(extensionEntryStructClass); jmethodID extensionEntryStructCtor = env->GetMethodID(extensionEntryStructClass, "", "(Ljava/lang/Integer;[B)V"); if (extensionEntryStructCtor == nullptr) { @@ -2326,7 +2323,6 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfo"); return; } - chip::JniClass structJniClass(outputInfoStructClass); jmethodID outputInfoStructCtor = env->GetMethodID(outputInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V"); if (outputInfoStructCtor == nullptr) @@ -3773,7 +3769,6 @@ void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$BridgedActionsClusterActionStruct"); return; } - chip::JniClass structJniClass(actionStructStructClass); jmethodID actionStructStructCtor = env->GetMethodID( actionStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); @@ -3892,7 +3887,6 @@ void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$BridgedActionsClusterEndpointListStruct"); return; } - chip::JniClass structJniClass(endpointListStructStructClass); jmethodID endpointListStructStructCtor = env->GetMethodID(endpointListStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); @@ -4426,7 +4420,6 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo"); return; } - chip::JniClass structJniClass(channelInfoStructClass); jmethodID channelInfoStructCtor = env->GetMethodID(channelInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); @@ -5230,7 +5223,6 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceType"); return; } - chip::JniClass structJniClass(deviceTypeStructClass); jmethodID deviceTypeStructCtor = env->GetMethodID(deviceTypeStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); if (deviceTypeStructCtor == nullptr) @@ -6924,7 +6916,6 @@ void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); return; } - chip::JniClass structJniClass(labelStructStructClass); jmethodID labelStructStructCtor = env->GetMethodID(labelStructStructClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); if (labelStructStructCtor == nullptr) @@ -7685,7 +7676,6 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterfaceType"); return; } - chip::JniClass structJniClass(networkInterfaceTypeStructClass); jmethodID networkInterfaceTypeStructCtor = env->GetMethodID(networkInterfaceTypeStructClass, "", "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/lang/Integer;)V"); @@ -8223,7 +8213,6 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); return; } - chip::JniClass structJniClass(groupKeyMapStructStructClass); jmethodID groupKeyMapStructStructCtor = env->GetMethodID(groupKeyMapStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (groupKeyMapStructStructCtor == nullptr) @@ -8348,7 +8337,6 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); return; } - chip::JniClass structJniClass(groupInfoMapStructStructClass); jmethodID groupInfoMapStructStructCtor = env->GetMethodID(groupInfoMapStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;)V"); @@ -10749,7 +10737,6 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfo"); return; } - chip::JniClass structJniClass(inputInfoStructClass); jmethodID inputInfoStructCtor = env->GetMethodID( inputInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V"); if (inputInfoStructCtor == nullptr) @@ -11272,7 +11259,6 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); return; } - chip::JniClass structJniClass(modeOptionStructStructClass); jmethodID modeOptionStructStructCtor = env->GetMethodID(modeOptionStructStructClass, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V"); if (modeOptionStructStructCtor == nullptr) @@ -11583,7 +11569,6 @@ void CHIPNetworkCommissioningNetworksAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfo"); return; } - chip::JniClass structJniClass(networkInfoStructClass); jmethodID networkInfoStructCtor = env->GetMethodID(networkInfoStructClass, "", "([BLjava/lang/Boolean;)V"); if (networkInfoStructCtor == nullptr) { @@ -11906,7 +11891,6 @@ void CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback::Callbac ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); return; } - chip::JniClass structJniClass(providerLocationStructClass); jmethodID providerLocationStructCtor = env->GetMethodID(providerLocationStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V"); if (providerLocationStructCtor == nullptr) @@ -12796,7 +12780,6 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); return; } - chip::JniClass structJniClass(NOCStructStructClass); jmethodID NOCStructStructCtor = env->GetMethodID(NOCStructStructClass, "", "(Ljava/lang/Integer;[B[B)V"); if (NOCStructStructCtor == nullptr) { @@ -12914,7 +12897,6 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptor"); return; } - chip::JniClass structJniClass(fabricDescriptorStructClass); jmethodID fabricDescriptorStructCtor = env->GetMethodID(fabricDescriptorStructClass, "", "(Ljava/lang/Integer;[BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;)V"); @@ -14800,7 +14782,6 @@ void CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetrics"); return; } - chip::JniClass structJniClass(threadMetricsStructClass); jmethodID threadMetricsStructCtor = env->GetMethodID(threadMetricsStructClass, "", "(Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); @@ -15323,7 +15304,6 @@ void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfo"); return; } - chip::JniClass structJniClass(targetInfoStructClass); jmethodID targetInfoStructCtor = env->GetMethodID(targetInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); if (targetInfoStructCtor == nullptr) @@ -15845,7 +15825,6 @@ void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterTestListStructOctet"); return; } - chip::JniClass structJniClass(testListStructOctetStructClass); jmethodID testListStructOctetStructCtor = env->GetMethodID(testListStructOctetStructClass, "", "(Ljava/lang/Long;[B)V"); if (testListStructOctetStructCtor == nullptr) @@ -16129,7 +16108,6 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -16207,7 +16185,6 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -16299,7 +16276,6 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterSimpleStruct"); return; } - chip::JniClass structJniClass(simpleStructStructClass); jmethodID simpleStructStructCtor = env->GetMethodID(simpleStructStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" @@ -16401,7 +16377,6 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn ChipLogError(Zcl, "Could not find class ChipStructs$TestClusterClusterNullablesAndOptionalsStruct"); return; } - chip::JniClass structJniClass(nullablesAndOptionalsStructStructClass); jmethodID nullablesAndOptionalsStructStructCtor = env->GetMethodID(nullablesAndOptionalsStructStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/" @@ -19283,7 +19258,6 @@ void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTable"); return; } - chip::JniClass structJniClass(neighborTableStructClass); jmethodID neighborTableStructCtor = env->GetMethodID(neighborTableStructClass, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/" @@ -19434,7 +19408,6 @@ void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTable"); return; } - chip::JniClass structJniClass(routeTableStructClass); jmethodID routeTableStructCtor = env->GetMethodID(routeTableStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" @@ -19537,7 +19510,6 @@ void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); return; } - chip::JniClass structJniClass(securityPolicyStructClass); jmethodID securityPolicyStructCtor = env->GetMethodID(securityPolicyStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); if (securityPolicyStructCtor == nullptr) @@ -19701,7 +19673,6 @@ void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); return; } - chip::JniClass structJniClass(operationalDatasetComponentsStructClass); jmethodID operationalDatasetComponentsStructCtor = env->GetMethodID(operationalDatasetComponentsStructClass, "", "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" @@ -20372,7 +20343,6 @@ void CHIPUserLabelLabelListAttributeCallback::CallbackFn( ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); return; } - chip::JniClass structJniClass(labelStructStructClass); jmethodID labelStructStructCtor = env->GetMethodID(labelStructStructClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); if (labelStructStructCtor == nullptr) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 2d2245a7e21b2a..c1c6400d79b935 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -321,6 +321,13 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000001: { + "attributeName": "ApplicationLauncherApp", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "ServerGeneratedCommandList", "attributeId": 0x0000FFF8, @@ -1068,6 +1075,20 @@ class ChipClusters: "type": "", "reportable": True, }, + 0x00000001: { + "attributeName": "ChannelLineup", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + "writable": True, + }, + 0x00000002: { + "attributeName": "CurrentChannel", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "ServerGeneratedCommandList", "attributeId": 0x0000FFF8, @@ -3345,6 +3366,13 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000003: { + "attributeName": "Position", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + "writable": True, + }, 0x00000004: { "attributeName": "PlaybackSpeed", "attributeId": 0x00000004, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 780d7ea63fe937..d55f7f11ebedc6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -707,6 +707,25 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } + case Attributes::ApplicationLauncherApp::Id: { + using TypeInfo = Attributes::ApplicationLauncherApp::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + CHIPApplicationLauncherClusterApplicationEP * _Nonnull value; + value = [CHIPApplicationLauncherClusterApplicationEP new]; + value.application = [CHIPApplicationLauncherClusterApplication new]; + value.application.catalogVendorId = [NSNumber numberWithUnsignedShort:cppValue.application.catalogVendorId]; + value.application.applicationId = [[NSString alloc] initWithBytes:cppValue.application.applicationId.data() + length:cppValue.application.applicationId.size() + encoding:NSUTF8StringEncoding]; + value.endpoint = [[NSString alloc] initWithBytes:cppValue.endpoint.data() + length:cppValue.endpoint.size() + encoding:NSUTF8StringEncoding]; + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2211,6 +2230,49 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } + case Attributes::ChannelLineup::Id: { + using TypeInfo = Attributes::ChannelLineup::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + CHIPChannelClusterLineupInfo * _Nonnull value; + value = [CHIPChannelClusterLineupInfo new]; + value.operatorName = [[NSString alloc] initWithBytes:cppValue.operatorName.data() + length:cppValue.operatorName.size() + encoding:NSUTF8StringEncoding]; + value.lineupName = [[NSString alloc] initWithBytes:cppValue.lineupName.data() + length:cppValue.lineupName.size() + encoding:NSUTF8StringEncoding]; + value.postalCode = [[NSString alloc] initWithBytes:cppValue.postalCode.data() + length:cppValue.postalCode.size() + encoding:NSUTF8StringEncoding]; + value.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.lineupInfoType)]; + return value; + } + case Attributes::CurrentChannel::Id: { + using TypeInfo = Attributes::CurrentChannel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + CHIPChannelClusterChannelInfo * _Nonnull value; + value = [CHIPChannelClusterChannelInfo new]; + value.majorNumber = [NSNumber numberWithUnsignedShort:cppValue.majorNumber]; + value.minorNumber = [NSNumber numberWithUnsignedShort:cppValue.minorNumber]; + value.name = [[NSString alloc] initWithBytes:cppValue.name.data() + length:cppValue.name.size() + encoding:NSUTF8StringEncoding]; + value.callSign = [[NSString alloc] initWithBytes:cppValue.callSign.data() + length:cppValue.callSign.size() + encoding:NSUTF8StringEncoding]; + value.affiliateCallSign = [[NSString alloc] initWithBytes:cppValue.affiliateCallSign.data() + length:cppValue.affiliateCallSign.size() + encoding:NSUTF8StringEncoding]; + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -6213,6 +6275,19 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } + case Attributes::Position::Id: { + using TypeInfo = Attributes::Position::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull value; + value = [CHIPMediaPlaybackClusterPlaybackPosition new]; + value.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.updatedAt]; + value.position = [NSNumber numberWithUnsignedLongLong:cppValue.position]; + return value; + } case Attributes::PlaybackSpeed::Id: { using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a0893812f038d6..5c8428bf376a3b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -401,6 +401,7 @@ class WriteApplicationBasicApplicationApp : public WriteAttribute |------------------------------------------------------------------------------| | Attributes: | | | * ApplicationLauncherList | 0x0000 | +| * ApplicationLauncherApp | 0x0001 | | * ServerGeneratedCommandList | 0xFFF8 | | * ClientGeneratedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -485,6 +486,29 @@ class ApplicationLauncherStopAppRequest : public ClusterCommand TypedComplexArgument mComplex_Application; }; +class WriteApplicationLauncherApplicationLauncherApp : public WriteAttribute +{ +public: + WriteApplicationLauncherApplicationLauncherApp(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("ApplicationLauncherApp", credsIssuerConfig), mComplex(&mValue) + { + AddArgument("attr-name", "application-launcher-app"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteApplicationLauncherApplicationLauncherApp() {} + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + return WriteAttribute::SendCommand(device, endpointId, 0x0000050C, 0x00000001, mValue); + } + +private: + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type mValue; + TypedComplexArgument mComplex; +}; + /*----------------------------------------------------------------------------*\ | Cluster AudioOutput | 0x050B | |------------------------------------------------------------------------------| @@ -1257,6 +1281,8 @@ class WriteBridgedDeviceBasicNodeLabel : public WriteAttribute |------------------------------------------------------------------------------| | Attributes: | | | * ChannelList | 0x0000 | +| * ChannelLineup | 0x0001 | +| * CurrentChannel | 0x0002 | | * ServerGeneratedCommandList | 0xFFF8 | | * ClientGeneratedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -1338,6 +1364,52 @@ class ChannelSkipChannelRequest : public ClusterCommand chip::app::Clusters::Channel::Commands::SkipChannelRequest::Type mRequest; }; +class WriteChannelChannelLineup : public WriteAttribute +{ +public: + WriteChannelChannelLineup(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("ChannelLineup", credsIssuerConfig), mComplex(&mValue) + { + AddArgument("attr-name", "channel-lineup"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteChannelChannelLineup() {} + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + return WriteAttribute::SendCommand(device, endpointId, 0x00000504, 0x00000001, mValue); + } + +private: + chip::app::Clusters::Channel::Structs::LineupInfo::Type mValue; + TypedComplexArgument mComplex; +}; + +class WriteChannelCurrentChannel : public WriteAttribute +{ +public: + WriteChannelCurrentChannel(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("CurrentChannel", credsIssuerConfig), mComplex(&mValue) + { + AddArgument("attr-name", "current-channel"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteChannelCurrentChannel() {} + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + return WriteAttribute::SendCommand(device, endpointId, 0x00000504, 0x00000002, mValue); + } + +private: + chip::app::Clusters::Channel::Structs::ChannelInfo::Type mValue; + TypedComplexArgument mComplex; +}; + /*----------------------------------------------------------------------------*\ | Cluster ColorControl | 0x0300 | |------------------------------------------------------------------------------| @@ -4282,6 +4354,7 @@ class MediaInputShowInputStatusRequest : public ClusterCommand | * PlaybackState | 0x0000 | | * StartTime | 0x0001 | | * Duration | 0x0002 | +| * Position | 0x0003 | | * PlaybackSpeed | 0x0004 | | * SeekRangeEnd | 0x0005 | | * SeekRangeStart | 0x0006 | @@ -4543,6 +4616,29 @@ class MediaPlaybackStopRequest : public ClusterCommand chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type mRequest; }; +class WriteMediaPlaybackPosition : public WriteAttribute +{ +public: + WriteMediaPlaybackPosition(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("Position", credsIssuerConfig), mComplex(&mValue) + { + AddArgument("attr-name", "position"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteMediaPlaybackPosition() {} + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + return WriteAttribute::SendCommand(device, endpointId, 0x00000506, 0x00000003, mValue); + } + +private: + chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::Type mValue; + TypedComplexArgument mComplex; +}; + /*----------------------------------------------------------------------------*\ | Cluster ModeSelect | 0x0050 | |------------------------------------------------------------------------------| @@ -9502,6 +9598,7 @@ void registerClusterApplicationLauncher(Commands & commands, CredentialIssuerCom // make_unique(Id, credsIssuerConfig), // make_unique(Id, "application-launcher-list", Attributes::ApplicationLauncherList::Id, credsIssuerConfig), // + make_unique(Id, "application-launcher-app", Attributes::ApplicationLauncherApp::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, @@ -9509,9 +9606,12 @@ void registerClusterApplicationLauncher(Commands & commands, CredentialIssuerCom make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "application-launcher-list", Attributes::ApplicationLauncherList::Id, credsIssuerConfig), // + make_unique(Id, "application-launcher-app", Attributes::ApplicationLauncherApp::Id, + credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, @@ -9986,17 +10086,23 @@ void registerClusterChannel(Commands & commands, CredentialIssuerCommands * cred // // Attributes // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "channel-list", Attributes::ChannelList::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "channel-list", Attributes::ChannelList::Id, credsIssuerConfig), // + make_unique(Id, "channel-lineup", Attributes::ChannelLineup::Id, credsIssuerConfig), // + make_unique(Id, "current-channel", Attributes::CurrentChannel::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, - credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "channel-list", Attributes::ChannelList::Id, credsIssuerConfig), // + credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "channel-list", Attributes::ChannelList::Id, credsIssuerConfig), // + make_unique(Id, "channel-lineup", Attributes::ChannelLineup::Id, credsIssuerConfig), // + make_unique(Id, "current-channel", Attributes::CurrentChannel::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, @@ -11236,6 +11342,7 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands make_unique(Id, "playback-state", Attributes::PlaybackState::Id, credsIssuerConfig), // make_unique(Id, "start-time", Attributes::StartTime::Id, credsIssuerConfig), // make_unique(Id, "duration", Attributes::Duration::Id, credsIssuerConfig), // + make_unique(Id, "position", Attributes::Position::Id, credsIssuerConfig), // make_unique(Id, "playback-speed", Attributes::PlaybackSpeed::Id, credsIssuerConfig), // make_unique(Id, "seek-range-end", Attributes::SeekRangeEnd::Id, credsIssuerConfig), // make_unique(Id, "seek-range-start", Attributes::SeekRangeStart::Id, credsIssuerConfig), // @@ -11246,10 +11353,12 @@ void registerClusterMediaPlayback(Commands & commands, CredentialIssuerCommands make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "playback-state", Attributes::PlaybackState::Id, credsIssuerConfig), // make_unique(Id, "start-time", Attributes::StartTime::Id, credsIssuerConfig), // make_unique(Id, "duration", Attributes::Duration::Id, credsIssuerConfig), // + make_unique(Id, "position", Attributes::Position::Id, credsIssuerConfig), // make_unique(Id, "playback-speed", Attributes::PlaybackSpeed::Id, credsIssuerConfig), // make_unique(Id, "seek-range-end", Attributes::SeekRangeEnd::Id, credsIssuerConfig), // make_unique(Id, "seek-range-start", Attributes::SeekRangeStart::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 892ec908c3674b..8220cf4126665e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -4081,6 +4081,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("application launcher list", 1, value); } + case ApplicationLauncher::Attributes::ApplicationLauncherApp::Id: { + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("application launcher app", 1, value); + } case ApplicationLauncher::Attributes::ServerGeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -4551,6 +4556,16 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("channel list", 1, value); } + case Channel::Attributes::ChannelLineup::Id: { + chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("channel lineup", 1, value); + } + case Channel::Attributes::CurrentChannel::Id: { + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("current channel", 1, value); + } case Channel::Attributes::ServerGeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -5846,6 +5861,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("duration", 1, value); } + case MediaPlayback::Attributes::Position::Id: { + chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("position", 1, value); + } case MediaPlayback::Attributes::PlaybackSpeed::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); From 149b3f45757530d7d1e0c8c989f79517343854fa Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Feb 2022 20:10:41 -0500 Subject: [PATCH 04/30] Add support for struct-typed attributes on darwin. (#14814) * Add support for struct-typed attributes on darwin. Fixes https://github.com/project-chip/connectedhomeip/issues/14127 * Address review comments. --- examples/tv-app/tv-common/tv-app.matter | 2 +- src/app/tests/suites/TestCluster.yaml | 33 ++ .../tests/suites/TestClusterComplexTypes.yaml | 33 -- .../chip/application-basic-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../python/chip/clusters/CHIPClusters.py | 1 - .../templates/CHIPCallbackBridge-src.zapt | 4 + .../CHIPCallbackBridge_internal.zapt | 14 + .../CHIP/templates/CHIPClustersObjc-src.zapt | 45 +-- .../CHIP/templates/CHIPClustersObjc.zapt | 2 - .../CHIP/templates/clusters-tests.zapt | 6 +- src/darwin/Framework/CHIP/templates/helper.js | 5 +- .../attribute_data_callback_name.zapt | 20 + .../Framework/CHIP/templates/templates.json | 4 + .../CHIP/zap-generated/CHIPCallbackBridge.mm | 124 ++++++ .../CHIPCallbackBridge_internal.h | 128 ++++++ .../CHIP/zap-generated/CHIPClustersObjc.h | 40 ++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 184 +++++++++ .../CHIP/zap-generated/CHIPTestClustersObjc.h | 2 + .../zap-generated/CHIPTestClustersObjc.mm | 20 + .../Framework/CHIPTests/CHIPClustersTests.m | 365 +++++------------- .../zap-generated/cluster/Commands.h | 24 -- .../chip-tool/zap-generated/test/Commands.h | 178 ++++----- .../tv-app/zap-generated/endpoint_config.h | 33 +- 24 files changed, 782 insertions(+), 489 deletions(-) create mode 100644 src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 4f07fd6d020926..ff968c9c29bd12 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -142,7 +142,7 @@ server cluster ApplicationBasic = 1293 { readonly attribute int16u vendorId = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; - attribute ApplicationBasicApplication applicationApp = 4; + readonly attribute ApplicationBasicApplication applicationApp = 4; readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index 545305a6afb74b..36ed3409a42758 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -3748,3 +3748,36 @@ tests: attribute: "ServerGeneratedCommandList" response: value: [0, 1, 4, 5, 6, 9, 10, 11] + + # Struct-typed attribute + - label: "Write struct-typed attribute" + command: "writeAttribute" + attribute: "struct_attr" + arguments: + value: + { + a: 5, + b: true, + c: 2, + d: "abc", + e: "", + f: 17, + g: 1.5, + h: 3.14159265358979, + } + + - label: "Read struct-typed attribute" + command: "readAttribute" + attribute: "struct_attr" + response: + value: + { + a: 5, + b: true, + c: 2, + d: "abc", + e: "", + f: 17, + g: 1.5, + h: 3.14159265358979, + } diff --git a/src/app/tests/suites/TestClusterComplexTypes.yaml b/src/app/tests/suites/TestClusterComplexTypes.yaml index ef3d09ab30b17c..3cde68b2812b95 100644 --- a/src/app/tests/suites/TestClusterComplexTypes.yaml +++ b/src/app/tests/suites/TestClusterComplexTypes.yaml @@ -197,36 +197,3 @@ tests: attribute: "boolean" arguments: value: false - - # Struct-typed attribute - - label: "Write struct-typed attribute" - command: "writeAttribute" - attribute: "struct_attr" - arguments: - value: - { - a: 5, - b: true, - c: 2, - d: "abc", - e: "", - f: 17, - g: 1.5, - h: 3.14159265358979, - } - - - label: "Read struct-typed attribute" - command: "readAttribute" - attribute: "struct_attr" - response: - value: - { - a: 5, - b: true, - c: 2, - d: "abc", - e: "", - f: 17, - g: 1.5, - h: 3.14159265358979, - } diff --git a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml index 0df216ceda6178..16d96e1c1e9a90 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml @@ -28,7 +28,7 @@ limitations under the License. vendor id application name product id - application app + application app application status application version allowed vendor list diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b29008d68230fa..a2ad703a8dc429 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -150,7 +150,7 @@ client cluster ApplicationBasic = 1293 { readonly attribute int16u vendorId = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productId = 3; - attribute ApplicationBasicApplication applicationApp = 4; + readonly attribute ApplicationBasicApplication applicationApp = 4; readonly attribute ApplicationStatusEnum applicationStatus = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index c1c6400d79b935..e8a1233ac7af04 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -238,7 +238,6 @@ class ChipClusters: "attributeId": 0x00000004, "type": "", "reportable": True, - "writable": True, }, 0x00000005: { "attributeName": "ApplicationStatus", diff --git a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt index 6548dd8004d270..c83769158ca2b1 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt @@ -42,6 +42,10 @@ {{#chip_server_cluster_attributes}} {{#if isArray}} {{#>CHIPCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}ListAttributeCallback{{/CHIPCallbackBridge}} +{{else}} + {{#if_is_struct type}} + {{#>CHIPCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}StructAttributeCallback{{/CHIPCallbackBridge}} + {{/if_is_struct}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt index 78221bf9ecb0c0..06d6e8c7ed65f8 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt @@ -27,6 +27,16 @@ typedef void (*Nullable{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase {{/zcl_enums}} {{/zcl_clusters}} +{{#chip_client_clusters}} +{{#chip_server_cluster_attributes}} +{{#unless isArray}} +{{#if_is_struct type}} +typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}StructAttributeCallback)(void *, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}}); +{{/if_is_struct}} +{{/unless}} +{{/chip_server_cluster_attributes}} +{{/chip_client_clusters}} + {{#>CHIPCallbackBridge header="1" partial-type="Status" }}DefaultSuccessCallback{{/CHIPCallbackBridge}} {{#>CHIPCallbackBridge header="1" partial-type="CommandStatus" }}CommandSuccessCallback{{/CHIPCallbackBridge}} {{#>CHIPCallbackBridge header="1" type="Octet_String" isNullable=false ns="chip"}}OctetStringAttributeCallback{{/CHIPCallbackBridge}} @@ -62,6 +72,10 @@ typedef void (*Nullable{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase {{#chip_server_cluster_attributes}} {{#if isArray}} {{#>CHIPCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}ListAttributeCallback{{/CHIPCallbackBridge}} +{{else}} + {{#if_is_struct type}} + {{#>CHIPCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}StructAttributeCallback{{/CHIPCallbackBridge}} + {{/if_is_struct}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt index 7c7f634ea7c977..a53b7d12b0aa71 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc-src.zapt @@ -82,34 +82,16 @@ using namespace chip::app::Clusters; {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} -{{! TODO: Need to add support for struct-type attibutes here. And remove the callbackName - inline duplication with subscribe. }} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name}}{{/inline}} -{{#*inline "callbackName"}} - {{~#if isArray~}} - {{asUpperCamelCase ../name}}{{asUpperCamelCase name}}List - {{~else~}} - {{~#if isNullable}}Nullable{{/if~}} - {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} - VendorId - {{~else if isEnum~}} - {{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase type}} - {{~else~}} - {{chipCallback.name}} - {{~/if~}} - {{~/if~}} - Attribute -{{~/inline}} - (void)read{{>attribute}}WithCompletionHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIP{{>callbackName}}CallbackBridge(self.callbackQueue, + new CHIP{{>attribute_data_callback_name}}CallbackBridge(self.callbackQueue, {{! This treats completionHandler as taking an id for the data. This is not great from a type-safety perspective, of course. }} completionHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = {{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; - auto successFn = Callback<{{>callbackName}}Callback>::FromCancelable(success); + auto successFn = Callback<{{>attribute_data_callback_name}}Callback>::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -144,38 +126,21 @@ using namespace chip::app::Clusters; {{/if}} {{#if isReportableAttribute}} -{{! This callbackName bit is duplicated with the readAttribute code above. }} -{{#*inline "callbackName"}} - {{~#if isArray~}} - {{asUpperCamelCase ../name}}{{asUpperCamelCase name}}List - {{~else~}} - {{~#if isNullable}}Nullable{{/if~}} - {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} - VendorId - {{~else if isEnum~}} - {{asUpperCamelCase ../name}}Cluster{{asUpperCamelCase type}} - {{~else~}} - {{chipCallback.name}} - {{~/if~}} - {{~/if~}} - Attribute -{{~/inline}} - (void) subscribe{{>attribute}}WithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIP{{>callbackName}}CallbackSubscriptionBridge(self.callbackQueue, + new CHIP{{>attribute_data_callback_name}}CallbackSubscriptionBridge(self.callbackQueue, {{! This treats reportHandler as taking an id for the data. This is not great from a type-safety perspective, of course. }} reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = {{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; - auto successFn = Callback<{{>callbackName}}Callback>::FromCancelable(success); + auto successFn = Callback<{{>attribute_data_callback_name}}Callback>::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, CHIP{{>callbackName}}CallbackSubscriptionBridge::OnSubscriptionEstablished); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, CHIP{{>attribute_data_callback_name}}CallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } {{/if}} -{{/unless}} {{/chip_server_cluster_attributes}} @end diff --git a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt index adf932fd6d772f..3d9fb1a5b88854 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt @@ -38,7 +38,6 @@ NS_ASSUME_NONNULL_BEGIN {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name}}{{/inline}} - (void)read{{>attribute}}WithCompletionHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completionHandler; {{#if isWritableAttribute}} @@ -47,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN {{#if isReportableAttribute}} - (void) subscribe{{>attribute}}WithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler; {{/if}} -{{/unless}} {{/chip_server_cluster_attributes}} @end diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 05873ac3dc9e19..29dc83916f2408 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -219,8 +219,8 @@ CHIPDevice * GetConnectedDevice(void) {{#unless (isStrEqual "Thermostat" name)}} {{#unless (isStrEqual "OTA Software Update Provider" name)}} {{#unless (isStrEqual "Network Commissioning" name)}} {{! "Networks" is broken }} +{{#unless (isStrEqual "Application Basic" name)}} {{! "Application App" is broken }} {{#chip_server_cluster_attributes}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} - (void)testSendCluster{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -259,7 +259,7 @@ CHIPDevice * GetConnectedDevice(void) XCTestExpectation * expectation = [self expectationWithDescription:@"{{asUpperCamelCase parent.name}}WriteAttribute{{asUpperCamelCase name}}WithValue"]; - {{asObjectiveCType type parent.name}} value = {{asTestValue}}; + {{asObjectiveCType type parent.name}} value = {{asTestValue parent.name}}; [cluster writeAttribute{{asUpperCamelCase name}}WithValue:value completionHandler:^(NSError * _Nullable err) { NSLog(@"{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %@", err); XCTAssertEqual(err.code, 0); @@ -269,7 +269,6 @@ CHIPDevice * GetConnectedDevice(void) [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } {{/if}} -{{/unless}} {{/chip_server_cluster_attributes}} {{/unless}} {{/unless}} @@ -277,6 +276,7 @@ CHIPDevice * GetConnectedDevice(void) {{/unless}} {{/unless}} {{/unless}} +{{/unless}} {{/chip_client_clusters}} @end diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index c0ec9cdeb1829b..866a81e2b6ff1d 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -56,7 +56,7 @@ function asExpectedEndpointForCluster(clusterName) return 1; } -function asTestValue() +async function asTestValue(cluster, options) { if (StringHelper.isOctetString(this.type)) { return `[@"${"Test".substring(0, this.maxLength)}" dataUsingEncoding:NSUTF8StringEncoding]`; @@ -64,6 +64,9 @@ function asTestValue() return `@"${"Test".substring(0, this.maxLength)}"`; } else if (this.isArray) { return '[NSArray array]'; + } else if (this.isStruct) { + let ourClass = await asObjectiveCClass.call(this, this.type, cluster, options); + return `[[${ourClass} alloc] init]`; } else { return `@(${this.min || this.max || 0})`; } diff --git a/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt new file mode 100644 index 00000000000000..48845cc5f6a89d --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt @@ -0,0 +1,20 @@ +{{~#if isArray~}} + {{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}List +{{~else~}} + {{~#if_is_struct type~}} + {{~! Structs are not used as types of attributes much, so it's + less code to generate the callbacks on a per-attribute basis + than a per-struct-type basis. ~}} + {{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Struct + {{~else~}} + {{~#if isNullable}}Nullable{{/if~}} + {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} + VendorId + {{~else if isEnum~}} + {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase type}} + {{~else~}} + {{chipCallback.name}} + {{~/if~}} + {{~/if_is_struct~}} +{{~/if~}} +Attribute \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index f37f2672cd4658..76cbf2db253a31 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -48,6 +48,10 @@ { "name": "command_completion_type", "path": "partials/command_completion_type.zapt" + }, + { + "name": "attribute_data_callback_name", + "path": "partials/attribute_data_callback_name.zapt" } ], "templates": [ diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 1080ea741e6bdb..d162110349ae6f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -1227,6 +1227,34 @@ } } +void CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) +{ + CHIPApplicationBasicClusterApplicationBasicApplication * _Nonnull objCValue; + objCValue = [CHIPApplicationBasicClusterApplicationBasicApplication new]; + objCValue.catalogVendorId = [NSNumber numberWithUnsignedShort:value.catalogVendorId]; + objCValue.applicationId = [[NSString alloc] initWithBytes:value.applicationId.data() + length:value.applicationId.size() + encoding:NSUTF8StringEncoding]; + DispatchSuccess(context, objCValue); +}; + +void CHIPApplicationBasicApplicationAppStructAttributeCallbackSubscriptionBridge::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 CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -4106,6 +4134,32 @@ } } +void CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType & value) +{ + CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull objCValue; + objCValue = [CHIPGeneralCommissioningClusterBasicCommissioningInfo new]; + objCValue.failSafeExpiryLengthSeconds = [NSNumber numberWithUnsignedShort:value.failSafeExpiryLengthSeconds]; + DispatchSuccess(context, objCValue); +}; + +void CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge::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 CHIPGeneralCommissioningServerGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -8386,6 +8440,38 @@ } } +void CHIPTestClusterStructAttrStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & value) +{ + CHIPTestClusterClusterSimpleStruct * _Nonnull objCValue; + objCValue = [CHIPTestClusterClusterSimpleStruct new]; + objCValue.a = [NSNumber numberWithUnsignedChar:value.a]; + objCValue.b = [NSNumber numberWithBool:value.b]; + objCValue.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.c)]; + objCValue.d = [NSData dataWithBytes:value.d.data() length:value.d.size()]; + objCValue.e = [[NSString alloc] initWithBytes:value.e.data() length:value.e.size() encoding:NSUTF8StringEncoding]; + objCValue.f = [NSNumber numberWithUnsignedChar:value.f.Raw()]; + objCValue.g = [NSNumber numberWithFloat:value.g]; + objCValue.h = [NSNumber numberWithDouble:value.h]; + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterStructAttrStructAttributeCallbackSubscriptionBridge::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 CHIPTestClusterListLongOctetStringListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -8425,6 +8511,44 @@ } } +void CHIPTestClusterNullableStructStructAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + CHIPTestClusterClusterSimpleStruct * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [CHIPTestClusterClusterSimpleStruct new]; + objCValue.a = [NSNumber numberWithUnsignedChar:value.Value().a]; + objCValue.b = [NSNumber numberWithBool:value.Value().b]; + objCValue.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value().c)]; + objCValue.d = [NSData dataWithBytes:value.Value().d.data() length:value.Value().d.size()]; + objCValue.e = [[NSString alloc] initWithBytes:value.Value().e.data() + length:value.Value().e.size() + encoding:NSUTF8StringEncoding]; + objCValue.f = [NSNumber numberWithUnsignedChar:value.Value().f.Raw()]; + objCValue.g = [NSNumber numberWithFloat:value.Value().g]; + objCValue.h = [NSNumber numberWithDouble:value.Value().h]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterNullableStructStructAttributeCallbackSubscriptionBridge::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 CHIPTestClusterServerGeneratedCommandListListAttributeCallbackBridge::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 ee88d105152013..e8805677828cbc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -543,6 +543,15 @@ typedef void (*ApplianceEventsAndAlertClusterEventIdentificationAttributeCallbac typedef void (*NullableApplianceEventsAndAlertClusterEventIdentificationAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*ApplicationBasicApplicationAppStructAttributeCallback)( + void *, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType &); +typedef void (*GeneralCommissioningBasicCommissioningInfoStructAttributeCallback)( + void *, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType &); +typedef void (*TestClusterStructAttrStructAttributeCallback)( + void *, const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType &); +typedef void (*TestClusterNullableStructStructAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); + class CHIPDefaultSuccessCallbackBridge : public CHIPCallbackBridge { public: @@ -1587,6 +1596,36 @@ class CHIPAdministratorCommissioningAttributeListListAttributeCallbackSubscripti SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge(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::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value); +}; + +class CHIPApplicationBasicApplicationAppStructAttributeCallbackSubscriptionBridge + : public CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge +{ +public: + CHIPApplicationBasicApplicationAppStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -3643,6 +3682,37 @@ class CHIPFlowMeasurementAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge(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::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType & value); +}; + +class CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge + : public CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge +{ +public: + CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPGeneralCommissioningServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -6605,6 +6675,34 @@ class CHIPTestClusterListNullablesAndOptionalsStructListAttributeCallbackSubscri SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPTestClusterStructAttrStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterStructAttrStructAttributeCallbackBridge(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::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & value); +}; + +class CHIPTestClusterStructAttrStructAttributeCallbackSubscriptionBridge + : public CHIPTestClusterStructAttrStructAttributeCallbackBridge +{ +public: + CHIPTestClusterStructAttrStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterStructAttrStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPTestClusterListLongOctetStringListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -6633,6 +6731,36 @@ class CHIPTestClusterListLongOctetStringListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPTestClusterNullableStructStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterNullableStructStructAttributeCallbackBridge(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::Nullable & value); +}; + +class CHIPTestClusterNullableStructStructAttributeCallbackSubscriptionBridge + : public CHIPTestClusterNullableStructStructAttributeCallbackBridge +{ +public: + CHIPTestClusterNullableStructStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterNullableStructStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPTestClusterServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index b7af84a270b724..ec04507377ef8f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -244,6 +244,16 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeApplicationAppWithCompletionHandler: + (void (^)( + CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeApplicationAppWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeApplicationStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeApplicationStatusWithMinInterval:(uint16_t)minInterval @@ -2481,6 +2491,16 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeBasicCommissioningInfoWithCompletionHandler: + (void (^)(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error))completionHandler; +- (void) + subscribeAttributeBasicCommissioningInfoWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeRegulatoryConfigWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeRegulatoryConfigWithMinInterval:(uint16_t)minInterval @@ -5312,6 +5332,16 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeStructAttrWithCompletionHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeStructAttrWithValue:(CHIPTestClusterClusterSimpleStruct * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeStructAttrWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeRangeRestrictedInt8uWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)writeAttributeRangeRestrictedInt8uWithValue:(NSNumber * _Nonnull)value @@ -5659,6 +5689,16 @@ NS_ASSUME_NONNULL_BEGIN reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeNullableStructWithCompletionHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeNullableStructWithValue:(CHIPTestClusterClusterSimpleStruct * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeNullableStructWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSNumber * _Nullable)value diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index d8b041e6b8e2ea..679e9462293c07 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -969,6 +969,38 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeApplicationAppWithCompletionHandler: + (void (^)(CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPApplicationBasicApplicationAppStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationBasic::Attributes::ApplicationApp::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeApplicationAppWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(CHIPApplicationBasicClusterApplicationBasicApplication * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPApplicationBasicApplicationAppStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationBasic::Attributes::ApplicationApp::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPApplicationBasicApplicationAppStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeApplicationStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -10171,6 +10203,39 @@ new CHIPInt64uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeBasicCommissioningInfoWithCompletionHandler: + (void (^)(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GeneralCommissioning::Attributes::BasicCommissioningInfo::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void) + subscribeAttributeBasicCommissioningInfoWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GeneralCommissioning::Attributes::BasicCommissioningInfo::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeRegulatoryConfigWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -22568,6 +22633,63 @@ new CHIPTestClusterClusterSimpleEnumAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeStructAttrWithCompletionHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPTestClusterStructAttrStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::StructAttr::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeStructAttrWithValue:(CHIPTestClusterClusterSimpleStruct * _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 = TestCluster::Attributes::StructAttr::TypeInfo; + TypeInfo::Type cppValue; + cppValue.a = value.a.unsignedCharValue; + cppValue.b = value.b.boolValue; + cppValue.c = static_cast>(value.c.unsignedCharValue); + cppValue.d = [self asByteSpan:value.d]; + cppValue.e = [self asCharSpan:value.e]; + cppValue.f = static_cast>(value.f.unsignedCharValue); + cppValue.g = value.g.floatValue; + cppValue.h = value.h.doubleValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeStructAttrWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPTestClusterStructAttrStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::StructAttr::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPTestClusterStructAttrStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeRangeRestrictedInt8uWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -24472,6 +24594,68 @@ new CHIPNullableTestClusterClusterSimpleEnumAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeNullableStructWithCompletionHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPTestClusterNullableStructStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::NullableStruct::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeNullableStructWithValue:(CHIPTestClusterClusterSimpleStruct * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = TestCluster::Attributes::NullableStruct::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0.a = value.a.unsignedCharValue; + nonNullValue_0.b = value.b.boolValue; + nonNullValue_0.c = static_cast>(value.c.unsignedCharValue); + nonNullValue_0.d = [self asByteSpan:value.d]; + nonNullValue_0.e = [self asCharSpan:value.e]; + nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); + nonNullValue_0.g = value.g.floatValue; + nonNullValue_0.h = value.h.doubleValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeNullableStructWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPTestClusterClusterSimpleStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPTestClusterNullableStructStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::NullableStruct::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPTestClusterNullableStructStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index 2d7c95e9385780..2495e07b205d66 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -81,6 +81,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeApplicationNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeProductIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeApplicationAppWithValue:(CHIPApplicationBasicClusterApplicationBasicApplication * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeApplicationStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeApplicationVersionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 6518bd384bbc00..a491f1ba624f0f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -620,6 +620,26 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeApplicationAppWithValue:(CHIPApplicationBasicClusterApplicationBasicApplication * _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 = ApplicationBasic::Attributes::ApplicationApp::TypeInfo; + TypeInfo::Type cppValue; + cppValue.catalogVendorId = value.catalogVendorId.unsignedShortValue; + cppValue.applicationId = [self asCharSpan:value.applicationId]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeApplicationStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 015bab228debb2..6ae58e8239dea3 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -37525,6 +37525,70 @@ - (void)testSendClusterTestCluster_000477_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestCluster_000478_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write struct-typed attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id structAttrArgument; + structAttrArgument = [[CHIPTestClusterClusterSimpleStruct alloc] init]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).a = [NSNumber numberWithUnsignedChar:5]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).b = [NSNumber numberWithBool:true]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).c = [NSNumber numberWithUnsignedChar:2]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).d = [[NSData alloc] initWithBytes:"abc" length:3]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).e = @""; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).f = [NSNumber numberWithUnsignedChar:17]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).g = [NSNumber numberWithFloat:1.5f]; + ((CHIPTestClusterClusterSimpleStruct *) structAttrArgument).h = [NSNumber numberWithDouble:3.14159265358979]; + + [cluster writeAttributeStructAttrWithValue:structAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write struct-typed attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000479_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read struct-typed attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeStructAttrWithCompletionHandler:^( + CHIPTestClusterClusterSimpleStruct * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read struct-typed attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).a unsignedCharValue], 5); + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).b boolValue], true); + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).c unsignedCharValue], 2); + XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).d isEqualToData:[[NSData alloc] initWithBytes:"abc" + length:3]]); + XCTAssertTrue([((CHIPTestClusterClusterSimpleStruct *) actualValue).e isEqualToString:@""]); + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).f unsignedCharValue], 17); + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).g floatValue], 1.5f); + XCTAssertEqual([((CHIPTestClusterClusterSimpleStruct *) actualValue).h doubleValue], 3.14159265358979); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTestSaveAs_000000_WaitForCommissionee { @@ -43165,281 +43229,6 @@ - (void)testSendClusterAdministratorCommissioningReadAttributeClusterRevisionWit [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeVendorNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorNameWithCompletionHandler"]; - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic VendorName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeVendorIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorIdWithCompletionHandler"]; - - [cluster readAttributeVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic VendorId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeApplicationNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationNameWithCompletionHandler"]; - - [cluster readAttributeApplicationNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ApplicationName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeProductIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeProductIdWithCompletionHandler"]; - - [cluster readAttributeProductIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ProductId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeApplicationStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationStatusWithCompletionHandler"]; - - [cluster readAttributeApplicationStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ApplicationStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeApplicationVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationVersionWithCompletionHandler"]; - - [cluster readAttributeApplicationVersionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ApplicationVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeAllowedVendorListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeAllowedVendorListWithCompletionHandler"]; - - [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic AllowedVendorList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationBasicReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationBasicReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationBasic ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -49213,6 +49002,32 @@ - (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumbWithValue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterGeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"GeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler"]; + + [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( + CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"GeneralCommissioning BasicCommissioningInfo Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterGeneralCommissioningReadAttributeRegulatoryConfigWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 5c8428bf376a3b..4fbcefa8193e8e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -368,29 +368,6 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand | Events: | | \*----------------------------------------------------------------------------*/ -class WriteApplicationBasicApplicationApp : public WriteAttribute -{ -public: - WriteApplicationBasicApplicationApp(CredentialIssuerCommands * credsIssuerConfig) : - WriteAttribute("ApplicationApp", credsIssuerConfig), mComplex(&mValue) - { - AddArgument("attr-name", "application-app"); - AddArgument("attr-value", &mComplex); - WriteAttribute::AddArguments(); - } - - ~WriteApplicationBasicApplicationApp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - return WriteAttribute::SendCommand(device, endpointId, 0x0000050D, 0x00000004, mValue); - } - -private: - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type mValue; - TypedComplexArgument mComplex; -}; - /*----------------------------------------------------------------------------*\ | Cluster ApplicationLauncher | 0x050C | |------------------------------------------------------------------------------| @@ -9554,7 +9531,6 @@ void registerClusterApplicationBasic(Commands & commands, CredentialIssuerComman make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "vendor-name", Attributes::VendorName::Id, credsIssuerConfig), // make_unique(Id, "vendor-id", Attributes::VendorId::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 69344067e3912f..f54100b279450c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -49291,6 +49291,14 @@ class TestCluster : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 477 : read ServerGeneratedCommandList attribute\n"); err = TestReadServerGeneratedCommandListAttribute_477(); break; + case 478: + ChipLogProgress(chipTool, " ***** Test Step 478 : Write struct-typed attribute\n"); + err = TestWriteStructTypedAttribute_478(); + break; + case 479: + ChipLogProgress(chipTool, " ***** Test Step 479 : Read struct-typed attribute\n"); + err = TestReadStructTypedAttribute_479(); + break; } if (CHIP_NO_ERROR != err) @@ -49302,7 +49310,7 @@ class TestCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 478; + const uint16_t mTestCount = 480; chip::Optional mCluster; chip::Optional mEndpoint; @@ -53228,6 +53236,24 @@ class TestCluster : public TestCommand (static_cast(context))->OnSuccessResponse_477(serverGeneratedCommandList); } + static void OnFailureCallback_478(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_478(error); + } + + static void OnSuccessCallback_478(void * context) { (static_cast(context))->OnSuccessResponse_478(); } + + static void OnFailureCallback_479(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_479(error); + } + + static void OnSuccessCallback_479(void * context, + const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & structAttr) + { + (static_cast(context))->OnSuccessResponse_479(structAttr); + } + // // Tests methods // @@ -65426,6 +65452,67 @@ class TestCluster : public TestCommand NextTest(); } + + CHIP_ERROR TestWriteStructTypedAttribute_478() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type structAttrArgument; + + structAttrArgument.a = 5; + structAttrArgument.b = true; + structAttrArgument.c = static_cast(2); + structAttrArgument.d = chip::ByteSpan(chip::Uint8::from_const_char("abcgarbage: not in length on purpose"), 3); + structAttrArgument.e = chip::Span("garbage: not in length on purpose", 0); + structAttrArgument.f = static_cast>(17); + structAttrArgument.g = 1.5f; + structAttrArgument.h = 3.14159265358979; + + ReturnErrorOnFailure(cluster.WriteAttribute( + structAttrArgument, this, OnSuccessCallback_478, OnFailureCallback_478)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_478(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_478() { NextTest(); } + + CHIP_ERROR TestReadStructTypedAttribute_479() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_479, OnFailureCallback_479)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_479(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_479(const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & structAttr) + { + VerifyOrReturn(CheckValue("structAttr.a", structAttr.a, 5)); + VerifyOrReturn(CheckValue("structAttr.b", structAttr.b, true)); + VerifyOrReturn(CheckValue("structAttr.c", structAttr.c, 2)); + VerifyOrReturn(CheckValueAsString("structAttr.d", structAttr.d, chip::ByteSpan(chip::Uint8::from_const_char("abc"), 3))); + VerifyOrReturn(CheckValueAsString("structAttr.e", structAttr.e, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("structAttr.f", structAttr.f, 17)); + VerifyOrReturn(CheckValue("structAttr.g", structAttr.g, 1.5f)); + VerifyOrReturn(CheckValue("structAttr.h", structAttr.h, 3.14159265358979)); + + NextTest(); + } }; class TestClusterComplexTypes : public TestCommand @@ -65554,14 +65641,6 @@ class TestClusterComplexTypes : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 20 : Write attribute that does not need timed write reset to default\n"); err = TestWriteAttributeThatDoesNotNeedTimedWriteResetToDefault_20(); break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Write struct-typed attribute\n"); - err = TestWriteStructTypedAttribute_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Read struct-typed attribute\n"); - err = TestReadStructTypedAttribute_22(); - break; } if (CHIP_NO_ERROR != err) @@ -65573,7 +65652,7 @@ class TestClusterComplexTypes : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 23; + const uint16_t mTestCount = 21; chip::Optional mCluster; chip::Optional mEndpoint; @@ -65697,24 +65776,6 @@ class TestClusterComplexTypes : public TestCommand static void OnSuccessCallback_20(void * context) { (static_cast(context))->OnSuccessResponse_20(); } - static void OnFailureCallback_21(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_21(error); - } - - static void OnSuccessCallback_21(void * context) { (static_cast(context))->OnSuccessResponse_21(); } - - static void OnFailureCallback_22(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_22(error); - } - - static void OnSuccessCallback_22(void * context, - const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & structAttr) - { - (static_cast(context))->OnSuccessResponse_22(structAttr); - } - // // Tests methods // @@ -66266,67 +66327,6 @@ class TestClusterComplexTypes : public TestCommand } void OnSuccessResponse_20() { NextTest(); } - - CHIP_ERROR TestWriteStructTypedAttribute_21() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type structAttrArgument; - - structAttrArgument.a = 5; - structAttrArgument.b = true; - structAttrArgument.c = static_cast(2); - structAttrArgument.d = chip::ByteSpan(chip::Uint8::from_const_char("abcgarbage: not in length on purpose"), 3); - structAttrArgument.e = chip::Span("garbage: not in length on purpose", 0); - structAttrArgument.f = static_cast>(17); - structAttrArgument.g = 1.5f; - structAttrArgument.h = 3.14159265358979; - - ReturnErrorOnFailure(cluster.WriteAttribute( - structAttrArgument, this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_21(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_21() { NextTest(); } - - CHIP_ERROR TestReadStructTypedAttribute_22() - { - const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_22(CHIP_ERROR error) - { - chip::app::StatusIB status(error); - ThrowFailureResponse(); - } - - void OnSuccessResponse_22(const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & structAttr) - { - VerifyOrReturn(CheckValue("structAttr.a", structAttr.a, 5)); - VerifyOrReturn(CheckValue("structAttr.b", structAttr.b, true)); - VerifyOrReturn(CheckValue("structAttr.c", structAttr.c, 2)); - VerifyOrReturn(CheckValueAsString("structAttr.d", structAttr.d, chip::ByteSpan(chip::Uint8::from_const_char("abc"), 3))); - VerifyOrReturn(CheckValueAsString("structAttr.e", structAttr.e, chip::CharSpan("", 0))); - VerifyOrReturn(CheckValue("structAttr.f", structAttr.f, 17)); - VerifyOrReturn(CheckValue("structAttr.g", structAttr.g, 1.5f)); - VerifyOrReturn(CheckValue("structAttr.h", structAttr.h, 3.14159265358979)); - - NextTest(); - } }; class TestConstraints : public TestCommand diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 291009cc30c168..be4023311835a5 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -1366,12 +1366,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* product id */ \ - { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* application app */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* product id */ \ + { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2701) }, /* allowed vendor list */ \ @@ -1394,12 +1393,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* application app */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2991) }, /* allowed vendor list */ \ @@ -1413,12 +1411,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* application app */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ From 84359b4b81a33b6c9bed930d7b7b5ed16ed85ad0 Mon Sep 17 00:00:00 2001 From: Praveen Chandran Date: Mon, 7 Feb 2022 19:07:50 -0800 Subject: [PATCH 05/30] Support Network Commissioning for Infineon P6 platform (#14767) * Support Network Commissioning for P6 Platform * Add Persistent Storage app for Infineon P6 Platform --- examples/all-clusters-app/p6/src/AppTask.cpp | 23 +- examples/lighting-app/p6/src/AppTask.cpp | 16 +- examples/lock-app/p6/src/AppTask.cpp | 17 +- examples/persistent-storage/p6/.gn | 28 ++ examples/persistent-storage/p6/BUILD.gn | 91 +++++ examples/persistent-storage/p6/README.md | 54 +++ examples/persistent-storage/p6/args.gni | 20 + .../persistent-storage/p6/build_overrides | 1 + .../persistent-storage/p6/include/AppConfig.h | 33 ++ .../p6/include/CHIPProjectConfig.h | 111 ++++++ examples/persistent-storage/p6/main.cpp | 55 +++ .../p6/third_party/connectedhomeip | 1 + scripts/tools/check_includes_config.py | 1 + src/platform/P6/BUILD.gn | 2 + src/platform/P6/ConnectivityManagerImpl.cpp | 3 + src/platform/P6/NetworkCommissioningDriver.h | 139 +++++++ .../P6/NetworkCommissioningWiFiDriver.cpp | 367 ++++++++++++++++++ 17 files changed, 957 insertions(+), 5 deletions(-) create mode 100644 examples/persistent-storage/p6/.gn create mode 100644 examples/persistent-storage/p6/BUILD.gn create mode 100644 examples/persistent-storage/p6/README.md create mode 100644 examples/persistent-storage/p6/args.gni create mode 120000 examples/persistent-storage/p6/build_overrides create mode 100644 examples/persistent-storage/p6/include/AppConfig.h create mode 100644 examples/persistent-storage/p6/include/CHIPProjectConfig.h create mode 100644 examples/persistent-storage/p6/main.cpp create mode 120000 examples/persistent-storage/p6/third_party/connectedhomeip create mode 100644 src/platform/P6/NetworkCommissioningDriver.h create mode 100644 src/platform/P6/NetworkCommissioningWiFiDriver.cpp diff --git a/examples/all-clusters-app/p6/src/AppTask.cpp b/examples/all-clusters-app/p6/src/AppTask.cpp index e2ce865f6fc39f..977730e5845631 100644 --- a/examples/all-clusters-app/p6/src/AppTask.cpp +++ b/examples/all-clusters-app/p6/src/AppTask.cpp @@ -40,6 +40,9 @@ #include #include +#include +#include + #define APP_EVENT_QUEUE_SIZE 10 #define APP_TASK_STACK_SIZE (4096) #define APP_WAIT_LOOP 1000 @@ -60,13 +63,24 @@ StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; } // namespace +using namespace ::chip; using namespace chip::TLV; using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; -using namespace ::chip::app::Clusters; +using namespace ::chip::System; AppTask AppTask::sAppTask; +namespace { +app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::P6WiFiDriver::GetInstance())); +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); +} + CHIP_ERROR AppTask::StartAppTask() { sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct); @@ -107,6 +121,7 @@ CHIP_ERROR AppTask::Init() // Initialise WSTK buttons PB0 and PB1 (including debounce). ButtonHandler::Init(); + NetWorkCommissioningInstInit(); P6_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); // Initialize LEDs @@ -219,10 +234,12 @@ void AppTask::DispatchEvent(AppEvent * aEvent) void AppTask::OnOffUpdateClusterState(void) { - uint8_t newValue = sLightLED.Get(); + uint8_t onoff = sLightLED.Get(); // write the new on/off value - EmberAfStatus status = OnOff::Attributes::OnOff::Set(2, newValue); + EmberAfStatus status = + emberAfWriteServerAttribute(2, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + if (status != EMBER_ZCL_STATUS_SUCCESS) { P6_LOG("ERR: updating on/off %x", status); diff --git a/examples/lighting-app/p6/src/AppTask.cpp b/examples/lighting-app/p6/src/AppTask.cpp index f85a59158e2aa4..8e04f710716515 100644 --- a/examples/lighting-app/p6/src/AppTask.cpp +++ b/examples/lighting-app/p6/src/AppTask.cpp @@ -38,6 +38,9 @@ #include #include +#include +#include + #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 #define APP_TASK_STACK_SIZE (4096) @@ -65,12 +68,23 @@ StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; } // namespace +using namespace ::chip; using namespace chip::TLV; using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; AppTask AppTask::sAppTask; +namespace { +app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::P6WiFiDriver::GetInstance())); +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); +} + CHIP_ERROR AppTask::StartAppTask() { sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct); @@ -124,7 +138,7 @@ CHIP_ERROR AppTask::Init() P6_LOG("funct timer create failed"); appError(APP_ERROR_CREATE_TIMER_FAILED); } - + NetWorkCommissioningInstInit(); P6_LOG("Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); err = LightMgr().Init(); if (err != CHIP_NO_ERROR) diff --git a/examples/lock-app/p6/src/AppTask.cpp b/examples/lock-app/p6/src/AppTask.cpp index 94ecddb6a8365e..74c40151eefe95 100644 --- a/examples/lock-app/p6/src/AppTask.cpp +++ b/examples/lock-app/p6/src/AppTask.cpp @@ -37,6 +37,9 @@ #include #include +#include +#include + #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 #define APP_TASK_STACK_SIZE (4096) @@ -62,12 +65,24 @@ StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; } // namespace +using namespace ::chip; using namespace chip::TLV; using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; +using namespace ::chip::System; AppTask AppTask::sAppTask; +namespace { +app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::P6WiFiDriver::GetInstance())); +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); +} + CHIP_ERROR AppTask::StartAppTask() { sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); @@ -121,7 +136,7 @@ CHIP_ERROR AppTask::Init() P6_LOG("funct timer create failed"); appError(APP_ERROR_CREATE_TIMER_FAILED); } - + NetWorkCommissioningInstInit(); P6_LOG("Current Software Version: %d", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); err = BoltLockMgr().Init(); if (err != CHIP_NO_ERROR) diff --git a/examples/persistent-storage/p6/.gn b/examples/persistent-storage/p6/.gn new file mode 100644 index 00000000000000..81cec9d11a421b --- /dev/null +++ b/examples/persistent-storage/p6/.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/persistent-storage/p6/BUILD.gn b/examples/persistent-storage/p6/BUILD.gn new file mode 100644 index 00000000000000..944a2e07178056 --- /dev/null +++ b/examples/persistent-storage/p6/BUILD.gn @@ -0,0 +1,91 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/p6.gni") + +import("${build_root}/config/defaults.gni") +import("${p6_sdk_build_root}/p6_executable.gni") +import("${p6_sdk_build_root}/p6_sdk.gni") + +assert(current_os == "freertos") + +p6_project_dir = "${chip_root}/examples/persistent-storage/p6" +examples_plat_dir = "${chip_root}/examples/platform/p6" + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false +} + +p6_sdk_sources("persistent_storage_app_sdk_sources") { + include_dirs = [ + "${chip_root}/src/platform/P6", + "${p6_project_dir}/include", + "${examples_plat_dir}", + ] + + defines = [ + "BOARD_ID=${p6_board}", + "P6_LOG_ENABLED=1", + ] + + sources = [ "${p6_project_dir}/include/CHIPProjectConfig.h" ] + + public_configs = [ "${chip_root}/third_party/p6:p6_sdk_config" ] +} + +p6_executable("persistent_storage_app") { + include_dirs = [] + defines = [] + output_name = "chip-p6-persistent-storage-example.out" + + public_deps = [ + ":persistent_storage_app_sdk_sources", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] + + include_dirs += [ + "include", + "${examples_plat_dir}", + "${p6_project_dir}/include", + "${chip_root}/examples/persistent-storage", + ] + + sources = [ + "${chip_root}/examples/persistent-storage/KeyValueStorageTest.cpp", + "${examples_plat_dir}/init_p6Platform.cpp", + "${p6_project_dir}/include/CHIPProjectConfig.h", + "main.cpp", + ] + + output_dir = root_out_dir + + if (chip_print_memory_usage) { + ldflags = [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } +} + +group("p6") { + deps = [ ":persistent_storage_app" ] +} + +group("default") { + deps = [ ":p6" ] +} diff --git a/examples/persistent-storage/p6/README.md b/examples/persistent-storage/p6/README.md new file mode 100644 index 00000000000000..8f30ecab6dbc39 --- /dev/null +++ b/examples/persistent-storage/p6/README.md @@ -0,0 +1,54 @@ +# CHIP P6 Persistent Storage Example + +An example testing and demonstrating the key value storage API. + +
+ +- [CHIP P6 Persistent Storage Example](#chip-P6-persistent-storage-example) + - [Introduction](#introduction) + - [P6](#P6) + - [Building](#building) + - [Flashing the Application](#flashing-the-application) + +
+ + + +## Introduction + +This example serves to both test the key value storage implementation and API as +it is brought-up on different platforms, as well as provide an example for how +to use the API. + +In the future this example can be moved into a unit test when available on all +platforms. + + + +## P6 + +The P6 platform KVS is fully implemented, the KVS is enabled and configured by +providing a file during the init call. + + + +### Building + +- Build the example application: + + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ ./scripts/examples/gn_p6_example.sh examples/persistent-storage/p6 out/persistent_storage_app_p6 + + + +### Flashing the Application + +- Put CY8CKIT-062S2-43012 board on KitProg3 CMSIS-DAP Mode by pressing the + `MODE SELECT` button. `KITPROG3 STATUS` LED is ON confirms board is in + proper mode. + +- On the command line: + + $ cd ~/connectedhomeip + $ python3 out/persistent_storage_app_p6/chip-p6-persistent-storage-example.flash.py diff --git a/examples/persistent-storage/p6/args.gni b/examples/persistent-storage/p6/args.gni new file mode 100644 index 00000000000000..1c30d812940d3d --- /dev/null +++ b/examples/persistent-storage/p6/args.gni @@ -0,0 +1,20 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") +import("${chip_root}/src/platform/P6/args.gni") + +p6_target_project = + get_label_info(":persistent_storage_app_sdk_sources", "label_no_toolchain") diff --git a/examples/persistent-storage/p6/build_overrides b/examples/persistent-storage/p6/build_overrides new file mode 120000 index 00000000000000..194ee0b812dc3d --- /dev/null +++ b/examples/persistent-storage/p6/build_overrides @@ -0,0 +1 @@ +../../build_overrides/ \ No newline at end of file diff --git a/examples/persistent-storage/p6/include/AppConfig.h b/examples/persistent-storage/p6/include/AppConfig.h new file mode 100644 index 00000000000000..4c4efaefa09e8c --- /dev/null +++ b/examples/persistent-storage/p6/include/AppConfig.h @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// P6 Logging +#ifdef __cplusplus +extern "C" { +#endif + +void appError(int err); +void P6Log(const char * aFormat, ...); +#define P6_LOG(...) P6Log(__VA_ARGS__) + +#ifdef __cplusplus +} +#endif diff --git a/examples/persistent-storage/p6/include/CHIPProjectConfig.h b/examples/persistent-storage/p6/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..e410cc9f4857c0 --- /dev/null +++ b/examples/persistent-storage/p6/include/CHIPProjectConfig.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +/** + * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY + * + * Enables the use of a hard-coded default Chip device id and credentials if no device id + * is found in Chip NV storage. + * + * This option is for testing only and should be disabled in production releases. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 +#define CHIP_CONFIG_REQUIRE_AUTH 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * + * The product revision number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software revisions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * + * A string identifying the firmware revision running on the device. + * CHIP service currently expects the firmware version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#endif +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) diff --git a/examples/persistent-storage/p6/main.cpp b/examples/persistent-storage/p6/main.cpp new file mode 100644 index 00000000000000..2c5dabc7d09d18 --- /dev/null +++ b/examples/persistent-storage/p6/main.cpp @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppConfig.h" +#include "KeyValueStorageTest.h" +#include "init_p6Platform.h" +#include +#include + +using namespace chip; + +int main(int argc, char * argv[]) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + init_p6Platform(); + + err = chip::Platform::MemoryInit(); + SuccessOrExit(err); + + err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(); + SuccessOrExit(err); + + P6_LOG("=============================================\n"); + P6_LOG("chip-p6-persistent-storage-example starting\n"); + P6_LOG("=============================================\n"); + + while (1) + { + P6_LOG("Running Tests:\n"); + chip::RunKvsTest(); + cyhal_system_delay_ms(60000); // Run every minute + } + +exit: + if (err != CHIP_NO_ERROR) + { + return 1; + } + return 0; +} diff --git a/examples/persistent-storage/p6/third_party/connectedhomeip b/examples/persistent-storage/p6/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/persistent-storage/p6/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/scripts/tools/check_includes_config.py b/scripts/tools/check_includes_config.py index c3be4b0e5dd6b9..8b7b2e152b0d37 100644 --- a/scripts/tools/check_includes_config.py +++ b/scripts/tools/check_includes_config.py @@ -47,6 +47,7 @@ '/platform/Linux/', '/platform/nxp/', '/platform/Tizen/', + '/platform/P6/', r'POSIX\.h$', } diff --git a/src/platform/P6/BUILD.gn b/src/platform/P6/BUILD.gn index f33ef8e443539c..ed08a0b5ba3526 100644 --- a/src/platform/P6/BUILD.gn +++ b/src/platform/P6/BUILD.gn @@ -48,6 +48,8 @@ static_library("P6") { "LwIPCoreLock.cpp", "MTBKeyValueStore.cpp", "MTBKeyValueStore.h", + "NetworkCommissioningDriver.h", + "NetworkCommissioningWiFiDriver.cpp", "P6Config.cpp", "P6Config.h", "P6Utils.cpp", diff --git a/src/platform/P6/ConnectivityManagerImpl.cpp b/src/platform/P6/ConnectivityManagerImpl.cpp index 6819e71a76f685..27a38150089d11 100644 --- a/src/platform/P6/ConnectivityManagerImpl.cpp +++ b/src/platform/P6/ConnectivityManagerImpl.cpp @@ -37,6 +37,7 @@ #include "lwip/opt.h" #include +#include #include #if !CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION @@ -240,6 +241,7 @@ void ConnectivityManagerImpl::wlan_event_cb(cy_wcm_event_t event, cy_wcm_event_d case CY_WCM_EVENT_CONNECTED: ChipLogProgress(DeviceLayer, "CY_WCM_EVENT_CONNECTED"); ConnectivityMgrImpl().ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + NetworkCommissioning::P6WiFiDriver::GetInstance().OnConnectWiFiNetwork(); ConnectivityMgrImpl().DriveStationState(); break; case CY_WCM_EVENT_CONNECT_FAILED: @@ -250,6 +252,7 @@ void ConnectivityManagerImpl::wlan_event_cb(cy_wcm_event_t event, cy_wcm_event_d case CY_WCM_EVENT_RECONNECTED: ChipLogProgress(DeviceLayer, "CY_WCM_EVENT_RECONNECTED"); ConnectivityMgrImpl().ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + NetworkCommissioning::P6WiFiDriver::GetInstance().OnConnectWiFiNetwork(); ConnectivityMgrImpl().DriveStationState(); break; case CY_WCM_EVENT_DISCONNECTED: diff --git a/src/platform/P6/NetworkCommissioningDriver.h b/src/platform/P6/NetworkCommissioningDriver.h new file mode 100644 index 00000000000000..a1c30b4e8488e8 --- /dev/null +++ b/src/platform/P6/NetworkCommissioningDriver.h @@ -0,0 +1,139 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +namespace { +constexpr uint8_t kMaxWiFiNetworks = 1; +constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +constexpr uint8_t kWiFiMaxNetworks = 15; +} // namespace + +class P6ScanResponseIterator : public Iterator +{ +public: + P6ScanResponseIterator(const size_t size, const cy_wcm_scan_result_t * scanResults) : mSize(size), mpScanResults(scanResults) {} + size_t Count() override { return mSize; } + bool Next(WiFiScanResponse & item) override + { + if (mIternum >= mSize) + { + return false; + } + + item.security = mpScanResults[mIternum].security; + item.ssidLen = + strnlen(reinterpret_cast(mpScanResults[mIternum].SSID), chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); + item.channel = mpScanResults[mIternum].channel; + item.wiFiBand = (mpScanResults[mIternum].band == CY_WCM_WIFI_BAND_2_4GHZ) + ? chip::DeviceLayer::NetworkCommissioning::WiFiBand::k2g4 + : chip::DeviceLayer::NetworkCommissioning::WiFiBand::k5g; + item.rssi = mpScanResults[mIternum].signal_strength; + memcpy(item.ssid, mpScanResults[mIternum].SSID, item.ssidLen); + memcpy(item.bssid, mpScanResults[mIternum].BSSID, 6); + + mIternum++; + return true; + } + void Release() override {} + +private: + const size_t mSize; // no of network scanned + const cy_wcm_scan_result_t * mpScanResults; // list of scanned network info of size mSize + size_t mIternum = 0; // to iterate through mpScanResults of size mSize +}; + +class P6WiFiDriver final : public WiFiDriver +{ +public: + class WiFiNetworkIterator final : public NetworkIterator + { + public: + WiFiNetworkIterator(P6WiFiDriver * aDriver) : mDriver(aDriver) {} + size_t Count() override; + bool Next(Network & item) override; + void Release() override { delete this; } + ~WiFiNetworkIterator() = default; + + private: + P6WiFiDriver * mDriver; + bool mExhausted = false; + }; + + struct WiFiNetwork + { + char ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; + uint8_t ssidLen = 0; + char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; + uint8_t credentialsLen = 0; + }; + + // BaseDriver + NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } + CHIP_ERROR Init() override; + CHIP_ERROR Shutdown() override; + + // WirelessDriver + uint8_t GetMaxNetworks() override { return kMaxWiFiNetworks; } + uint8_t GetScanNetworkTimeoutSeconds() override { return kWiFiScanNetworksTimeOutSeconds; } + uint8_t GetConnectNetworkTimeoutSeconds() override { return kWiFiConnectNetworkTimeoutSeconds; } + + CHIP_ERROR CommitConfiguration() override; + CHIP_ERROR RevertConfiguration() override; + + Status RemoveNetwork(ByteSpan networkId) override; + Status ReorderNetwork(ByteSpan networkId, uint8_t index) override; + void ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) override; + + // WiFiDriver + Status AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials) override; + void ScanNetworks(ByteSpan ssid, ScanCallback * callback) override; + + CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen); + + static void scan_result_callback(cy_wcm_scan_result_t * result_ptr, void * user_data, cy_wcm_scan_status_t status); + uint8_t ConvertSecuritytype(cy_wcm_security_t security); + + void OnConnectWiFiNetwork(); + void OnScanWiFiNetworkDone(); + static P6WiFiDriver & GetInstance() + { + static P6WiFiDriver instance; + return instance; + } + +private: + bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); + CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); + + WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); + WiFiNetwork mSavedNetwork; + WiFiNetwork mStagingNetwork; + ScanCallback * mpScanCallback; + ConnectCallback * mpConnectCallback; +}; + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/P6/NetworkCommissioningWiFiDriver.cpp b/src/platform/P6/NetworkCommissioningWiFiDriver.cpp new file mode 100644 index 00000000000000..ec1fb771274e79 --- /dev/null +++ b/src/platform/P6/NetworkCommissioningWiFiDriver.cpp @@ -0,0 +1,367 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace ::chip; + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +namespace { +constexpr char kWiFiSSIDKeyName[] = "wifi-ssid"; +constexpr char kWiFiCredentialsKeyName[] = "wifi-pass"; +} // namespace + +cy_wcm_scan_result_t scan_result_list[kWiFiMaxNetworks]; +uint8_t NumAP; // no of network scanned + +CHIP_ERROR P6WiFiDriver::Init() +{ + CHIP_ERROR err; + size_t ssidLen = 0; + size_t credentialsLen = 0; + mpScanCallback = nullptr; + mpConnectCallback = nullptr; + + err = PersistedStorage::KeyValueStoreMgr().Get(kWiFiCredentialsKeyName, mSavedNetwork.credentials, + sizeof(mSavedNetwork.credentials), &credentialsLen); + if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + + err = PersistedStorage::KeyValueStoreMgr().Get(kWiFiSSIDKeyName, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), &ssidLen); + if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + + mSavedNetwork.credentialsLen = credentialsLen; + mSavedNetwork.ssidLen = ssidLen; + mStagingNetwork = mSavedNetwork; + return err; +} + +CHIP_ERROR P6WiFiDriver::Shutdown() +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR P6WiFiDriver::CommitConfiguration() +{ + ReturnErrorOnFailure(PersistedStorage::KeyValueStoreMgr().Put(kWiFiSSIDKeyName, mStagingNetwork.ssid, mStagingNetwork.ssidLen)); + ReturnErrorOnFailure(PersistedStorage::KeyValueStoreMgr().Put(kWiFiCredentialsKeyName, mStagingNetwork.credentials, + mStagingNetwork.credentialsLen)); + mSavedNetwork = mStagingNetwork; + return CHIP_NO_ERROR; +} + +CHIP_ERROR P6WiFiDriver::RevertConfiguration() +{ + mStagingNetwork = mSavedNetwork; + return CHIP_NO_ERROR; +} + +bool P6WiFiDriver::NetworkMatch(const WiFiNetwork & network, ByteSpan networkId) +{ + return networkId.size() == network.ssidLen && memcmp(networkId.data(), network.ssid, network.ssidLen) == 0; +} + +Status P6WiFiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials) +{ + VerifyOrReturnError(mStagingNetwork.ssidLen == 0 || NetworkMatch(mStagingNetwork, ssid), Status::kBoundsExceeded); + VerifyOrReturnError(credentials.size() <= sizeof(mStagingNetwork.credentials), Status::kOutOfRange); + VerifyOrReturnError(ssid.size() <= sizeof(mStagingNetwork.ssid), Status::kOutOfRange); + + memcpy(mStagingNetwork.credentials, credentials.data(), credentials.size()); + mStagingNetwork.credentialsLen = static_cast(credentials.size()); + + memcpy(mStagingNetwork.ssid, ssid.data(), ssid.size()); + mStagingNetwork.ssidLen = static_cast(ssid.size()); + + return Status::kSuccess; +} + +Status P6WiFiDriver::RemoveNetwork(ByteSpan networkId) +{ + VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); + + // Use empty ssid for representing invalid network + mStagingNetwork.ssidLen = 0; + return Status::kSuccess; +} + +Status P6WiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index) +{ + // Only one network is supported now + VerifyOrReturnError(index == 0, Status::kOutOfRange); + VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); + return Status::kSuccess; +} + +CHIP_ERROR P6WiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled)); + // Set the wifi configuration + wifi_config_t wifi_config; + chip::DeviceLayer::Internal::P6Utils::populate_wifi_config_t( + &wifi_config, WIFI_IF_STA, (const cy_wcm_ssid_t *) ssid, (const cy_wcm_passphrase_t *) key, + (keyLen) ? CHIP_DEVICE_CONFIG_DEFAULT_STA_SECURITY : CY_WCM_SECURITY_OPEN); + + err = chip::DeviceLayer::Internal::P6Utils::p6_wifi_set_config(WIFI_IF_STA, &wifi_config); + SuccessOrExit(err); + + ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled)); + err = ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Enabled); + +exit: + return err; +} + +void P6WiFiDriver::OnConnectWiFiNetwork() +{ + if (mpConnectCallback) + { + mpConnectCallback->OnResult(Status::kSuccess, CharSpan(), 0); + mpConnectCallback = nullptr; + } +} + +void P6WiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + Status networkingStatus = Status::kSuccess; + + VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound); + VerifyOrExit(mpConnectCallback == nullptr, networkingStatus = Status::kUnknownError); + ChipLogProgress(NetworkProvisioning, "P6 NetworkCommissioningDelegate: SSID: %s", networkId.data()); + err = ConnectWiFiNetwork(reinterpret_cast(mStagingNetwork.ssid), mStagingNetwork.ssidLen, + reinterpret_cast(mStagingNetwork.credentials), mStagingNetwork.credentialsLen); + mpConnectCallback = callback; +exit: + if (err != CHIP_NO_ERROR) + { + networkingStatus = Status::kUnknownError; + } + if (networkingStatus != Status::kSuccess) + { + ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network:%s", chip::ErrorStr(err)); + mpConnectCallback = nullptr; + callback->OnResult(networkingStatus, CharSpan(), 0); + } +} + +uint8_t P6WiFiDriver::ConvertSecuritytype(cy_wcm_security_t security) +{ + uint8_t securityType = EMBER_ZCL_SECURITY_TYPE_UNSPECIFIED; + if (security == CY_WCM_SECURITY_OPEN) + { + securityType = EMBER_ZCL_SECURITY_TYPE_NONE; + } + else if (security & WPA3_SECURITY) + { + securityType = EMBER_ZCL_SECURITY_TYPE_WPA3; + } + else if (security & WPA2_SECURITY) + { + securityType = EMBER_ZCL_SECURITY_TYPE_WPA2; + } + else if (security & WPA_SECURITY) + { + securityType = EMBER_ZCL_SECURITY_TYPE_WPA; + } + else if (security & WEP_ENABLED) + { + securityType = EMBER_ZCL_SECURITY_TYPE_WEP; + } + return securityType; +} + +void P6WiFiDriver::scan_result_callback(cy_wcm_scan_result_t * result_ptr, void * user_data, cy_wcm_scan_status_t status) +{ + if ((status == CY_WCM_SCAN_COMPLETE) || (NumAP >= kWiFiMaxNetworks)) + { + /* Sent Scan response after Scan is complete */ + P6WiFiDriver::GetInstance().OnScanWiFiNetworkDone(); + } + else + { + if (result_ptr != NULL) + { + /* Copy Scan results and increment the AP count */ + memcpy(&scan_result_list[NumAP], (void *) result_ptr, sizeof(cy_wcm_scan_result_t)); + /* Convert Security type to proper EmberAfSecurityType value */ + scan_result_list[NumAP].security = + static_cast(P6WiFiDriver::GetInstance().ConvertSecuritytype(scan_result_list[NumAP].security)); + NumAP++; + } /* end of if ( result_ptr != NULL ) */ + } /* end of else */ +} + +CHIP_ERROR P6WiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) +{ + cy_rslt_t result; + /* Reset Number of APs Scanned to Zero */ + NumAP = 0; + /* Clear Scanned AP list */ + memset(scan_result_list, 0, sizeof(scan_result_list)); + cy_wcm_scan_filter_t scan_filter; + memset(&scan_filter, 0, sizeof(scan_filter)); + + if (ssid.data()) + { + + scan_filter.mode = CY_WCM_SCAN_FILTER_TYPE_SSID; + memcpy(scan_filter.param.SSID, ssid.data(), ssid.size()); + result = cy_wcm_start_scan(scan_result_callback, NULL, &scan_filter); + } + else + { + scan_filter.mode = CY_WCM_SCAN_FILTER_TYPE_RSSI; + scan_filter.param.rssi_range = CY_WCM_SCAN_RSSI_GOOD; + result = cy_wcm_start_scan(scan_result_callback, NULL, &scan_filter); + } + if (result != CY_RSLT_SUCCESS) + { + return CHIP_ERROR_NOT_FOUND; + } + return CHIP_NO_ERROR; +} + +void P6WiFiDriver::OnScanWiFiNetworkDone() +{ + uint8_t ap_num = NumAP; + if (!ap_num) + { + ChipLogProgress(DeviceLayer, "No AP found"); + if (mpScanCallback != nullptr) + { + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); + mpScanCallback = nullptr; + } + return; + } + cy_wcm_scan_result_t * ScanResult = &scan_result_list[0]; + + if (ScanResult) + { + if (CHIP_NO_ERROR == DeviceLayer::SystemLayer().ScheduleLambda([ap_num, ScanResult]() { + P6ScanResponseIterator iter(ap_num, ScanResult); + if (GetInstance().mpScanCallback) + { + GetInstance().mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), &iter); + GetInstance().mpScanCallback = nullptr; + } + else + { + ChipLogError(DeviceLayer, "can't find the ScanCallback function"); + } + })) + { + ChipLogProgress(DeviceLayer, "ScheduleLambda OK"); + } + } + else + { + ChipLogError(DeviceLayer, "can't get ap_records "); + if (mpScanCallback) + { + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + mpScanCallback = nullptr; + } + } +} + +void P6WiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) +{ + if (callback != nullptr) + { + mpScanCallback = callback; + if (StartScanWiFiNetworks(ssid) != CHIP_NO_ERROR) + { + mpScanCallback = nullptr; + callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + } + } +} + +CHIP_ERROR GetConnectedNetwork(Network & network) +{ + cy_wcm_associated_ap_info_t ap_info; + cy_rslt_t result = CY_RSLT_SUCCESS; + + result = cy_wcm_get_associated_ap_info(&ap_info); + if (result != CY_RSLT_SUCCESS) + { + ChipLogError(DeviceLayer, "cy_wcm_get_associated_ap_info failed: %d", (int) result); + return CHIP_ERROR_INTERNAL; + } + uint8_t length = strnlen(reinterpret_cast(ap_info.SSID), DeviceLayer::Internal::kMaxWiFiSSIDLength); + if (length > sizeof(network.networkID)) + { + ChipLogError(DeviceLayer, "SSID too long"); + return CHIP_ERROR_INTERNAL; + } + memcpy(network.networkID, ap_info.SSID, length); + network.networkIDLen = length; + + return CHIP_NO_ERROR; +} + +size_t P6WiFiDriver::WiFiNetworkIterator::Count() +{ + return mDriver->mStagingNetwork.ssidLen == 0 ? 0 : 1; +} + +bool P6WiFiDriver::WiFiNetworkIterator::Next(Network & item) +{ + if (mExhausted || mDriver->mStagingNetwork.ssidLen == 0) + { + return false; + } + memcpy(item.networkID, mDriver->mStagingNetwork.ssid, mDriver->mStagingNetwork.ssidLen); + item.networkIDLen = mDriver->mStagingNetwork.ssidLen; + item.connected = false; + mExhausted = true; + + Network connectedNetwork; + CHIP_ERROR err = GetConnectedNetwork(connectedNetwork); + if (err == CHIP_NO_ERROR) + { + if (connectedNetwork.networkIDLen == item.networkIDLen && + memcmp(connectedNetwork.networkID, item.networkID, item.networkIDLen) == 0) + { + item.connected = true; + } + } + return true; +} + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip From fb94eb886792dc5ec4deebe872e7504050835078 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 8 Feb 2022 04:10:56 +0100 Subject: [PATCH 06/30] Add RPC and shell support to the qpg platforms (#14742) * Add RPC and shell support to the qpg platforms * add rpc support for light, lock and ota * add shell application * add shell support for light and lock application * fix style errors --- config/qpg/lib/pw_rpc/BUILD.gn | 47 ++++++ config/qpg/lib/pw_rpc/pw_rpc.gni | 27 ++++ config/qpg/toolchain/BUILD.gn | 7 + examples/build_overrides/openthread.gni | 1 + .../common/pigweed/qpg/PigweedLoggerMutex.cpp | 27 ++++ .../common/pigweed/qpg/PigweedLoggerMutex.h | 40 +++++ examples/lighting-app/qpg/.gn | 1 + examples/lighting-app/qpg/BUILD.gn | 90 +++++++++-- examples/lighting-app/qpg/args.gni | 4 + examples/lighting-app/qpg/include/Rpc.h | 29 ++++ examples/lighting-app/qpg/src/AppTask.cpp | 10 +- examples/lighting-app/qpg/with_pw_rpc.gni | 27 ++++ examples/lock-app/qpg/BUILD.gn | 86 ++++++++-- examples/lock-app/qpg/args.gni | 4 + .../lock-app/qpg/include/BoltLockManager.h | 7 +- examples/lock-app/qpg/include/Rpc.h | 29 ++++ examples/lock-app/qpg/src/AppTask.cpp | 2 +- examples/lock-app/qpg/with_pw_rpc.gni | 27 ++++ examples/platform/qpg/BUILD.gn | 26 ++- examples/platform/qpg/PigweedLogger.cpp | 110 +++++++++++++ examples/platform/qpg/PigweedLogger.h | 32 ++++ examples/platform/qpg/Rpc.cpp | 151 ++++++++++++++++++ examples/platform/qpg/Rpc.h | 28 ++++ examples/platform/qpg/app/main.cpp | 36 ++++- examples/platform/qpg/pw_sys_io/BUILD.gn | 39 +++++ .../qpg/pw_sys_io/public/pw_sys_io_qpg/init.h | 27 ++++ examples/platform/qpg/pw_sys_io/sys_io_qpg.cc | 76 +++++++++ examples/platform/qpg/shell_common/shell.cpp | 94 +++++++++++ examples/platform/qpg/shell_common/shell.h | 42 +++++ examples/platform/qpg/uart.c | 52 ++++++ examples/platform/qpg/uart.h | 33 ++++ examples/shell/qpg/.gn | 28 ++++ examples/shell/qpg/BUILD.gn | 82 ++++++++++ examples/shell/qpg/args.gni | 24 +++ examples/shell/qpg/build_overrides | 1 + examples/shell/qpg/include/AppConfig.h | 27 ++++ examples/shell/qpg/include/AppTask.h | 43 +++++ examples/shell/qpg/src/AppTask.cpp | 28 ++++ .../shell/qpg/third_party/connectedhomeip | 1 + src/lib/shell/BUILD.gn | 5 + src/lib/shell/streamer_qpg.cpp | 66 ++++++++ src/platform/qpg/Logging.cpp | 4 + 42 files changed, 1470 insertions(+), 50 deletions(-) create mode 100644 config/qpg/lib/pw_rpc/BUILD.gn create mode 100644 config/qpg/lib/pw_rpc/pw_rpc.gni create mode 100644 examples/common/pigweed/qpg/PigweedLoggerMutex.cpp create mode 100644 examples/common/pigweed/qpg/PigweedLoggerMutex.h create mode 100644 examples/lighting-app/qpg/include/Rpc.h create mode 100644 examples/lighting-app/qpg/with_pw_rpc.gni create mode 100644 examples/lock-app/qpg/include/Rpc.h create mode 100644 examples/lock-app/qpg/with_pw_rpc.gni create mode 100644 examples/platform/qpg/PigweedLogger.cpp create mode 100644 examples/platform/qpg/PigweedLogger.h create mode 100644 examples/platform/qpg/Rpc.cpp create mode 100644 examples/platform/qpg/Rpc.h create mode 100644 examples/platform/qpg/pw_sys_io/BUILD.gn create mode 100644 examples/platform/qpg/pw_sys_io/public/pw_sys_io_qpg/init.h create mode 100644 examples/platform/qpg/pw_sys_io/sys_io_qpg.cc create mode 100644 examples/platform/qpg/shell_common/shell.cpp create mode 100644 examples/platform/qpg/shell_common/shell.h create mode 100644 examples/platform/qpg/uart.c create mode 100644 examples/platform/qpg/uart.h create mode 100644 examples/shell/qpg/.gn create mode 100644 examples/shell/qpg/BUILD.gn create mode 100644 examples/shell/qpg/args.gni create mode 120000 examples/shell/qpg/build_overrides create mode 100644 examples/shell/qpg/include/AppConfig.h create mode 100644 examples/shell/qpg/include/AppTask.h create mode 100644 examples/shell/qpg/src/AppTask.cpp create mode 120000 examples/shell/qpg/third_party/connectedhomeip create mode 100644 src/lib/shell/streamer_qpg.cpp diff --git a/config/qpg/lib/pw_rpc/BUILD.gn b/config/qpg/lib/pw_rpc/BUILD.gn new file mode 100644 index 00000000000000..bd633d591b3577 --- /dev/null +++ b/config/qpg/lib/pw_rpc/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") +import("$dir_pw_build/target_types.gni") + +config("cpp17") { + cflags_cc = [ "-std=gnu++17" ] + cflags_c = [ "-std=gnu11" ] + cflags_objc = [ "-std=gnu11" ] + cflags_objcc = [ "-std=gnu++17" ] +} + +config("std_cpp17") { + configs = [ ":cpp17" ] +} + +static_library("pw_rpc") { + output_name = "libPwRpc" + + public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ] + + public_deps = [ + "$dir_pw_rpc:server", + "$dir_pw_rpc/nanopb:echo_service", + "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg", + "${dir_pigweed}/pw_hdlc:pw_rpc", + dir_pw_assert, + dir_pw_checksum, + dir_pw_hdlc, + dir_pw_log, + ] + + output_dir = "${root_out_dir}/lib" +} diff --git a/config/qpg/lib/pw_rpc/pw_rpc.gni b/config/qpg/lib/pw_rpc/pw_rpc.gni new file mode 100644 index 00000000000000..1f1a5012e803ea --- /dev/null +++ b/config/qpg/lib/pw_rpc/pw_rpc.gni @@ -0,0 +1,27 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +pw_log_BACKEND = "$dir_pw_log_basic" +pw_assert_BACKEND = "$dir_pw_assert_log" +pw_sys_io_BACKEND = "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg" + +pw_build_LINK_DEPS = [ + "$dir_pw_assert:impl", + "$dir_pw_log:impl", +] + +dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" diff --git a/config/qpg/toolchain/BUILD.gn b/config/qpg/toolchain/BUILD.gn index b7953bd98482a8..bdf72c9b2ccf5e 100644 --- a/config/qpg/toolchain/BUILD.gn +++ b/config/qpg/toolchain/BUILD.gn @@ -30,3 +30,10 @@ arm_toolchain("qpg_lighting_app") { import("${chip_root}/examples/lighting-app/qpg/args.gni") } } + +arm_toolchain("qpg_shell_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/shell-app/qpg/args.gni") + } +} diff --git a/examples/build_overrides/openthread.gni b/examples/build_overrides/openthread.gni index ac9881f90a90e2..37f5c98eb6f21a 100644 --- a/examples/build_overrides/openthread.gni +++ b/examples/build_overrides/openthread.gni @@ -15,4 +15,5 @@ declare_args() { # Root directory for openthread. openthread_root = "//third_party/connectedhomeip/third_party/openthread/repo" + openthread_device_type = "ftd" } diff --git a/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp b/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp new file mode 100644 index 00000000000000..5061d53e768a6d --- /dev/null +++ b/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PigweedLoggerMutex.h" + +namespace chip { +namespace rpc { + +PigweedLoggerMutex logger_mutex; + +} // namespace rpc +} // namespace chip diff --git a/examples/common/pigweed/qpg/PigweedLoggerMutex.h b/examples/common/pigweed/qpg/PigweedLoggerMutex.h new file mode 100644 index 00000000000000..4c58bee961826c --- /dev/null +++ b/examples/common/pigweed/qpg/PigweedLoggerMutex.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "PigweedLogger.h" +#include "pigweed/RpcService.h" +#include "semphr.h" +#include + +namespace chip { +namespace rpc { +class PigweedLoggerMutex : public ::chip::rpc::Mutex +{ + +public: + PigweedLoggerMutex() {} + void Lock() override { PigweedLogger::lock(); } + void Unlock() override { PigweedLogger::unlock(); } +}; + +extern PigweedLoggerMutex logger_mutex; + +} // namespace rpc +} // namespace chip diff --git a/examples/lighting-app/qpg/.gn b/examples/lighting-app/qpg/.gn index 3d48789e30ab3d..438f76dfea04e8 100644 --- a/examples/lighting-app/qpg/.gn +++ b/examples/lighting-app/qpg/.gn @@ -23,6 +23,7 @@ check_system_includes = true default_args = { target_cpu = "arm" target_os = "freertos" + chip_openthread_ftd = false import("//args.gni") } diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 4b8c416fffdfa5..18b4b3342ffdb1 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -1,6 +1,6 @@ # Copyright(c) 2021 Project CHIP Authors # -# Licensed under the Apache License, Version 2.0(the "License"); +# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -21,9 +21,19 @@ import("${build_root}/config/defaults.gni") import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") + +# declares chip_build_libshell = false +import("${chip_root}/src/lib/lib.gni") + +# declares chip_enable_pw_rpc = false +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + assert(current_os == "freertos") -qpg_project_dir = "${chip_root}/examples/lighting-app/qpg" examples_plat_dir = "${chip_root}/examples/platform/qpg" qpg_sdk("sdk") { @@ -31,8 +41,13 @@ qpg_sdk("sdk") { include_dirs = [ "${chip_root}/src/platform/qpg", + "${examples_plat_dir}", "${examples_plat_dir}/project_include", ] + + if (chip_enable_pw_rpc) { + defines = [ "PW_RPC_ENABLED" ] + } } qpg_executable("lighting_app") { @@ -51,7 +66,7 @@ qpg_executable("lighting_app") { deps = [ ":sdk", - "${chip_root}/examples/lighting-app/lighting-common/", + "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", @@ -59,26 +74,71 @@ qpg_executable("lighting_app") { ] if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] } else { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", - ] + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] } - cflags = [ "-Wconversion" ] - include_dirs = [ - "${qpg_project_dir}/include/", - "${examples_plat_dir}", + "include", "${examples_plat_dir}/ota", "${chip_root}/examples/lighting-app/lighting-common/color_format", ] + defines = [] + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + "PW_RPC_LIGHTING_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp", + "${examples_plat_dir}/PigweedLogger.cpp", + "${examples_plat_dir}/Rpc.cpp", + "${examples_plat_dir}/uart.c", + ] + + deps += [ + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "${chip_root}/config/qpg/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", + "${examples_plat_dir}/pw_sys_io:pw_sys_io_qpg", + ] + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/qpg", + ] + } else { + # The below gives compiler erros in pigweed, therefore it is only enabled + # when rpc is not + cflags = [ "-Wconversion" ] + } + + if (chip_build_libshell) { + deps += [ "${examples_plat_dir}:qpg-matter-shell" ] + } else { + if (chip_openthread_ftd) { + deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd" ] + } else { + deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd" ] + } + } + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" inputs = [ ldscript ] diff --git a/examples/lighting-app/qpg/args.gni b/examples/lighting-app/qpg/args.gni index 8f05dc6ace9362..cba75e2ec1cc81 100644 --- a/examples/lighting-app/qpg/args.gni +++ b/examples/lighting-app/qpg/args.gni @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") import("${chip_root}/examples/platform/qpg/args.gni") qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") @@ -20,3 +21,6 @@ qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") declare_args() { chip_enable_ota_requestor = true } + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lighting-app/qpg/include/Rpc.h b/examples/lighting-app/qpg/include/Rpc.h new file mode 100644 index 00000000000000..789c95f967171b --- /dev/null +++ b/examples/lighting-app/qpg/include/Rpc.h @@ -0,0 +1,29 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +namespace chip { +namespace rpc { + +CHIP_ERROR Init(); +void RunRpcService(void *); + +} // namespace rpc +} // namespace chip diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index 475cb8324f4325..83f1336093a9f9 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -76,15 +76,15 @@ constexpr int extDiscTimeoutSecs = 20; CHIP_ERROR AppTask::StartAppTask() { sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct); - if (sAppEventQueue == NULL) + if (sAppEventQueue == nullptr) { ChipLogError(NotSpecified, "Failed to allocate app event queue"); return CHIP_ERROR_NO_MEMORY; } // Start App task. - sAppTaskHandle = xTaskCreateStatic(AppTaskMain, APP_TASK_NAME, ArraySize(appStack), NULL, 1, appStack, &appTaskStruct); - if (sAppTaskHandle != NULL) + sAppTaskHandle = xTaskCreateStatic(AppTaskMain, APP_TASK_NAME, ArraySize(appStack), nullptr, 1, appStack, &appTaskStruct); + if (sAppTaskHandle == nullptr) { return CHIP_NO_ERROR; } @@ -142,11 +142,9 @@ void AppTask::AppTaskMain(void * pvParameter) if (err != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "AppTask.Init() failed: %" CHIP_ERROR_FORMAT, err.Format()); - // appError(err); + return; } - ChipLogProgress(NotSpecified, "App Task started"); - while (true) { BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); diff --git a/examples/lighting-app/qpg/with_pw_rpc.gni b/examples/lighting-app/qpg/with_pw_rpc.gni new file mode 100644 index 00000000000000..2cea3f68507ea1 --- /dev/null +++ b/examples/lighting-app/qpg/with_pw_rpc.gni @@ -0,0 +1,27 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# add this gni as import in your build args to use pigweed in the example +# 'import("//with_pw_rpc.gni")' + +import("//build_overrides/chip.gni") +import("${chip_root}/config/qpg/lib/pw_rpc/pw_rpc.gni") +import("${chip_root}/examples/platform/qpg/args.gni") + +qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +chip_enable_pw_rpc = true +chip_enable_openthread = true + +cpp_standard = "gnu++17" diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index c25fe779b00dc0..767d066c7ed72b 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Project CHIP Authors +# Copyright(c) 2021 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,9 +22,18 @@ import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") +# declares chip_build_libshell = false +import("${chip_root}/src/lib/lib.gni") + +# declares chip_enable_pw_rpc = false +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + assert(current_os == "freertos") -qpg_project_dir = "${chip_root}/examples/lock-app/qpg" examples_plat_dir = "${chip_root}/examples/platform/qpg" qpg_sdk("sdk") { @@ -32,8 +41,13 @@ qpg_sdk("sdk") { include_dirs = [ "${chip_root}/src/platform/qpg", + "${examples_plat_dir}", "${examples_plat_dir}/project_include", ] + + if (chip_enable_pw_rpc) { + defines = [ "PW_RPC_ENABLED" ] + } } qpg_executable("lock_app") { @@ -56,24 +70,66 @@ qpg_executable("lock_app") { ] if (chip_openthread_ftd) { - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] } else { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } + + include_dirs = [ "include" ] + + defines = [] + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + "PW_RPC_LOCKING_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp", + "${examples_plat_dir}/PigweedLogger.cpp", + "${examples_plat_dir}/Rpc.cpp", + "${examples_plat_dir}/uart.c", + ] + deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "${chip_root}/config/qpg/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:locking_service.nanopb_rpc", + "${examples_plat_dir}/pw_sys_io:pw_sys_io_qpg", ] - } - include_dirs = [ - "${qpg_project_dir}/include", - "${examples_plat_dir}", - "${examples_plat_dir}/app/include", - ] + deps += pw_build_LINK_DEPS - cflags = [ "-Wconversion" ] + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/qpg", + ] + } else { + # The below gives compiler erros in pigweed, therefore it is only enabled + # when rpc is not + cflags = [ "-Wconversion" ] + } + + if (chip_build_libshell) { + deps += [ "${examples_plat_dir}:qpg-matter-shell" ] + } else { + if (chip_openthread_ftd) { + deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd" ] + } else { + deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd" ] + } + } ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" diff --git a/examples/lock-app/qpg/args.gni b/examples/lock-app/qpg/args.gni index 8a90e0c6e66dbc..1260954648f486 100644 --- a/examples/lock-app/qpg/args.gni +++ b/examples/lock-app/qpg/args.gni @@ -13,6 +13,10 @@ # limitations under the License. import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") import("${chip_root}/examples/platform/qpg/args.gni") qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lock-app/qpg/include/BoltLockManager.h b/examples/lock-app/qpg/include/BoltLockManager.h index ad4a5a965196a7..ddb5b9bf0dcb91 100644 --- a/examples/lock-app/qpg/include/BoltLockManager.h +++ b/examples/lock-app/qpg/include/BoltLockManager.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2021 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +16,7 @@ * limitations under the License. */ -#ifndef LOCK_MANAGER_H -#define LOCK_MANAGER_H +#pragma once #include #include @@ -84,5 +83,3 @@ inline BoltLockManager & BoltLockMgr(void) { return BoltLockManager::sLock; } - -#endif // LOCK_MANAGER_H diff --git a/examples/lock-app/qpg/include/Rpc.h b/examples/lock-app/qpg/include/Rpc.h new file mode 100644 index 00000000000000..789c95f967171b --- /dev/null +++ b/examples/lock-app/qpg/include/Rpc.h @@ -0,0 +1,29 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +namespace chip { +namespace rpc { + +CHIP_ERROR Init(); +void RunRpcService(void *); + +} // namespace rpc +} // namespace chip diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index f146612baf693e..0de8099700e81a 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020-2021 Project CHIP Authors + * Copyright (c) 2021 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/examples/lock-app/qpg/with_pw_rpc.gni b/examples/lock-app/qpg/with_pw_rpc.gni new file mode 100644 index 00000000000000..2cea3f68507ea1 --- /dev/null +++ b/examples/lock-app/qpg/with_pw_rpc.gni @@ -0,0 +1,27 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# add this gni as import in your build args to use pigweed in the example +# 'import("//with_pw_rpc.gni")' + +import("//build_overrides/chip.gni") +import("${chip_root}/config/qpg/lib/pw_rpc/pw_rpc.gni") +import("${chip_root}/examples/platform/qpg/args.gni") + +qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +chip_enable_pw_rpc = true +chip_enable_openthread = true + +cpp_standard = "gnu++17" diff --git a/examples/platform/qpg/BUILD.gn b/examples/platform/qpg/BUILD.gn index 49f2be28f2c616..ddfd0ce5be3704 100644 --- a/examples/platform/qpg/BUILD.gn +++ b/examples/platform/qpg/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021 Project CHIP Authors +# Copyright (c) 2021 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ import("//build_overrides/qpg_sdk.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") +# declares chip_build_libshell = false +import("${chip_root}/src/lib/lib.gni") config("chip_examples_project_config") { include_dirs = [ "project_include" ] } @@ -31,3 +33,25 @@ source_set("openthread_core_config_qpg_chip_examples") { public_configs = [ ":chip_examples_project_config" ] } + +source_set("qpg-matter-shell") { + if (chip_build_libshell) { + defines = [ + "OPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE", + "ENABLE_CHIP_SHELL", + ] + + sources = [ + "shell_common/shell.cpp", + "uart.c", + ] + + include_dirs = [ "." ] + + public_deps = [ + "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/lib/shell:shell", + "${chip_root}/src/lib/shell:shell_core", + ] + } +} diff --git a/examples/platform/qpg/PigweedLogger.cpp b/examples/platform/qpg/PigweedLogger.cpp new file mode 100644 index 00000000000000..5b9324ec67b754 --- /dev/null +++ b/examples/platform/qpg/PigweedLogger.cpp @@ -0,0 +1,110 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * @file PigweedLogger.cpp + * + * This file contains basic string writting function, based on Pigweed HDLC + * over UART transport. It allows to send log messages even if the application + * needs to use HDLC/UART for another purpose like the RPC server. + */ + +#include + +#include "PigweedLogger.h" +#include "semphr.h" +#include +#include +#include + +#include +#include +#include +#include + +namespace PigweedLogger { +namespace { + +constexpr uint8_t kLogHdlcAddress = 1; // Send log messages to HDLC address 1 (other than RPC communication) +constexpr size_t kWriteBufferSize = 128; // Buffer for constructing HDLC frames + +// Exclusive access to the backend is needed to make sure that log messages coming +// from different threads are not interwoven. +StaticSemaphore_t sLoggerLockBuffer; +SemaphoreHandle_t sLoggerLock; + +static pw::stream::SysIoWriter sWriter; +static size_t sWriteBufferPos; +static char sWriteBuffer[kWriteBufferSize]; + +static void send(void) +{ + pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter); + sWriteBufferPos = 0; +} + +} // namespace + +void init(void) +{ + sLoggerLock = xSemaphoreCreateMutexStatic(&sLoggerLockBuffer); + assert(sLoggerLock != NULL); + + pw_sys_io_Init(); +} + +int putString(const char * buffer, size_t size) +{ + assert(sWriteBufferPos < kWriteBufferSize); + + lock(); + + for (size_t i = 0; i < size; ++i) + { + // Send each line excluding "\r\n" in a separate frame + + if (buffer[i] == '\r') + continue; + + if (buffer[i] == '\n') + { + send(); + continue; + } + + sWriteBuffer[sWriteBufferPos++] = buffer[i]; + + if (sWriteBufferPos == kWriteBufferSize) + send(); + } + + unlock(); + return size; +} + +void lock(void) +{ + xSemaphoreTake(sLoggerLock, portMAX_DELAY); +} + +void unlock(void) +{ + xSemaphoreGive(sLoggerLock); +} + +} // namespace PigweedLogger diff --git a/examples/platform/qpg/PigweedLogger.h b/examples/platform/qpg/PigweedLogger.h new file mode 100644 index 00000000000000..55ac4d9cd0f80c --- /dev/null +++ b/examples/platform/qpg/PigweedLogger.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "semphr.h" +#include + +namespace PigweedLogger { + +void init(void); +int putString(const char * buffer, size_t size); +void lock(void); +void unlock(void); + +} // namespace PigweedLogger diff --git a/examples/platform/qpg/Rpc.cpp b/examples/platform/qpg/Rpc.cpp new file mode 100644 index 00000000000000..45d31ccd2083cb --- /dev/null +++ b/examples/platform/qpg/Rpc.cpp @@ -0,0 +1,151 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "FreeRTOS.h" +#include "PigweedLoggerMutex.h" +#include "ota.h" +#include "pigweed/RpcService.h" +#include "pw_sys_io_qpg/init.h" +#include "task.h" + +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE +#include "pigweed/rpc_services/Attributes.h" +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +#include "pigweed/rpc_services/Button.h" +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#include "pigweed/rpc_services/Device.h" +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE +#include "pigweed/rpc_services/Lighting.h" +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#include "pigweed/rpc_services/Locking.h" +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +namespace chip { +namespace rpc { + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +class QpgButton final : public Button +{ +public: + pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) + { + GetAppTask().ButtonEventHandler((uint8_t) request.idx, (bool) request.pushed); + return pw::OkStatus(); + } +}; +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +class QpgDevice final : public Device +{ +public: + pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) + { + qvCHIP_ResetSystem(); + // WILL NOT RETURN + return pw::OkStatus(); + } + pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) + { + TriggerOTAQuery(); + return pw::OkStatus(); + } +}; +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +namespace { + +#define RPC_TASK_STACK_SIZE 4096 +#define RPC_TASK_PRIORITY 1 +static TaskHandle_t sRpcTaskHandle; +StaticTask_t sRpcTaskBuffer; +StackType_t sRpcTaskStack[RPC_TASK_STACK_SIZE]; + +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE +Attributes attributes_service; +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +QpgButton button_service; +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +QpgDevice device_service; +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE +Lighting lighting_service; +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +Locking locking; +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +void RegisterServices(pw::rpc::Server & server) +{ +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + server.RegisterService(attributes_service); +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + server.RegisterService(button_service); +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + server.RegisterService(device_service); +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + server.RegisterService(lighting_service); +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + server.RegisterService(locking); +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +} + +} // namespace + +void RunRpcService(void *) +{ + Start(RegisterServices, &logger_mutex); +} + +bool Init(void) +{ + pw_sys_io_Init(); + + PigweedLogger::init(); + + // Start App task. + sRpcTaskHandle = xTaskCreateStatic(RunRpcService, "RPC_TASK", ArraySize(sRpcTaskStack), nullptr, RPC_TASK_PRIORITY, + sRpcTaskStack, &sRpcTaskBuffer); + return (sRpcTaskHandle == nullptr); +} + +} // namespace rpc +} // namespace chip diff --git a/examples/platform/qpg/Rpc.h b/examples/platform/qpg/Rpc.h new file mode 100644 index 00000000000000..3f8c6da6969810 --- /dev/null +++ b/examples/platform/qpg/Rpc.h @@ -0,0 +1,28 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +namespace chip { +namespace rpc { + +bool Init(void); +void RunRpcService(void *); + +} // namespace rpc +} // namespace chip diff --git a/examples/platform/qpg/app/main.cpp b/examples/platform/qpg/app/main.cpp index 98adc615a87934..dc71281d592e5d 100644 --- a/examples/platform/qpg/app/main.cpp +++ b/examples/platform/qpg/app/main.cpp @@ -33,12 +33,19 @@ #include "qvCHIP.h" // CHIP includes -#include #include #include #include #include +#if PW_RPC_ENABLED +#include "Rpc.h" +#endif // PW_RPC_ENABLED + +#if ENABLE_CHIP_SHELL +#include "shell_common/shell.h" +#endif // ENABLE_CHIP_SHELL + // Application level logic #include "AppTask.h" @@ -82,14 +89,33 @@ int Application_Init(void) CHIP_ERROR CHIP_Init(void) { - CHIP_ERROR ret = chip::Platform::MemoryInit(); + CHIP_ERROR ret = CHIP_NO_ERROR; + +#if PW_RPC_ENABLED + ret = (CHIP_ERROR) chip::rpc::Init(); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "rpc::Init() failed"); + goto exit; + } +#endif + + ret = chip::Platform::MemoryInit(); if (ret != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Platform::MemoryInit() failed"); goto exit; } - ChipLogProgress(NotSpecified, "Init CHIP Stack"); +#if ENABLE_CHIP_SHELL + ret = (CHIP_ERROR) ShellTask::Start(); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "ShellTask::Start() failed"); + goto exit; + } +#endif // ENABLE_CHIP_SHELL + ret = PlatformMgr().InitChipStack(); if (ret != CHIP_NO_ERROR) { @@ -127,10 +153,6 @@ CHIP_ERROR CHIP_Init(void) } #endif // CHIP_ENABLE_OPENTHREAD -#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY - chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs); -#endif - ChipLogProgress(NotSpecified, "Starting Platform Manager Event Loop"); ret = PlatformMgr().StartEventLoopTask(); if (ret != CHIP_NO_ERROR) diff --git a/examples/platform/qpg/pw_sys_io/BUILD.gn b/examples/platform/qpg/pw_sys_io/BUILD.gn new file mode 100644 index 00000000000000..9b8bea2cf5a727 --- /dev/null +++ b/examples/platform/qpg/pw_sys_io/BUILD.gn @@ -0,0 +1,39 @@ +# Copyright(c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") +import("//build_overrides/qpg_sdk.gni") +import("$dir_pw_build/target_types.gni") +import("${qpg_sdk_build_root}/qpg_sdk.gni") + +examples_plat_dir = "${chip_root}/examples/platform/qpg" + +config("default_config") { + include_dirs = [ "public" ] +} + +pw_source_set("pw_sys_io_qpg") { + sources = [ "sys_io_qpg.cc" ] + + deps = [ + "$dir_pw_sys_io:default_putget_bytes", + "$dir_pw_sys_io:facade", + "${qpg_sdk_build_root}:qpg_sdk", + ] + + public_configs = [ ":default_config" ] + + include_dirs = [ "${examples_plat_dir}" ] +} diff --git a/examples/platform/qpg/pw_sys_io/public/pw_sys_io_qpg/init.h b/examples/platform/qpg/pw_sys_io/public/pw_sys_io_qpg/init.h new file mode 100644 index 00000000000000..f11f5e928f3e14 --- /dev/null +++ b/examples/platform/qpg/pw_sys_io/public/pw_sys_io_qpg/init.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "pw_preprocessor/util.h" + +PW_EXTERN_C_START + +// The actual implement of PreMainInit() in sys_io_BACKEND. +void pw_sys_io_Init(); + +PW_EXTERN_C_END diff --git a/examples/platform/qpg/pw_sys_io/sys_io_qpg.cc b/examples/platform/qpg/pw_sys_io/sys_io_qpg.cc new file mode 100644 index 00000000000000..ce3e424253b24f --- /dev/null +++ b/examples/platform/qpg/pw_sys_io/sys_io_qpg.cc @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pw_sys_io/sys_io.h" +#include +#include +#include +#include + +#include "uart.h" + +int16_t console_getchar(char * chr) +{ + return uartConsoleRead(chr, 1); +} + +int16_t console_putchar(const char * chr) +{ + return uartConsoleWrite(chr, 1); +} + +extern "C" void pw_sys_io_Init() +{ + uartConsoleInit(); +} + +namespace pw::sys_io { + +Status ReadByte(std::byte * dest) +{ + if (!dest) + { + return Status::InvalidArgument(); + } + + int16_t ret = console_getchar(reinterpret_cast(dest)); + return ret < 0 ? Status::FailedPrecondition() : OkStatus(); +} + +Status WriteByte(std::byte b) +{ + int16_t ret = console_putchar(reinterpret_cast(&b)); + return ret < 0 ? Status::FailedPrecondition() : OkStatus(); +} + +// Writes a string using pw::sys_io, and add newline characters at the end. +StatusWithSize WriteLine(const std::string_view & s) +{ + size_t chars_written = 0; + StatusWithSize result = WriteBytes(std::as_bytes(std::span(s))); + if (!result.ok()) + { + return result; + } + chars_written += result.size(); + result = WriteBytes(std::as_bytes(std::span("\r\n", 2))); + chars_written += result.size(); + + return StatusWithSize(result.status(), chars_written); +} + +} // namespace pw::sys_io diff --git a/examples/platform/qpg/shell_common/shell.cpp b/examples/platform/qpg/shell_common/shell.cpp new file mode 100644 index 00000000000000..e2c09637015943 --- /dev/null +++ b/examples/platform/qpg/shell_common/shell.cpp @@ -0,0 +1,94 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "shell.h" + +#include "task.h" +#include + +#include +#include + +#include + +#define APP_TASK_STACK_SIZE 8192 +#define APP_TASK_PRIORITY 3 + +namespace { +TaskHandle_t sShellTaskHandle; + +StackType_t shellStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; +StaticTask_t shellTaskStruct; +} // namespace + +ShellTask ShellTask::sShellTask; + +/* required by cmd_send.cpp:ProcessCommand */ +extern "C" unsigned int sleep(unsigned int seconds) +{ + const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS; + vTaskDelay(xDelay); + return 0; +} + +// using namespace ::chip; + +int ShellTask::Init(void) +{ + int err = 0; + + err = (int) chip::Shell::streamer_init(chip::Shell::streamer_get()); + if (err != 0) + { + return err; + } + + cmd_misc_init(); + cmd_otcli_init(); + cmd_ping_init(); + cmd_send_init(); + + return err; +} + +void ShellTask::Main(void * args) +{ + + int err = sShellTask.Init(); + if (err != 0) + { + // ChipLogError(NotSpecified, "Shell task init failed"); + return; + } + + chip::Shell::Engine::Root().RunMainLoop(); +} + +int ShellTask::Start(void) +{ + + // Start App task. + sShellTaskHandle = + xTaskCreateStatic(ShellTask::Main, "SHELL_TASK", ArraySize(shellStack), nullptr, 1, shellStack, &shellTaskStruct); + if (sShellTaskHandle == nullptr) + { + return 1; + } + + return 0; +} diff --git a/examples/platform/qpg/shell_common/shell.h b/examples/platform/qpg/shell_common/shell.h new file mode 100644 index 00000000000000..60acba40be07fb --- /dev/null +++ b/examples/platform/qpg/shell_common/shell.h @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "FreeRTOS.h" +#include "task.h" + +class ShellTask +{ + +public: + static int Start(void); + static void Main(void * args); + +private: + friend ShellTask & GetShellTask(void); + + int Init(void); + + static ShellTask sShellTask; +}; + +inline ShellTask & GetShellTask(void) +{ + return ShellTask::sShellTask; +} diff --git a/examples/platform/qpg/uart.c b/examples/platform/qpg/uart.c new file mode 100644 index 00000000000000..8e0dac00232a9c --- /dev/null +++ b/examples/platform/qpg/uart.c @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "uart.h" +#include "FreeRTOS.h" +#include "qvIO.h" +#include "task.h" +#include +#include + +#define UART_CONSOLE_ERR -1 // Negative value in case of UART Console action failed. Triggers a failure for PW_RPC + +void uartConsoleInit(void) +{ + qvIO_UartInit(); +} + +int16_t uartConsoleWrite(const char * Buf, uint16_t BufLength) +{ + if (Buf == NULL || BufLength < 1) + { + return UART_CONSOLE_ERR; + } + + qvIO_UartTxData((uint8_t) BufLength, Buf); + return (int16_t) BufLength; +} + +int16_t uartConsoleRead(char * Buf, uint16_t BufLength) +{ + if (Buf == NULL || BufLength < 1) + { + return UART_CONSOLE_ERR; + } + vTaskDelay(1); // taskYIELD or vTaskDelay(0) is not sufficient + uint8_t rxLen = qvIO_UartReadRxData((uint8_t) BufLength, Buf); + return (int16_t) rxLen; +} diff --git a/examples/platform/qpg/uart.h b/examples/platform/qpg/uart.h new file mode 100644 index 00000000000000..035d5b3b0ede7d --- /dev/null +++ b/examples/platform/qpg/uart.h @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void uartConsoleInit(void); +int16_t uartConsoleWrite(const char * Buf, uint16_t BufLength); +int16_t uartConsoleRead(char * Buf, uint16_t NbBytesToRead); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/examples/shell/qpg/.gn b/examples/shell/qpg/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/shell/qpg/.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/shell/qpg/BUILD.gn b/examples/shell/qpg/BUILD.gn new file mode 100644 index 00000000000000..0d2bf5d5671e4c --- /dev/null +++ b/examples/shell/qpg/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright(c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/openthread.gni") +import("//build_overrides/qpg_sdk.gni") + +import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") +import("${qpg_sdk_build_root}/qpg_executable.gni") +import("${qpg_sdk_build_root}/qpg_sdk.gni") + +assert(current_os == "freertos") + +examples_plat_dir = "${chip_root}/examples/platform/qpg" + +qpg_sdk("sdk") { + include_dirs = [ + "${chip_root}/src/platform/qpg", + "${examples_plat_dir}/project_include", + "${examples_plat_dir}", + ] + + defines = [ + "OPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE", + "ENABLE_CHIP_SHELL", + ] +} + +qpg_executable("shell_app") { + output_name = "chip-${qpg_target_ic}-shell-example.out" + + sources = [ + "${examples_plat_dir}/app/main.cpp", + "src/AppTask.cpp", + ] + + deps = [ + ":sdk", + "${chip_root}/examples/shell/shell_common:shell_common", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:qpg-matter-shell", + ] + + include_dirs = [ + "include", + "${examples_plat_dir}/shell_common", + ] + + defines = [] + + ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + output_dir = root_out_dir +} + +group("qpg") { + deps = [ ":shell_app" ] +} + +group("default") { + deps = [ ":qpg" ] +} diff --git a/examples/shell/qpg/args.gni b/examples/shell/qpg/args.gni new file mode 100644 index 00000000000000..30f1e5ebc92c02 --- /dev/null +++ b/examples/shell/qpg/args.gni @@ -0,0 +1,24 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") +import("${chip_root}/examples/platform/qpg/args.gni") + +qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" +chip_enable_openthread = true +chip_build_libshell = true diff --git a/examples/shell/qpg/build_overrides b/examples/shell/qpg/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/shell/qpg/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/shell/qpg/include/AppConfig.h b/examples/shell/qpg/include/AppConfig.h new file mode 100644 index 00000000000000..7cd7d08d4775ce --- /dev/null +++ b/examples/shell/qpg/include/AppConfig.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// ---- Shell Example App Config ---- + +#define SYSTEM_STATE_LED LED_GREEN + +// ---- Thread Polling Config ---- +#define THREAD_ACTIVE_POLLING_INTERVAL_MS 100 +#define THREAD_INACTIVE_POLLING_INTERVAL_MS 1000 diff --git a/examples/shell/qpg/include/AppTask.h b/examples/shell/qpg/include/AppTask.h new file mode 100644 index 00000000000000..45ea3bcb5b00f9 --- /dev/null +++ b/examples/shell/qpg/include/AppTask.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include + +#define APP_NAME "Shell-app" + +class AppTask +{ + +public: + CHIP_ERROR StartAppTask(); + +private: + friend AppTask & GetAppTask(void); + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/shell/qpg/src/AppTask.cpp b/examples/shell/qpg/src/AppTask.cpp new file mode 100644 index 00000000000000..fcad76e3855b45 --- /dev/null +++ b/examples/shell/qpg/src/AppTask.cpp @@ -0,0 +1,28 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" + +#include + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::StartAppTask() +{ + return CHIP_NO_ERROR; +} diff --git a/examples/shell/qpg/third_party/connectedhomeip b/examples/shell/qpg/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/shell/qpg/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/src/lib/shell/BUILD.gn b/src/lib/shell/BUILD.gn index 0e4f7d74557057..04202cbbf95c52 100644 --- a/src/lib/shell/BUILD.gn +++ b/src/lib/shell/BUILD.gn @@ -69,6 +69,11 @@ static_library("shell") { "streamer_zephyr.cpp", "streamer_zephyr.h", ] + } else if (chip_device_platform == "qpg") { + sources += [ + "MainLoopDefault.cpp", + "streamer_qpg.cpp", + ] } else { sources += [ "MainLoopDefault.cpp" ] } diff --git a/src/lib/shell/streamer_qpg.cpp b/src/lib/shell/streamer_qpg.cpp new file mode 100644 index 00000000000000..85bc7ea49b6698 --- /dev/null +++ b/src/lib/shell/streamer_qpg.cpp @@ -0,0 +1,66 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Source implementation of an input / output stream for zehpyr targets. + */ + +#include +#include + +#include "uart.h" +#include +#include + +namespace chip { +namespace Shell { +namespace { + +int streamer_qpg_init(streamer_t * streamer) +{ + (void) streamer; + uartConsoleInit(); + return 0; +} + +ssize_t streamer_qpg_read(streamer_t * streamer, char * buffer, size_t length) +{ + (void) streamer; + return (ssize_t) uartConsoleRead(buffer, (uint16_t) length); +} + +ssize_t streamer_qpg_write(streamer_t * streamer, const char * buffer, size_t length) +{ + (void) streamer; + return uartConsoleWrite(buffer, (uint16_t) length); +} + +static streamer_t streamer_qpg = { + .init_cb = streamer_qpg_init, + .read_cb = streamer_qpg_read, + .write_cb = streamer_qpg_write, +}; +} // namespace + +streamer_t * streamer_get(void) +{ + return &streamer_qpg; +} + +} // namespace Shell +} // namespace chip diff --git a/src/platform/qpg/Logging.cpp b/src/platform/qpg/Logging.cpp index b9fb6b4ef0eaf5..54ff51bf598fb2 100644 --- a/src/platform/qpg/Logging.cpp +++ b/src/platform/qpg/Logging.cpp @@ -17,6 +17,10 @@ #include #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD +#ifdef PW_RPC_ENABLED +#include "PigweedLogger.h" +#endif + constexpr uint8_t kPrintfModuleLwip = 0x01; constexpr uint8_t kPrintfModuleOpenThread = 0x02; constexpr uint8_t kPrintfModuleLogging = 0x03; From d5fffd72110add574712cf0d87ac019fca43fe11 Mon Sep 17 00:00:00 2001 From: ManjunathRA Date: Tue, 8 Feb 2022 08:50:13 +0530 Subject: [PATCH 07/30] Modified Color control testcases - 27 Jan (#14432) * Modified CC testcases * Adding auto generated files * Auto genearted files after rebase --- .../suites/certification/Test_TC_CC_3_1.yaml | 17 +- .../suites/certification/Test_TC_CC_6_2.yaml | 70 +- .../suites/certification/Test_TC_CC_7_1.yaml | 98 +- .../suites/certification/Test_TC_CC_7_2.yaml | 40 +- .../suites/certification/Test_TC_CC_9_1.yaml | 114 +- .../suites/certification/Test_TC_CC_9_2.yaml | 27 +- .../suites/certification/Test_TC_CC_9_3.yaml | 27 +- .../Framework/CHIPTests/CHIPClustersTests.m | 1114 +++++++- .../chip-tool/zap-generated/test/Commands.h | 2454 +++++++++++++---- 9 files changed, 3313 insertions(+), 648 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 a656fc8246b0de..8a630cb5ce873c 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 @@ -34,6 +34,15 @@ tests: response: value: 1 + - label: "Reads CurrentHue attribute from DUT." + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + - label: "Move to hue shortest distance command" command: "MoveToHue" arguments: @@ -43,7 +52,7 @@ tests: - name: "direction" value: 0 - name: "transitionTime" - value: 100 + value: 300 - name: "optionsMask" value: 0 - name: "optionsOverride" @@ -67,7 +76,7 @@ tests: - name: "direction" value: 1 - name: "transitionTime" - value: 100 + value: 300 - name: "optionsMask" value: 0 - name: "optionsOverride" @@ -91,7 +100,7 @@ tests: - name: "direction" value: 2 - name: "transitionTime" - value: 100 + value: 300 - name: "optionsMask" value: 0 - name: "optionsOverride" @@ -115,7 +124,7 @@ tests: - name: "direction" value: 3 - name: "transitionTime" - value: 100 + value: 300 - name: "optionsMask" value: 0 - name: "optionsOverride" 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 0b64005f24b6ac..fb57aa523d9a47 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 @@ -36,11 +36,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 up color temperature command" command: "MoveColorTemperature" @@ -59,13 +61,54 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read current color temprature" + - label: "Read current color temprature attribute from DUT several times" disabled: true command: "readAttribute" attribute: "color temperature" response: value: -1 + - label: "Move down color temperature command" + command: "MoveColorTemperature" + arguments: + values: + - name: "moveMode" + value: 3 + - name: "rate" + value: 20 + - name: "colorTemperatureMinimum" + value: 1 + - name: "colorTemperatureMaximum" + value: 255 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read current color temprature attribute from DUT several times" + disabled: true + command: "readAttribute" + attribute: "color temperature" + response: + value: -1 + + - label: "Move up color temperature command" + command: "MoveColorTemperature" + arguments: + values: + - name: "moveMode" + value: 1 + - name: "rate" + value: 10 + - name: "colorTemperatureMinimum" + value: 1 + - name: "colorTemperatureMaximum" + value: 255 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + - label: "Stop Color Temperature command" command: "MoveColorTemperature" arguments: @@ -83,7 +126,7 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read current color temprature" + - label: "Read current color temprature attribute from DUT several times" disabled: true command: "readAttribute" attribute: "color temperature" @@ -107,7 +150,24 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read current color temprature" + - label: "Stop Color Temperature command" + command: "MoveColorTemperature" + arguments: + values: + - name: "moveMode" + value: 0 + - name: "rate" + value: 10 + - name: "colorTemperatureMinimum" + value: 1 + - name: "colorTemperatureMaximum" + value: 255 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Read current color temprature attribute from DUT several times" disabled: true command: "readAttribute" attribute: "color temperature" 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 fe47f18d3e9c12..c64b90899c5a68 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 @@ -50,12 +50,28 @@ tests: value: 0 - label: - "Check Remaining time attribute value matched the value sent by the - last command" + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true command: "readAttribute" - attribute: "remaining time" + attribute: "enhanced current hue" response: - value: 1 + value: 1025 + + - label: "Enhanced Move To Hue command" + command: "EnhancedMoveToHue" + arguments: + values: + - name: "enhancedHue" + value: 1100 + - name: "direction" + value: 0 + - name: "transitionTime" + value: 300 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 - label: "Check EnhancedCurrentHue attribute value matched the value sent by @@ -64,7 +80,79 @@ tests: command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + value: 1100 + + - label: "Enhanced Move To Hue command" + command: "EnhancedMoveToHue" + arguments: + values: + - name: "enhancedHue" + value: 1150 + - name: "direction" + value: 1 + - name: "transitionTime" + value: 300 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1150 + + - label: "Enhanced Move To Hue command" + command: "EnhancedMoveToHue" + arguments: + values: + - name: "enhancedHue" + value: 1200 + - name: "direction" + value: 2 + - name: "transitionTime" + value: 300 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1200 + + - label: "Enhanced Move To Hue command" + command: "EnhancedMoveToHue" + arguments: + values: + - name: "enhancedHue" + value: 1300 + - name: "direction" + value: 3 + - name: "transitionTime" + value: 300 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: 1300 - 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 17b4fc3bc61fe2..afb287b9a6855a 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 @@ -34,28 +34,35 @@ tests: response: value: 1 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Check EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - - label: "Enhanced Move Hue Down command " + - label: "Enhanced Move Hue Up command" command: "EnhancedMoveHue" arguments: values: - name: "moveMode" - value: 3 + value: 1 - name: "rate" - value: 5 + value: 50 - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 + - label: "Read EnhancedCurrentHue attribute from DUT several times" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: -1 + - label: "Enhanced Move Hue Stop command" command: "EnhancedMoveHue" arguments: @@ -69,26 +76,33 @@ tests: - name: "optionsOverride" value: 0 - - label: "Check EnhancedCurrentHue attribute value changed to a lower Hue" + - label: "Read EnhancedCurrentHue attribute from DUT several times" disabled: true command: "readAttribute" attribute: "enhanced current hue" response: value: -1 - - label: "Enhanced Move Hue Up command" + - label: "Enhanced Move Hue Down command " command: "EnhancedMoveHue" arguments: values: - name: "moveMode" - value: 1 + value: 3 - name: "rate" - value: 50 + value: 5 - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 + - label: "Read EnhancedCurrentHue attribute from DUT several times" + disabled: true + command: "readAttribute" + attribute: "enhanced current hue" + response: + value: -1 + - label: "Enhanced Move Hue Stop command" command: "EnhancedMoveHue" arguments: @@ -102,7 +116,7 @@ tests: - name: "optionsOverride" value: 0 - - label: "Check EnhancedCurrentHue attribute value changed to a higher Hue" + - label: "Read EnhancedCurrentHue attribute from DUT several times" disabled: true command: "readAttribute" attribute: "enhanced current hue" diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml index 45a1c7ac1b5e73..09a12ef591e6be 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml @@ -169,14 +169,21 @@ tests: response: value: 1 - #Issue #10816 Disabled as value needs to be same as EnhancedCurrentHue + - label: "Read EnhancedCurrentHue attribute from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + PICS: A_ENHANCEDCURRENTHUE + response: + saveAs: EnhancedCurrentHueValue1 + constraints: + type: uint16 + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + value: EnhancedCurrentHueValue1 # 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 @@ -225,14 +232,21 @@ tests: response: value: 0 - #Issue #10816 Disabled as value needs to be same as EnhancedCurrentHue + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." + command: "readAttribute" + attribute: "color loop stored enhanced hue" + PICS: A_COLORLOOPSTOREDENHANCEDHUE + response: + saveAs: ColorLoopStoredEnhancedHueValue1 + constraints: + type: uint16 + - label: "Read EnhancedCurrentHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHueValue1 - label: "Sends ColorLoopSet Command - Set all Attributes" command: "ColorLoopSet" @@ -288,14 +302,21 @@ tests: response: value: 1 - #Issue #10816 Disabled as value needs to be same as EnhancedCurrentHue + - label: "Read EnhancedCurrentHue attribute from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + PICS: A_ENHANCEDCURRENTHUE + response: + saveAs: EnhancedCurrentHueValue2 + constraints: + type: uint16 + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + value: EnhancedCurrentHueValue2 # 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 @@ -344,16 +365,23 @@ tests: response: value: 0 - #Issue #10816 Disabled as value needs to be same as ColorLoopStoredEnhancedHue. + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." + command: "readAttribute" + attribute: "color loop stored enhanced hue" + PICS: A_COLORLOOPSTOREDENHANCEDHUE + response: + saveAs: ColorLoopStoredEnhancedHueValue2 + constraints: + type: uint16 + - label: "Read EnhancedCurrentHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHueValue2 - - label: "Enhanced Move To Hue command 10" + - label: "Enhanced Move To Hue command" command: "EnhancedMoveToHue" PICS: CR_ENHANCEDMOVETOHUE arguments: @@ -431,7 +459,6 @@ tests: - name: "optionsOverride" value: 0 - #Issue #335 expected value is 2 but returned is 1 - label: "Read ColorLoopActive attribute from DUT" command: "readAttribute" attribute: "color loop active" @@ -439,14 +466,21 @@ tests: response: value: 1 - #Issue# 10816 Disabled as value needs to be same as EnhancedCurrentHue. + - label: "Read EnhancedCurrentHue attribute from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + PICS: A_ENHANCEDCURRENTHUE + response: + saveAs: EnhancedCurrentHueValue3 + constraints: + type: uint16 + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + value: EnhancedCurrentHueValue3 # 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 @@ -495,14 +529,21 @@ tests: response: value: 0 - #Issue #10816 Disabled as value needs to be same as ColorLoopStoredEnhancedHue. + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." + command: "readAttribute" + attribute: "color loop stored enhanced hue" + PICS: A_COLORLOOPSTOREDENHANCEDHUE + response: + saveAs: ColorLoopStoredEnhancedHueValue3 + constraints: + type: uint16 + - label: "Read EnhancedCurrentHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHueValue3 - label: "Sends ColorLoopSet Command - Set all Attributes" command: "ColorLoopSet" @@ -559,14 +600,21 @@ tests: response: value: 1 - #Issue #10816 Disabled as value needs to be same as EnhancedCurrentHue. + - label: "Read EnhancedCurrentHue attribute from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + PICS: A_ENHANCEDCURRENTHUE + response: + saveAs: EnhancedCurrentHueValue4 + constraints: + type: uint16 + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + value: EnhancedCurrentHueValue4 # 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 @@ -615,15 +663,29 @@ tests: response: value: 0 - #Issue #10816 Disabled as value needs to be same as ColorLoopStoredEnhancedHue.. + - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." + command: "readAttribute" + attribute: "color loop stored enhanced hue" + PICS: A_COLORLOOPSTOREDENHANCEDHUE + response: + saveAs: ColorLoopStoredEnhancedHue4 + constraints: + type: uint16 + - label: "Read EnhancedCurrentHue attribute from DUT" - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHue4 - label: "Turn Off light for color control tests" cluster: "On/Off" command: "Off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml index 337269efcef2b9..e2d4bad38c223a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml @@ -111,22 +111,21 @@ tests: response: value: 1 - #Issue #10816 Need to store EnhancedCurrentHue value and compare it with ColorLoopStoredEnhancedHue attribute - - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true + - label: "Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + saveAs: EnhancedCurrentHueValue + constraints: + type: uint16 - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 500 + value: EnhancedCurrentHueValue # 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 @@ -222,23 +221,29 @@ tests: response: value: 0 - #Issue #10816 Need to store ColorLoopStoredEnhancedHue value and compare it with EnhancedCurrentHue attribute - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true command: "readAttribute" PICS: A_COLORLOOPSTOREDENHANCEDHUE attribute: "color loop stored enhanced hue" response: - value: 0 + saveAs: ColorLoopStoredEnhancedHueValue + constraints: + type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHueValue - label: "Turn off light for color control tests" cluster: "On/Off" command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml index de2ecc07127915..b92cd8d9f7c046 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml @@ -110,22 +110,21 @@ tests: response: value: 1 - #Issue #10816 Need to store EnhancedCurrentHue value and compare it with ColorLoopStoredEnhancedHue attribute - - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true + - label: "Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + saveAs: EnhancedCurrentHueValue + constraints: + type: uint16 - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + value: EnhancedCurrentHueValue # 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 @@ -221,23 +220,29 @@ tests: response: value: 0 - #Issue #10816 Need to store ColorLoopStoredEnhancedHue value and compare it with EnhancedCurrentHue attribute - label: "Read ColorLoopStoredEnhancedHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "color loop stored enhanced hue" PICS: A_COLORLOOPSTOREDENHANCEDHUE response: - value: 0 + saveAs: ColorLoopStoredEnhancedHueValue + constraints: + type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT." - disabled: true command: "readAttribute" attribute: "enhanced current hue" PICS: A_ENHANCEDCURRENTHUE response: - value: 0 + value: ColorLoopStoredEnhancedHueValue - label: "Turn off light for color control tests" cluster: "On/Off" command: "off" + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 6ae58e8239dea3..55c239066c218f 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -5264,7 +5264,39 @@ - (void)testSendClusterTest_TC_CC_3_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue +- (void)testSendClusterTest_TC_CC_3_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads CurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue { XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue shortest distance command"]; @@ -5276,7 +5308,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; params.hue = [NSNumber numberWithUnsignedChar:150]; params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueWithParams:params @@ -5290,7 +5322,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000003_MoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue +- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue { XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue longest distance command"]; @@ -5302,7 +5334,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; params.hue = [NSNumber numberWithUnsignedChar:200]; params.direction = [NSNumber numberWithUnsignedChar:1]; - params.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueWithParams:params @@ -5316,7 +5348,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000004_MoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue +- (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue { XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue up command"]; @@ -5328,7 +5360,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; params.hue = [NSNumber numberWithUnsignedChar:250]; params.direction = [NSNumber numberWithUnsignedChar:2]; - params.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueWithParams:params @@ -5342,7 +5374,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000005_MoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue +- (void)testSendClusterTest_TC_CC_3_1_000007_MoveToHue { XCTestExpectation * expectation = [self expectationWithDescription:@"Move to hue down command"]; @@ -5354,7 +5386,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; params.hue = [NSNumber numberWithUnsignedChar:225]; params.direction = [NSNumber numberWithUnsignedChar:3]; - params.transitionTime = [NSNumber numberWithUnsignedShort:100U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueWithParams:params @@ -5368,7 +5400,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000006_MoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000007_Off +- (void)testSendClusterTest_TC_CC_3_1_000008_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -5387,7 +5419,7 @@ - (void)testSendClusterTest_TC_CC_3_1_000007_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_3_1_000008_ReadAttribute +- (void)testSendClusterTest_TC_CC_3_1_000009_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -6943,7 +6975,39 @@ - (void)testSendClusterTest_TC_CC_6_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature +- (void)testSendClusterTest_TC_CC_6_2_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read current color temprature"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature { XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; @@ -6970,7 +7034,61 @@ - (void)testSendClusterTest_TC_CC_6_2_000003_MoveColorTemperature [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature +- (void)testSendClusterTest_TC_CC_6_2_000005_MoveColorTemperature +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_2_000006_MoveColorTemperature +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Move up color temperature command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_2_000007_MoveColorTemperature { XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; @@ -6997,7 +7115,7 @@ - (void)testSendClusterTest_TC_CC_6_2_000004_MoveColorTemperature [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000005_MoveColorTemperature +- (void)testSendClusterTest_TC_CC_6_2_000008_MoveColorTemperature { XCTestExpectation * expectation = [self expectationWithDescription:@"Move down color temperature command"]; @@ -7024,7 +7142,34 @@ - (void)testSendClusterTest_TC_CC_6_2_000005_MoveColorTemperature [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000006_Off +- (void)testSendClusterTest_TC_CC_6_2_000009_MoveColorTemperature +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Stop Color Temperature command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_6_2_000010_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -7043,7 +7188,7 @@ - (void)testSendClusterTest_TC_CC_6_2_000006_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_6_2_000007_ReadAttribute +- (void)testSendClusterTest_TC_CC_6_2_000011_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -7296,32 +7441,111 @@ - (void)testSendClusterTest_TC_CC_7_1_000003_EnhancedMoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000004_EnhancedMoveToHue { - XCTestExpectation * expectation = - [self expectationWithDescription:@"Check Remaining time attribute value matched the value sent by the last command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check Remaining time attribute value matched the value sent by the last command Error: %@", err); + __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); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } + [expectation fulfill]; + }]; - [expectation fulfill]; - }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_7_1_000005_EnhancedMoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_7_1_000006_EnhancedMoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_7_1_000007_EnhancedMoveToHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000005_Off +- (void)testSendClusterTest_TC_CC_7_1_000008_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -7340,7 +7564,7 @@ - (void)testSendClusterTest_TC_CC_7_1_000005_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_1_000006_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_1_000009_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -7416,34 +7640,66 @@ - (void)testSendClusterTest_TC_CC_7_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000003_EnhancedMoveHue +- (void)testSendClusterTest_TC_CC_7_2_000003_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Check EnhancedCurrentHue attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:5U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Down command Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute from DUT Error: %@", err); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __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); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -7466,9 +7722,9 @@ - (void)testSendClusterTest_TC_CC_7_2_000004_EnhancedMoveHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue +- (void)testSendClusterTest_TC_CC_7_2_000006_EnhancedMoveHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Up command"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Down command "]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -7476,13 +7732,13 @@ - (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue XCTAssertNotNil(cluster); __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:50U]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedShort:5U]; 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 Down command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -7491,7 +7747,7 @@ - (void)testSendClusterTest_TC_CC_7_2_000005_EnhancedMoveHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000006_EnhancedMoveHue +- (void)testSendClusterTest_TC_CC_7_2_000007_EnhancedMoveHue { XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move Hue Stop command"]; @@ -7516,7 +7772,7 @@ - (void)testSendClusterTest_TC_CC_7_2_000006_EnhancedMoveHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000007_Off +- (void)testSendClusterTest_TC_CC_7_2_000008_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light that we turned on"]; @@ -7535,7 +7791,7 @@ - (void)testSendClusterTest_TC_CC_7_2_000007_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_7_2_000008_ReadAttribute +- (void)testSendClusterTest_TC_CC_7_2_000009_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; @@ -8539,7 +8795,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000012_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000013_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue1; +- (void)testSendClusterTest_TC_CC_9_1_000013_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue1 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue1); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000015_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8567,7 +8872,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000013_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000016_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -8591,7 +8896,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000014_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000015_ColorLoopSet +NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue1; +- (void)testSendClusterTest_TC_CC_9_1_000017_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHueValue1 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000018_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue1); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000019_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8619,7 +8973,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000015_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000016_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000020_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; @@ -8643,7 +8997,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000016_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000017_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_1_000021_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8671,7 +9025,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000017_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000018_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000022_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -8695,7 +9049,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000018_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000019_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue2; +- (void)testSendClusterTest_TC_CC_9_1_000023_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue2 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000024_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000025_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8723,7 +9126,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000019_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000020_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000026_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -8747,9 +9150,58 @@ - (void)testSendClusterTest_TC_CC_9_1_000020_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000021_EnhancedMoveToHue +NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue2; +- (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHueValue2 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000028_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue2); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000029_EnhancedMoveToHue { - XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command 10"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Enhanced Move To Hue command"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -8764,7 +9216,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000021_EnhancedMoveToHue params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveToHueWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command 10 Error: %@", err); + NSLog(@"Enhanced Move To Hue command Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -8773,7 +9225,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000021_EnhancedMoveToHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000022_WaitForMs +- (void)testSendClusterTest_TC_CC_9_1_000030_WaitForMs { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait 2000ms"]; @@ -8781,7 +9233,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000022_WaitForMs WaitForMs(expectation, queue, 2000); [self waitForExpectationsWithTimeout:(2000 / 1000) + kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000023_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000031_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; @@ -8805,7 +9257,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000023_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000024_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_1_000032_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8833,7 +9285,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000024_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000025_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000033_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; @@ -8857,7 +9309,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000025_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000026_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_1_000034_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8885,7 +9337,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000026_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000035_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -8909,20 +9361,69 @@ - (void)testSendClusterTest_TC_CC_9_1_000027_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000028_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue3; +- (void)testSendClusterTest_TC_CC_9_1_000036_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue3 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000037_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue3); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000038_ColorLoopSet +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; + params.updateFlags = [NSNumber numberWithUnsignedChar:1]; + params.action = [NSNumber numberWithUnsignedChar:0]; + params.direction = [NSNumber numberWithUnsignedChar:0]; + params.time = [NSNumber numberWithUnsignedShort:0U]; params.startHue = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; @@ -8937,7 +9438,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000028_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000029_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000039_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -8961,7 +9462,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000029_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000030_ColorLoopSet +NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue3; +- (void)testSendClusterTest_TC_CC_9_1_000040_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHueValue3 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000041_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue3); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000042_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -8989,7 +9539,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000030_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000031_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000043_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT"]; @@ -9013,7 +9563,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000031_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000032_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_1_000044_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -9041,7 +9591,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000032_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000033_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000045_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -9065,7 +9615,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000033_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000034_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue4; +- (void)testSendClusterTest_TC_CC_9_1_000046_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue4 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000047_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue4); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000048_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Sends ColorLoopSet Command - Set all Attributes"]; @@ -9093,7 +9692,7 @@ - (void)testSendClusterTest_TC_CC_9_1_000034_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000035_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_1_000049_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -9117,7 +9716,56 @@ - (void)testSendClusterTest_TC_CC_9_1_000035_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_1_000036_Off +NSNumber * _Nonnull ColorLoopStoredEnhancedHue4; +- (void)testSendClusterTest_TC_CC_9_1_000050_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHue4 = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000051_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHue4); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_1_000052_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn Off light for color control tests"]; @@ -9136,6 +9784,30 @@ - (void)testSendClusterTest_TC_CC_9_1_000036_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_CC_9_1_000053_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue boolValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_CC_9_2_000000_WaitForCommissionee { @@ -9365,7 +10037,56 @@ - (void)testSendClusterTest_TC_CC_9_2_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000010_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue; +- (void)testSendClusterTest_TC_CC_9_2_000010_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_2_000012_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; @@ -9393,7 +10114,7 @@ - (void)testSendClusterTest_TC_CC_9_2_000010_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_2_000013_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopDirection attribute from DUT."]; @@ -9417,7 +10138,7 @@ - (void)testSendClusterTest_TC_CC_9_2_000011_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000012_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_2_000014_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; @@ -9445,7 +10166,7 @@ - (void)testSendClusterTest_TC_CC_9_2_000012_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000013_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_2_000015_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -9469,7 +10190,56 @@ - (void)testSendClusterTest_TC_CC_9_2_000013_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_2_000014_Off +NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue; +- (void)testSendClusterTest_TC_CC_9_2_000016_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHueValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_2_000017_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_2_000018_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"]; @@ -9488,6 +10258,30 @@ - (void)testSendClusterTest_TC_CC_9_2_000014_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_CC_9_2_000019_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue boolValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_CC_9_3_000000_WaitForCommissionee { @@ -9717,7 +10511,56 @@ - (void)testSendClusterTest_TC_CC_9_3_000009_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_3_000010_ColorLoopSet +NSNumber * _Nonnull EnhancedCurrentHueValue; +- (void)testSendClusterTest_TC_CC_9_3_000010_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + EnhancedCurrentHueValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, EnhancedCurrentHueValue); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_3_000012_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; @@ -9745,7 +10588,7 @@ - (void)testSendClusterTest_TC_CC_9_3_000010_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_3_000013_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopTime attribute from DUT."]; @@ -9769,7 +10612,7 @@ - (void)testSendClusterTest_TC_CC_9_3_000011_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_3_000012_ColorLoopSet +- (void)testSendClusterTest_TC_CC_9_3_000014_ColorLoopSet { XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Start Color Loop"]; @@ -9797,7 +10640,7 @@ - (void)testSendClusterTest_TC_CC_9_3_000012_ColorLoopSet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_3_000013_ReadAttribute +- (void)testSendClusterTest_TC_CC_9_3_000015_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopActive attribute from DUT"]; @@ -9821,7 +10664,56 @@ - (void)testSendClusterTest_TC_CC_9_3_000013_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_CC_9_3_000014_Off +NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue; +- (void)testSendClusterTest_TC_CC_9_3_000016_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read ColorLoopStoredEnhancedHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ColorLoopStoredEnhancedHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + ColorLoopStoredEnhancedHueValue = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_3_000017_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read EnhancedCurrentHue attribute from DUT."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EnhancedCurrentHue attribute from DUT. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqualObjects(actualValue, ColorLoopStoredEnhancedHueValue); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_CC_9_3_000018_Off { XCTestExpectation * expectation = [self expectationWithDescription:@"Turn off light for color control tests"]; @@ -9840,6 +10732,30 @@ - (void)testSendClusterTest_TC_CC_9_3_000014_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_CC_9_3_000019_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check on/off attribute value is false after off command"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue boolValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_DD_1_5_000000_Log { diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f54100b279450c..43b0f49d3e90a4 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -7906,28 +7906,32 @@ class Test_TC_CC_3_1 : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to hue shortest distance command\n"); - err = TestMoveToHueShortestDistanceCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT.\n"); + err = TestReadsCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue longest distance command\n"); - err = TestMoveToHueLongestDistanceCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Move to hue shortest distance command\n"); + err = TestMoveToHueShortestDistanceCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue up command\n"); - err = TestMoveToHueUpCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue longest distance command\n"); + err = TestMoveToHueLongestDistanceCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move to hue down command\n"); - err = TestMoveToHueDownCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Move to hue up command\n"); + err = TestMoveToHueUpCommand_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 : Move to hue down command\n"); + err = TestMoveToHueDownCommand_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 : 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; } @@ -7940,7 +7944,7 @@ class Test_TC_CC_3_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 10; chip::Optional mCluster; chip::Optional mEndpoint; @@ -7955,14 +7959,24 @@ class Test_TC_CC_3_1 : public TestCommand (static_cast(context))->OnSuccessResponse_2(onOff); } - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_8(void * context, bool onOff) + static void OnSuccessCallback_3(void * context, uint8_t currentHue) + { + (static_cast(context))->OnSuccessResponse_3(currentHue); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_8(onOff); + (static_cast(context))->OnSuccessResponse_9(onOff); } // @@ -8026,7 +8040,32 @@ class Test_TC_CC_3_1 : public TestCommand NextTest(); } - CHIP_ERROR TestMoveToHueShortestDistanceCommand_3() + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(uint8_t currentHue) + { + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentHue", currentHue, 0)); + VerifyOrReturn(CheckConstraintMaxValue("currentHue", currentHue, 254)); + NextTest(); + } + + CHIP_ERROR TestMoveToHueShortestDistanceCommand_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; @@ -8034,31 +8073,31 @@ class Test_TC_CC_3_1 : public TestCommand RequestType request; request.hue = 150; request.direction = static_cast(0); - request.transitionTime = 100U; + request.transitionTime = 300U; request.optionsMask = 0; request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); + (static_cast(context))->OnSuccessResponse_4(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_4(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestMoveToHueLongestDistanceCommand_4() + CHIP_ERROR TestMoveToHueLongestDistanceCommand_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; @@ -8066,31 +8105,31 @@ class Test_TC_CC_3_1 : public TestCommand RequestType request; request.hue = 200; request.direction = static_cast(1); - request.transitionTime = 100U; + request.transitionTime = 300U; request.optionsMask = 0; request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); + (static_cast(context))->OnSuccessResponse_5(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_5(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_5(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestMoveToHueUpCommand_5() + CHIP_ERROR TestMoveToHueUpCommand_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; @@ -8098,31 +8137,31 @@ class Test_TC_CC_3_1 : public TestCommand RequestType request; request.hue = 250; request.direction = static_cast(2); - request.transitionTime = 100U; + request.transitionTime = 300U; request.optionsMask = 0; request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); + (static_cast(context))->OnSuccessResponse_6(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_6(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestMoveToHueDownCommand_6() + CHIP_ERROR TestMoveToHueDownCommand_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveToHue::Type; @@ -8130,31 +8169,31 @@ class Test_TC_CC_3_1 : public TestCommand RequestType request; request.hue = 225; request.direction = static_cast(3); - request.transitionTime = 100U; + request.transitionTime = 300U; request.optionsMask = 0; request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); + (static_cast(context))->OnSuccessResponse_7(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_7(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -8162,43 +8201,43 @@ class Test_TC_CC_3_1 : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(); + (static_cast(context))->OnSuccessResponse_8(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_8(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7() { NextTest(); } + void OnSuccessResponse_8() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); + this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8(bool onOff) + void OnSuccessResponse_9(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); @@ -11045,24 +11084,40 @@ class Test_TC_CC_6_2 : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_4(); break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Move down color temperature command\n"); err = TestMoveDownColorTemperatureCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Move down color temperature command\n"); + err = TestMoveDownColorTemperatureCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_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; } @@ -11075,7 +11130,7 @@ class Test_TC_CC_6_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 12; chip::Optional mCluster; chip::Optional mEndpoint; @@ -11090,14 +11145,24 @@ class Test_TC_CC_6_2 : public TestCommand (static_cast(context))->OnSuccessResponse_2(onOff); } - static void OnFailureCallback_7(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_7(void * context, bool onOff) + static void OnSuccessCallback_3(void * context, uint16_t colorTemperature) + { + (static_cast(context))->OnSuccessResponse_3(colorTemperature); + } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_7(onOff); + (static_cast(context))->OnSuccessResponse_11(onOff); } // @@ -11161,7 +11226,32 @@ class Test_TC_CC_6_2 : public TestCommand NextTest(); } - CHIP_ERROR TestMoveUpColorTemperatureCommand_3() + CHIP_ERROR TestReadCurrentColorTemprature_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(uint16_t colorTemperature) + { + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", colorTemperature, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", colorTemperature, 65279U)); + NextTest(); + } + + CHIP_ERROR TestMoveUpColorTemperatureCommand_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; @@ -11175,26 +11265,92 @@ class Test_TC_CC_6_2 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); + (static_cast(context))->OnSuccessResponse_4(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_4(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_4(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestMoveDownColorTemperatureCommand_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + + RequestType request; + request.moveMode = static_cast(3); + request.rate = 20U; + request.colorTemperatureMinimum = 1U; + request.colorTemperatureMaximum = 255U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_5(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_5(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestMoveUpColorTemperatureCommand_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + + RequestType request; + request.moveMode = static_cast(1); + request.rate = 10U; + request.colorTemperatureMinimum = 1U; + request.colorTemperatureMaximum = 255U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_6(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestStopColorTemperatureCommand_4() + CHIP_ERROR TestStopColorTemperatureCommand_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; @@ -11208,26 +11364,26 @@ class Test_TC_CC_6_2 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); + (static_cast(context))->OnSuccessResponse_7(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_7(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestMoveDownColorTemperatureCommand_5() + CHIP_ERROR TestMoveDownColorTemperatureCommand_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; @@ -11241,26 +11397,59 @@ class Test_TC_CC_6_2 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(); + (static_cast(context))->OnSuccessResponse_8(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_8(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5() { NextTest(); } + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestStopColorTemperatureCommand_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type; + + RequestType request; + request.moveMode = static_cast(0); + request.rate = 10U; + request.colorTemperatureMinimum = 1U; + request.colorTemperatureMaximum = 255U; + request.optionsMask = 0; + request.optionsOverride = 0; - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_6() + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_9(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_9(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -11268,43 +11457,43 @@ class Test_TC_CC_6_2 : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_6(); + (static_cast(context))->OnSuccessResponse_10(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_10(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_10(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_10() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_7() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); + this, OnSuccessCallback_11, OnFailureCallback_11)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(CHIP_ERROR error) + void OnFailureResponse_11(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_7(bool onOff) + void OnSuccessResponse_11(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); @@ -11646,17 +11835,28 @@ class Test_TC_CC_7_1 : public TestCommand err = TestEnhancedMoveToHueCommand_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Check Remaining time attribute value matched the value sent by the last command\n"); - err = TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_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 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_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 : 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; } @@ -11669,7 +11869,7 @@ class Test_TC_CC_7_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 10; chip::Optional mCluster; chip::Optional mEndpoint; @@ -11684,24 +11884,14 @@ class Test_TC_CC_7_1 : public TestCommand (static_cast(context))->OnSuccessResponse_2(onOff); } - static void OnFailureCallback_4(void * context, CHIP_ERROR error) - { - (static_cast(context))->OnFailureResponse_4(error); - } - - static void OnSuccessCallback_4(void * context, uint16_t remainingTime) - { - (static_cast(context))->OnSuccessResponse_4(remainingTime); - } - - static void OnFailureCallback_6(void * context, CHIP_ERROR error) + static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_6(void * context, bool onOff) + static void OnSuccessCallback_9(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_6(onOff); + (static_cast(context))->OnSuccessResponse_9(onOff); } // @@ -11797,14 +11987,27 @@ class Test_TC_CC_7_1 : public TestCommand void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestCheckRemainingTimeAttributeValueMatchedTheValueSentByTheLastCommand_4() + CHIP_ERROR TestEnhancedMoveToHueCommand_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::ColorControlClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); + RequestType request; + request.enhancedHue = 1100U; + request.direction = static_cast(0); + request.transitionTime = 300U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_4(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } @@ -11814,19 +12017,19 @@ class Test_TC_CC_7_1 : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t remainingTime) - { - VerifyOrReturn(CheckValue("remainingTime", remainingTime, 1U)); - - NextTest(); - } + void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestEnhancedMoveToHueCommand_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; RequestType request; + request.enhancedHue = 1150U; + request.direction = static_cast(1); + request.transitionTime = 300U; + request.optionsMask = 0; + request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_5(); @@ -11848,24 +12051,115 @@ class Test_TC_CC_7_1 : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestEnhancedMoveToHueCommand_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; + + RequestType request; + request.enhancedHue = 1200U; + request.direction = static_cast(2); + request.transitionTime = 300U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_6(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestEnhancedMoveToHueCommand_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; + + RequestType request; + request.enhancedHue = 1300U; + request.direction = static_cast(3); + request.transitionTime = 300U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_7(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_7(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7() { NextTest(); } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_8(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_8(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); + this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_6(bool onOff) + void OnSuccessResponse_9(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); @@ -11922,28 +12216,32 @@ class Test_TC_CC_7_2 : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move Hue Down command \n"); - err = TestEnhancedMoveHueDownCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check EnhancedCurrentHue attribute from DUT\n"); + err = TestCheckEnhancedCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move Hue Up command\n"); + err = TestEnhancedMoveHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Up command\n"); - err = TestEnhancedMoveHueUpCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move Hue Down command \n"); + err = TestEnhancedMoveHueDownCommand_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 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_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 : 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; } @@ -11956,7 +12254,7 @@ class Test_TC_CC_7_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 10; chip::Optional mCluster; chip::Optional mEndpoint; @@ -11971,14 +12269,24 @@ class Test_TC_CC_7_2 : public TestCommand (static_cast(context))->OnSuccessResponse_2(onOff); } - static void OnFailureCallback_8(void * context, CHIP_ERROR error) + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_8(void * context, bool onOff) + static void OnSuccessCallback_3(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_3(enhancedCurrentHue); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_8(onOff); + (static_cast(context))->OnSuccessResponse_9(onOff); } // @@ -12042,26 +12350,14 @@ class Test_TC_CC_7_2 : public TestCommand NextTest(); } - CHIP_ERROR TestEnhancedMoveHueDownCommand_3() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeFromDut_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; - - RequestType request; - request.moveMode = static_cast(3); - request.rate = 5U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); - }; - - auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); - }; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } @@ -12071,16 +12367,22 @@ class Test_TC_CC_7_2 : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_3(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", enhancedCurrentHue, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", enhancedCurrentHue, 65535U)); + NextTest(); + } - CHIP_ERROR TestEnhancedMoveHueStopCommand_4() + CHIP_ERROR TestEnhancedMoveHueUpCommand_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; - request.moveMode = static_cast(0); - request.rate = 0U; + request.moveMode = static_cast(1); + request.rate = 50U; request.optionsMask = 0; request.optionsOverride = 0; @@ -12104,14 +12406,14 @@ class Test_TC_CC_7_2 : public TestCommand void OnSuccessResponse_4() { NextTest(); } - CHIP_ERROR TestEnhancedMoveHueUpCommand_5() + CHIP_ERROR TestEnhancedMoveHueStopCommand_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; - request.moveMode = static_cast(1); - request.rate = 50U; + request.moveMode = static_cast(0); + request.rate = 0U; request.optionsMask = 0; request.optionsOverride = 0; @@ -12135,14 +12437,14 @@ class Test_TC_CC_7_2 : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestEnhancedMoveHueStopCommand_6() + CHIP_ERROR TestEnhancedMoveHueDownCommand_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; - request.moveMode = static_cast(0); - request.rate = 0U; + request.moveMode = static_cast(3); + request.rate = 5U; request.optionsMask = 0; request.optionsOverride = 0; @@ -12166,12 +12468,16 @@ class Test_TC_CC_7_2 : public TestCommand void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() + CHIP_ERROR TestEnhancedMoveHueStopCommand_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type; RequestType request; + request.moveMode = static_cast(0); + request.rate = 0U; + request.optionsMask = 0; + request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_7(); @@ -12193,24 +12499,51 @@ class Test_TC_CC_7_2 : public TestCommand void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_8(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_8(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); + this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_8(CHIP_ERROR error) + void OnFailureResponse_9(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_8(bool onOff) + void OnSuccessResponse_9(bool onOff) { VerifyOrReturn(CheckValue("onOff", onOff, 0)); @@ -13537,22 +13870,22 @@ class Test_TC_CC_9_1 : public TestCommand err = TestReadColorLoopActiveAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 13 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestSendsColorLoopSetCommandSetAllAttributes_13(); + err = TestReadEnhancedCurrentHueAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 14 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_14(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_14(); break; case 15: ChipLogProgress(chipTool, " ***** Test Step 15 : Sends ColorLoopSet Command - Set all Attributes\n"); @@ -13564,31 +13897,31 @@ class Test_TC_CC_9_1 : public TestCommand err = TestSendsColorLoopSetCommandSetAllAttributes_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopDirection attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPDIRECTION")) + ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) { NextTest(); return; } - err = TestReadColorLoopDirectionAttributeFromDut_16(); + err = TestReadColorLoopActiveAttributeFromDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 17 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestSendsColorLoopSetCommandSetAllAttributes_17(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 18 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_18(); + err = TestReadEnhancedCurrentHueAttributeFromDut_18(); break; case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Sends ColorLoopSet Command - Set all Attributes\n"); @@ -13600,26 +13933,31 @@ class Test_TC_CC_9_1 : public TestCommand err = TestSendsColorLoopSetCommandSetAllAttributes_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 20 : Read ColorLoopDirection attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPDIRECTION")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_20(); + err = TestReadColorLoopDirectionAttributeFromDut_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Enhanced Move To Hue command 10\n"); - if (ShouldSkip("CR_ENHANCEDMOVETOHUE")) + ChipLogProgress(chipTool, " ***** Test Step 21 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) { NextTest(); return; } - err = TestEnhancedMoveToHueCommand10_21(); + err = TestSendsColorLoopSetCommandSetAllAttributes_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 2000ms\n"); - err = TestWait2000ms_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_22(); break; case 23: ChipLogProgress(chipTool, " ***** Test Step 23 : Read EnhancedCurrentHue attribute from DUT\n"); @@ -13631,76 +13969,71 @@ class Test_TC_CC_9_1 : public TestCommand err = TestReadEnhancedCurrentHueAttributeFromDut_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 24 : Read ColorLoopStoredEnhancedHue attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestSendsColorLoopSetCommandSetAllAttributes_24(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Read ColorLoopDirection attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPDIRECTION")) + ChipLogProgress(chipTool, " ***** Test Step 25 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) { NextTest(); return; } - err = TestReadColorLoopDirectionAttributeFromDut_25(); + err = TestSendsColorLoopSetCommandSetAllAttributes_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 26 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) { NextTest(); return; } - err = TestSendsColorLoopSetCommandSetAllAttributes_26(); + err = TestReadColorLoopActiveAttributeFromDut_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 27 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_27(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 28 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestSendsColorLoopSetCommandSetAllAttributes_28(); + err = TestReadEnhancedCurrentHueAttributeFromDut_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 29 : Enhanced Move To Hue command\n"); + if (ShouldSkip("CR_ENHANCEDMOVETOHUE")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_29(); + err = TestEnhancedMoveToHueCommand_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Sends ColorLoopSet Command - Set all Attributes\n"); - if (ShouldSkip("CR_COLORLOOPSET")) - { - NextTest(); - return; - } - err = TestSendsColorLoopSetCommandSetAllAttributes_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 2000ms\n"); + err = TestWait2000ms_30(); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read ColorLoopDirection attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPDIRECTION")) + ChipLogProgress(chipTool, " ***** Test Step 31 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestReadColorLoopDirectionAttributeFromDut_31(); + err = TestReadEnhancedCurrentHueAttributeFromDut_31(); break; case 32: ChipLogProgress(chipTool, " ***** Test Step 32 : Sends ColorLoopSet Command - Set all Attributes\n"); @@ -13712,13 +14045,13 @@ class Test_TC_CC_9_1 : public TestCommand err = TestSendsColorLoopSetCommandSetAllAttributes_32(); break; case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 33 : Read ColorLoopDirection attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPDIRECTION")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_33(); + err = TestReadColorLoopDirectionAttributeFromDut_33(); break; case 34: ChipLogProgress(chipTool, " ***** Test Step 34 : Sends ColorLoopSet Command - Set all Attributes\n"); @@ -13739,8 +14072,156 @@ class Test_TC_CC_9_1 : public TestCommand err = TestReadColorLoopActiveAttributeFromDut_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Turn Off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_36(); + ChipLogProgress(chipTool, " ***** Test Step 36 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Read ColorLoopStoredEnhancedHue attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : Read ColorLoopDirection attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPDIRECTION")) + { + NextTest(); + return; + } + err = TestReadColorLoopDirectionAttributeFromDut_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Read ColorLoopStoredEnhancedHue attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : Sends ColorLoopSet Command - Set all Attributes\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestSendsColorLoopSetCommandSetAllAttributes_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_49(); + break; + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : Read EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_51(); + break; + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : Turn Off light for color control tests\n"); + err = TestTurnOffLightForColorControlTests_52(); + break; + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_53(); break; } @@ -13753,11 +14234,20 @@ class Test_TC_CC_9_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 37; + const uint16_t mTestCount = 54; chip::Optional mCluster; chip::Optional mEndpoint; + uint16_t EnhancedCurrentHueValue1; + uint16_t ColorLoopStoredEnhancedHueValue1; + uint16_t EnhancedCurrentHueValue2; + uint16_t ColorLoopStoredEnhancedHueValue2; + uint16_t EnhancedCurrentHueValue3; + uint16_t ColorLoopStoredEnhancedHueValue3; + uint16_t EnhancedCurrentHueValue4; + uint16_t ColorLoopStoredEnhancedHue4; + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -13818,14 +14308,24 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnSuccessResponse_12(colorLoopActive); } + static void OnFailureCallback_13(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_13(error); + } + + static void OnSuccessCallback_13(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_13(enhancedCurrentHue); + } + static void OnFailureCallback_14(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_14(error); } - static void OnSuccessCallback_14(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_14(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_14(colorLoopActive); + (static_cast(context))->OnSuccessResponse_14(colorLoopStoredEnhancedHue); } static void OnFailureCallback_16(void * context, CHIP_ERROR error) @@ -13833,9 +14333,19 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_16(void * context, uint8_t colorLoopDirection) + static void OnSuccessCallback_16(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_16(colorLoopActive); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_16(colorLoopDirection); + (static_cast(context))->OnSuccessResponse_17(colorLoopStoredEnhancedHue); } static void OnFailureCallback_18(void * context, CHIP_ERROR error) @@ -13843,9 +14353,9 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_18(error); } - static void OnSuccessCallback_18(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_18(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_18(colorLoopActive); + (static_cast(context))->OnSuccessResponse_18(enhancedCurrentHue); } static void OnFailureCallback_20(void * context, CHIP_ERROR error) @@ -13853,9 +14363,19 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_20(error); } - static void OnSuccessCallback_20(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_20(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_20(colorLoopDirection); + } + + static void OnFailureCallback_22(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_22(error); + } + + static void OnSuccessCallback_22(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_20(colorLoopActive); + (static_cast(context))->OnSuccessResponse_22(colorLoopActive); } static void OnFailureCallback_23(void * context, CHIP_ERROR error) @@ -13868,14 +14388,24 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnSuccessResponse_23(enhancedCurrentHue); } - static void OnFailureCallback_25(void * context, CHIP_ERROR error) + static void OnFailureCallback_24(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_24(error); + } + + static void OnSuccessCallback_24(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_24(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_26(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_25(error); + (static_cast(context))->OnFailureResponse_26(error); } - static void OnSuccessCallback_25(void * context, uint8_t colorLoopDirection) + static void OnSuccessCallback_26(void * context, uint8_t colorLoopActive) { - (static_cast(context))->OnSuccessResponse_25(colorLoopDirection); + (static_cast(context))->OnSuccessResponse_26(colorLoopActive); } static void OnFailureCallback_27(void * context, CHIP_ERROR error) @@ -13883,19 +14413,19 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_27(error); } - static void OnSuccessCallback_27(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_27(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_27(colorLoopActive); + (static_cast(context))->OnSuccessResponse_27(colorLoopStoredEnhancedHue); } - static void OnFailureCallback_29(void * context, CHIP_ERROR error) + static void OnFailureCallback_28(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_29(error); + (static_cast(context))->OnFailureResponse_28(error); } - static void OnSuccessCallback_29(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_28(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_29(colorLoopActive); + (static_cast(context))->OnSuccessResponse_28(enhancedCurrentHue); } static void OnFailureCallback_31(void * context, CHIP_ERROR error) @@ -13903,9 +14433,9 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_31(error); } - static void OnSuccessCallback_31(void * context, uint8_t colorLoopDirection) + static void OnSuccessCallback_31(void * context, uint16_t enhancedCurrentHue) { - (static_cast(context))->OnSuccessResponse_31(colorLoopDirection); + (static_cast(context))->OnSuccessResponse_31(enhancedCurrentHue); } static void OnFailureCallback_33(void * context, CHIP_ERROR error) @@ -13913,9 +14443,9 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnFailureResponse_33(error); } - static void OnSuccessCallback_33(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_33(void * context, uint8_t colorLoopDirection) { - (static_cast(context))->OnSuccessResponse_33(colorLoopActive); + (static_cast(context))->OnSuccessResponse_33(colorLoopDirection); } static void OnFailureCallback_35(void * context, CHIP_ERROR error) @@ -13928,6 +14458,136 @@ class Test_TC_CC_9_1 : public TestCommand (static_cast(context))->OnSuccessResponse_35(colorLoopActive); } + static void OnFailureCallback_36(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_36(error); + } + + static void OnSuccessCallback_36(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_36(enhancedCurrentHue); + } + + static void OnFailureCallback_37(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_37(error); + } + + static void OnSuccessCallback_37(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_37(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_39(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_39(error); + } + + static void OnSuccessCallback_39(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_39(colorLoopActive); + } + + static void OnFailureCallback_40(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_40(error); + } + + static void OnSuccessCallback_40(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_40(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_41(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_41(error); + } + + static void OnSuccessCallback_41(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_41(enhancedCurrentHue); + } + + static void OnFailureCallback_43(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_43(error); + } + + static void OnSuccessCallback_43(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_43(colorLoopDirection); + } + + static void OnFailureCallback_45(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_45(error); + } + + static void OnSuccessCallback_45(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_45(colorLoopActive); + } + + static void OnFailureCallback_46(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_46(error); + } + + static void OnSuccessCallback_46(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_46(enhancedCurrentHue); + } + + static void OnFailureCallback_47(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_47(error); + } + + static void OnSuccessCallback_47(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_47(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_49(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_49(error); + } + + static void OnSuccessCallback_49(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_49(colorLoopActive); + } + + static void OnFailureCallback_50(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_50(error); + } + + static void OnSuccessCallback_50(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_50(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_51(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_51(error); + } + + static void OnSuccessCallback_51(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_51(enhancedCurrentHue); + } + + static void OnFailureCallback_53(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_53(error); + } + + static void OnSuccessCallback_53(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_53(onOff); + } + // // Tests methods // @@ -14280,65 +14940,163 @@ class Test_TC_CC_9_1 : public TestCommand NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_13() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_13(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue1 = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_14, OnFailureCallback_14)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue1)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + + RequestType request; + request.updateFlags = static_cast>(1); + request.action = static_cast(0); + request.direction = static_cast(0); + request.time = 0U; + request.startHue = 0U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_15(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_13(error); + (static_cast(context))->OnFailureResponse_15(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13() { NextTest(); } + void OnSuccessResponse_15() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_14() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_16() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_14, OnFailureCallback_14)); + this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t colorLoopActive) + void OnSuccessResponse_16(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_15() + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_17() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_17(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_17(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHueValue1 = colorLoopStoredEnhancedHue; + NextTest(); + } + + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_18() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_18(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_18(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHueValue1)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_19() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14353,50 +15111,50 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(); + (static_cast(context))->OnSuccessResponse_19(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_15(error); + (static_cast(context))->OnFailureResponse_19(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_15(CHIP_ERROR error) + void OnFailureResponse_19(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_15() { NextTest(); } + void OnSuccessResponse_19() { NextTest(); } - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_16() + CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_20() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); + this, OnSuccessCallback_20, OnFailureCallback_20)); return CHIP_NO_ERROR; } - void OnFailureResponse_16(CHIP_ERROR error) + void OnFailureResponse_20(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_16(uint8_t colorLoopDirection) + void OnSuccessResponse_20(uint8_t colorLoopDirection) { VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_17() + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_21() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14411,50 +15169,99 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(); + (static_cast(context))->OnSuccessResponse_21(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_17(error); + (static_cast(context))->OnFailureResponse_21(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_17(CHIP_ERROR error) + void OnFailureResponse_21(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_17() { NextTest(); } + void OnSuccessResponse_21() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_18() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_22() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); + this, OnSuccessCallback_22, OnFailureCallback_22)); return CHIP_NO_ERROR; } - void OnFailureResponse_18(CHIP_ERROR error) + void OnFailureResponse_22(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_18(uint8_t colorLoopActive) + void OnSuccessResponse_22(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_19() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_23() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_23(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_23(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue2 = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_24() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_24, OnFailureCallback_24)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_24(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_24(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue2)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_25() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14469,50 +15276,99 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(); + (static_cast(context))->OnSuccessResponse_25(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_19(error); + (static_cast(context))->OnFailureResponse_25(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_19(CHIP_ERROR error) + void OnFailureResponse_25(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_19() { NextTest(); } + void OnSuccessResponse_25() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_20() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_26() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); + this, OnSuccessCallback_26, OnFailureCallback_26)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(CHIP_ERROR error) + void OnFailureResponse_26(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_20(uint8_t colorLoopActive) + void OnSuccessResponse_26(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestEnhancedMoveToHueCommand10_21() + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_27() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_27, OnFailureCallback_27)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_27(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_27(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHueValue2 = colorLoopStoredEnhancedHue; + NextTest(); + } + + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_28() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_28, OnFailureCallback_28)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_28(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_28(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHueValue2)); + + NextTest(); + } + + CHIP_ERROR TestEnhancedMoveToHueCommand_29() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type; @@ -14525,56 +15381,56 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(); + (static_cast(context))->OnSuccessResponse_29(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_21(error); + (static_cast(context))->OnFailureResponse_29(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(CHIP_ERROR error) + void OnFailureResponse_29(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_21() { NextTest(); } + void OnSuccessResponse_29() { NextTest(); } - CHIP_ERROR TestWait2000ms_22() + CHIP_ERROR TestWait2000ms_30() { SetIdentity(kIdentityAlpha); return WaitForMs(2000); } - CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_23() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_31() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); + this, OnSuccessCallback_31, OnFailureCallback_31)); return CHIP_NO_ERROR; } - void OnFailureResponse_23(CHIP_ERROR error) + void OnFailureResponse_31(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_23(uint16_t enhancedCurrentHue) + void OnSuccessResponse_31(uint16_t enhancedCurrentHue) { VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, 40960U)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_24() + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_32() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14589,50 +15445,50 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_24(); + (static_cast(context))->OnSuccessResponse_32(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_24(error); + (static_cast(context))->OnFailureResponse_32(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_24(CHIP_ERROR error) + void OnFailureResponse_32(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_24() { NextTest(); } + void OnSuccessResponse_32() { NextTest(); } - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_25() + CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_33() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); + this, OnSuccessCallback_33, OnFailureCallback_33)); return CHIP_NO_ERROR; } - void OnFailureResponse_25(CHIP_ERROR error) + void OnFailureResponse_33(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_25(uint8_t colorLoopDirection) + void OnSuccessResponse_33(uint8_t colorLoopDirection) { VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 0)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_26() + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_34() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14647,50 +15503,99 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_26(); + (static_cast(context))->OnSuccessResponse_34(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_26(error); + (static_cast(context))->OnFailureResponse_34(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_26(CHIP_ERROR error) + void OnFailureResponse_34(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_26() { NextTest(); } + void OnSuccessResponse_34() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_27() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_35() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_27, OnFailureCallback_27)); + this, OnSuccessCallback_35, OnFailureCallback_35)); return CHIP_NO_ERROR; } - void OnFailureResponse_27(CHIP_ERROR error) + void OnFailureResponse_35(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_27(uint8_t colorLoopActive) + void OnSuccessResponse_35(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_28() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_36() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_36, OnFailureCallback_36)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_36(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_36(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue3 = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_37() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_37, OnFailureCallback_37)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_37(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_37(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue3)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_38() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14705,50 +15610,99 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_28(); + (static_cast(context))->OnSuccessResponse_38(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_28(error); + (static_cast(context))->OnFailureResponse_38(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_28(CHIP_ERROR error) + void OnFailureResponse_38(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_28() { NextTest(); } + void OnSuccessResponse_38() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_29() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_39() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_29, OnFailureCallback_29)); + this, OnSuccessCallback_39, OnFailureCallback_39)); return CHIP_NO_ERROR; } - void OnFailureResponse_29(CHIP_ERROR error) + void OnFailureResponse_39(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_29(uint8_t colorLoopActive) + void OnSuccessResponse_39(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_30() + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_40() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_40, OnFailureCallback_40)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_40(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_40(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHueValue3 = colorLoopStoredEnhancedHue; + NextTest(); + } + + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_41() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_41(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_41(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHueValue3)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_42() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -14763,57 +15717,164 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_30(); + (static_cast(context))->OnSuccessResponse_42(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_30(error); + (static_cast(context))->OnFailureResponse_42(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_30(CHIP_ERROR error) + void OnFailureResponse_42(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_30() { NextTest(); } + void OnSuccessResponse_42() { NextTest(); } - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_31() + CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_43() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); + this, OnSuccessCallback_43, OnFailureCallback_43)); return CHIP_NO_ERROR; } - void OnFailureResponse_31(CHIP_ERROR error) + void OnFailureResponse_43(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_43(uint8_t colorLoopDirection) + { + VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); + + NextTest(); + } + + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_44() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; + + RequestType request; + request.updateFlags = static_cast>(1); + request.action = static_cast(2); + request.direction = static_cast(0); + request.time = 0U; + request.startHue = 0U; + request.optionsMask = 0; + request.optionsOverride = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_44(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_44(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_44(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_44() { NextTest(); } + + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_45() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_45, OnFailureCallback_45)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_45(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_45(uint8_t colorLoopActive) + { + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + + NextTest(); + } + + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_46() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_46(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_46(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue4 = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_47() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_47, OnFailureCallback_47)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_47(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_31(uint8_t colorLoopDirection) + void OnSuccessResponse_47(uint16_t colorLoopStoredEnhancedHue) { - VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue4)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_32() + CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_48() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; RequestType request; request.updateFlags = static_cast>(1); - request.action = static_cast(2); + request.action = static_cast(0); request.direction = static_cast(0); request.time = 0U; request.startHue = 0U; @@ -14821,108 +15882,99 @@ class Test_TC_CC_9_1 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_32(); + (static_cast(context))->OnSuccessResponse_48(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_32(error); + (static_cast(context))->OnFailureResponse_48(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_32(CHIP_ERROR error) + void OnFailureResponse_48(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_32() { NextTest(); } + void OnSuccessResponse_48() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_33() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_49() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); + this, OnSuccessCallback_49, OnFailureCallback_49)); return CHIP_NO_ERROR; } - void OnFailureResponse_33(CHIP_ERROR error) + void OnFailureResponse_49(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_33(uint8_t colorLoopActive) + void OnSuccessResponse_49(uint8_t colorLoopActive) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 1)); + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestSendsColorLoopSetCommandSetAllAttributes_34() + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_50() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; - - RequestType request; - request.updateFlags = static_cast>(1); - request.action = static_cast(0); - request.direction = static_cast(0); - request.time = 0U; - request.startHue = 0U; - request.optionsMask = 0; - request.optionsOverride = 0; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_34(); - }; - - auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_34(error); - }; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_50, OnFailureCallback_50)); return CHIP_NO_ERROR; } - void OnFailureResponse_34(CHIP_ERROR error) + void OnFailureResponse_50(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_34() { NextTest(); } + void OnSuccessResponse_50(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHue4 = colorLoopStoredEnhancedHue; + NextTest(); + } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_35() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_51() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_51, OnFailureCallback_51)); return CHIP_NO_ERROR; } - void OnFailureResponse_35(CHIP_ERROR error) + void OnFailureResponse_51(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_35(uint8_t colorLoopActive) + void OnSuccessResponse_51(uint16_t enhancedCurrentHue) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHue4)); NextTest(); } - CHIP_ERROR TestTurnOffLightForColorControlTests_36() + CHIP_ERROR TestTurnOffLightForColorControlTests_52() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -14930,24 +15982,48 @@ class Test_TC_CC_9_1 : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_36(); + (static_cast(context))->OnSuccessResponse_52(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_36(error); + (static_cast(context))->OnFailureResponse_52(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_36(CHIP_ERROR error) + void OnFailureResponse_52(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_36() { NextTest(); } + void OnSuccessResponse_52() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_53() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_53, OnFailureCallback_53)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_53(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_53(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + + NextTest(); + } }; class Test_TC_CC_9_2 : public TestCommand @@ -15062,22 +16138,22 @@ class Test_TC_CC_9_2 : public TestCommand err = TestReadColorLoopActiveAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 10 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestColorLoopSetCommandStartColorLoop_10(); + err = TestReadEnhancedCurrentHueAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopDirection attribute from DUT.\n"); - if (ShouldSkip("A_COLORLOOPDIRECTION")) + ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestReadColorLoopDirectionAttributeFromDut_11(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); @@ -15089,17 +16165,57 @@ class Test_TC_CC_9_2 : public TestCommand err = TestColorLoopSetCommandStartColorLoop_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopDirection attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPDIRECTION")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_13(); + err = TestReadColorLoopDirectionAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Color Loop Set Command - Start Color Loop\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Turn off light for color control tests\n"); + err = TestTurnOffLightForColorControlTests_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); break; } @@ -15112,11 +16228,14 @@ class Test_TC_CC_9_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + const uint16_t mTestCount = 20; chip::Optional mCluster; chip::Optional mEndpoint; + uint16_t EnhancedCurrentHueValue; + uint16_t ColorLoopStoredEnhancedHueValue; + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -15177,14 +16296,24 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnSuccessResponse_9(colorLoopActive); } + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_10(enhancedCurrentHue); + } + static void OnFailureCallback_11(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_11(error); } - static void OnSuccessCallback_11(void * context, uint8_t colorLoopDirection) + static void OnSuccessCallback_11(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_11(colorLoopDirection); + (static_cast(context))->OnSuccessResponse_11(colorLoopStoredEnhancedHue); } static void OnFailureCallback_13(void * context, CHIP_ERROR error) @@ -15192,9 +16321,49 @@ class Test_TC_CC_9_2 : public TestCommand (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_13(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_13(void * context, uint8_t colorLoopDirection) + { + (static_cast(context))->OnSuccessResponse_13(colorLoopDirection); + } + + static void OnFailureCallback_15(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_15(error); + } + + static void OnSuccessCallback_15(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_15(colorLoopActive); + } + + static void OnFailureCallback_16(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_16(error); + } + + static void OnSuccessCallback_16(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_16(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_17(enhancedCurrentHue); + } + + static void OnFailureCallback_19(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_19(error); + } + + static void OnSuccessCallback_19(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_13(colorLoopActive); + (static_cast(context))->OnSuccessResponse_19(onOff); } // @@ -15447,7 +16616,56 @@ class Test_TC_CC_9_2 : public TestCommand NextTest(); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_10() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue)); + + NextTest(); + } + + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -15462,50 +16680,50 @@ class Test_TC_CC_9_2 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(); + (static_cast(context))->OnSuccessResponse_12(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_10(error); + (static_cast(context))->OnFailureResponse_12(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_12() { NextTest(); } - CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_11() + CHIP_ERROR TestReadColorLoopDirectionAttributeFromDut_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); + this, OnSuccessCallback_13, OnFailureCallback_13)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t colorLoopDirection) + void OnSuccessResponse_13(uint8_t colorLoopDirection) { VerifyOrReturn(CheckValue("colorLoopDirection", colorLoopDirection, 1)); NextTest(); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -15520,50 +16738,99 @@ class Test_TC_CC_9_2 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); + (static_cast(context))->OnSuccessResponse_14(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_14(error); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14() { NextTest(); } + + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_15, OnFailureCallback_15)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_15(uint8_t colorLoopActive) + { + VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_16(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12() { NextTest(); } + void OnSuccessResponse_16(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHueValue = colorLoopStoredEnhancedHue; + NextTest(); + } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_13() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_17() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_17(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t colorLoopActive) + void OnSuccessResponse_17(uint16_t enhancedCurrentHue) { - VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHueValue)); NextTest(); } - CHIP_ERROR TestTurnOffLightForColorControlTests_14() + CHIP_ERROR TestTurnOffLightForColorControlTests_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -15571,24 +16838,48 @@ class Test_TC_CC_9_2 : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(); + (static_cast(context))->OnSuccessResponse_18(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_18(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_18() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_19, OnFailureCallback_19)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_19(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_19(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + + NextTest(); + } }; class Test_TC_CC_9_3 : public TestCommand @@ -15703,22 +16994,22 @@ class Test_TC_CC_9_3 : public TestCommand err = TestReadColorLoopActiveAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Start Color Loop\n"); - if (ShouldSkip("CR_COLORLOOPSET")) + ChipLogProgress(chipTool, " ***** Test Step 10 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) { NextTest(); return; } - err = TestColorLoopSetCommandStartColorLoop_10(); + err = TestReadEnhancedCurrentHueAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopTime attribute from DUT.\n"); - if (ShouldSkip("A_COLORLOOPTIME")) + ChipLogProgress(chipTool, " ***** Test Step 11 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) { NextTest(); return; } - err = TestReadColorLoopTimeAttributeFromDut_11(); + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Color Loop Set Command - Start Color Loop\n"); @@ -15730,17 +17021,57 @@ class Test_TC_CC_9_3 : public TestCommand err = TestColorLoopSetCommandStartColorLoop_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopActive attribute from DUT\n"); - if (ShouldSkip("A_COLORLOOPACTIVE")) + ChipLogProgress(chipTool, " ***** Test Step 13 : Read ColorLoopTime attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPTIME")) { NextTest(); return; } - err = TestReadColorLoopActiveAttributeFromDut_13(); + err = TestReadColorLoopTimeAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Turn off light for color control tests\n"); - err = TestTurnOffLightForColorControlTests_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Color Loop Set Command - Start Color Loop\n"); + if (ShouldSkip("CR_COLORLOOPSET")) + { + NextTest(); + return; + } + err = TestColorLoopSetCommandStartColorLoop_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("A_COLORLOOPACTIVE")) + { + NextTest(); + return; + } + err = TestReadColorLoopActiveAttributeFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Read ColorLoopStoredEnhancedHue attribute from DUT.\n"); + if (ShouldSkip("A_COLORLOOPSTOREDENHANCEDHUE")) + { + NextTest(); + return; + } + err = TestReadColorLoopStoredEnhancedHueAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read EnhancedCurrentHue attribute from DUT.\n"); + if (ShouldSkip("A_ENHANCEDCURRENTHUE")) + { + NextTest(); + return; + } + err = TestReadEnhancedCurrentHueAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Turn off light for color control tests\n"); + err = TestTurnOffLightForColorControlTests_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); break; } @@ -15753,11 +17084,14 @@ class Test_TC_CC_9_3 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 15; + const uint16_t mTestCount = 20; chip::Optional mCluster; chip::Optional mEndpoint; + uint16_t EnhancedCurrentHueValue; + uint16_t ColorLoopStoredEnhancedHueValue; + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -15818,14 +17152,24 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnSuccessResponse_9(colorLoopActive); } + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_10(enhancedCurrentHue); + } + static void OnFailureCallback_11(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_11(error); } - static void OnSuccessCallback_11(void * context, uint16_t colorLoopTime) + static void OnSuccessCallback_11(void * context, uint16_t colorLoopStoredEnhancedHue) { - (static_cast(context))->OnSuccessResponse_11(colorLoopTime); + (static_cast(context))->OnSuccessResponse_11(colorLoopStoredEnhancedHue); } static void OnFailureCallback_13(void * context, CHIP_ERROR error) @@ -15833,9 +17177,49 @@ class Test_TC_CC_9_3 : public TestCommand (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_13(void * context, uint8_t colorLoopActive) + static void OnSuccessCallback_13(void * context, uint16_t colorLoopTime) + { + (static_cast(context))->OnSuccessResponse_13(colorLoopTime); + } + + static void OnFailureCallback_15(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_15(error); + } + + static void OnSuccessCallback_15(void * context, uint8_t colorLoopActive) + { + (static_cast(context))->OnSuccessResponse_15(colorLoopActive); + } + + static void OnFailureCallback_16(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_16(error); + } + + static void OnSuccessCallback_16(void * context, uint16_t colorLoopStoredEnhancedHue) + { + (static_cast(context))->OnSuccessResponse_16(colorLoopStoredEnhancedHue); + } + + static void OnFailureCallback_17(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_17(error); + } + + static void OnSuccessCallback_17(void * context, uint16_t enhancedCurrentHue) + { + (static_cast(context))->OnSuccessResponse_17(enhancedCurrentHue); + } + + static void OnFailureCallback_19(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_19(error); + } + + static void OnSuccessCallback_19(void * context, bool onOff) { - (static_cast(context))->OnSuccessResponse_13(colorLoopActive); + (static_cast(context))->OnSuccessResponse_19(onOff); } // @@ -16088,7 +17472,56 @@ class Test_TC_CC_9_3 : public TestCommand NextTest(); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_10() + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + EnhancedCurrentHueValue = enhancedCurrentHue; + NextTest(); + } + + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", colorLoopStoredEnhancedHue, EnhancedCurrentHueValue)); + + NextTest(); + } + + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -16103,50 +17536,50 @@ class Test_TC_CC_9_3 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(); + (static_cast(context))->OnSuccessResponse_12(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_10(error); + (static_cast(context))->OnFailureResponse_12(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_10(CHIP_ERROR error) + void OnFailureResponse_12(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_10() { NextTest(); } + void OnSuccessResponse_12() { NextTest(); } - CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_11() + CHIP_ERROR TestReadColorLoopTimeAttributeFromDut_13() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); + this, OnSuccessCallback_13, OnFailureCallback_13)); return CHIP_NO_ERROR; } - void OnFailureResponse_11(CHIP_ERROR error) + void OnFailureResponse_13(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_11(uint16_t colorLoopTime) + void OnSuccessResponse_13(uint16_t colorLoopTime) { VerifyOrReturn(CheckValue("colorLoopTime", colorLoopTime, 60U)); NextTest(); } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_12() + CHIP_ERROR TestColorLoopSetCommandStartColorLoop_14() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -16161,50 +17594,99 @@ class Test_TC_CC_9_3 : public TestCommand request.optionsOverride = 0; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(); + (static_cast(context))->OnSuccessResponse_14(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_12(error); + (static_cast(context))->OnFailureResponse_14(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_12(CHIP_ERROR error) + void OnFailureResponse_14(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_12() { NextTest(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_13() + CHIP_ERROR TestReadColorLoopActiveAttributeFromDut_15() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::ColorControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); + this, OnSuccessCallback_15, OnFailureCallback_15)); return CHIP_NO_ERROR; } - void OnFailureResponse_13(CHIP_ERROR error) + void OnFailureResponse_15(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t colorLoopActive) + void OnSuccessResponse_15(uint8_t colorLoopActive) { VerifyOrReturn(CheckValue("colorLoopActive", colorLoopActive, 0)); NextTest(); } - CHIP_ERROR TestTurnOffLightForColorControlTests_14() + CHIP_ERROR TestReadColorLoopStoredEnhancedHueAttributeFromDut_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_16(uint16_t colorLoopStoredEnhancedHue) + { + VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); + ColorLoopStoredEnhancedHueValue = colorLoopStoredEnhancedHue; + NextTest(); + } + + CHIP_ERROR TestReadEnhancedCurrentHueAttributeFromDut_17() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ColorControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_17, OnFailureCallback_17)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_17(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_17(uint16_t enhancedCurrentHue) + { + VerifyOrReturn(CheckValue("enhancedCurrentHue", enhancedCurrentHue, ColorLoopStoredEnhancedHueValue)); + + NextTest(); + } + + CHIP_ERROR TestTurnOffLightForColorControlTests_18() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; using RequestType = chip::app::Clusters::OnOff::Commands::Off::Type; @@ -16212,24 +17694,48 @@ class Test_TC_CC_9_3 : public TestCommand RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(); + (static_cast(context))->OnSuccessResponse_18(); }; auto failure = [](void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_14(error); + (static_cast(context))->OnFailureResponse_18(error); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_14(CHIP_ERROR error) + void OnFailureResponse_18(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_14() { NextTest(); } + void OnSuccessResponse_18() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_19, OnFailureCallback_19)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_19(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_19(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + + NextTest(); + } }; class Test_TC_DM_1_1 : public TestCommand From 88032ed67f98e7ce1100a4421e250724d4f5e253 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 7 Feb 2022 22:22:11 -0500 Subject: [PATCH 08/30] Add README that describes the libfuzzer integration. (#14856) --- .github/.wordlist.txt | 9 ++++ examples/all-clusters-app/linux/README.md | 58 +++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 examples/all-clusters-app/linux/README.md diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 707a0fd79c1252..7be07374114354 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -64,6 +64,7 @@ argv armeabi ARMmbed armv +ASAN asdk AssertionError ASYNC @@ -143,6 +144,7 @@ capacitive CatalogVendorId CBB cbd +ccf CCMP CCS CCSTUDIO @@ -302,6 +304,7 @@ DevKitC DevKitM df dfu +DgDxsfHx dhclient DHCP DHCPC @@ -413,6 +416,7 @@ ffeebaefa FFF fffe fffff +fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA Fi filepath fini @@ -429,6 +433,7 @@ fstab fsync ftd fullclean +fuzzer gbl gcloud GDB @@ -571,6 +576,7 @@ libdbus LIBDIR libegl libffi +libfuzzer libgirepository libglib libical @@ -1134,7 +1140,9 @@ WSTK xa xab xaver +xb xbef +xc xcd Xcode xcodeproj @@ -1143,6 +1151,7 @@ xd xdeadbeefcafe xds xdsdfu +xed xef xF xFFFF diff --git a/examples/all-clusters-app/linux/README.md b/examples/all-clusters-app/linux/README.md new file mode 100644 index 00000000000000..c7e72959cbc11b --- /dev/null +++ b/examples/all-clusters-app/linux/README.md @@ -0,0 +1,58 @@ +# Matter Linux/Mac All Clusters Example + +## Fuzzing integration + +This example supports compilation with libfuzzer enabled. + +### Compiling with fuzzing enabled + +To compile with libfuzzer enabled on Mac, run: + + $ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target darwin-x64-all-clusters-no-ble-asan-libfuzzer build" + +at the top level of the Matter tree. + +Similarly, to compile on Linux run: + + $ ./scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-x64-all-clusters-no-ble-asan-libfuzzer build" + +### Running libfuzzer-enabled binaries + +#### Initial run + +To run the resulting binary with no particular inputs do: + + $ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer/chip-all-clusters-app-fuzzing + +or + + $ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer/chip-all-clusters-app-fuzzing + +If this crashes, it will output the input that caused the crash in a variety of +formats, looking something like this: + + 0xe,0x0,0xf1,0xb1,0xf1,0xf1,0xf1,0xf1,0xed,0x73,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc1,0x0,0x0,0x0,0x0,0x0,0x5c,0xf3,0x25,0x0,0x0,0x0,0x0,0x0, + \016\000\361\261\361\361\361\361\355s\007\000\000\000\000\000\000\000\301\000\000\000\000\000\\\363%\000\000\000\000\000 + artifact_prefix='./'; Test unit written to ./crash-c9fd2434ccf4a33a7f49765dcc519e1fd529a8e5 + Base64: DgDxsfHx8fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA= + +Note that this creates a file holding the input that caused the crash. + +#### Run with a fixed input + +To run the binary with a specific input, place the input bytes in a file (which +a crashing run of the fuzzer does automatically). If `$(INPUT_FILE)` is the name +of that file, then run: + + $ ./out/darwin-x64-all-clusters-no-ble-asan-libfuzzer/chip-all-clusters-app-fuzzing $(INPUT_FILE) + +or + + $ ./out/linux-x64-all-clusters-no-ble-asan-libfuzzer/chip-all-clusters-app-fuzzing $(INPUT_FILE) + +#### Additional execution options. + +The binary can be run with `-help=1` to see more available options. + +Running with `ASAN_OPTIONS="handle_abort=2"` set in the environment may produce +nicer stack traces. From c729dc255ff5cb1769213d1eefaf6e277820d4c8 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 7 Feb 2022 22:24:23 -0500 Subject: [PATCH 09/30] Update openjdk version: apparently alpine has a new openjdk and old version is not usable anymore (#14842) Co-authored-by: Andrei Litvin --- integrations/docker/images/chip-build-zap/Dockerfile | 2 +- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/chip-build-zap/Dockerfile b/integrations/docker/images/chip-build-zap/Dockerfile index 2c18beb2456d93..da43b6e7b3f2e3 100644 --- a/integrations/docker/images/chip-build-zap/Dockerfile +++ b/integrations/docker/images/chip-build-zap/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.14 RUN apk add --no-cache \ nodejs=14.18.1-r0 \ - openjdk11=11.0.12_p7-r0 \ + openjdk11=11.0.14_p9-r0 \ npm=7.17.0-r0 \ python3=3.9.5-r2 \ pixman-dev=0.40.0-r2 \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index a1297447e0cb18..648c32a5b7979d 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.53 Version bump reason: Update ESP-IDF to v4.4 release +0.5.54 Version bump reason: Openjdk version update for zap image From 1c1eca43fc09cb7fd792657d793e146b0fcb3241 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Mon, 7 Feb 2022 19:34:45 -0800 Subject: [PATCH 10/30] Updating zap --- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 126 +++++++++++ .../CHIPCallbackBridge_internal.h | 122 ++++++++++ .../CHIP/zap-generated/CHIPClustersObjc.h | 41 ++++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 212 ++++++++++++++++++ .../Framework/CHIPTests/CHIPClustersTests.m | 202 +++++++++++++++++ 5 files changed, 703 insertions(+) diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index d162110349ae6f..4118b10e1cee20 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -1453,6 +1453,39 @@ } } +void CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value) +{ + CHIPApplicationLauncherClusterApplicationEP * _Nonnull objCValue; + objCValue = [CHIPApplicationLauncherClusterApplicationEP new]; + objCValue.application = [CHIPApplicationLauncherClusterApplication new]; + objCValue.application.catalogVendorId = [NSNumber numberWithUnsignedShort:value.application.catalogVendorId]; + objCValue.application.applicationId = [[NSString alloc] initWithBytes:value.application.applicationId.data() + length:value.application.applicationId.size() + encoding:NSUTF8StringEncoding]; + objCValue.endpoint = [[NSString alloc] initWithBytes:value.endpoint.data() + length:value.endpoint.size() + encoding:NSUTF8StringEncoding]; + DispatchSuccess(context, objCValue); +}; + +void CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackSubscriptionBridge::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 CHIPApplicationLauncherServerGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -2714,6 +2747,73 @@ } } +void CHIPChannelChannelLineupStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value) +{ + CHIPChannelClusterLineupInfo * _Nonnull objCValue; + objCValue = [CHIPChannelClusterLineupInfo new]; + objCValue.operatorName = [[NSString alloc] initWithBytes:value.operatorName.data() + length:value.operatorName.size() + encoding:NSUTF8StringEncoding]; + objCValue.lineupName = [[NSString alloc] initWithBytes:value.lineupName.data() + length:value.lineupName.size() + encoding:NSUTF8StringEncoding]; + objCValue.postalCode = [[NSString alloc] initWithBytes:value.postalCode.data() + length:value.postalCode.size() + encoding:NSUTF8StringEncoding]; + objCValue.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.lineupInfoType)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPChannelChannelLineupStructAttributeCallbackSubscriptionBridge::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 CHIPChannelCurrentChannelStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & value) +{ + CHIPChannelClusterChannelInfo * _Nonnull objCValue; + objCValue = [CHIPChannelClusterChannelInfo new]; + objCValue.majorNumber = [NSNumber numberWithUnsignedShort:value.majorNumber]; + objCValue.minorNumber = [NSNumber numberWithUnsignedShort:value.minorNumber]; + objCValue.name = [[NSString alloc] initWithBytes:value.name.data() length:value.name.size() encoding:NSUTF8StringEncoding]; + objCValue.callSign = [[NSString alloc] initWithBytes:value.callSign.data() + length:value.callSign.size() + encoding:NSUTF8StringEncoding]; + objCValue.affiliateCallSign = [[NSString alloc] initWithBytes:value.affiliateCallSign.data() + length:value.affiliateCallSign.size() + encoding:NSUTF8StringEncoding]; + DispatchSuccess(context, objCValue); +}; + +void CHIPChannelCurrentChannelStructAttributeCallbackSubscriptionBridge::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 CHIPChannelServerGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -5781,6 +5881,32 @@ } } +void CHIPMediaPlaybackPositionStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value) +{ + CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull objCValue; + objCValue = [CHIPMediaPlaybackClusterPlaybackPosition new]; + objCValue.updatedAt = [NSNumber numberWithUnsignedLongLong:value.updatedAt]; + objCValue.position = [NSNumber numberWithUnsignedLongLong:value.position]; + DispatchSuccess(context, objCValue); +}; + +void CHIPMediaPlaybackPositionStructAttributeCallbackSubscriptionBridge::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 CHIPMediaPlaybackServerGeneratedCommandListListAttributeCallbackBridge::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 e8805677828cbc..d3e4eb4758bb43 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -545,8 +545,16 @@ typedef void (*NullableApplianceEventsAndAlertClusterEventIdentificationAttribut typedef void (*ApplicationBasicApplicationAppStructAttributeCallback)( void *, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType &); +typedef void (*ApplicationLauncherApplicationLauncherAppStructAttributeCallback)( + void *, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType &); +typedef void (*ChannelChannelLineupStructAttributeCallback)( + void *, const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType &); +typedef void (*ChannelCurrentChannelStructAttributeCallback)( + void *, const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType &); typedef void (*GeneralCommissioningBasicCommissioningInfoStructAttributeCallback)( void *, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType &); +typedef void (*MediaPlaybackPositionStructAttributeCallback)( + void *, const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType &); typedef void (*TestClusterStructAttrStructAttributeCallback)( void *, const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType &); typedef void (*TestClusterNullableStructStructAttributeCallback)( @@ -1770,6 +1778,36 @@ class CHIPApplicationLauncherApplicationLauncherListListAttributeCallbackSubscri SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge(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::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value); +}; + +class CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackSubscriptionBridge + : public CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge +{ +public: + CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPApplicationLauncherServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -2658,6 +2696,61 @@ class CHIPChannelChannelListListAttributeCallbackSubscriptionBridge : public CHI SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPChannelChannelLineupStructAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPChannelChannelLineupStructAttributeCallbackBridge(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::Clusters::Channel::Structs::LineupInfo::DecodableType & value); +}; + +class CHIPChannelChannelLineupStructAttributeCallbackSubscriptionBridge + : public CHIPChannelChannelLineupStructAttributeCallbackBridge +{ +public: + CHIPChannelChannelLineupStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelChannelLineupStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPChannelCurrentChannelStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPChannelCurrentChannelStructAttributeCallbackBridge(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::Clusters::Channel::Structs::ChannelInfo::DecodableType & value); +}; + +class CHIPChannelCurrentChannelStructAttributeCallbackSubscriptionBridge + : public CHIPChannelCurrentChannelStructAttributeCallbackBridge +{ +public: + CHIPChannelCurrentChannelStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelCurrentChannelStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPChannelServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -4868,6 +4961,35 @@ class CHIPMediaInputAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPMediaPlaybackPositionStructAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPMediaPlaybackPositionStructAttributeCallbackBridge(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::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value); +}; + +class CHIPMediaPlaybackPositionStructAttributeCallbackSubscriptionBridge + : public CHIPMediaPlaybackPositionStructAttributeCallbackBridge +{ +public: + CHIPMediaPlaybackPositionStructAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPMediaPlaybackPositionStructAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPMediaPlaybackServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index ec04507377ef8f..008ab30d57bf17 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -339,6 +339,17 @@ NS_ASSUME_NONNULL_BEGIN reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeApplicationLauncherAppWithCompletionHandler: + (void (^)(CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeApplicationLauncherAppWithValue:(CHIPApplicationLauncherClusterApplicationEP * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void) + subscribeAttributeApplicationLauncherAppWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPApplicationLauncherClusterApplicationEP * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeServerGeneratedCommandListWithMinInterval:(uint16_t)minInterval @@ -1128,6 +1139,26 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeChannelLineupWithCompletionHandler:(void (^)(CHIPChannelClusterLineupInfo * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeChannelLineupWithValue:(CHIPChannelClusterLineupInfo * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeChannelLineupWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPChannelClusterLineupInfo * _Nullable value, + NSError * _Nullable error))reportHandler; + +- (void)readAttributeCurrentChannelWithCompletionHandler:(void (^)(CHIPChannelClusterChannelInfo * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeCurrentChannelWithValue:(CHIPChannelClusterChannelInfo * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeCurrentChannelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPChannelClusterChannelInfo * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeServerGeneratedCommandListWithMinInterval:(uint16_t)minInterval @@ -3394,6 +3425,16 @@ NS_ASSUME_NONNULL_BEGIN subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributePositionWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributePositionWithValue:(CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributePositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, + NSError * _Nullable error))reportHandler; + - (void)readAttributePlaybackSpeedWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributePlaybackSpeedWithMinInterval:(uint16_t)minInterval diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 679e9462293c07..5a94e913a00948 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -1308,6 +1308,59 @@ new CHIPApplicationLauncherApplicationLauncherListListAttributeCallbackSubscript subscriptionEstablishedHandler); } +- (void)readAttributeApplicationLauncherAppWithCompletionHandler: + (void (^)(CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationLauncher::Attributes::ApplicationLauncherApp::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeApplicationLauncherAppWithValue:(CHIPApplicationLauncherClusterApplicationEP * _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 = ApplicationLauncher::Attributes::ApplicationLauncherApp::TypeInfo; + TypeInfo::Type cppValue; + cppValue.application.catalogVendorId = value.application.catalogVendorId.unsignedShortValue; + cppValue.application.applicationId = [self asCharSpan:value.application.applicationId]; + cppValue.endpoint = [self asCharSpan:value.endpoint]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void) + subscribeAttributeApplicationLauncherAppWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPApplicationLauncherClusterApplicationEP * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationLauncher::Attributes::ApplicationLauncherApp::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPApplicationLauncherApplicationLauncherAppStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -4406,6 +4459,114 @@ new CHIPChannelChannelListListAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeChannelLineupWithCompletionHandler:(void (^)(CHIPChannelClusterLineupInfo * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPChannelChannelLineupStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ChannelLineup::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeChannelLineupWithValue:(CHIPChannelClusterLineupInfo * _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 = Channel::Attributes::ChannelLineup::TypeInfo; + TypeInfo::Type cppValue; + cppValue.operatorName = [self asCharSpan:value.operatorName]; + cppValue.lineupName = [self asCharSpan:value.lineupName]; + cppValue.postalCode = [self asCharSpan:value.postalCode]; + cppValue.lineupInfoType + = static_cast>(value.lineupInfoType.unsignedCharValue); + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeChannelLineupWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPChannelClusterLineupInfo * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPChannelChannelLineupStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ChannelLineup::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPChannelChannelLineupStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +- (void)readAttributeCurrentChannelWithCompletionHandler:(void (^)(CHIPChannelClusterChannelInfo * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPChannelCurrentChannelStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::CurrentChannel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeCurrentChannelWithValue:(CHIPChannelClusterChannelInfo * _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 = Channel::Attributes::CurrentChannel::TypeInfo; + TypeInfo::Type cppValue; + cppValue.majorNumber = value.majorNumber.unsignedShortValue; + cppValue.minorNumber = value.minorNumber.unsignedShortValue; + cppValue.name = [self asCharSpan:value.name]; + cppValue.callSign = [self asCharSpan:value.callSign]; + cppValue.affiliateCallSign = [self asCharSpan:value.affiliateCallSign]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeCurrentChannelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPChannelClusterChannelInfo * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPChannelCurrentChannelStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::CurrentChannel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPChannelCurrentChannelStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -13922,6 +14083,57 @@ new CHIPInt64uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributePositionWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPMediaPlaybackPositionStructAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = MediaPlayback::Attributes::Position::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributePositionWithValue:(CHIPMediaPlaybackClusterPlaybackPosition * _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 = MediaPlayback::Attributes::Position::TypeInfo; + TypeInfo::Type cppValue; + cppValue.updatedAt = value.updatedAt.unsignedLongLongValue; + cppValue.position = value.position.unsignedLongLongValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPMediaPlaybackPositionStructAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = MediaPlayback::Attributes::Position::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPMediaPlaybackPositionStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributePlaybackSpeedWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 55c239066c218f..71116af4a37eb9 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -44170,6 +44170,58 @@ - (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherListWi [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler"]; + + [cluster readAttributeApplicationLauncherAppWithCompletionHandler:^( + CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { + NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterApplicationLauncherWriteAttributeApplicationLauncherAppWithValue +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationLauncherWriteAttributeApplicationLauncherAppWithValue"]; + + CHIPApplicationLauncherClusterApplicationEP * _Nonnull value = [[CHIPApplicationLauncherClusterApplicationEP alloc] init]; + [cluster writeAttributeApplicationLauncherAppWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterApplicationLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -45740,6 +45792,106 @@ - (void)testSendClusterChannelReadAttributeChannelListWithCompletionHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterChannelReadAttributeChannelLineupWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelLineupWithCompletionHandler"]; + + [cluster + readAttributeChannelLineupWithCompletionHandler:^(CHIPChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Channel ChannelLineup Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterChannelWriteAttributeChannelLineupWithValue +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeChannelLineupWithValue"]; + + CHIPChannelClusterLineupInfo * _Nonnull value = [[CHIPChannelClusterLineupInfo alloc] init]; + [cluster writeAttributeChannelLineupWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Channel ChannelLineup Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterChannelReadAttributeCurrentChannelWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeCurrentChannelWithCompletionHandler"]; + + [cluster readAttributeCurrentChannelWithCompletionHandler:^( + CHIPChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { + NSLog(@"Channel CurrentChannel Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterChannelWriteAttributeCurrentChannelWithValue +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeCurrentChannelWithValue"]; + + CHIPChannelClusterChannelInfo * _Nonnull value = [[CHIPChannelClusterChannelInfo alloc] init]; + [cluster writeAttributeCurrentChannelWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Channel CurrentChannel Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterChannelReadAttributeServerGeneratedCommandListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -52356,6 +52508,56 @@ - (void)testSendClusterMediaPlaybackReadAttributeDurationWithCompletionHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterMediaPlaybackReadAttributePositionWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributePositionWithCompletionHandler"]; + + [cluster readAttributePositionWithCompletionHandler:^( + CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { + NSLog(@"MediaPlayback Position Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterMediaPlaybackWriteAttributePositionWithValue +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackWriteAttributePositionWithValue"]; + + CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull value = [[CHIPMediaPlaybackClusterPlaybackPosition alloc] init]; + [cluster writeAttributePositionWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"MediaPlayback Position Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterMediaPlaybackReadAttributePlaybackSpeedWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); From 127cebba9049d438ee34bbcd15213eb4f4550a4e Mon Sep 17 00:00:00 2001 From: Yuanyao Zhong <82843247+yyzhong-g@users.noreply.github.com> Date: Mon, 7 Feb 2022 23:17:24 -0500 Subject: [PATCH 11/30] [third_party] Add third_party/perfetto (#14793) --- .gitmodules | 3 +++ third_party/perfetto/repo | 1 + 2 files changed, 4 insertions(+) create mode 160000 third_party/perfetto/repo diff --git a/.gitmodules b/.gitmodules index 477eb44fbd22d3..0e2b2f6a4602d6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -184,3 +184,6 @@ [submodule "third_party/mbed-mcu-boot/repo"] path = third_party/mbed-mcu-boot/repo url = https://github.com/ATmobica/mcuboot.git +[submodule "perfetto"] + path = third_party/perfetto/repo + url = https://github.com/google/perfetto diff --git a/third_party/perfetto/repo b/third_party/perfetto/repo new file mode 160000 index 00000000000000..57b59d6e2effdc --- /dev/null +++ b/third_party/perfetto/repo @@ -0,0 +1 @@ +Subproject commit 57b59d6e2effdc5d3b9dc8da68fa519d9d37f2e0 From 1bbbc3548db3f02c766075c83dabb5863d5ecf29 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Mon, 7 Feb 2022 20:17:34 -0800 Subject: [PATCH 12/30] Add support for thermostat and humidity sensor (#14803) --- examples/all-clusters-app/esp32/main/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index ef742c53da078c..79c2e590c2f5f6 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -523,6 +523,24 @@ void SetupPretendDevices() AddCluster("Contact Sensor"); AddAttribute("BooleanState", "true"); app::Clusters::BooleanState::Attributes::StateValue::Set(1, true); + + AddDevice("Thermostat"); + AddEndpoint("1"); + AddCluster("Thermostat"); + app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Set(1, static_cast(21 * 100)); + app::Clusters::Thermostat::Attributes::LocalTemperature::Set(1, static_cast(21 * 100)); + AddAttribute("SystemMode", "4"); + app::Clusters::Thermostat::Attributes::SystemMode::Set(1, 4); + AddAttribute("OccupiedCoolingSetpoint", "19"); + app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::Set(1, static_cast(19 * 100)); + AddAttribute("OccupiedHeatingSetpoint", "25"); + app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::Set(1, static_cast(25 * 100)); + + AddDevice("Humidity Sensor"); + AddEndpoint("External"); + AddCluster("Humidity Sensor"); + AddAttribute("MeasuredValue", "30"); + app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(1, static_cast(30 * 100)); } WiFiWidget pairingWindowLED; From 5a0e8497c5aa39bf6c7e876051dccb139fb69788 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 7 Feb 2022 20:18:14 -0800 Subject: [PATCH 13/30] Align Generic Diagnostics cluster with the latest spec (#14824) * Align Generic Diagnostics cluster with the latest spec * Run codegen --- .../all-clusters-app.matter | 4 +- .../bridge-common/bridge-app.matter | 4 +- .../door-lock-common/door-lock-app.matter | 4 +- .../light-switch-app.matter | 4 +- .../lighting-common/lighting-app.matter | 4 +- examples/lock-app/lock-common/lock-app.matter | 4 +- examples/pump-app/pump-common/pump-app.matter | 4 +- .../pump-controller-app.matter | 4 +- .../esp32/main/temperature-measurement.matter | 4 +- .../thermostat-common/thermostat.matter | 4 +- examples/tv-app/tv-common/tv-app.matter | 4 +- .../tv-casting-common/tv-casting-app.matter | 4 +- examples/window-app/common/window-app.matter | 4 +- .../chip/general-diagnostics-cluster.xml | 4 +- .../data_model/controller-clusters.matter | 4 +- .../CHIPAttributeTLVValueDecoder.cpp | 38 +++++++++++++------ .../java/zap-generated/CHIPReadCallbacks.cpp | 38 +++++++++++++------ .../chip/devicecontroller/ChipStructs.java | 8 ++-- .../python/chip/clusters/Objects.py | 8 ++-- .../CHIPAttributeTLVValueDecoder.mm | 14 ++++++- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 14 ++++++- .../CHIP/zap-generated/CHIPStructsObjc.h | 4 +- .../CHIP/zap-generated/CHIPStructsObjc.mm | 4 +- .../zap-generated/CHIPTestClustersObjc.mm | 16 ++++++-- .../Ameba/DiagnosticDataProviderImpl.cpp | 4 +- .../EFR32/DiagnosticDataProviderImpl.cpp | 12 +++--- .../ESP32/DiagnosticDataProviderImpl.cpp | 4 +- .../Linux/DiagnosticDataProviderImpl.cpp | 10 ++--- .../P6/DiagnosticDataProviderImpl.cpp | 12 +++--- .../Zephyr/DiagnosticDataProviderImpl.cpp | 4 +- .../zap-generated/cluster-objects.h | 6 +-- 31 files changed, 156 insertions(+), 100 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 68285788abe004..5a3c79092a4f93 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 @@ -1457,8 +1457,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 13a7f3d7804ad4..fa796b5b1c8cb4 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -389,8 +389,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/door-lock-app/door-lock-common/door-lock-app.matter b/examples/door-lock-app/door-lock-common/door-lock-app.matter index e994c385313be0..7f75ec5fe32551 100644 --- a/examples/door-lock-app/door-lock-common/door-lock-app.matter +++ b/examples/door-lock-app/door-lock-common/door-lock-app.matter @@ -866,8 +866,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } 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 b46e9af6ca9b65..aaf72e6e311630 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 @@ -578,8 +578,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 6e59dd7f6b3c2c..04e15ca871582c 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -583,8 +583,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index fdc976a4a65294..5bd41d87d3402f 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -327,8 +327,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index de2aa63cf68a37..39d005084fda65 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -314,8 +314,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } 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 65a2636078dcf5..9d60e4f10b27c2 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 @@ -334,8 +334,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 785c64339fcfc6..66cba62e42f869 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -327,8 +327,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index ab2b892dfd3ad8..5cd74fd6e15500 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -348,8 +348,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index ff968c9c29bd12..09eb6dc9dca4e4 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -714,8 +714,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } 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 b41a504fa3ea3a..f526dac0c5e079 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 @@ -1380,8 +1380,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 831a7526c5735c..5dfba10b47137f 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -297,8 +297,8 @@ server cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml index 86ca9d621ecbe9..a78b4e76d3669d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml @@ -69,8 +69,8 @@ limitations under the License. - - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a2ad703a8dc429..87ccd1dd5708e1 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1784,8 +1784,8 @@ client cluster GeneralDiagnostics = 51 { struct NetworkInterfaceType { CHAR_STRING<32> name = 0; BOOLEAN fabricConnected = 1; - BOOLEAN offPremiseServicesReachableIPv4 = 2; - BOOLEAN offPremiseServicesReachableIPv6 = 3; + nullable BOOLEAN offPremiseServicesReachableIPv4 = 2; + nullable BOOLEAN offPremiseServicesReachableIPv6 = 3; OCTET_STRING<8> hardwareAddress = 4; InterfaceType type = 5; } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 422b5263df882e..f6dd50da150a25 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -5566,19 +5566,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricConnectedCtorSignature.c_str(), entry_0.fabricConnected, newElement_0_fabricConnected); jobject newElement_0_offPremiseServicesReachableIPv4; - std::string newElement_0_offPremiseServicesReachableIPv4ClassName = "java/lang/Boolean"; - std::string newElement_0_offPremiseServicesReachableIPv4CtorSignature = "(Z)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_offPremiseServicesReachableIPv4ClassName.c_str(), - newElement_0_offPremiseServicesReachableIPv4CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv4, - newElement_0_offPremiseServicesReachableIPv4); + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) + { + newElement_0_offPremiseServicesReachableIPv4 = nullptr; + } + else + { + std::string newElement_0_offPremiseServicesReachableIPv4ClassName = "java/lang/Boolean"; + std::string newElement_0_offPremiseServicesReachableIPv4CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offPremiseServicesReachableIPv4ClassName.c_str(), + newElement_0_offPremiseServicesReachableIPv4CtorSignature.c_str(), + entry_0.offPremiseServicesReachableIPv4.Value(), newElement_0_offPremiseServicesReachableIPv4); + } jobject newElement_0_offPremiseServicesReachableIPv6; - std::string newElement_0_offPremiseServicesReachableIPv6ClassName = "java/lang/Boolean"; - std::string newElement_0_offPremiseServicesReachableIPv6CtorSignature = "(Z)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_offPremiseServicesReachableIPv6ClassName.c_str(), - newElement_0_offPremiseServicesReachableIPv6CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv6, - newElement_0_offPremiseServicesReachableIPv6); + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) + { + newElement_0_offPremiseServicesReachableIPv6 = nullptr; + } + else + { + std::string newElement_0_offPremiseServicesReachableIPv6ClassName = "java/lang/Boolean"; + std::string newElement_0_offPremiseServicesReachableIPv6CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offPremiseServicesReachableIPv6ClassName.c_str(), + newElement_0_offPremiseServicesReachableIPv6CtorSignature.c_str(), + entry_0.offPremiseServicesReachableIPv6.Value(), newElement_0_offPremiseServicesReachableIPv6); + } jobject newElement_0_hardwareAddress; jbyteArray newElement_0_hardwareAddressByteArray = env->NewByteArray(static_cast(entry_0.hardwareAddress.size())); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index a68cee119fb7c0..392223bc06e010 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -7642,19 +7642,33 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( newElement_0_fabricConnectedCtorSignature.c_str(), entry_0.fabricConnected, newElement_0_fabricConnected); jobject newElement_0_offPremiseServicesReachableIPv4; - std::string newElement_0_offPremiseServicesReachableIPv4ClassName = "java/lang/Boolean"; - std::string newElement_0_offPremiseServicesReachableIPv4CtorSignature = "(Z)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_offPremiseServicesReachableIPv4ClassName.c_str(), - newElement_0_offPremiseServicesReachableIPv4CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv4, - newElement_0_offPremiseServicesReachableIPv4); + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) + { + newElement_0_offPremiseServicesReachableIPv4 = nullptr; + } + else + { + std::string newElement_0_offPremiseServicesReachableIPv4ClassName = "java/lang/Boolean"; + std::string newElement_0_offPremiseServicesReachableIPv4CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offPremiseServicesReachableIPv4ClassName.c_str(), + newElement_0_offPremiseServicesReachableIPv4CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv4.Value(), + newElement_0_offPremiseServicesReachableIPv4); + } jobject newElement_0_offPremiseServicesReachableIPv6; - std::string newElement_0_offPremiseServicesReachableIPv6ClassName = "java/lang/Boolean"; - std::string newElement_0_offPremiseServicesReachableIPv6CtorSignature = "(Z)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_offPremiseServicesReachableIPv6ClassName.c_str(), - newElement_0_offPremiseServicesReachableIPv6CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv6, - newElement_0_offPremiseServicesReachableIPv6); + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) + { + newElement_0_offPremiseServicesReachableIPv6 = nullptr; + } + else + { + std::string newElement_0_offPremiseServicesReachableIPv6ClassName = "java/lang/Boolean"; + std::string newElement_0_offPremiseServicesReachableIPv6CtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offPremiseServicesReachableIPv6ClassName.c_str(), + newElement_0_offPremiseServicesReachableIPv6CtorSignature.c_str(), entry_0.offPremiseServicesReachableIPv6.Value(), + newElement_0_offPremiseServicesReachableIPv6); + } jobject newElement_0_hardwareAddress; jbyteArray newElement_0_hardwareAddressByteArray = env->NewByteArray(static_cast(entry_0.hardwareAddress.size())); env->SetByteArrayRegion(newElement_0_hardwareAddressByteArray, 0, static_cast(entry_0.hardwareAddress.size()), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 35a06a2be545ff..abf13f07de0a89 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -668,16 +668,16 @@ public String toString() { public static class GeneralDiagnosticsClusterNetworkInterfaceType { public String name; public Boolean fabricConnected; - public Boolean offPremiseServicesReachableIPv4; - public Boolean offPremiseServicesReachableIPv6; + public @Nullable Boolean offPremiseServicesReachableIPv4; + public @Nullable Boolean offPremiseServicesReachableIPv6; public byte[] hardwareAddress; public Integer type; public GeneralDiagnosticsClusterNetworkInterfaceType( String name, Boolean fabricConnected, - Boolean offPremiseServicesReachableIPv4, - Boolean offPremiseServicesReachableIPv6, + @Nullable Boolean offPremiseServicesReachableIPv4, + @Nullable Boolean offPremiseServicesReachableIPv6, byte[] hardwareAddress, Integer type) { this.name = name; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 747590caaf8f0b..7f6431c23d4c9a 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -10234,16 +10234,16 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="fabricConnected", Tag=1, Type=bool), - ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv4", Tag=2, Type=bool), - ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv6", Tag=3, Type=bool), + ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv4", Tag=2, Type=typing.Union[Nullable, bool]), + ClusterObjectFieldDescriptor(Label="offPremiseServicesReachableIPv6", Tag=3, Type=typing.Union[Nullable, bool]), ClusterObjectFieldDescriptor(Label="hardwareAddress", Tag=4, Type=bytes), ClusterObjectFieldDescriptor(Label="type", Tag=5, Type=GeneralDiagnostics.Enums.InterfaceType), ]) name: 'str' = "" fabricConnected: 'bool' = False - offPremiseServicesReachableIPv4: 'bool' = False - offPremiseServicesReachableIPv6: 'bool' = False + offPremiseServicesReachableIPv4: 'typing.Union[Nullable, bool]' = NullValue + offPremiseServicesReachableIPv6: 'typing.Union[Nullable, bool]' = NullValue hardwareAddress: 'bytes' = b"" type: 'GeneralDiagnostics.Enums.InterfaceType' = 0 diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index d55f7f11ebedc6..4f10709d4d62c1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -4676,8 +4676,18 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader length:entry_0.name.size() encoding:NSUTF8StringEncoding]; newElement_0.fabricConnected = [NSNumber numberWithBool:entry_0.fabricConnected]; - newElement_0.offPremiseServicesReachableIPv4 = [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4]; - newElement_0.offPremiseServicesReachableIPv6 = [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6]; + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { + newElement_0.offPremiseServicesReachableIPv4 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv4 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; + } + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { + newElement_0.offPremiseServicesReachableIPv6 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv6 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; + } newElement_0.hardwareAddress = [NSData dataWithBytes:entry_0.hardwareAddress.data() length:entry_0.hardwareAddress.size()]; newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 4118b10e1cee20..b5c7678e66cc28 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -4394,8 +4394,18 @@ length:entry_0.name.size() encoding:NSUTF8StringEncoding]; newElement_0.fabricConnected = [NSNumber numberWithBool:entry_0.fabricConnected]; - newElement_0.offPremiseServicesReachableIPv4 = [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4]; - newElement_0.offPremiseServicesReachableIPv6 = [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6]; + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { + newElement_0.offPremiseServicesReachableIPv4 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv4 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; + } + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { + newElement_0.offPremiseServicesReachableIPv6 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv6 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; + } newElement_0.hardwareAddress = [NSData dataWithBytes:entry_0.hardwareAddress.data() length:entry_0.hardwareAddress.size()]; newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; [array_0 addObject:newElement_0]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index f5937dbce2cd52..1674178e29b652 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -162,8 +162,8 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPGeneralDiagnosticsClusterNetworkInterfaceType : NSObject @property (strong, nonatomic) NSString * _Nonnull name; @property (strong, nonatomic) NSNumber * _Nonnull fabricConnected; -@property (strong, nonatomic) NSNumber * _Nonnull offPremiseServicesReachableIPv4; -@property (strong, nonatomic) NSNumber * _Nonnull offPremiseServicesReachableIPv6; +@property (strong, nonatomic) NSNumber * _Nullable offPremiseServicesReachableIPv4; +@property (strong, nonatomic) NSNumber * _Nullable offPremiseServicesReachableIPv6; @property (strong, nonatomic) NSData * _Nonnull hardwareAddress; @property (strong, nonatomic) NSNumber * _Nonnull type; - (instancetype)init; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index f92b0921b81b5f..aaf012124262be 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -318,9 +318,9 @@ - (instancetype)init _fabricConnected = @(0); - _offPremiseServicesReachableIPv4 = @(0); + _offPremiseServicesReachableIPv4 = nil; - _offPremiseServicesReachableIPv6 = @(0); + _offPremiseServicesReachableIPv6 = nil; _hardwareAddress = [NSData data]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index a491f1ba624f0f..b77974cb263cc9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -6514,10 +6514,18 @@ new CHIPDefaultSuccessCallbackBridge( auto element_0 = (CHIPGeneralDiagnosticsClusterNetworkInterfaceType *) value[i_0]; listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; listHolder_0->mList[i_0].fabricConnected = element_0.fabricConnected.boolValue; - listHolder_0->mList[i_0].offPremiseServicesReachableIPv4 - = element_0.offPremiseServicesReachableIPv4.boolValue; - listHolder_0->mList[i_0].offPremiseServicesReachableIPv6 - = element_0.offPremiseServicesReachableIPv6.boolValue; + if (element_0.offPremiseServicesReachableIPv4 == nil) { + listHolder_0->mList[i_0].offPremiseServicesReachableIPv4.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].offPremiseServicesReachableIPv4.SetNonNull(); + nonNullValue_2 = element_0.offPremiseServicesReachableIPv4.boolValue; + } + if (element_0.offPremiseServicesReachableIPv6 == nil) { + listHolder_0->mList[i_0].offPremiseServicesReachableIPv6.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].offPremiseServicesReachableIPv6.SetNonNull(); + nonNullValue_2 = element_0.offPremiseServicesReachableIPv6.boolValue; + } listHolder_0->mList[i_0].hardwareAddress = [self asByteSpan:element_0.hardwareAddress]; listHolder_0->mList[i_0].type = static_castmList[i_0].type)>>( diff --git a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp index 397ec04b25085a..9b1f4e68a95101 100644 --- a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp @@ -143,8 +143,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->type = EMBER_ZCL_INTERFACE_TYPE_ETHERNET; else ifp->type = EMBER_ZCL_INTERFACE_TYPE_WI_FI; - ifp->offPremiseServicesReachableIPv4 = false; - ifp->offPremiseServicesReachableIPv6 = false; + ifp->offPremiseServicesReachableIPv4.SetNonNull(false); + ifp->offPremiseServicesReachableIPv6.SetNonNull(false); memcpy(ifp->MacAddress, ifa->hwaddr, sizeof(ifa->hwaddr)); diff --git a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp index 7c838ecb8633e7..973f2d4a9eee6c 100644 --- a/src/platform/EFR32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/EFR32/DiagnosticDataProviderImpl.cpp @@ -182,12 +182,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** NetworkInterface * ifp = new NetworkInterface(); #if CHIP_DEVICE_CONFIG_ENABLE_THREAD - const char * threadNetworkName = otThreadGetNetworkName(ThreadStackMgrImpl().OTInstance()); - ifp->name = Span(threadNetworkName, strlen(threadNetworkName)); - ifp->fabricConnected = true; - ifp->offPremiseServicesReachableIPv4 = false; - ifp->offPremiseServicesReachableIPv6 = false; - ifp->type = InterfaceType::EMBER_ZCL_INTERFACE_TYPE_THREAD; + const char * threadNetworkName = otThreadGetNetworkName(ThreadStackMgrImpl().OTInstance()); + ifp->name = Span(threadNetworkName, strlen(threadNetworkName)); + ifp->fabricConnected = true; + ifp->offPremiseServicesReachableIPv4.SetNonNull(false); + ifp->offPremiseServicesReachableIPv6.SetNonNull(false); + ifp->type = InterfaceType::EMBER_ZCL_INTERFACE_TYPE_THREAD; #else /* TODO */ #endif diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index b66037c4325561..dac196d1061c2e 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -212,8 +212,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->name = CharSpan::fromCharString(ifp->Name); ifp->fabricConnected = true; ifp->type = GetInterfaceType(esp_netif_get_desc(ifa)); - ifp->offPremiseServicesReachableIPv4 = false; - ifp->offPremiseServicesReachableIPv6 = false; + ifp->offPremiseServicesReachableIPv4.SetNonNull(false); + ifp->offPremiseServicesReachableIPv6.SetNonNull(false); if (esp_netif_get_mac(ifa, ifp->MacAddress) != ESP_OK) { ChipLogError(DeviceLayer, "Failed to get network hardware address"); diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index b2ad3a8b7d510a..2ee4f44f2b2697 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -432,11 +432,11 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** strncpy(ifp->Name, ifa->ifa_name, Inet::InterfaceId::kMaxIfNameLength); ifp->Name[Inet::InterfaceId::kMaxIfNameLength - 1] = '\0'; - ifp->name = CharSpan::fromCharString(ifp->Name); - ifp->fabricConnected = ifa->ifa_flags & IFF_RUNNING; - ifp->type = ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name); - ifp->offPremiseServicesReachableIPv4 = false; - ifp->offPremiseServicesReachableIPv6 = false; + ifp->name = CharSpan::fromCharString(ifp->Name); + ifp->fabricConnected = ifa->ifa_flags & IFF_RUNNING; + ifp->type = ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name); + ifp->offPremiseServicesReachableIPv4.SetNonNull(false); + ifp->offPremiseServicesReachableIPv6.SetNonNull(false); if (ConnectivityUtils::GetInterfaceHardwareAddrs(ifa->ifa_name, ifp->MacAddress, kMaxHardwareAddrSize) != CHIP_NO_ERROR) diff --git a/src/platform/P6/DiagnosticDataProviderImpl.cpp b/src/platform/P6/DiagnosticDataProviderImpl.cpp index ad7f395aa97d74..d17af3c5f94629 100644 --- a/src/platform/P6/DiagnosticDataProviderImpl.cpp +++ b/src/platform/P6/DiagnosticDataProviderImpl.cpp @@ -158,12 +158,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** if (net_interface) { /* Update Network Interface list */ - ifp->name = CharSpan::fromCharString(net_interface->name); - ifp->fabricConnected = net_interface->flags & NETIF_FLAG_LINK_UP; - ifp->type = EMBER_ZCL_INTERFACE_TYPE_WI_FI; - ifp->offPremiseServicesReachableIPv4 = mipv4_offpremise; - ifp->offPremiseServicesReachableIPv6 = mipv6_offpremise; - ifp->hardwareAddress = ByteSpan(net_interface->hwaddr, net_interface->hwaddr_len); + ifp->name = CharSpan::fromCharString(net_interface->name); + ifp->fabricConnected = net_interface->flags & NETIF_FLAG_LINK_UP; + ifp->type = EMBER_ZCL_INTERFACE_TYPE_WI_FI; + ifp->offPremiseServicesReachableIPv4.SetNonNull(mipv4_offpremise); + ifp->offPremiseServicesReachableIPv6.SetNonNull(mipv6_offpremise); + ifp->hardwareAddress = ByteSpan(net_interface->hwaddr, net_interface->hwaddr_len); } *netifpp = ifp; diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index 8558d68cbe92c3..96f5074427a722 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -199,8 +199,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ChipLogError(DeviceLayer, "Failed to get interface type"); } - ifp->offPremiseServicesReachableIPv4 = false; - ifp->offPremiseServicesReachableIPv6 = false; + ifp->offPremiseServicesReachableIPv4.SetNonNull(false); + ifp->offPremiseServicesReachableIPv6.SetNonNull(false); uint8_t addressSize; if (interfaceIterator.GetHardwareAddress(ifp->MacAddress, addressSize, sizeof(ifp->MacAddress)) != CHIP_NO_ERROR) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 7af807ed1bcfcf..8ea1a6e196a7f3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -12119,9 +12119,9 @@ struct Type { public: chip::CharSpan name; - bool fabricConnected = static_cast(0); - bool offPremiseServicesReachableIPv4 = static_cast(0); - bool offPremiseServicesReachableIPv6 = static_cast(0); + bool fabricConnected = static_cast(0); + DataModel::Nullable offPremiseServicesReachableIPv4; + DataModel::Nullable offPremiseServicesReachableIPv6; chip::ByteSpan hardwareAddress; InterfaceType type = static_cast(0); From 2ffbe9f55490bc71e6c956b3add13e8b0a6b9f36 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 7 Feb 2022 23:21:05 -0500 Subject: [PATCH 14/30] Mark MCSP responses as NOT_IMPLEMENTED (#14853) * Validate session type before trying to cast and return the secure session counter * Completely remove the counter response: MCSP not yet implemented for groups it seems * Fix typo --- .../secure_channel/MessageCounterManager.cpp | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/protocols/secure_channel/MessageCounterManager.cpp b/src/protocols/secure_channel/MessageCounterManager.cpp index 4ccf8a0960a10d..a94c1b50dc5511 100644 --- a/src/protocols/secure_channel/MessageCounterManager.cpp +++ b/src/protocols/secure_channel/MessageCounterManager.cpp @@ -222,26 +222,20 @@ CHIP_ERROR MessageCounterManager::SendMsgCounterSyncResp(Messaging::ExchangeCont FixedByteSpan challenge) { System::PacketBufferHandle msgBuf; - VerifyOrDie(exchangeContext->HasSessionHandle()); - // Allocate new buffer. - msgBuf = MessagePacketBuffer::New(kSyncRespMsgSize); - VerifyOrReturnError(!msgBuf.IsNull(), CHIP_ERROR_NO_MEMORY); - - { - uint8_t * msg = msgBuf->Start(); - Encoding::LittleEndian::BufferWriter bbuf(msg, kSyncRespMsgSize); - bbuf.Put32( - exchangeContext->GetSessionHandle()->AsSecureSession()->GetSessionMessageCounter().GetLocalMessageCounter().Value()); - bbuf.Put(challenge.data(), kChallengeSize); - VerifyOrReturnError(bbuf.Fit(), CHIP_ERROR_NO_MEMORY); - } + VerifyOrReturnError(exchangeContext->GetSessionHandle()->GetSessionType() == Transport::Session::SessionType::kGroup, + CHIP_ERROR_INVALID_ARGUMENT); - msgBuf->SetDataLength(kSyncRespMsgSize); + // NOTE: not currently implemented. When implementing, the following should be done: + // - allocate a new buffer: MessagePacketBuffer::New + // - setup payload and place the local message counter + challange in it + // - exchangeContext->SendMessage(Protocols::SecureChannel::MsgType::MsgCounterSyncRsp, ...) + // + // You can view the history of this file for a partial implementation that got + // removed due to it using non-group sessions. - return exchangeContext->SendMessage(Protocols::SecureChannel::MsgType::MsgCounterSyncRsp, std::move(msgBuf), - Messaging::SendFlags(Messaging::SendMessageFlags::kNoAutoRequestAck)); + return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR MessageCounterManager::HandleMsgCounterSyncReq(Messaging::ExchangeContext * exchangeContext, From 64c8a60b7a1efe216cdc6eb31b8352c3cf7aaae1 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel <67607049+kpschoedel@users.noreply.github.com> Date: Mon, 7 Feb 2022 23:21:13 -0500 Subject: [PATCH 15/30] [CI] TSAN build on Linux (#14860) #### Problem Thread races are bad. #### Change overview Add a Linux build with Thread Sanitizer. This is built with `chip_enable_wifi=false` because builds with WiFi on Linux enable `CHIP_WITH_GIO`, for which TSAN reports warnings from the gdbus thread. (It remains to be determined whether these indicate a genuine problem.) #### Testing CI. --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f64054d6ec29d3..43372ee113de26 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -168,11 +168,11 @@ jobs: LSAN_OPTIONS: detect_leaks=0 run: | # for BUILD_TYPE in asan msan tsan ubsan; do - for BUILD_TYPE in asan ubsan; do + for BUILD_TYPE in asan tsan ubsan; do case $BUILD_TYPE in "asan") GN_ARGS='is_clang=true is_asan=true';; "msan") GN_ARGS='is_clang=true is_msan=true';; - "tsan") GN_ARGS='is_clang=true is_tsan=true';; + "tsan") GN_ARGS='is_clang=true is_tsan=true chip_enable_wifi=false';; "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; esac From 0a33a10a9ed8928edf9a4e78b42a96d6eca1ac7b Mon Sep 17 00:00:00 2001 From: Daniel Nicoara Date: Mon, 7 Feb 2022 23:21:36 -0500 Subject: [PATCH 16/30] Update all_clusters_app README (#14863) The instructions currently customize the device via menuconfig. This bypasses the various customizations from the device specific defaults. Add a section to encourage users to start with the device specific defaults to avoid running into hard to debug run-time issues. --- examples/all-clusters-app/esp32/README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 3f051fd1400d4e..8c912676dbc201 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -84,7 +84,20 @@ To set IDF target, run set-target with one of the commands. - Configuration Options -To choose from the different configuration options, run menuconfig. +To build the default configuration (`sdkconfig.defaults`) skip to building the +demo application. + +To build a specific configuration (as an example `m5stack`): + + $ rm sdkconfig + $ idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig_m5stack.defaults' build + + Note: If using a specific device configuration, it is highly recommended to + start off with one of the defaults and customize on top of that. Certain + configurations have different constraints that are customized within the + device specific configuration (eg: main app stack size). + +To customize the configuration, run menuconfig. $ idf.py menuconfig From 78776acf6f19eb72e63c98c1cad11054554b4091 Mon Sep 17 00:00:00 2001 From: xBill Date: Tue, 8 Feb 2022 13:25:04 +0900 Subject: [PATCH 17/30] add missing openocd install instructions (#14583) * add missing openocd install instructions * Restyled by prettier-markdown * resolve failing spell check Co-authored-by: Restyled.io --- .github/.wordlist.txt | 1 + examples/all-clusters-app/mbed/README.md | 18 ++++++++++++++--- examples/lighting-app/mbed/README.md | 18 ++++++++++++++--- examples/lock-app/mbed/README.md | 18 ++++++++++++++--- examples/ota-requestor-app/mbed/README.md | 18 ++++++++++++++--- examples/pigweed-app/mbed/README.md | 18 ++++++++++++++--- examples/shell/mbed/README.md | 18 ++++++++++++++--- .../mbed/integration_tests/README.md | 20 +++++++++++++++---- src/test_driver/mbed/unit_tests/README.md | 20 +++++++++++++++---- 9 files changed, 123 insertions(+), 26 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 7be07374114354..54583ad80494bf 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1164,6 +1164,7 @@ XXXX XXXXXXXX xyz xz +xzvf yaml yearday yml diff --git a/examples/all-clusters-app/mbed/README.md b/examples/all-clusters-app/mbed/README.md index 1a9d7ca76d3242..547d9436f90d79 100644 --- a/examples/all-clusters-app/mbed/README.md +++ b/examples/all-clusters-app/mbed/README.md @@ -77,9 +77,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/examples/lighting-app/mbed/README.md b/examples/lighting-app/mbed/README.md index bcf717f5725a00..e9f3ac7b99054d 100644 --- a/examples/lighting-app/mbed/README.md +++ b/examples/lighting-app/mbed/README.md @@ -90,9 +90,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/examples/lock-app/mbed/README.md b/examples/lock-app/mbed/README.md index 7d5ebcee6ad4c7..076794944445b8 100644 --- a/examples/lock-app/mbed/README.md +++ b/examples/lock-app/mbed/README.md @@ -80,9 +80,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/examples/ota-requestor-app/mbed/README.md b/examples/ota-requestor-app/mbed/README.md index 3346c4581fc90b..8cbc56b310eee4 100644 --- a/examples/ota-requestor-app/mbed/README.md +++ b/examples/ota-requestor-app/mbed/README.md @@ -82,9 +82,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/examples/pigweed-app/mbed/README.md b/examples/pigweed-app/mbed/README.md index 544c10f19876e4..05b8d469163d32 100644 --- a/examples/pigweed-app/mbed/README.md +++ b/examples/pigweed-app/mbed/README.md @@ -55,9 +55,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/examples/shell/mbed/README.md b/examples/shell/mbed/README.md index cefc576929a4f4..e2b8e119dfa219 100644 --- a/examples/shell/mbed/README.md +++ b/examples/shell/mbed/README.md @@ -48,9 +48,21 @@ using the following command: $ git submodule update --init Building the example application requires the use of **ARM Mbed-OS** sources and -the **arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/src/test_driver/mbed/integration_tests/README.md b/src/test_driver/mbed/integration_tests/README.md index 9166fbf5f27435..4db0e025fdc623 100644 --- a/src/test_driver/mbed/integration_tests/README.md +++ b/src/test_driver/mbed/integration_tests/README.md @@ -82,10 +82,22 @@ following command: $ git submodule update --init -Building the application requires the use of **ARM Mbed-OS** sources and the -**arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +Building the example application requires the use of **ARM Mbed-OS** sources and +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the diff --git a/src/test_driver/mbed/unit_tests/README.md b/src/test_driver/mbed/unit_tests/README.md index 925db3e6321704..9d1b02e08c62d3 100644 --- a/src/test_driver/mbed/unit_tests/README.md +++ b/src/test_driver/mbed/unit_tests/README.md @@ -42,10 +42,22 @@ submodules using the following command: $ git submodule update --init -Building the application requires the use of **ARM Mbed-OS** sources and the -**arm-none-gnu-eabi** toolchain. The OpenOCD package is used for flashing -purpose.
Some additional packages may be needed, depending on selected -build target and its requirements. +Building the example application requires the use of **ARM Mbed-OS** sources and +the **arm-none-gnu-eabi** toolchain. + +The Cypress OpenOCD package is required for flashing purpose. Install the +Cypress OpenOCD and set env var `OPENOCD_PATH` before calling the flashing +script. + +``` +cd ~ +wget https://github.com/Infineon/openocd/releases/download/release-v4.3.0/openocd-4.3.0.1746-linux.tar.gz +tar xzvf openocd-4.3.0.1746-linux.tar.gz +export OPENOCD_PATH=$HOME/openocd +``` + +Some additional packages may be needed, depending on selected build target and +its requirements. > **The VSCode devcontainer has these components pre-installed. Using the VSCode > devcontainer is the recommended way to interact with Arm Mbed-OS port of the From 97cf4ff6000136a59f0b5515822704f9e974c579 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:28:07 +0800 Subject: [PATCH 18/30] ESP: Add case command to establish CASESession to another node for TC-SC-4.9(RIO Support) verification. (#13900) * Add case command to establish CASESession to another node for ESP all-clusters-app * Restyled by clang-format * Use a single file ShellCommands.cpp to register the external shell commands * Auto Format * Add check for executing the case command before the last command done * Restyled by clang-format Co-authored-by: Restyled.io --- .../esp32/main/OnOffCommands.cpp | 102 --------- .../esp32/main/ShellCommands.cpp | 52 +++++ .../esp32/main/include/OnOffCommands.h | 47 ---- .../esp32/main/include/ShellCommands.h | 210 ++++++++++++++++++ examples/all-clusters-app/esp32/main/main.cpp | 7 +- 5 files changed, 265 insertions(+), 153 deletions(-) delete mode 100644 examples/all-clusters-app/esp32/main/OnOffCommands.cpp create mode 100644 examples/all-clusters-app/esp32/main/ShellCommands.cpp delete mode 100644 examples/all-clusters-app/esp32/main/include/OnOffCommands.h create mode 100644 examples/all-clusters-app/esp32/main/include/ShellCommands.h diff --git a/examples/all-clusters-app/esp32/main/OnOffCommands.cpp b/examples/all-clusters-app/esp32/main/OnOffCommands.cpp deleted file mode 100644 index 45a393548fcb3e..00000000000000 --- a/examples/all-clusters-app/esp32/main/OnOffCommands.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include - -#include -#if CONFIG_DEVICE_LAYER -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -namespace chip { -namespace Shell { -namespace { - -Shell::Engine sSubShell; - -CHIP_ERROR OnOffHandler(int argc, char ** argv) -{ - if (argc == 0) - { - sSubShell.ForEachCommand(PrintCommandHelp, nullptr); - return CHIP_NO_ERROR; - } - - CHIP_ERROR error = sSubShell.ExecCommand(argc, argv); - - if (error != CHIP_NO_ERROR) - { - streamer_printf(streamer_get(), "Error: %" CHIP_ERROR_FORMAT "\r\n", error.Format()); - } - - return error; -} - -static CHIP_ERROR OnLightHandler(int argc, char ** argv) -{ - if (argc != 1) - return CHIP_ERROR_INVALID_ARGUMENT; - chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), 1); - return CHIP_NO_ERROR; -} - -static CHIP_ERROR OffLightHandler(int argc, char ** argv) -{ - if (argc != 1) - return CHIP_ERROR_INVALID_ARGUMENT; - chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), 0); - return CHIP_NO_ERROR; -} - -static CHIP_ERROR ToggleLightHandler(int argc, char ** argv) -{ - if (argc != 1) - return CHIP_ERROR_INVALID_ARGUMENT; - bool value; - chip::app::Clusters::OnOff::Attributes::OnOff::Get(atoi(argv[0]), &value); - chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), !value); - return CHIP_NO_ERROR; -} - -} // namespace - -void OnOffCommands::Register() -{ - static const shell_command_t subCommands[] = { { &OnLightHandler, "on", "Usage: OnOff on endpoint-id" }, - { &OffLightHandler, "off", "Usage: OnOff off endpoint-id" }, - { &ToggleLightHandler, "toggle", "Usage: OnOff toggle endpoint-id" } }; - sSubShell.RegisterCommands(subCommands, ArraySize(subCommands)); - - // Register the root `OnOff` command in the top-level shell. - static const shell_command_t onOffCommand = { &OnOffHandler, "OnOff", "OnOff commands" }; - - Engine::Root().RegisterCommands(&onOffCommand, 1); -} - -} // namespace Shell -} // namespace chip diff --git a/examples/all-clusters-app/esp32/main/ShellCommands.cpp b/examples/all-clusters-app/esp32/main/ShellCommands.cpp new file mode 100644 index 00000000000000..3c7b4822d21558 --- /dev/null +++ b/examples/all-clusters-app/esp32/main/ShellCommands.cpp @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace chip { +namespace Shell { + +Shell::Engine OnOffCommands::sSubShell; +void OnOffCommands::Register() +{ + static const shell_command_t subCommands[] = { { &OnLightHandler, "on", "Usage: OnOff on endpoint-id" }, + { &OffLightHandler, "off", "Usage: OnOff off endpoint-id" }, + { &ToggleLightHandler, "toggle", "Usage: OnOff toggle endpoint-id" } }; + sSubShell.RegisterCommands(subCommands, ArraySize(subCommands)); + + // Register the root `OnOff` command in the top-level shell. + static const shell_command_t onOffCommand = { &OnOffHandler, "OnOff", "OnOff commands" }; + + Engine::Root().RegisterCommands(&onOffCommand, 1); +} + +Callback::Callback CASECommands::sOnConnectedCallback(CASECommands::OnConnected, nullptr); +Callback::Callback CASECommands::sOnConnectionFailureCallback(CASECommands::OnConnectionFailure, + nullptr); +Shell::Engine CASECommands::sSubShell; +void CASECommands::Register() +{ + static const shell_command_t subCommands[] = { + { &ConnectToNodeHandler, "connect", "Establish CASESession to a node, Usage: case connect " }, + }; + sSubShell.RegisterCommands(subCommands, ArraySize(subCommands)); + + static const shell_command_t CASECommand = { &CASEHandler, "case", "Case Commands" }; + Engine::Root().RegisterCommands(&CASECommand, 1); +} +} // namespace Shell +} // namespace chip diff --git a/examples/all-clusters-app/esp32/main/include/OnOffCommands.h b/examples/all-clusters-app/esp32/main/include/OnOffCommands.h deleted file mode 100644 index 18674f01003c55..00000000000000 --- a/examples/all-clusters-app/esp32/main/include/OnOffCommands.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -namespace chip { -namespace Shell { - -class OnOffCommands -{ -public: - // delete the copy constructor - OnOffCommands(const OnOffCommands &) = delete; - // delete the move constructor - OnOffCommands(OnOffCommands &&) = delete; - // delete the assignment operator - OnOffCommands & operator=(const OnOffCommands &) = delete; - - static OnOffCommands & GetInstance() - { - static OnOffCommands instance; - return instance; - } - - // Register the OTA provider commands - void Register(); - -private: - OnOffCommands() {} -}; - -} // namespace Shell -} // namespace chip diff --git a/examples/all-clusters-app/esp32/main/include/ShellCommands.h b/examples/all-clusters-app/esp32/main/include/ShellCommands.h new file mode 100644 index 00000000000000..aea17cca138523 --- /dev/null +++ b/examples/all-clusters-app/esp32/main/include/ShellCommands.h @@ -0,0 +1,210 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if CONFIG_DEVICE_LAYER +#include +#endif + +namespace chip { +namespace Shell { + +class OnOffCommands +{ +public: + // delete the copy constructor + OnOffCommands(const OnOffCommands &) = delete; + // delete the move constructor + OnOffCommands(OnOffCommands &&) = delete; + // delete the assignment operator + OnOffCommands & operator=(const OnOffCommands &) = delete; + + static OnOffCommands & GetInstance() + { + static OnOffCommands instance; + return instance; + } + + // Register the OnOff commands + void Register(); + +private: + OnOffCommands() {} + + static CHIP_ERROR OnOffHandler(int argc, char ** argv) + { + if (argc == 0) + { + sSubShell.ForEachCommand(PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; + } + + CHIP_ERROR error = sSubShell.ExecCommand(argc, argv); + + if (error != CHIP_NO_ERROR) + { + streamer_printf(streamer_get(), "Error: %" CHIP_ERROR_FORMAT "\r\n", error.Format()); + } + + return error; + } + + static CHIP_ERROR OnLightHandler(int argc, char ** argv) + { + if (argc != 1) + return CHIP_ERROR_INVALID_ARGUMENT; + chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), 1); + return CHIP_NO_ERROR; + } + + static CHIP_ERROR OffLightHandler(int argc, char ** argv) + { + if (argc != 1) + return CHIP_ERROR_INVALID_ARGUMENT; + chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), 0); + return CHIP_NO_ERROR; + } + + static CHIP_ERROR ToggleLightHandler(int argc, char ** argv) + { + if (argc != 1) + return CHIP_ERROR_INVALID_ARGUMENT; + bool value; + chip::app::Clusters::OnOff::Attributes::OnOff::Get(atoi(argv[0]), &value); + chip::app::Clusters::OnOff::Attributes::OnOff::Set(atoi(argv[0]), !value); + return CHIP_NO_ERROR; + } + + static Shell::Engine sSubShell; +}; + +class CASECommands +{ +public: + // delete the copy constructor + CASECommands(const CASECommands &) = delete; + // delete the move constructor + CASECommands(CASECommands &&) = delete; + // delete the assignment operator + CASECommands & operator=(const CASECommands &) = delete; + + static CASECommands & GetInstance() + { + static CASECommands instance; + return instance; + } + + // Register the CASESession commands + void Register(); + + void SetFabricInfo(FabricInfo * fabricInfo) { mFabricInfo = fabricInfo; } + void SetNodeId(NodeId nodeId) { mNodeId = nodeId; } + void SetOnConnecting(bool onConnecting) { mOnConnecting = onConnecting; } + FabricInfo * GetFabricInfo(void) { return mFabricInfo; } + NodeId GetNodeId(void) { return mNodeId; } + bool GetOnConnecting(void) { return mOnConnecting; } + +private: + CASECommands() {} + static void OnConnected(void * context, OperationalDeviceProxy * deviceProxy) + { + streamer_printf(streamer_get(), "Establish CASESession Success!\r\n"); + GetInstance().SetOnConnecting(false); + } + + static void OnConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) + { + streamer_printf(streamer_get(), "Establish CASESession Failure!\r\n"); + GetInstance().SetOnConnecting(false); + } + + static void ConnectToNode(intptr_t arg) + { + CASECommands * caseCommand = reinterpret_cast(arg); + Server * server = &(chip::Server::GetInstance()); + CASESessionManager * caseSessionManager = server->GetCASESessionManager(); + if (caseSessionManager == nullptr) + { + ChipLogError(SecureChannel, "Can't get the CASESessionManager"); + return; + } + caseSessionManager->FindOrEstablishSession(caseCommand->GetFabricInfo()->GetPeerIdForNode(caseCommand->GetNodeId()), + &sOnConnectedCallback, &sOnConnectionFailureCallback); + } + + static CHIP_ERROR ConnectToNodeHandler(int argc, char ** argv) + { + if (GetInstance().GetOnConnecting()) + { + return CHIP_ERROR_INCORRECT_STATE; + } + const FabricIndex fabricIndex = static_cast(strtoul(argv[0], nullptr, 10)); + FabricInfo * fabricInfo = Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabricIndex); + + if (fabricInfo == nullptr) + { + streamer_printf(streamer_get(), "Can't get fabric information from FabricIndex\r\n"); + return CHIP_ERROR_NOT_FOUND; + } + GetInstance().SetFabricInfo(fabricInfo); + GetInstance().SetNodeId(static_cast(strtoul(argv[1], nullptr, 10))); + streamer_printf(streamer_get(), "Try to establish CaseSession to NodeId:0x" ChipLogFormatX64 " on fabric index %d\r\n", + ChipLogValueX64(GetInstance().GetNodeId()), fabricIndex); + GetInstance().SetOnConnecting(true); + chip::DeviceLayer::PlatformMgr().ScheduleWork(ConnectToNode, reinterpret_cast(&GetInstance())); + return CHIP_NO_ERROR; + } + + static CHIP_ERROR CASEHandler(int argc, char ** argv) + { + if (argc == 0) + { + sSubShell.ForEachCommand(PrintCommandHelp, nullptr); + return CHIP_NO_ERROR; + } + CHIP_ERROR err = sSubShell.ExecCommand(argc, argv); + if (err != CHIP_NO_ERROR) + { + streamer_printf(streamer_get(), "Error: %" CHIP_ERROR_FORMAT "\r\n", err.Format()); + } + return err; + } + + static Callback::Callback sOnConnectedCallback; + static Callback::Callback sOnConnectionFailureCallback; + static Shell::Engine sSubShell; + FabricInfo * mFabricInfo = nullptr; + NodeId mNodeId = 0; + bool mOnConnecting = false; +}; + +} // namespace Shell +} // namespace chip diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 79c2e590c2f5f6..a50444821800a6 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -26,6 +26,7 @@ #include "OpenThreadLaunch.h" #include "QRCodeScreen.h" #include "ScreenManager.h" +#include "ShellCommands.h" #include "WiFiWidget.h" #include "esp_heap_caps_init.h" #include "esp_log.h" @@ -82,8 +83,6 @@ #include #endif -#include - using namespace ::chip; using namespace ::chip::Shell; using namespace ::chip::Credentials; @@ -614,8 +613,8 @@ extern "C" void app_main() #if CONFIG_ENABLE_CHIP_SHELL chip::LaunchShell(); - OnOffCommands & onOffCommands = OnOffCommands::GetInstance(); - onOffCommands.Register(); + OnOffCommands::GetInstance().Register(); + CASECommands::GetInstance().Register(); #endif // CONFIG_ENABLE_CHIP_SHELL #if CONFIG_OPENTHREAD_ENABLED From e91c44e892d397d95d71d91404e66f265d9b5b2c Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Feb 2022 08:00:33 +0100 Subject: [PATCH 19/30] [Darwin] Remove automatically generated tests for Darwin since there are many YAMLs tests now (#14828) * [Darwin] Remove automatically generated tests for Darwin since there are many YAMLs tests now * Update generated darwin tests --- .../CHIP/templates/clusters-tests.zapt | 67 - src/darwin/Framework/CHIP/templates/helper.js | 65 +- .../Framework/CHIPTests/CHIPClustersTests.m | 16487 ---------------- 3 files changed, 8 insertions(+), 16611 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 29dc83916f2408..1b3f3c95daff7f 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -212,71 +212,4 @@ CHIPDevice * GetConnectedDevice(void) {{>test_cluster tests=(getTests)}} -{{#chip_client_clusters}} -{{#unless (isStrEqual "Test Cluster" name)}} -{{#unless (isStrEqual "Access Control" name)}} -{{#unless (isStrEqual "Basic" name)}} -{{#unless (isStrEqual "Thermostat" name)}} -{{#unless (isStrEqual "OTA Software Update Provider" name)}} -{{#unless (isStrEqual "Network Commissioning" name)}} {{! "Networks" is broken }} -{{#unless (isStrEqual "Application Basic" name)}} {{! "Application App" is broken }} -{{#chip_server_cluster_attributes}} -- (void)testSendCluster{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIP{{asUpperCamelCase parent.name}} * cluster = [[CHIP{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asUpperCamelCase parent.name)}} queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asUpperCamelCase parent.name}}ReadAttribute{{asUpperCamelCase name}}WithCompletionHandler"]; - - [cluster readAttribute{{asUpperCamelCase name}}WithCompletionHandler:^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable err) { - NSLog(@"{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -{{#if isWritableAttribute}} -- (void)testSendCluster{{asUpperCamelCase parent.name}}WriteAttribute{{asUpperCamelCase name}}WithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIP{{asUpperCamelCase parent.name}} * cluster = [[CHIP{{asUpperCamelCase parent.name}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asUpperCamelCase parent.name)}} queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asUpperCamelCase parent.name}}WriteAttribute{{asUpperCamelCase name}}WithValue"]; - - {{asObjectiveCType type parent.name}} value = {{asTestValue parent.name}}; - [cluster writeAttribute{{asUpperCamelCase name}}WithValue:value completionHandler:^(NSError * _Nullable err) { - NSLog(@"{{asUpperCamelCase parent.name}} {{asUpperCamelCase name}} Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -{{/if}} -{{/chip_server_cluster_attributes}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/unless}} -{{/chip_client_clusters}} - @end diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 866a81e2b6ff1d..d018a659a92f3b 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -25,53 +25,6 @@ const ChipTypesHelper = require('../../../../../src/app/zap-templates/common/Chi const StringHelper = require('../../../../../src/app/zap-templates/common/StringHelper.js'); const appHelper = require('../../../../../src/app/zap-templates/templates/app/helper.js'); -// Ideally those clusters clusters endpoints should be retrieved from the -// descriptor cluster. -function asExpectedEndpointForCluster(clusterName) -{ - switch (clusterName) { - case 'AccessControl': - case 'AdministratorCommissioning': - case 'Basic': - case 'Descriptor': - case 'DiagnosticLogs': - case 'GeneralCommissioning': - case 'GeneralDiagnostics': - case 'LocalizationConfiguration': - case 'SoftwareDiagnostics': - case 'ThreadNetworkDiagnostics': - case 'EthernetNetworkDiagnostics': - case 'WiFiNetworkDiagnostics': - case 'GroupKeyManagement': - case 'NetworkCommissioning': - case 'OperationalCredentials': - case 'TimeFormatLocalization': - case 'TrustedRootCertificates': - case 'OtaSoftwareUpdateProvider': - case 'OtaSoftwareUpdateRequestor': - case 'PowerSourceConfiguration': - case 'UnitLocalization': - return 0; - } - return 1; -} - -async function asTestValue(cluster, options) -{ - if (StringHelper.isOctetString(this.type)) { - return `[@"${"Test".substring(0, this.maxLength)}" dataUsingEncoding:NSUTF8StringEncoding]`; - } else if (StringHelper.isCharString(this.type)) { - return `@"${"Test".substring(0, this.maxLength)}"`; - } else if (this.isArray) { - return '[NSArray array]'; - } else if (this.isStruct) { - let ourClass = await asObjectiveCClass.call(this, this.type, cluster, options); - return `[[${ourClass} alloc] init]`; - } else { - return `@(${this.min || this.max || 0})`; - } -} - function asObjectiveCBasicType(type, options) { if (StringHelper.isOctetString(type)) { @@ -200,13 +153,11 @@ function commandHasRequiredField(command) // // Module exports // -exports.asObjectiveCBasicType = asObjectiveCBasicType; -exports.asObjectiveCNumberType = asObjectiveCNumberType; -exports.asExpectedEndpointForCluster = asExpectedEndpointForCluster; -exports.asTestIndex = asTestIndex; -exports.asTestValue = asTestValue; -exports.asObjectiveCClass = asObjectiveCClass; -exports.asObjectiveCType = asObjectiveCType; -exports.asStructPropertyName = asStructPropertyName; -exports.asGetterName = asGetterName; -exports.commandHasRequiredField = commandHasRequiredField; +exports.asObjectiveCBasicType = asObjectiveCBasicType; +exports.asObjectiveCNumberType = asObjectiveCNumberType; +exports.asTestIndex = asTestIndex; +exports.asObjectiveCClass = asObjectiveCClass; +exports.asObjectiveCType = asObjectiveCType; +exports.asStructPropertyName = asStructPropertyName; +exports.asGetterName = asGetterName; +exports.commandHasRequiredField = commandHasRequiredField; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 71116af4a37eb9..148c5106d153d2 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -43856,16491 +43856,4 @@ - (void)testSendClusterTestSubscribe_OnOff_000007_WaitForReport [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterAccountLoginReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAccountLoginReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAccountLogin * cluster = [[CHIPAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AccountLoginReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AccountLogin ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeWindowStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeWindowStatusWithCompletionHandler"]; - - [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning WindowStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAdminFabricIndexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAdminFabricIndexWithCompletionHandler"]; - - [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AdminFabricIndex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAdminVendorIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAdminVendorIdWithCompletionHandler"]; - - [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AdminVendorId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAdministratorCommissioningReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAdministratorCommissioning * cluster = [[CHIPAdministratorCommissioning alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AdministratorCommissioningReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AdministratorCommissioning ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationLauncherListWithCompletionHandler"]; - - [cluster readAttributeApplicationLauncherListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeApplicationLauncherAppWithCompletionHandler"]; - - [cluster readAttributeApplicationLauncherAppWithCompletionHandler:^( - CHIPApplicationLauncherClusterApplicationEP * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherWriteAttributeApplicationLauncherAppWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherWriteAttributeApplicationLauncherAppWithValue"]; - - CHIPApplicationLauncherClusterApplicationEP * _Nonnull value = [[CHIPApplicationLauncherClusterApplicationEP alloc] init]; - [cluster writeAttributeApplicationLauncherAppWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ApplicationLauncherApp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterApplicationLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterApplicationLauncherReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPApplicationLauncher * cluster = [[CHIPApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ApplicationLauncherReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ApplicationLauncher ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeAudioOutputListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeAudioOutputListWithCompletionHandler"]; - - [cluster readAttributeAudioOutputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput AudioOutputList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeCurrentAudioOutputWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeCurrentAudioOutputWithCompletionHandler"]; - - [cluster readAttributeCurrentAudioOutputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput CurrentAudioOutput Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterAudioOutputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPAudioOutput * cluster = [[CHIPAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"AudioOutputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"AudioOutput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierMovingStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierMovingStateWithCompletionHandler"]; - - [cluster readAttributeBarrierMovingStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierMovingState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierSafetyStatusWithCompletionHandler"]; - - [cluster readAttributeBarrierSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierSafetyStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierCapabilitiesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierCapabilitiesWithCompletionHandler"]; - - [cluster readAttributeBarrierCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierCapabilities Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeBarrierPositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeBarrierPositionWithCompletionHandler"]; - - [cluster readAttributeBarrierPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl BarrierPosition Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBarrierControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BarrierControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BarrierControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeOutOfServiceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeOutOfServiceWithCompletionHandler"]; - - [cluster readAttributeOutOfServiceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic OutOfService Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicWriteAttributeOutOfServiceWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BinaryInputBasicWriteAttributeOutOfServiceWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOutOfServiceWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BinaryInputBasic OutOfService Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBinaryInputBasicReadAttributePresentValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributePresentValueWithCompletionHandler"]; - - [cluster readAttributePresentValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic PresentValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicWriteAttributePresentValueWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BinaryInputBasicWriteAttributePresentValueWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributePresentValueWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BinaryInputBasic PresentValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBinaryInputBasicReadAttributeStatusFlagsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeStatusFlagsWithCompletionHandler"]; - - [cluster readAttributeStatusFlagsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic StatusFlags Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBinaryInputBasicReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinaryInputBasic * cluster = [[CHIPBinaryInputBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BinaryInputBasicReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BinaryInputBasic ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BindingReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BindingReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBindingReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Binding ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeStateValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BooleanStateReadAttributeStateValueWithCompletionHandler"]; - - [cluster readAttributeStateValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState StateValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBooleanStateReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBooleanState * cluster = [[CHIPBooleanState alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BooleanStateReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BooleanState ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeActionListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeActionListWithCompletionHandler"]; - - [cluster readAttributeActionListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ActionList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeEndpointListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeEndpointListWithCompletionHandler"]; - - [cluster readAttributeEndpointListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions EndpointList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeSetupUrlWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BridgedActionsReadAttributeSetupUrlWithCompletionHandler"]; - - [cluster readAttributeSetupUrlWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions SetupUrl Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedActionsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedActions * cluster = [[CHIPBridgedActions alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedActionsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedActions ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler"]; - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler"]; - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorID Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductNameWithCompletionHandler"]; - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler"]; - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicWriteAttributeNodeLabelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BridgedDeviceBasicWriteAttributeNodeLabelWithValue"]; - - NSString * _Nonnull value = @"Test"; - [cluster writeAttributeNodeLabelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler"]; - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ManufacturingDate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributePartNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributePartNumberWithCompletionHandler"]; - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic PartNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductURLWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductURLWithCompletionHandler"]; - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductURL Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler"]; - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler"]; - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SerialNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeReachableWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeReachableWithCompletionHandler"]; - - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic Reachable Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeChannelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelListWithCompletionHandler"]; - - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ChannelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeChannelLineupWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelLineupWithCompletionHandler"]; - - [cluster - readAttributeChannelLineupWithCompletionHandler:^(CHIPChannelClusterLineupInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ChannelLineup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelWriteAttributeChannelLineupWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeChannelLineupWithValue"]; - - CHIPChannelClusterLineupInfo * _Nonnull value = [[CHIPChannelClusterLineupInfo alloc] init]; - [cluster writeAttributeChannelLineupWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Channel ChannelLineup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterChannelReadAttributeCurrentChannelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeCurrentChannelWithCompletionHandler"]; - - [cluster readAttributeCurrentChannelWithCompletionHandler:^( - CHIPChannelClusterChannelInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel CurrentChannel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelWriteAttributeCurrentChannelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelWriteAttributeCurrentChannelWithValue"]; - - CHIPChannelClusterChannelInfo * _Nonnull value = [[CHIPChannelClusterChannelInfo alloc] init]; - [cluster writeAttributeCurrentChannelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Channel CurrentChannel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterChannelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ChannelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ChannelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterChannelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Channel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentHueWithCompletionHandler"]; - - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentSaturationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCurrentSaturationWithCompletionHandler"]; - - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentSaturation Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeRemainingTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeRemainingTimeWithCompletionHandler"]; - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl RemainingTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentXWithCompletionHandler"]; - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCurrentYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentYWithCompletionHandler"]; - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CurrentY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeDriftCompensationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeDriftCompensationWithCompletionHandler"]; - - [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl DriftCompensation Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCompensationTextWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCompensationTextWithCompletionHandler"]; - - [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CompensationText Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTemperatureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTemperatureWithCompletionHandler"]; - - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTemperature Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorModeWithCompletionHandler"]; - - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorControlOptionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorControlOptionsWithCompletionHandler"]; - - [cluster readAttributeColorControlOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorControlOptions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorControlOptionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorControlOptionsWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorControlOptionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorControlOptions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeNumberOfPrimariesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeNumberOfPrimariesWithCompletionHandler"]; - - [cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl NumberOfPrimaries Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1XWithCompletionHandler"]; - - [cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1YWithCompletionHandler"]; - - [cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary1IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary1IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary1IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary1Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2XWithCompletionHandler"]; - - [cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2YWithCompletionHandler"]; - - [cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary2IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary2IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary2IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary2Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3XWithCompletionHandler"]; - - [cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3YWithCompletionHandler"]; - - [cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary3IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary3IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary3IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary3Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4XWithCompletionHandler"]; - - [cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4YWithCompletionHandler"]; - - [cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary4IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary4IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary4IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary4Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5XWithCompletionHandler"]; - - [cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5YWithCompletionHandler"]; - - [cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary5IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary5IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary5IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary5Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6XWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6XWithCompletionHandler"]; - - [cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6X Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6YWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6YWithCompletionHandler"]; - - [cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6Y Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributePrimary6IntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributePrimary6IntensityWithCompletionHandler"]; - - [cluster readAttributePrimary6IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl Primary6Intensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeWhitePointXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeWhitePointXWithCompletionHandler"]; - - [cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeWhitePointXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeWhitePointXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeWhitePointYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeWhitePointYWithCompletionHandler"]; - - [cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeWhitePointYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeWhitePointYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl WhitePointY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRXWithCompletionHandler"]; - - [cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointRXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRYWithCompletionHandler"]; - - [cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointRYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointRIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointRIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointRIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointRIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGXWithCompletionHandler"]; - - [cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointGXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGYWithCompletionHandler"]; - - [cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointGYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointGIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointGIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointGIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointGIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBXWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBXWithCompletionHandler"]; - - [cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBXWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBXWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointBXWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBYWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBYWithCompletionHandler"]; - - [cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBYWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBYWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeColorPointBYWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeColorPointBIntensityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorPointBIntensityWithCompletionHandler"]; - - [cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeColorPointBIntensityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBIntensityWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeColorPointBIntensityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeEnhancedCurrentHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeEnhancedCurrentHueWithCompletionHandler"]; - - [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl EnhancedCurrentHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeEnhancedColorModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeEnhancedColorModeWithCompletionHandler"]; - - [cluster readAttributeEnhancedColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl EnhancedColorMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopActiveWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopActiveWithCompletionHandler"]; - - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopActive Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopDirectionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopDirectionWithCompletionHandler"]; - - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopDirection Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopTimeWithCompletionHandler"]; - - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopStartEnhancedHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopStartEnhancedHueWithCompletionHandler"]; - - [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopStartEnhancedHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorLoopStoredEnhancedHueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorLoopStoredEnhancedHueWithCompletionHandler"]; - - [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorLoopStoredEnhancedHue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorCapabilitiesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorCapabilitiesWithCompletionHandler"]; - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorCapabilities Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMinWithCompletionHandler"]; - - [cluster readAttributeColorTempPhysicalMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTempPhysicalMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMaxWithCompletionHandler"]; - - [cluster readAttributeColorTempPhysicalMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ColorTempPhysicalMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler"]; - - [cluster - readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl CoupleColorTempToLevelMinMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMiredsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeStartUpColorTemperatureMiredsWithCompletionHandler"]; - - [cluster - readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue"]; - - NSNumber * _Nonnull value = @(0x0000); - [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterColorControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterColorControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ColorControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ColorControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler"]; - - [cluster readAttributeAcceptHeaderListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher AcceptHeaderList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeSupportedStreamingProtocolsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeSupportedStreamingProtocolsWithCompletionHandler"]; - - [cluster readAttributeSupportedStreamingProtocolsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher SupportedStreamingProtocols Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherWriteAttributeSupportedStreamingProtocolsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherWriteAttributeSupportedStreamingProtocolsWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeSupportedStreamingProtocolsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ContentLauncher SupportedStreamingProtocols Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterContentLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterContentLauncherReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPContentLauncher * cluster = [[CHIPContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeDeviceListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeDeviceListWithCompletionHandler"]; - - [cluster readAttributeDeviceListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor DeviceList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeServerListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeServerListWithCompletionHandler"]; - - [cluster readAttributeServerListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ServerList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClientListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeClientListWithCompletionHandler"]; - - [cluster readAttributeClientListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClientList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributePartsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributePartsListWithCompletionHandler"]; - - [cluster readAttributePartsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor PartsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDescriptorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DescriptorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Descriptor ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDiagnosticLogsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDiagnosticLogs * cluster = [[CHIPDiagnosticLogs alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DiagnosticLogsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DiagnosticLogs AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLockStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockStateWithCompletionHandler"]; - - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock LockState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLockTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockTypeWithCompletionHandler"]; - - [cluster readAttributeLockTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock LockType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeActuatorEnabledWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeActuatorEnabledWithCompletionHandler"]; - - [cluster readAttributeActuatorEnabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ActuatorEnabled Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeDoorStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeDoorStateWithCompletionHandler"]; - - [cluster readAttributeDoorStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock DoorState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfTotalUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfTotalUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfTotalUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfPINUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfPINUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfPINUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfPINUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfRFIDUsersSupportedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfRFIDUsersSupportedWithCompletionHandler"]; - - [cluster readAttributeNumberOfRFIDUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfRFIDUsersSupported Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler"]; - - [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfWeekDaySchedulesSupportedPerUser Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler"]; - - [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( - NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock NumberOfYearDaySchedulesSupportedPerUser Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMaxPINCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMaxPINCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMaxPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MaxPINCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMinPINCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMinPINCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMinPINCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MinPINCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMaxRFIDCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMaxRFIDCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMaxRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MaxRFIDCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeMinRFIDCodeLengthWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeMinRFIDCodeLengthWithCompletionHandler"]; - - [cluster readAttributeMinRFIDCodeLengthWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock MinRFIDCodeLength Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeLanguageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLanguageWithCompletionHandler"]; - - [cluster readAttributeLanguageWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock Language Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeLanguageWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeLanguageWithValue"]; - - NSString * _Nonnull value = @"Tes"; - [cluster writeAttributeLanguageWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock Language Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeAutoRelockTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeAutoRelockTimeWithCompletionHandler"]; - - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock AutoRelockTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeAutoRelockTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeAutoRelockTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeAutoRelockTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock AutoRelockTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeSoundVolumeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeSoundVolumeWithCompletionHandler"]; - - [cluster readAttributeSoundVolumeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock SoundVolume Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeSoundVolumeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeSoundVolumeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeSoundVolumeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock SoundVolume Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeOperatingModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeOperatingModeWithCompletionHandler"]; - - [cluster readAttributeOperatingModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock OperatingMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeOperatingModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeOperatingModeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOperatingModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock OperatingMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeSupportedOperatingModesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeSupportedOperatingModesWithCompletionHandler"]; - - [cluster readAttributeSupportedOperatingModesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock SupportedOperatingModes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeEnableOneTouchLockingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeEnableOneTouchLockingWithCompletionHandler"]; - - [cluster readAttributeEnableOneTouchLockingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock EnableOneTouchLocking Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeEnableOneTouchLockingWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeEnableOneTouchLockingWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeEnableOneTouchLockingWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock EnableOneTouchLocking Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeEnablePrivacyModeButtonWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeEnablePrivacyModeButtonWithCompletionHandler"]; - - [cluster readAttributeEnablePrivacyModeButtonWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock EnablePrivacyModeButton Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeEnablePrivacyModeButtonWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeEnablePrivacyModeButtonWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeEnablePrivacyModeButtonWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock EnablePrivacyModeButton Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeWrongCodeEntryLimitWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeWrongCodeEntryLimitWithCompletionHandler"]; - - [cluster readAttributeWrongCodeEntryLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock WrongCodeEntryLimit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockWriteAttributeWrongCodeEntryLimitWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockWriteAttributeWrongCodeEntryLimitWithValue"]; - - NSNumber * _Nonnull value = @(1); - [cluster writeAttributeWrongCodeEntryLimitWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"DoorLock WrongCodeEntryLimit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterDoorLockReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"DoorLockReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DoorLock ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeMeasurementTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeMeasurementTypeWithCompletionHandler"]; - - [cluster readAttributeMeasurementTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement MeasurementType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeTotalActivePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeTotalActivePowerWithCompletionHandler"]; - - [cluster readAttributeTotalActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement TotalActivePower Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageMinWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltageMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsVoltageMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsVoltageMaxWithCompletionHandler"]; - - [cluster readAttributeRmsVoltageMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsVoltageMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrent Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentMinWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrentMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeRmsCurrentMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeRmsCurrentMaxWithCompletionHandler"]; - - [cluster readAttributeRmsCurrentMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement RmsCurrentMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerWithCompletionHandler"]; - - [cluster readAttributeActivePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePower Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerMinWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerMinWithCompletionHandler"]; - - [cluster readAttributeActivePowerMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePowerMin Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeActivePowerMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeActivePowerMaxWithCompletionHandler"]; - - [cluster readAttributeActivePowerMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ActivePowerMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterElectricalMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPElectricalMeasurement * cluster = [[CHIPElectricalMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ElectricalMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ElectricalMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePHYRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePHYRateWithCompletionHandler"]; - - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PHYRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeFullDuplexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeFullDuplexWithCompletionHandler"]; - - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics FullDuplex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePacketRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePacketRxCountWithCompletionHandler"]; - - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PacketRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributePacketTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributePacketTxCountWithCompletionHandler"]; - - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics PacketTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeTxErrCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeTxErrCountWithCompletionHandler"]; - - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics TxErrCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeCollisionCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeCollisionCountWithCompletionHandler"]; - - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics CollisionCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeCarrierDetectWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeCarrierDetectWithCompletionHandler"]; - - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics CarrierDetect Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeTimeSinceResetWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeTimeSinceResetWithCompletionHandler"]; - - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics TimeSinceReset Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterEthernetNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPEthernetNetworkDiagnostics * cluster = [[CHIPEthernetNetworkDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"EthernetNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"EthernetNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeLabelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"FixedLabelReadAttributeLabelListWithCompletionHandler"]; - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFixedLabelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFixedLabel * cluster = [[CHIPFixedLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FixedLabelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FixedLabel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterFlowMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"FlowMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"FlowMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumbWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeBreadcrumbWithCompletionHandler"]; - - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumbWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningWriteAttributeBreadcrumbWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeBreadcrumbWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterGeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeBasicCommissioningInfoWithCompletionHandler"]; - - [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( - CHIPGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning BasicCommissioningInfo Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeRegulatoryConfigWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeRegulatoryConfigWithCompletionHandler"]; - - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning RegulatoryConfig Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeLocationCapabilityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeLocationCapabilityWithCompletionHandler"]; - - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning LocationCapability Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralCommissioningReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralCommissioningReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralCommissioning ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeNetworkInterfacesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeNetworkInterfacesWithCompletionHandler"]; - - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics NetworkInterfaces Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeRebootCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeRebootCountWithCompletionHandler"]; - - [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics RebootCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeUpTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeUpTimeWithCompletionHandler"]; - - [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics UpTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeTotalOperationalHoursWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeTotalOperationalHoursWithCompletionHandler"]; - - [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics TotalOperationalHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeBootReasonsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeBootReasonsWithCompletionHandler"]; - - [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics BootReasons Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveHardwareFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveHardwareFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveHardwareFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveHardwareFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveRadioFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveRadioFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveRadioFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveRadioFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeActiveNetworkFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeActiveNetworkFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveNetworkFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ActiveNetworkFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGeneralDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGeneralDiagnostics * cluster = [[CHIPGeneralDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GeneralDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GeneralDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler"]; - - [cluster readAttributeGroupKeyMapWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementWriteAttributeGroupKeyMapWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementWriteAttributeGroupKeyMapWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeGroupKeyMapWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterGroupKeyManagementReadAttributeGroupTableWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupTableWithCompletionHandler"]; - - [cluster readAttributeGroupTableWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupTable Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler"]; - - [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement MaxGroupsPerFabric Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler"]; - - [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement MaxGroupKeysPerFabric Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupKeyManagementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeNameSupportWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeNameSupportWithCompletionHandler"]; - - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups NameSupport Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterGroupsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Groups ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeIdentifyTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTimeWithCompletionHandler"]; - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify IdentifyTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyWriteAttributeIdentifyTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyWriteAttributeIdentifyTimeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeIdentifyTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Identify IdentifyTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterIdentifyReadAttributeIdentifyTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTypeWithCompletionHandler"]; - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify IdentifyType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIdentifyReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IdentifyReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Identify ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeLightSensorTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeLightSensorTypeWithCompletionHandler"]; - - [cluster readAttributeLightSensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement LightSensorType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterIlluminanceMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPIlluminanceMeasurement * cluster = [[CHIPIlluminanceMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"IlluminanceMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"IlluminanceMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterKeypadInputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPKeypadInput * cluster = [[CHIPKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"KeypadInputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"KeypadInput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeCurrentLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeCurrentLevelWithCompletionHandler"]; - - [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl CurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeRemainingTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeRemainingTimeWithCompletionHandler"]; - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl RemainingTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMinLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeMinLevelWithCompletionHandler"]; - - [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MinLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMaxLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeMaxLevelWithCompletionHandler"]; - - [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MaxLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeCurrentFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeCurrentFrequencyWithCompletionHandler"]; - - [cluster readAttributeCurrentFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl CurrentFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMinFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeMinFrequencyWithCompletionHandler"]; - - [cluster readAttributeMinFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MinFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeMaxFrequencyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeMaxFrequencyWithCompletionHandler"]; - - [cluster readAttributeMaxFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl MaxFrequency Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeOptionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeOptionsWithCompletionHandler"]; - - [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl Options Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOptionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOptionsWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOptionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl Options Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnOffTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOnOffTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnOffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnOffTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnOffTransitionTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnOffTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnOffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeOnLevelWithCompletionHandler"]; - - [cluster readAttributeOnLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnLevelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnLevelWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOnLevelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOnTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOnTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOnTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OnTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOnTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOnTransitionTimeWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOnTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OnTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeOffTransitionTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeOffTransitionTimeWithCompletionHandler"]; - - [cluster readAttributeOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl OffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeOffTransitionTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeOffTransitionTimeWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeOffTransitionTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl OffTransitionTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeDefaultMoveRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeDefaultMoveRateWithCompletionHandler"]; - - [cluster readAttributeDefaultMoveRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl DefaultMoveRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeDefaultMoveRateWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeDefaultMoveRateWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeDefaultMoveRateWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl DefaultMoveRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeStartUpCurrentLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeStartUpCurrentLevelWithCompletionHandler"]; - - [cluster readAttributeStartUpCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl StartUpCurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlWriteAttributeStartUpCurrentLevelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlWriteAttributeStartUpCurrentLevelWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeStartUpCurrentLevelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LevelControl StartUpCurrentLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLevelControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LevelControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LevelControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeActiveLocaleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeActiveLocaleWithCompletionHandler"]; - - [cluster readAttributeActiveLocaleWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ActiveLocale Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationWriteAttributeActiveLocaleWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationWriteAttributeActiveLocaleWithValue"]; - - NSString * _Nonnull value = @"Test"; - [cluster writeAttributeActiveLocaleWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ActiveLocale Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLocalizationConfigurationReadAttributeSupportedLocalesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeSupportedLocalesWithCompletionHandler"]; - - [cluster readAttributeSupportedLocalesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration SupportedLocales Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLocalizationConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLocalizationConfiguration * cluster = [[CHIPLocalizationConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LocalizationConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LocalizationConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"LowPowerReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterLowPowerReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"LowPowerReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"LowPower ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeMediaInputListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeMediaInputListWithCompletionHandler"]; - - [cluster readAttributeMediaInputListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput MediaInputList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeCurrentMediaInputWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeCurrentMediaInputWithCompletionHandler"]; - - [cluster readAttributeCurrentMediaInputWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput CurrentMediaInput Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaInputReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaInput * cluster = [[CHIPMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaInputReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaInput ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributePlaybackStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributePlaybackStateWithCompletionHandler"]; - - [cluster readAttributePlaybackStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback PlaybackState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeStartTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributeStartTimeWithCompletionHandler"]; - - [cluster readAttributeStartTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback StartTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeDurationWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributeDurationWithCompletionHandler"]; - - [cluster readAttributeDurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback Duration Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributePositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackReadAttributePositionWithCompletionHandler"]; - - [cluster readAttributePositionWithCompletionHandler:^( - CHIPMediaPlaybackClusterPlaybackPosition * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback Position Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackWriteAttributePositionWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"MediaPlaybackWriteAttributePositionWithValue"]; - - CHIPMediaPlaybackClusterPlaybackPosition * _Nonnull value = [[CHIPMediaPlaybackClusterPlaybackPosition alloc] init]; - [cluster writeAttributePositionWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"MediaPlayback Position Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterMediaPlaybackReadAttributePlaybackSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributePlaybackSpeedWithCompletionHandler"]; - - [cluster readAttributePlaybackSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback PlaybackSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeSeekRangeEndWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeSeekRangeEndWithCompletionHandler"]; - - [cluster readAttributeSeekRangeEndWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback SeekRangeEnd Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeSeekRangeStartWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeSeekRangeStartWithCompletionHandler"]; - - [cluster readAttributeSeekRangeStartWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback SeekRangeStart Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterMediaPlaybackReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPMediaPlayback * cluster = [[CHIPMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"MediaPlaybackReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"MediaPlayback ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeCurrentModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeCurrentModeWithCompletionHandler"]; - - [cluster readAttributeCurrentModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect CurrentMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeSupportedModesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeSupportedModesWithCompletionHandler"]; - - [cluster readAttributeSupportedModesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect SupportedModes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeOnModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeOnModeWithCompletionHandler"]; - - [cluster readAttributeOnModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect OnMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectWriteAttributeOnModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectWriteAttributeOnModeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ModeSelect OnMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterModeSelectReadAttributeStartUpModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeStartUpModeWithCompletionHandler"]; - - [cluster readAttributeStartUpModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect StartUpMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeDescriptionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ModeSelectReadAttributeDescriptionWithCompletionHandler"]; - - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect Description Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterModeSelectReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ModeSelectReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ModeSelect ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler"]; - - [cluster readAttributeDefaultOtaProvidersWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeDefaultOtaProvidersWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdatePossibleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdatePossibleWithCompletionHandler"]; - - [cluster readAttributeUpdatePossibleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdatePossible Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler"]; - - [cluster readAttributeUpdateStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdateState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler"]; - - [cluster readAttributeUpdateStateProgressWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor UpdateStateProgress Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device - endpoint:0 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancyWithCompletionHandler"]; - - [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing Occupancy Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancySensorTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancySensorTypeWithCompletionHandler"]; - - [cluster readAttributeOccupancySensorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing OccupancySensorType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeOccupancySensorTypeBitmapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeOccupancySensorTypeBitmapWithCompletionHandler"]; - - [cluster readAttributeOccupancySensorTypeBitmapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing OccupancySensorTypeBitmap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOccupancySensingReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOccupancySensing * cluster = [[CHIPOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OccupancySensingReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OccupancySensing ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeOnOffWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnOffWithCompletionHandler"]; - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeGlobalSceneControlWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeGlobalSceneControlWithCompletionHandler"]; - - [cluster readAttributeGlobalSceneControlWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff GlobalSceneControl Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeOnTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnTimeWithCompletionHandler"]; - - [cluster readAttributeOnTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OnTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeOnTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeOnTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOnTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff OnTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeOffWaitTimeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOffWaitTimeWithCompletionHandler"]; - - [cluster readAttributeOffWaitTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeOffWaitTimeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeOffWaitTimeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeOffWaitTimeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff OffWaitTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeStartUpOnOffWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeStartUpOnOffWithCompletionHandler"]; - - [cluster readAttributeStartUpOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff StartUpOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffWriteAttributeStartUpOnOffWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffWriteAttributeStartUpOnOffWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeStartUpOnOffWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOff StartUpOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOff ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeSwitchTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeSwitchTypeWithCompletionHandler"]; - - [cluster readAttributeSwitchTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeSwitchActionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeSwitchActionsWithCompletionHandler"]; - - [cluster readAttributeSwitchActionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchActions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationWriteAttributeSwitchActionsWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationWriteAttributeSwitchActionsWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeSwitchActionsWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration SwitchActions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOnOffSwitchConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOnOffSwitchConfiguration * cluster = [[CHIPOnOffSwitchConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OnOffSwitchConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OnOffSwitchConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeNOCsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeNOCsWithCompletionHandler"]; - - [cluster readAttributeNOCsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials NOCs Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeFabricsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeFabricsListWithCompletionHandler"]; - - [cluster readAttributeFabricsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials FabricsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeSupportedFabricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeSupportedFabricsWithCompletionHandler"]; - - [cluster readAttributeSupportedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials SupportedFabrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeCommissionedFabricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeCommissionedFabricsWithCompletionHandler"]; - - [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials CommissionedFabrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeTrustedRootCertificatesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeTrustedRootCertificatesWithCompletionHandler"]; - - [cluster readAttributeTrustedRootCertificatesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials TrustedRootCertificates Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeCurrentFabricIndexWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeCurrentFabricIndexWithCompletionHandler"]; - - [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials CurrentFabricIndex Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterOperationalCredentialsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"OperationalCredentialsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"OperationalCredentials ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeStatusWithCompletionHandler"]; - - [cluster readAttributeStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Status Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeOrderWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeOrderWithCompletionHandler"]; - - [cluster readAttributeOrderWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Order Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeDescriptionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeDescriptionWithCompletionHandler"]; - - [cluster readAttributeDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource Description Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryVoltageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryVoltageWithCompletionHandler"]; - - [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryVoltage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryPercentRemainingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryPercentRemainingWithCompletionHandler"]; - - [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryPercentRemaining Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryTimeRemainingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryTimeRemainingWithCompletionHandler"]; - - [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryTimeRemaining Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryChargeLevelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryChargeLevelWithCompletionHandler"]; - - [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryChargeLevel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeActiveBatteryFaultsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeActiveBatteryFaultsWithCompletionHandler"]; - - [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ActiveBatteryFaults Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeBatteryChargeStateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeBatteryChargeStateWithCompletionHandler"]; - - [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource BatteryChargeState Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"PowerSourceReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSource ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeSourcesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeSourcesWithCompletionHandler"]; - - [cluster readAttributeSourcesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration Sources Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PowerSourceConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPressureMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPressureMeasurement * cluster = [[CHIPPressureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PressureMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PressureMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxPressureWithCompletionHandler"]; - - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxSpeedWithCompletionHandler"]; - - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxFlowWithCompletionHandler"]; - - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstPressureWithCompletionHandler"]; - - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstPressureWithCompletionHandler"]; - - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinCompPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinCompPressureWithCompletionHandler"]; - - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinCompPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxCompPressureWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxCompPressureWithCompletionHandler"]; - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxCompPressure Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstSpeedWithCompletionHandler"]; - - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstSpeedWithCompletionHandler"]; - - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstSpeed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstFlowWithCompletionHandler"]; - - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstFlowWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstFlowWithCompletionHandler"]; - - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstFlow Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMinConstTempWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMinConstTempWithCompletionHandler"]; - - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MinConstTemp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxConstTempWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxConstTempWithCompletionHandler"]; - - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl MaxConstTemp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributePumpStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributePumpStatusWithCompletionHandler"]; - - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl PumpStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperationModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveOperationModeWithCompletionHandler"]; - - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl EffectiveOperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveControlModeWithCompletionHandler"]; - - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl EffectiveControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeCapacityWithCompletionHandler"]; - - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Capacity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeSpeedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeSpeedWithCompletionHandler"]; - - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Speed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeLifetimeRunningHoursWithCompletionHandler"]; - - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeLifetimeRunningHoursWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeLifetimeRunningHoursWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeRunningHours Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributePowerWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributePowerWithCompletionHandler"]; - - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl Power Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeLifetimeEnergyConsumedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeLifetimeEnergyConsumedWithCompletionHandler"]; - - [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeEnergyConsumed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeLifetimeEnergyConsumedWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeLifetimeEnergyConsumedWithValue"]; - - NSNumber * _Nullable value = @(0); - [cluster writeAttributeLifetimeEnergyConsumedWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl LifetimeEnergyConsumed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeOperationModeWithCompletionHandler"]; - - [cluster readAttributeOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeOperationModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeOperationModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeControlModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeControlModeWithCompletionHandler"]; - - [cluster readAttributeControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeControlModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeControlModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeControlModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ControlMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterPumpConfigurationAndControlReadAttributeAlarmMaskWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeAlarmMaskWithCompletionHandler"]; - - [cluster readAttributeAlarmMaskWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl AlarmMask Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"PumpConfigurationAndControlReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPPumpConfigurationAndControl * cluster = [[CHIPPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"PumpConfigurationAndControl ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterRelativeHumidityMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"RelativeHumidityMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeSceneCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneCountWithCompletionHandler"]; - - [cluster readAttributeSceneCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes SceneCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeCurrentSceneWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentSceneWithCompletionHandler"]; - - [cluster readAttributeCurrentSceneWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes CurrentScene Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeCurrentGroupWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentGroupWithCompletionHandler"]; - - [cluster readAttributeCurrentGroupWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes CurrentGroup Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeSceneValidWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneValidWithCompletionHandler"]; - - [cluster readAttributeSceneValidWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes SceneValid Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeNameSupportWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeNameSupportWithCompletionHandler"]; - - [cluster readAttributeNameSupportWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes NameSupport Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ScenesReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ScenesReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterScenesReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Scenes ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeThreadMetricsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeThreadMetricsWithCompletionHandler"]; - - [cluster readAttributeThreadMetricsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ThreadMetrics Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapFreeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapFreeWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapFreeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapFree Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapUsedWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapUsedWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapUsedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapUsed Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeCurrentHeapHighWatermarkWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeCurrentHeapHighWatermarkWithCompletionHandler"]; - - [cluster readAttributeCurrentHeapHighWatermarkWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics CurrentHeapHighWatermark Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSoftwareDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSoftwareDiagnostics * cluster = [[CHIPSoftwareDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SoftwareDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"SoftwareDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeNumberOfPositionsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeNumberOfPositionsWithCompletionHandler"]; - - [cluster readAttributeNumberOfPositionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch NumberOfPositions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeCurrentPositionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeCurrentPositionWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch CurrentPosition Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeMultiPressMaxWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeMultiPressMaxWithCompletionHandler"]; - - [cluster readAttributeMultiPressMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch MultiPressMax Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"SwitchReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterSwitchReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Switch ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeTargetNavigatorListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeTargetNavigatorListWithCompletionHandler"]; - - [cluster readAttributeTargetNavigatorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator TargetNavigatorList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeCurrentNavigatorTargetWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeCurrentNavigatorTargetWithCompletionHandler"]; - - [cluster readAttributeCurrentNavigatorTargetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator CurrentNavigatorTarget Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTargetNavigatorReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTargetNavigator * cluster = [[CHIPTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TargetNavigatorReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TargetNavigator ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMinMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MinMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMaxMeasuredValueWithCompletionHandler"]; - - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement MaxMeasuredValue Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeToleranceWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeToleranceWithCompletionHandler"]; - - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement Tolerance Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TemperatureMeasurementReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TemperatureMeasurement ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeTemperatureDisplayModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeTemperatureDisplayModeWithCompletionHandler"]; - - [cluster readAttributeTemperatureDisplayModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration TemperatureDisplayMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeTemperatureDisplayModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeTemperatureDisplayModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeTemperatureDisplayModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration TemperatureDisplayMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeKeypadLockoutWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeKeypadLockoutWithCompletionHandler"]; - - [cluster readAttributeKeypadLockoutWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration KeypadLockout Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeKeypadLockoutWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeKeypadLockoutWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeKeypadLockoutWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration KeypadLockout Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeScheduleProgrammingVisibilityWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeScheduleProgrammingVisibilityWithCompletionHandler"]; - - [cluster - readAttributeScheduleProgrammingVisibilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationWriteAttributeScheduleProgrammingVisibilityWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThermostatUserInterfaceConfigurationWriteAttributeScheduleProgrammingVisibilityWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster - writeAttributeScheduleProgrammingVisibilityWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility Error: %@", - err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription: - @"ThermostatUserInterfaceConfigurationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThermostatUserInterfaceConfigurationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThermostatUserInterfaceConfiguration * cluster = [[CHIPThermostatUserInterfaceConfiguration alloc] initWithDevice:device - endpoint:1 - queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThermostatUserInterfaceConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThermostatUserInterfaceConfiguration ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChannelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChannelWithCompletionHandler"]; - - [cluster readAttributeChannelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Channel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRoutingRoleWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRoutingRoleWithCompletionHandler"]; - - [cluster readAttributeRoutingRoleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RoutingRole Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeNetworkNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeNetworkNameWithCompletionHandler"]; - - [cluster readAttributeNetworkNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics NetworkName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePanIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePanIdWithCompletionHandler"]; - - [cluster readAttributePanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PanId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeExtendedPanIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeExtendedPanIdWithCompletionHandler"]; - - [cluster readAttributeExtendedPanIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ExtendedPanId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeMeshLocalPrefixWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeMeshLocalPrefixWithCompletionHandler"]; - - [cluster readAttributeMeshLocalPrefixWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics MeshLocalPrefix Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeNeighborTableListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeNeighborTableListWithCompletionHandler"]; - - [cluster readAttributeNeighborTableListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics NeighborTableList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRouteTableListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRouteTableListWithCompletionHandler"]; - - [cluster readAttributeRouteTableListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RouteTableList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePartitionIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePartitionIdWithCompletionHandler"]; - - [cluster readAttributePartitionIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PartitionId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeWeightingWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeWeightingWithCompletionHandler"]; - - [cluster readAttributeWeightingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Weighting Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDataVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDataVersionWithCompletionHandler"]; - - [cluster readAttributeDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics DataVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeStableDataVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeStableDataVersionWithCompletionHandler"]; - - [cluster readAttributeStableDataVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics StableDataVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeLeaderRouterIdWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeLeaderRouterIdWithCompletionHandler"]; - - [cluster readAttributeLeaderRouterIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics LeaderRouterId Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDetachedRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDetachedRoleCountWithCompletionHandler"]; - - [cluster readAttributeDetachedRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics DetachedRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChildRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChildRoleCountWithCompletionHandler"]; - - [cluster readAttributeChildRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ChildRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRouterRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRouterRoleCountWithCompletionHandler"]; - - [cluster readAttributeRouterRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RouterRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeLeaderRoleCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeLeaderRoleCountWithCompletionHandler"]; - - [cluster readAttributeLeaderRoleCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics LeaderRoleCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeAttachAttemptCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeAttachAttemptCountWithCompletionHandler"]; - - [cluster readAttributeAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics AttachAttemptCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePartitionIdChangeCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePartitionIdChangeCountWithCompletionHandler"]; - - [cluster readAttributePartitionIdChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PartitionIdChangeCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeBetterPartitionAttachAttemptCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeBetterPartitionAttachAttemptCountWithCompletionHandler"]; - - [cluster - readAttributeBetterPartitionAttachAttemptCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics BetterPartitionAttachAttemptCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeParentChangeCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeParentChangeCountWithCompletionHandler"]; - - [cluster readAttributeParentChangeCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ParentChangeCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxTotalCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxTotalCountWithCompletionHandler"]; - - [cluster readAttributeTxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxTotalCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxUnicastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxUnicastCountWithCompletionHandler"]; - - [cluster readAttributeTxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxUnicastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBroadcastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBroadcastCountWithCompletionHandler"]; - - [cluster readAttributeTxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBroadcastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxAckRequestedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxAckRequestedCountWithCompletionHandler"]; - - [cluster readAttributeTxAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxAckRequestedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxAckedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxAckedCountWithCompletionHandler"]; - - [cluster readAttributeTxAckedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxAckedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxNoAckRequestedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxNoAckRequestedCountWithCompletionHandler"]; - - [cluster readAttributeTxNoAckRequestedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxNoAckRequestedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDataCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDataCountWithCompletionHandler"]; - - [cluster readAttributeTxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDataCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDataPollCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDataPollCountWithCompletionHandler"]; - - [cluster readAttributeTxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDataPollCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBeaconCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBeaconCountWithCompletionHandler"]; - - [cluster readAttributeTxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBeaconCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxBeaconRequestCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxBeaconRequestCountWithCompletionHandler"]; - - [cluster readAttributeTxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxBeaconRequestCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxOtherCountWithCompletionHandler"]; - - [cluster readAttributeTxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxRetryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxRetryCountWithCompletionHandler"]; - - [cluster readAttributeTxRetryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxRetryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler"]; - - [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxDirectMaxRetryExpiryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self - expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler"]; - - [cluster - readAttributeTxIndirectMaxRetryExpiryCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxIndirectMaxRetryExpiryCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrCcaCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrCcaCountWithCompletionHandler"]; - - [cluster readAttributeTxErrCcaCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrCcaCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrAbortCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrAbortCountWithCompletionHandler"]; - - [cluster readAttributeTxErrAbortCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrAbortCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeTxErrBusyChannelCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeTxErrBusyChannelCountWithCompletionHandler"]; - - [cluster readAttributeTxErrBusyChannelCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics TxErrBusyChannelCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxTotalCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxTotalCountWithCompletionHandler"]; - - [cluster readAttributeRxTotalCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxTotalCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxUnicastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxUnicastCountWithCompletionHandler"]; - - [cluster readAttributeRxUnicastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxUnicastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBroadcastCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBroadcastCountWithCompletionHandler"]; - - [cluster readAttributeRxBroadcastCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBroadcastCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDataCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDataCountWithCompletionHandler"]; - - [cluster readAttributeRxDataCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDataCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDataPollCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDataPollCountWithCompletionHandler"]; - - [cluster readAttributeRxDataPollCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDataPollCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBeaconCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBeaconCountWithCompletionHandler"]; - - [cluster readAttributeRxBeaconCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBeaconCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxBeaconRequestCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxBeaconRequestCountWithCompletionHandler"]; - - [cluster readAttributeRxBeaconRequestCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxBeaconRequestCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxOtherCountWithCompletionHandler"]; - - [cluster readAttributeRxOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxAddressFilteredCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxAddressFilteredCountWithCompletionHandler"]; - - [cluster readAttributeRxAddressFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxAddressFilteredCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDestAddrFilteredCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDestAddrFilteredCountWithCompletionHandler"]; - - [cluster readAttributeRxDestAddrFilteredCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDestAddrFilteredCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxDuplicatedCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxDuplicatedCountWithCompletionHandler"]; - - [cluster readAttributeRxDuplicatedCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxDuplicatedCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrNoFrameCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrNoFrameCountWithCompletionHandler"]; - - [cluster readAttributeRxErrNoFrameCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrNoFrameCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrUnknownNeighborCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrUnknownNeighborCountWithCompletionHandler"]; - - [cluster readAttributeRxErrUnknownNeighborCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrUnknownNeighborCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrInvalidSrcAddrCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrInvalidSrcAddrCountWithCompletionHandler"]; - - [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrInvalidSrcAddrCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrSecCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrSecCountWithCompletionHandler"]; - - [cluster readAttributeRxErrSecCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrSecCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrFcsCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrFcsCountWithCompletionHandler"]; - - [cluster readAttributeRxErrFcsCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrFcsCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeRxErrOtherCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeRxErrOtherCountWithCompletionHandler"]; - - [cluster readAttributeRxErrOtherCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics RxErrOtherCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeActiveTimestampWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeActiveTimestampWithCompletionHandler"]; - - [cluster readAttributeActiveTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ActiveTimestamp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributePendingTimestampWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributePendingTimestampWithCompletionHandler"]; - - [cluster readAttributePendingTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics PendingTimestamp Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeDelayWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeDelayWithCompletionHandler"]; - - [cluster readAttributeDelayWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics Delay Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeSecurityPolicyWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeSecurityPolicyWithCompletionHandler"]; - - [cluster readAttributeSecurityPolicyWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics SecurityPolicy Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeChannelMaskWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeChannelMaskWithCompletionHandler"]; - - [cluster readAttributeChannelMaskWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ChannelMask Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeOperationalDatasetComponentsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeOperationalDatasetComponentsWithCompletionHandler"]; - - [cluster readAttributeOperationalDatasetComponentsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics OperationalDatasetComponents Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeActiveNetworkFaultsListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeActiveNetworkFaultsListWithCompletionHandler"]; - - [cluster readAttributeActiveNetworkFaultsListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ActiveNetworkFaultsList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterThreadNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPThreadNetworkDiagnostics * cluster = [[CHIPThreadNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"ThreadNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"ThreadNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeHourFormatWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeHourFormatWithCompletionHandler"]; - - [cluster readAttributeHourFormatWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization HourFormat Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationWriteAttributeHourFormatWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"TimeFormatLocalizationWriteAttributeHourFormatWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeHourFormatWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization HourFormat Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTimeFormatLocalizationReadAttributeActiveCalendarTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeActiveCalendarTypeWithCompletionHandler"]; - - [cluster readAttributeActiveCalendarTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ActiveCalendarType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationWriteAttributeActiveCalendarTypeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationWriteAttributeActiveCalendarTypeWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeActiveCalendarTypeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ActiveCalendarType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTimeFormatLocalizationReadAttributeSupportedCalendarTypesWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeSupportedCalendarTypesWithCompletionHandler"]; - - [cluster readAttributeSupportedCalendarTypesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization SupportedCalendarTypes Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTimeFormatLocalizationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTimeFormatLocalization * cluster = [[CHIPTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TimeFormatLocalizationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TimeFormatLocalization ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeTemperatureUnitWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeTemperatureUnitWithCompletionHandler"]; - - [cluster readAttributeTemperatureUnitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization TemperatureUnit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationWriteAttributeTemperatureUnitWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UnitLocalizationWriteAttributeTemperatureUnitWithValue"]; - - NSNumber * _Nonnull value = @(0); - [cluster writeAttributeTemperatureUnitWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"UnitLocalization TemperatureUnit Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterUnitLocalizationReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUnitLocalizationReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUnitLocalization * cluster = [[CHIPUnitLocalization alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UnitLocalizationReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UnitLocalization ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeLabelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UserLabelReadAttributeLabelListWithCompletionHandler"]; - - [cluster readAttributeLabelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelWriteAttributeLabelListWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"UserLabelWriteAttributeLabelListWithValue"]; - - NSArray * _Nonnull value = [NSArray array]; - [cluster writeAttributeLabelListWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"UserLabel LabelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterUserLabelReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterUserLabelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"UserLabelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"UserLabel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeWakeOnLanMacAddressWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeWakeOnLanMacAddressWithCompletionHandler"]; - - [cluster readAttributeWakeOnLanMacAddressWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan WakeOnLanMacAddress Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WakeOnLanReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWakeOnLanReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWakeOnLan * cluster = [[CHIPWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WakeOnLanReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WakeOnLan ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBssidWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBssidWithCompletionHandler"]; - - [cluster readAttributeBssidWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics Bssid Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeSecurityTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeSecurityTypeWithCompletionHandler"]; - - [cluster readAttributeSecurityTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics SecurityType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeWiFiVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeWiFiVersionWithCompletionHandler"]; - - [cluster readAttributeWiFiVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics WiFiVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeChannelNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeChannelNumberWithCompletionHandler"]; - - [cluster readAttributeChannelNumberWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ChannelNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeRssiWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeRssiWithCompletionHandler"]; - - [cluster readAttributeRssiWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics Rssi Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBeaconLostCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBeaconLostCountWithCompletionHandler"]; - - [cluster readAttributeBeaconLostCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics BeaconLostCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeBeaconRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeBeaconRxCountWithCompletionHandler"]; - - [cluster readAttributeBeaconRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics BeaconRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketMulticastRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketMulticastRxCountWithCompletionHandler"]; - - [cluster readAttributePacketMulticastRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketMulticastRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketMulticastTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketMulticastTxCountWithCompletionHandler"]; - - [cluster readAttributePacketMulticastTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketMulticastTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketUnicastRxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketUnicastRxCountWithCompletionHandler"]; - - [cluster readAttributePacketUnicastRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketUnicastRxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributePacketUnicastTxCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributePacketUnicastTxCountWithCompletionHandler"]; - - [cluster readAttributePacketUnicastTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics PacketUnicastTxCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeCurrentMaxRateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeCurrentMaxRateWithCompletionHandler"]; - - [cluster readAttributeCurrentMaxRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics CurrentMaxRate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeOverrunCountWithCompletionHandler"]; - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics OverrunCount Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWiFiNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWiFiNetworkDiagnostics * cluster = [[CHIPWiFiNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WiFiNetworkDiagnosticsReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WiFiNetworkDiagnostics ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringReadAttributeTypeWithCompletionHandler"]; - - [cluster readAttributeTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering Type Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltWithCompletionHandler"]; - - [cluster readAttributeCurrentPositionTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeConfigStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeConfigStatusWithCompletionHandler"]; - - [cluster readAttributeConfigStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ConfigStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftPercentageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftPercentageWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionLiftPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLiftPercentage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltPercentageWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltPercentageWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionTiltPercentageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTiltPercentage Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeOperationalStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeOperationalStatusWithCompletionHandler"]; - - [cluster readAttributeOperationalStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering OperationalStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTargetPositionLiftPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeTargetPositionLiftPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering TargetPositionLiftPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeTargetPositionTiltPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeTargetPositionTiltPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering TargetPositionTiltPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeEndProductTypeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeEndProductTypeWithCompletionHandler"]; - - [cluster readAttributeEndProductTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering EndProductType Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionLiftPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionLiftPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionLiftPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeCurrentPositionTiltPercent100thsWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeCurrentPositionTiltPercent100thsWithCompletionHandler"]; - - [cluster - readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering CurrentPositionTiltPercent100ths Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledOpenLimitLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledOpenLimitLiftWithCompletionHandler"]; - - [cluster readAttributeInstalledOpenLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledOpenLimitLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledClosedLimitLiftWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledClosedLimitLiftWithCompletionHandler"]; - - [cluster readAttributeInstalledClosedLimitLiftWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledClosedLimitLift Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledOpenLimitTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledOpenLimitTiltWithCompletionHandler"]; - - [cluster readAttributeInstalledOpenLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledOpenLimitTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeInstalledClosedLimitTiltWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeInstalledClosedLimitTiltWithCompletionHandler"]; - - [cluster readAttributeInstalledClosedLimitTiltWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering InstalledClosedLimitTilt Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeModeWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringReadAttributeModeWithCompletionHandler"]; - - [cluster readAttributeModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering Mode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringWriteAttributeModeWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringWriteAttributeModeWithValue"]; - - NSNumber * _Nonnull value = @(0x00); - [cluster writeAttributeModeWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"WindowCovering Mode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterWindowCoveringReadAttributeSafetyStatusWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeSafetyStatusWithCompletionHandler"]; - - [cluster readAttributeSafetyStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering SafetyStatus Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeServerGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeServerGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ServerGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeClientGeneratedCommandListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeClientGeneratedCommandListWithCompletionHandler"]; - - [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ClientGeneratedCommandList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeFeatureMapWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeFeatureMapWithCompletionHandler"]; - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering FeatureMap Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterWindowCoveringReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"WindowCoveringReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"WindowCovering ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - @end From 29e6a345e58aaab8f40b04d6850c930b4433e12a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 Feb 2022 02:02:51 -0500 Subject: [PATCH 20/30] Fix compilation on newer clang. (#14868) There's a warning about thinking you are iterating without copying when you get copied anyway that this code was triggering. --- src/app/clusters/bindings/BindingManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp index d1622042bb37cc..a2817ca1576245 100644 --- a/src/app/clusters/bindings/BindingManager.cpp +++ b/src/app/clusters/bindings/BindingManager.cpp @@ -125,7 +125,9 @@ void BindingManager::HandleDeviceConnected(OperationalDeviceProxy * device) FabricIndex fabricToRemove = kUndefinedFabricIndex; NodeId nodeToRemove = kUndefinedNodeId; - for (const PendingNotificationEntry & pendingNotification : mPendingNotificationMap) + // Note: not using a const ref here, because the mPendingNotificationMap + // iterator returns things by value anyway. + for (PendingNotificationEntry pendingNotification : mPendingNotificationMap) { EmberBindingTableEntry entry; emberGetBinding(pendingNotification.mBindingEntryId, &entry); From b4901dbc139b7a18bf6b104f190e3735a2a2656f Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 8 Feb 2022 12:39:53 +0530 Subject: [PATCH 21/30] [ESP32] Automatically build OTA image based on flag (#14835) --- config/esp32/components/chip/CMakeLists.txt | 12 ++++ config/esp32/components/chip/Kconfig | 18 +++++- config/esp32/components/chip/ota-image.cmake | 65 ++++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 config/esp32/components/chip/ota-image.cmake diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 2fcfd0a899cf58..1f59be4cfe7f08 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -29,6 +29,8 @@ if(NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../.. REALPATH) endif() +include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake) + set(CHIP_REQURIE_COMPONENTS freertos lwip bt mdns mbedtls fatfs app_update console openthread) if (NOT CMAKE_BUILD_EARLY_EXPANSION) @@ -246,3 +248,13 @@ if(CONFIG_ENABLE_PW_RPC) set(WRAP_FUNCTIONS esp_log_write) target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") endif() + +# Build Matter OTA image +if (CONFIG_CHIP_OTA_IMAGE_BUILD) + chip_ota_image(chip-ota-image + INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin + OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin + ) + # Adding dependecy as app target so that this runs after images are ready + add_dependencies(chip-ota-image app) +endif() diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 4fb3fe4fe63a48..63535664264835 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -287,7 +287,7 @@ menu "CHIP Device Layer" config DEVICE_SOFTWARE_VERSION string "Device Software Version String" - default "" + default "v1.0" help A string identifying the software version running on the device. @@ -768,4 +768,20 @@ menu "CHIP Device Layer" endmenu + menu "Matter OTA Image" + + config CHIP_OTA_IMAGE_BUILD + bool "Generate Matter OTA image" + help + Enable building OTA (Over-the-air update) image which includes Matter OTA header. + + config CHIP_OTA_IMAGE_EXTRA_ARGS + string "OTA image creator extra arguments" + depends on CHIP_OTA_IMAGE_BUILD + help + This option allows one to pass optional arguments to the ota_image_tool.py script, + used for building OTA image with Matter OTA header. + + endmenu + endmenu diff --git a/config/esp32/components/chip/ota-image.cmake b/config/esp32/components/chip/ota-image.cmake new file mode 100644 index 00000000000000..59646edcab08a6 --- /dev/null +++ b/config/esp32/components/chip/ota-image.cmake @@ -0,0 +1,65 @@ +# +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +find_package(Python3 REQUIRED) + +# +# Create CMake target for building Matter OTA (Over-the-air update) image. +# Required arguments: +# INPUT_FILES file1, [file2...] - binary files which Matter OTA image will be composed of +# OUTPUT_FILE file - where to store newly created Matter OTA image +# +function(chip_ota_image TARGET_NAME) + cmake_parse_arguments(ARG "" "OUTPUT_FILE" "INPUT_FILES" ${ARGN}) + + if (NOT ARG_INPUT_FILES OR NOT ARG_OUTPUT_FILE) + message(FATAL_ERROR "Both INPUT_FILES and OUTPUT_FILE arguments must be specified") + endif() + + # Prepare ota_image_tool.py argument list + set(OTA_ARGS + "--vendor-id" + ${CONFIG_DEVICE_VENDOR_ID} + "--product-id" + ${CONFIG_DEVICE_PRODUCT_ID} + "--version" + ${CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER} + "--version-str" + ${CONFIG_DEVICE_SOFTWARE_VERSION} + "--digest-algorithm" + "sha256" + ) + + separate_arguments(OTA_EXTRA_ARGS NATIVE_COMMAND "${CHIP_OTA_IMAGE_EXTRA_ARGS}") + + list(APPEND OTA_ARGS ${OTA_EXTRA_ARGS}) + list(APPEND OTA_ARGS ${ARG_INPUT_FILES}) + list(APPEND OTA_ARGS ${ARG_OUTPUT_FILE}) + + # Convert the argument list to multi-line string + string(REPLACE ";" "\n" OTA_ARGS "${OTA_ARGS}") + + # Pass the argument list via file to avoid hitting Windows command-line length limit + file(GENERATE + OUTPUT ${BUILD_DIR}/args-ota-image.tmp + CONTENT ${OTA_ARGS} + ) + + add_custom_target(${TARGET_NAME} ALL + COMMAND ${Python3_EXECUTABLE} ${CHIP_ROOT}/src/app/ota_image_tool.py create @${BUILD_DIR}/args-ota-image.tmp + COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_DIR}/args-ota-image.tmp + ) +endfunction() From bed61c31fbef0dc20783558f889bdde379087b8e Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Tue, 8 Feb 2022 00:59:40 -0800 Subject: [PATCH 22/30] Make WriteHandler an ExchangeDelegate (#14821) * Make WriteHandler an ExchangeDelegate This is a meant to setup the WriteHandler's messaging processing pathways correctly to permit chunking to get implemented correctly (which will utilize this feature). * Removed the `EnableResponseGeneration` method that I added to the WriteHandler since that required enabling CONFIG_IM_BUILD_FOR_UNIT_TEST when building the src/app/tests/*. This caused issues when building these tests on EFR32 platforms which didn't have that defined. So rather than disable those tests outright for those platforms, or do some other hackery, I decided to just enable async dispatch for just the test I was modifying to make it more representative of real-world scenarios and consequently, avoid the special logic. * Added some comments * Fix comment typo. Co-authored-by: Michael Sandstedt Co-authored-by: Boris Zbarsky Co-authored-by: Michael Sandstedt --- src/app/InteractionModelEngine.cpp | 2 +- src/app/WriteHandler.cpp | 81 +++++++++++++++++++- src/app/WriteHandler.h | 20 ++++- src/app/tests/TestWriteInteraction.cpp | 40 ++++++++-- src/controller/tests/data_model/TestRead.cpp | 4 +- src/lib/core/CHIPError.h | 8 +- src/messaging/tests/MessagingContext.h | 14 ++++ src/transport/raw/tests/NetworkTestHelpers.h | 9 +++ 8 files changed, 158 insertions(+), 20 deletions(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index b08db60763aa2f..071591ac46192c 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -106,7 +106,7 @@ void InteractionModelEngine::Shutdown() for (auto & writeHandler : mWriteHandlers) { - VerifyOrDie(writeHandler.IsFree()); + writeHandler.Abort(); } mReportingEngine.Shutdown(); diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 180fec751a85ef..7090f8d00a6091 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -16,6 +16,7 @@ * limitations under the License. */ +#include "messaging/ExchangeContext.h" #include #include #include @@ -48,12 +49,53 @@ CHIP_ERROR WriteHandler::Init() return CHIP_NO_ERROR; } -void WriteHandler::Shutdown() +void WriteHandler::Close() { VerifyOrReturn(mState != State::Uninitialized); + mMessageWriter.Reset(); - mpExchangeCtx = nullptr; + + if (mpExchangeCtx != nullptr) + { + mpExchangeCtx->SetDelegate(nullptr); + mpExchangeCtx = nullptr; + } + + ClearState(); +} + +void WriteHandler::Abort() +{ +#if 0 + // TODO: When chunking gets added, we should add this back. + // + // If the exchange context hasn't already been gracefully closed + // (signaled by setting it to null), then we need to forcibly + // tear it down. + // + if (mpExchangeCtx != nullptr) + { + // We might be a delegate for this exchange, and we don't want the + // OnExchangeClosing notification in that case. Null out the delegate + // to avoid that. + // + // TODO: This makes all sorts of assumptions about what the delegate is + // (notice the "might" above!) that might not hold in practice. We + // really need a better solution here.... + mpExchangeCtx->SetDelegate(nullptr); + mpExchangeCtx->Abort(); + mpExchangeCtx = nullptr; + } + ClearState(); +#else + // + // The WriteHandler should get synchronously allocated and destroyed in the same execution + // context given that it's just a 2 message exchange (request + response). Consequently, we should + // never arrive at a situation where we have active handlers at any time Abort() is called. + // + VerifyOrDie(mState == State::Uninitialized); +#endif } Status WriteHandler::OnWriteRequest(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload, @@ -61,6 +103,12 @@ Status WriteHandler::OnWriteRequest(Messaging::ExchangeContext * apExchangeConte { mpExchangeCtx = apExchangeContext; + // + // Let's take over further message processing on this exchange from the IM. + // This is only relevant during chunked requests. + // + mpExchangeCtx->SetDelegate(this); + Status status = ProcessWriteRequest(std::move(aPayload), aIsTimedWrite); // Do not send response on Group Write @@ -73,10 +121,37 @@ Status WriteHandler::OnWriteRequest(Messaging::ExchangeContext * apExchangeConte } } - Shutdown(); + Close(); return status; } +CHIP_ERROR WriteHandler::OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, + System::PacketBufferHandle && aPayload) +{ + // + // As part of write handling, the exchange should get closed sychronously given there is always + // just a single response to a Write Request message before the exchange gets closed. There-after, + // even if we get any more messages on that exchange from a non-compliant client, our exchange layer + // should correctly discard those. If there is a bug there, this function here may get invoked. + // + // NOTE: Once chunking gets implemented, this will no longer be true. + // + VerifyOrDieWithMsg(false, DataManagement, "This function should never get invoked"); +} + +void WriteHandler::OnResponseTimeout(Messaging::ExchangeContext * apExchangeContext) +{ + // + // As part of write handling, the exchange should get closed sychronously given there is always + // just a single response to a Write Request message before the exchange gets closed. That response + // does not solicit any further responses back. Consequently, we never expect to get notified + // of any response timeouts. + // + // NOTE: Once chunking gets implemented, this will no longer be true. + // + VerifyOrDieWithMsg(false, DataManagement, "This function should never get invoked"); +} + CHIP_ERROR WriteHandler::FinalizeMessage(System::PacketBufferHandle & packet) { VerifyOrReturnError(mState == State::AddStatus, CHIP_ERROR_INCORRECT_STATE); diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index 099cdea0729aac..f3b120361e626f 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -36,13 +36,13 @@ namespace app { /** * @brief The write handler is responsible for processing a write request and sending a write reply. */ -class WriteHandler +class WriteHandler : public Messaging::ExchangeDelegate { public: /** * Initialize the WriteHandler. Within the lifetime * of this instance, this method is invoked once after object - * construction until a call to Shutdown is made to terminate the + * construction until a call to Close is made to terminate the * instance. * * @retval #CHIP_ERROR_INCORRECT_STATE If the state is not equal to @@ -53,7 +53,7 @@ class WriteHandler /** * Process a write request. Parts of the processing may end up being asynchronous, but the WriteHandler - * guarantees that it will call Shutdown on itself when processing is done (including if OnWriteRequest + * guarantees that it will call Close on itself when processing is done (including if OnWriteRequest * returns an error). * * @param[in] apExchangeContext A pointer to the ExchangeContext. @@ -66,6 +66,12 @@ class WriteHandler Protocols::InteractionModel::Status OnWriteRequest(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload, bool aIsTimedWrite); + /* + * This forcibly closes the exchange context if a valid one is pointed to and de-initializes the object. Such a situation does + * not arise during normal message processing flows that all normally call Close() below. + */ + void Abort(); + bool IsFree() const { return mState == State::Uninitialized; } virtual ~WriteHandler() = default; @@ -111,8 +117,14 @@ class WriteHandler /** * Clean up state when we are done sending the write response. */ - void Shutdown(); + void Close(); +private: // ExchangeDelegate + CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, + System::PacketBufferHandle && aPayload) override; + void OnResponseTimeout(Messaging::ExchangeContext * apExchangeContext) override; + +private: Messaging::ExchangeContext * mpExchangeCtx = nullptr; WriteResponseMessage::Builder mWriteResponseBuilder; System::PacketBufferTLVWriter mMessageWriter; diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index cd9b7f3ee088e7..8fb27fb286f8b8 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -262,6 +262,22 @@ void TestWriteInteraction::TestWriteHandler(nlTestSuite * apSuite, void * apCont TestContext & ctx = *static_cast(apContext); + // + // We have to enable async dispatch here to ensure that the exchange + // gets correctly closed out in the test below. Otherwise, the following happens: + // + // 1. WriteHandler generates a response upon OnWriteRequest being called. + // 2. Since there is no matching active client-side exchange for that request, the IM engine + // handles it incorrectly and treats it like an unsolicited message. + // 3. It is invalid to receive a WriteResponse as an unsolicited message so it correctly sends back + // a StatusResponse containing an error to that message. + // 4. Without unwinding the existing call stack, a response is received on the same exchange that the handler + // generated a WriteResponse on. This exchange should have been closed in a normal execution model, but in + // a synchronous model, the exchange is still open, and the status response is sent to the WriteHandler. + // 5. WriteHandler::OnMessageReceived is invoked, and it correctly asserts. + // + ctx.EnableAsyncDispatch(); + constexpr bool allBooleans[] = { true, false }; for (auto messageIsTimed : allBooleans) { @@ -278,27 +294,35 @@ void TestWriteInteraction::TestWriteHandler(nlTestSuite * apSuite, void * apCont TestExchangeDelegate delegate; Messaging::ExchangeContext * exchange = ctx.NewExchangeToBob(&delegate); - Status status = writeHandler.OnWriteRequest(exchange, std::move(buf), transactionIsTimed); + + Status status = writeHandler.OnWriteRequest(exchange, std::move(buf), transactionIsTimed); if (messageIsTimed == transactionIsTimed) { NL_TEST_ASSERT(apSuite, status == Status::Success); } else { - NL_TEST_ASSERT(apSuite, status == Status::UnsupportedAccess); - // In the normal code flow, the exchange would now get closed - // when we send the error status on it (of if that fails when - // the stack unwinds). In the success case it's been closed - // already by the WriteHandler sending the response on it, but - // if we are in the error case we need to make sure it gets - // closed. + // + // In a normal execution flow, the exchange manager would have closed out the exchange after the + // message dispatch call path had unwound. In this test however, we've manually allocated the exchange + // ourselves (as opposed to the exchange manager), so we need to take ownership of closing out the exchange. + // + // Note that this doesn't happen in the success case above, since that results in a call to send a message through + // the exchange context, which results in the exchange manager correctly closing it. + // exchange->Close(); + NL_TEST_ASSERT(apSuite, status == Status::UnsupportedAccess); } + ctx.DrainAndServiceIO(); + ctx.DrainAndServiceIO(); + Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); } } + + ctx.DisableAsyncDispatch(); } CHIP_ERROR WriteSingleClusterData(const Access::SubjectDescriptor & aSubjectDescriptor, ClusterInfo & aClusterInfo, diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index cbf8e5ddd550ec..52ba22a6624937 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -432,7 +432,7 @@ void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleSubscription auto onFailureCb = [&apSuite, &numFailureCalls](const app::ConcreteAttributePath * attributePath, CHIP_ERROR aError) { numFailureCalls++; - NL_TEST_ASSERT(apSuite, aError == CHIP_IM_GLOBAL_STATUS(Protocols::InteractionModel::Status::ResourceExhausted)); + NL_TEST_ASSERT(apSuite, aError == CHIP_IM_GLOBAL_STATUS(ResourceExhausted)); NL_TEST_ASSERT(apSuite, attributePath == nullptr); }; @@ -499,7 +499,7 @@ void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleReads(nlTest auto onFailureCb = [&apSuite, &numFailureCalls](const app::ConcreteAttributePath * attributePath, CHIP_ERROR aError) { numFailureCalls++; - NL_TEST_ASSERT(apSuite, aError == CHIP_IM_GLOBAL_STATUS(Protocols::InteractionModel::Status::ResourceExhausted)); + NL_TEST_ASSERT(apSuite, aError == CHIP_IM_GLOBAL_STATUS(ResourceExhausted)); NL_TEST_ASSERT(apSuite, attributePath == nullptr); }; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 35493bcc4c344e..87d083d0a08fdf 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -400,9 +400,13 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_CORE_ERROR(e) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kCore, (e)) -#define CHIP_IM_GLOBAL_STATUS(e) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMGlobalStatus, to_underlying(e)) +#define CHIP_IM_GLOBAL_STATUS(type) \ + CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMGlobalStatus, to_underlying(Protocols::InteractionModel::Status::type)) -#define CHIP_IM_CLUSTER_STATUS(e) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, e) +// +// type must be a compile-time constant as mandated by CHIP_SDK_ERROR. +// +#define CHIP_IM_CLUSTER_STATUS(type) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, type) // clang-format off diff --git a/src/messaging/tests/MessagingContext.h b/src/messaging/tests/MessagingContext.h index 06d5aa8cfa802d..afb771123ce9f1 100644 --- a/src/messaging/tests/MessagingContext.h +++ b/src/messaging/tests/MessagingContext.h @@ -234,6 +234,20 @@ class LoopbackMessagingContext : public MessagingContext impl.EnableAsyncDispatch(&mIOContext.GetSystemLayer()); } + /* + * Reset the dispatch back to a model that synchronously dispatches received messages up the stack. + * + * NOTE: This results in highly atypical/complex call stacks that are not representative of what happens on real + * devices and can cause subtle and complex bugs to either appear or get masked in the system. Where possible, please + * use this sparingly! + * + */ + void DisableAsyncDispatch() + { + auto & impl = GetLoopback(); + impl.DisableAsyncDispatch(); + } + /* * This drives the servicing of events using the embedded IOContext while there are pending * messages in the loopback transport's pending message queue. This should run to completion diff --git a/src/transport/raw/tests/NetworkTestHelpers.h b/src/transport/raw/tests/NetworkTestHelpers.h index 1cc57df34fa3ad..987c81a895c984 100644 --- a/src/transport/raw/tests/NetworkTestHelpers.h +++ b/src/transport/raw/tests/NetworkTestHelpers.h @@ -79,6 +79,15 @@ class LoopbackTransport : public Transport::Base mAsyncMessageDispatch = true; } + /* + * Reset the dispatch back to a model that synchronously dispatches received messages up the stack. + * + * NOTE: This results in highly atypical/complex call stacks that are not representative of what happens on real + * devices and can cause subtle and complex bugs to either appear or get masked in the system. Where possible, please + * use this sparingly! + */ + void DisableAsyncDispatch() { mAsyncMessageDispatch = false; } + bool HasPendingMessages() { return !mPendingMessageQueue.empty(); } static void OnMessageReceived(System::Layer * aSystemLayer, void * aAppState) From 2f785f44716fceeb5cda65df0cadefe7d11b0304 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 8 Feb 2022 10:24:24 +0100 Subject: [PATCH 23/30] [YAML] Add TestDiscovery.yaml (#14598) * Add DiscoveryCommands interface to src/app/tests/suites/commands/discovery * [YAML] Add additional PICS code to PICS.yaml * [YAML] Add TestDiscovery.yaml * Workaround the colliding mdns advertisment on CI * Update generated content --- examples/chip-tool/BUILD.gn | 1 + .../chip-tool/commands/tests/TestCommand.cpp | 6 +- .../chip-tool/commands/tests/TestCommand.h | 2 + .../templates/partials/test_cluster.zapt | 59 +- examples/chip-tool/templates/tests.js | 1 + examples/placeholder/linux/BUILD.gn | 1 + .../placeholder/linux/include/TestCommand.h | 9 +- src/app/tests/suites/TestDiscovery.yaml | 314 +++ src/app/tests/suites/certification/PICS.yaml | 43 +- .../tests/suites/commands/discovery/BUILD.gn | 32 + .../commands/discovery/DiscoveryCommands.cpp | 186 ++ .../commands/discovery/DiscoveryCommands.h | 82 + .../clusters/DiscoveryCommands.js | 162 ++ .../chip-tool/zap-generated/test/Commands.h | 1898 ++++++++++++++++- .../app1/zap-generated/test/Commands.h | 26 +- .../app2/zap-generated/test/Commands.h | 26 +- 16 files changed, 2767 insertions(+), 81 deletions(-) create mode 100644 src/app/tests/suites/TestDiscovery.yaml create mode 100644 src/app/tests/suites/commands/discovery/BUILD.gn create mode 100644 src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp create mode 100644 src/app/tests/suites/commands/discovery/DiscoveryCommands.h create mode 100644 src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index f8c0af9df1bad5..db1bdce4a54119 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -69,6 +69,7 @@ static_library("chip-tool-utils") { public_deps = [ "${chip_root}/src/app/server", + "${chip_root}/src/app/tests/suites/commands/discovery", "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/commands/system", "${chip_root}/src/app/tests/suites/pics", diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 72d4fdc870d40d..addc4ff4efb57c 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -32,6 +32,7 @@ CHIP_ERROR TestCommand::RunCommand() CHIP_ERROR TestCommand::WaitForCommissionee() { + CurrentCommissioner().ReleaseOperationalDevice(mNodeId); return CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } @@ -42,7 +43,7 @@ void TestCommand::OnDeviceConnectedFn(void * context, chip::OperationalDevicePro VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "Device connected, but cannot run the test, as the context is null")); command->mDevices[command->GetIdentity()] = device; - command->NextTest(); + command->ContinueOnChipMainThread(); } void TestCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error) @@ -51,7 +52,8 @@ void TestCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHI peerId.GetNodeId(), error.Format()); auto * command = static_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "Test command context is null")); - command->SetCommandExitStatus(error); + + command->ContinueOnChipMainThread(); } void TestCommand::OnWaitForMsFn(chip::System::Layer * systemLayer, void * context) diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index a6aa4fff92d9a4..f798082eb23b86 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -19,6 +19,7 @@ #pragma once #include "../common/CHIPCommand.h" +#include #include #include #include @@ -34,6 +35,7 @@ class TestCommand : public CHIPCommand, public ConstraintsChecker, public PICSChecker, public LogCommands, + public DiscoveryCommands, public SystemCommands { public: diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 4a62f625feca4d..8b9f9cfd549cca 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -102,6 +102,57 @@ class {{filename}}: public TestCommand {{/chip_tests_item_response_parameters}} {{/chip_tests_items}} + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + {{#chip_tests_items}} + {{#if (isStrEqual cluster "DiscoveryCommands")}} + if ((mTestIndex - 1) == {{index}}) + { + isExpectedDnssdResult = true; + {{#chip_tests_item_response_parameters}} + {{#*inline "itemValue"}}nodeData.{{name}}{{#if isOptional}}.Value(){{/if}}{{/inline}} + {{~#if hasExpectedValue}} + {{#if isOptional}}VerifyOrReturn(CheckValuePresent("{{name}}", nodeData.{{name}}));{{/if}} + VerifyOrReturn(CheckValue("{{name}}", {{>itemValue}}, + {{#if (chip_tests_config_has expectedValue)}} + m{{asUpperCamelCase expectedValue}}.HasValue() ? m{{asUpperCamelCase expectedValue}}.Value() : {{asTypedLiteral (chip_tests_config_get_default_value expectedValue) (chip_tests_config_get_type expectedValue)}} + {{else}} + {{expectedValue}} + {{/if}} + )); + {{/if}} + {{#if hasExpectedConstraints}} + {{#if isOptional}}VerifyOrReturn(CheckValuePresent("{{name}}", nodeData.{{name}}));{{/if}} + {{#if (hasProperty expectedConstraints "minLength")}}VerifyOrReturn(CheckConstraintMinLength("{{name}}", {{>itemValue}}.size(), {{expectedConstraints.minLength}}));{{/if}} + {{#if (hasProperty expectedConstraints "maxLength")}}VerifyOrReturn(CheckConstraintMaxLength("{{name}}", {{>itemValue}}.size(), {{expectedConstraints.maxLength}}));{{/if}} + {{#if (hasProperty expectedConstraints "minValue")}}VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{name}}", {{>itemValue}}, {{asTypedLiteral expectedConstraints.minValue type}}));{{/if}} + {{#if (hasProperty expectedConstraints "maxValue")}}VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{name}}", {{>itemValue}}, {{asTypedLiteral expectedConstraints.maxValue type}}));{{/if}} + {{#if (hasProperty expectedConstraints "notValue")}}VerifyOrReturn(CheckConstraintNotValue("{{name}}", {{>itemValue}}, {{asTypedLiteral expectedConstraints.notValue type}}));{{/if}} + {{/if}} + + {{#if saveAs}} + {{#if (isString type)}} + if ({{saveAs}}Buffer != nullptr) + { + chip::Platform::MemoryFree({{saveAs}}Buffer); + } + {{saveAs}}Buffer = static_cast<{{#if (isOctetString type)}}uint8_t{{else}}char{{/if}} *>(chip::Platform::MemoryAlloc({{>itemValue}}.size())); + memcpy({{saveAs}}Buffer, {{>itemValue}}.data(), {{>itemValue}}.size()); + {{saveAs}} = {{chipType}}({{saveAs}}Buffer, {{>itemValue}}.size()); + {{else}} + {{saveAs}} = {{>itemValue}}; + {{/if}} + {{/if}} + {{/chip_tests_item_response_parameters}} + } + {{/if}} + {{/chip_tests_items}} + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + {{! Helper around zapTypeToDecodableClusterObjectType that lets us set the array/nullable/etc context appropriately.}} {{~#*inline "subscribeResponseDataArgument"~}} @@ -194,7 +245,13 @@ class {{filename}}: public TestCommand CHIP_ERROR {{>testCommand}}() { SetIdentity(kIdentity{{asUpperCamelCase identity}}); - return {{command}}({{#chip_tests_item_parameters}}{{#not_first}}, {{/not_first}}{{#if (isString type)}}"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); + return {{command}}({{#chip_tests_item_parameters}}{{#not_first}}, {{/not_first}}{{#if (isString type)}}"{{/if~}} + {{~#if (chip_tests_config_has definedValue)~}} + m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{asTypedLiteral (chip_tests_config_get_default_value definedValue) (chip_tests_config_get_type definedValue)}} + {{else}} + {{definedValue}} + {{~/if~}} + {{~#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); } {{else if isWait}} CHIP_ERROR {{>testCommand}}() diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 579fda699c8623..1ef8cdb0722018 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -241,6 +241,7 @@ function getTests() 'TestClusterComplexTypes', 'TestConstraints', 'TestDelayCommands', + 'TestDiscovery', 'TestLogCommands', 'TestSaveAs', 'TestConfigVariables', diff --git a/examples/placeholder/linux/BUILD.gn b/examples/placeholder/linux/BUILD.gn index 1917652769dc64..dbcfb549509fe2 100644 --- a/examples/placeholder/linux/BUILD.gn +++ b/examples/placeholder/linux/BUILD.gn @@ -41,6 +41,7 @@ executable("chip-${chip_tests_zap_config}") { deps = [ ":configuration", "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/src/app/tests/suites/commands/discovery", "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/pics", "${chip_root}/src/lib", diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index 6f8a8cc64c342a..e03f5e39ce4d54 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -34,7 +35,7 @@ constexpr const char kIdentityAlpha[] = ""; constexpr const char kIdentityBeta[] = ""; constexpr const char kIdentityGamma[] = ""; -class TestCommand : public PICSChecker, public LogCommands +class TestCommand : public PICSChecker, public LogCommands, public DiscoveryCommands { public: TestCommand(const char * commandName) : mCommandPath(0, 0, 0), mAttributePath(0, 0, 0) {} @@ -70,6 +71,12 @@ class TestCommand : public PICSChecker, public LogCommands return CHIP_NO_ERROR; } + void Exit(std::string message) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", message.c_str()); + SetCommandExitStatus(CHIP_ERROR_INTERNAL); + } + static void ScheduleNextTest(intptr_t context) { TestCommand * command = reinterpret_cast(context); diff --git a/src/app/tests/suites/TestDiscovery.yaml b/src/app/tests/suites/TestDiscovery.yaml new file mode 100644 index 00000000000000..2987f8ee77908b --- /dev/null +++ b/src/app/tests/suites/TestDiscovery.yaml @@ -0,0 +1,314 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Test Discovery + +config: + endpoint: 0 + discriminator: + type: INT16U + defaultValue: GetUniqueDiscriminator() + vendorId: + type: INT16U + defaultValue: 65521 + productId: + type: INT16U + defaultValue: 32768 + deviceType: + type: INT16U + defaultValue: 5 + +tests: + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Open Commissioning Window" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 120 + + - label: "Wait 1000ms for the mdns advertisement to be published" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + + - label: "Check Instance Name" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + saveAs: deviceInstanceNameBeforeReboot + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + + # TODO: + # Find a way to validate the service type and the service domain + + - label: "Check Hostname" + PICS: "(WIFI || ETH) && !THREAD" + # On macOS the hostname is the device name and because of it this test is disabled for now. + disabled: true + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 12 + isUpperCase: true + isHexString: true + + - label: "Check Hostname" + PICS: "(!WIFI && !ETH) && THREAD" + # On macOS the hostname is the device name and because of it this test is disabled for now. + disabled: true + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + + # Commissioning Subtypes + + - label: "Check Long Discriminator _L" + cluster: "DiscoveryCommands" + command: "FindCommissionableByLongDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + + - label: "Check Short Discriminator (_S)" + cluster: "DiscoveryCommands" + command: "FindCommissionableByShortDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + + - label: "Check Commissioning Mode (_CM)" + cluster: "DiscoveryCommands" + command: "FindCommissionableByCommissioningMode" + + - label: "Check Vendor ID (_V)" + PICS: VENDOR_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByVendorId" + arguments: + values: + - name: "value" + value: vendorId + + - label: "Check Device Type ID (_T)" + # The device type is not broadcasted by the accessory under CI. + disabled: true + PICS: DEVTYPE_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByDeviceType" + arguments: + values: + - name: "value" + value: deviceType + + # TXT Records + + - label: "TXT key for discriminator (D)" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "longDiscriminator" + value: discriminator + constraints: + minValue: 0 + maxValue: 4096 + + - label: "TXT key for Vendor ID and Product ID (VP)" + PICS: VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "vendorId" + value: vendorId + + # Maybe it should be a PICS code to differentiate between manufacturer that wants to broadcast the + # product id ? + - label: "TXT key for Vendor ID and Product ID (VP)" + PICS: VP_KEY + optional: true + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "productId" + value: productId + + - label: "Optional TXT key for MRP Retry Interval Idle (CRI)" + PICS: CRI_COMM_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalIdle" + constraints: + maxValue: 3600000 + + - label: "Optional TXT key for MRP Retry Interval Active (CRA)" + PICS: CRA_COMM_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalActive" + constraints: + maxValue: 3600000 + + - label: "TXT key for commissioning mode (CM)" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "commissioningMode" + value: 1 + + - label: "Optional TXT key for device type (DT)" + disabled: true + PICS: DT_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceType" + value: deviceType + constraints: + # The specification says this is a number expressed as , but it seems like it can goes + # up to 0xBFFF (49151). + maxValue: 999 + + - label: "Optional TXT key for device name (DN)" + PICS: DN_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceName" + constraints: + maxLength: 32 + + - label: "Optional TXT key for rotating device identifier (RI)" + PICS: RI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "rotatingIdLen" + constraints: + maxValue: 100 + + - label: "Optional TXT key for pairing hint (PH)" + PICS: PH_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingHint" + notValue: 0 + + - label: "Optional TXT key for pairing instructions (PI)" + PICS: PI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingInstruction" + constraints: + maxLength: 128 + + - label: "Check IPs" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "numIPs" + constraints: + minValue: 1 + + - label: "Reboot target device" + cluster: "SystemCommands" + command: "Reboot" + arguments: + values: + - name: "discriminator" + value: discriminator + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Open Commissioning Window" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 120 + + - label: "Wait 1000ms for the mdns advertisement to be published" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + + - label: "Check Instance Name" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + notValue: deviceInstanceNameBeforeReboot diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index cb797a2052bf9d..e6939e2e2db644 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -21,9 +21,12 @@ PICS: - label: "Does the device support discovery over WiFi?" id: WIFI - - label: "Does the device support discover over THREAD" + - label: "Does the device support discovery over THREAD" id: THREAD + - label: "Does the device support discovery over Ethernet?" + id: ETH + - label: "Does the device support manufacturing date" id: MANF_DATE @@ -225,3 +228,41 @@ PICS: - label: "Does the device implement receiving the OnWithTimedOff command?" id: CR_ONWITHTIMEOFF + + - label: "Does Dnssd advertisment broadcast Vendor ID" + id: VENDOR_SUBTYPE + + - label: "Does Dnssd advertisment broadcast Device Type ID" + id: DEVTYPE_SUBTYPE + + - label: + "The optional key CRI indicates the MRP_RETRY_INTERVAL_IDLE of the + Node" + id: CRI_COMM_DISCOVERY_KEY + + - label: + "The optional key CRA indicates the MRP_RETRY_INTERVAL_ACTIVE of the + Node" + id: CRA_COMM_DISCOVERY_KEY + + - label: + "The optional key VP, if present, MAY provide Vendor ID and Product ID + information of the device" + id: VP_KEY + + - label: + "The optional key DT MAY provide the publisher’s primary device type." + id: DT_KEY + + - label: "The optional key DN MAY provide a device advertisement name." + id: DN_KEY + + - label: "The optional key RI MAY provide a Rotating Device Identifier." + id: RI_KEY + + - label: "The optional key PH MAY provide a pairing hint." + id: PH_KEY + + - label: + "The optional key PI MAY provide additional information for pairing." + id: PI_KEY diff --git a/src/app/tests/suites/commands/discovery/BUILD.gn b/src/app/tests/suites/commands/discovery/BUILD.gn new file mode 100644 index 00000000000000..8183767c470a36 --- /dev/null +++ b/src/app/tests/suites/commands/discovery/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +static_library("discovery") { + output_name = "libDiscoveryCommands" + + sources = [ + "DiscoveryCommands.cpp", + "DiscoveryCommands.h", + ] + + cflags = [ "-Wconversion" ] + + public_deps = [ + "${chip_root}/src/lib/dnssd", + "${chip_root}/src/lib/support", + ] +} diff --git a/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp b/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp new file mode 100644 index 00000000000000..029b3a7af5a934 --- /dev/null +++ b/src/app/tests/suites/commands/discovery/DiscoveryCommands.cpp @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "DiscoveryCommands.h" + +#include +#include +#include + +CHIP_ERROR DiscoveryCommands::FindCommissionable() +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kNone, (uint64_t) 0); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionableByShortDiscriminator(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + uint64_t shortDiscriminator = static_cast((value >> 8) & 0x0F); + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kShortDiscriminator, shortDiscriminator); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionableByLongDiscriminator(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kLongDiscriminator, value); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionableByCommissioningMode() +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kCommissioningMode); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionableByVendorId(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kVendorId, value); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionableByDeviceType(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kDeviceType, value); + return mDNSResolver.FindCommissionableNodes(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissioner() +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kCommissioner, 1); + return mDNSResolver.FindCommissioners(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionerByVendorId(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kVendorId, value); + return mDNSResolver.FindCommissioners(filter); +} + +CHIP_ERROR DiscoveryCommands::FindCommissionerByDeviceType(uint64_t value) +{ + ReturnErrorOnFailure(SetupDiscoveryCommands()); + + chip::Dnssd::DiscoveryFilter filter(chip::Dnssd::DiscoveryFilterType::kDeviceType, value); + return mDNSResolver.FindCommissioners(filter); +} + +CHIP_ERROR DiscoveryCommands::SetupDiscoveryCommands() +{ + ReturnErrorOnFailure(TearDownDiscoveryCommands()); + + if (mReady == false) + { + ReturnErrorOnFailure(mDNSResolver.Init(chip::DeviceLayer::UDPEndPointManager())); + mReady = true; + } + mDNSResolver.SetResolverDelegate(this); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DiscoveryCommands::TearDownDiscoveryCommands() +{ + mDNSResolver.SetResolverDelegate(nullptr); + return CHIP_NO_ERROR; +} + +uint16_t DiscoveryCommands::GetUniqueDiscriminator() +{ + if (mDiscriminatorUseForFiltering == 0) + { + std::random_device dev; + std::mt19937 rng(dev()); + std::uniform_int_distribution distribution(1, 4096); + mDiscriminatorUseForFiltering = static_cast(distribution(rng)); + } + return mDiscriminatorUseForFiltering; +} + +void DiscoveryCommands::OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) +{ + // TODO: If multiple results are found for the same filter, then the test result depends + // on which result comes first. At the moment, the code assume that there is only + // a single match on the network, but if that's not enough, there may be a need + // to implement some sort of list that is built for a given duration before returning + // + // But also, running on CI seems to show cross-talks between CI instances, so multiple + // results will comes up. Unexpected advertisements are filtered by validating the + // discriminator from the advertisement matches the one coming from the config section + // of the test. + if (nodeData.longDiscriminator != GetUniqueDiscriminator()) + { + ChipLogError(chipTool, "Non fatal error: Unexpected node advertisment. It will be ignored"); + nodeData.LogDetail(); + return; + } + + ReturnOnFailure(TearDownDiscoveryCommands()); + + nodeData.LogDetail(); + + DiscoveryCommandResult data; + data.hostName = chip::CharSpan(nodeData.hostName, strlen(nodeData.hostName)); + data.instanceName = chip::CharSpan(nodeData.instanceName, strlen(nodeData.instanceName)); + data.longDiscriminator = nodeData.longDiscriminator; + data.shortDiscriminator = ((nodeData.longDiscriminator >> 8) & 0x0F); + data.vendorId = nodeData.vendorId; + data.productId = nodeData.productId; + data.commissioningMode = nodeData.commissioningMode; + data.deviceType = nodeData.deviceType; + data.deviceName = chip::CharSpan(nodeData.deviceName, strlen(nodeData.deviceName)); + data.rotatingId = chip::ByteSpan(nodeData.rotatingId, nodeData.rotatingIdLen); + data.rotatingIdLen = nodeData.rotatingIdLen; + data.pairingHint = nodeData.pairingHint; + data.pairingInstruction = chip::CharSpan(nodeData.pairingInstruction, strlen(nodeData.pairingInstruction)); + data.supportsTcp = nodeData.supportsTcp; + data.port = nodeData.port; + + if (!chip::CanCastTo(nodeData.numIPs)) + { + ChipLogError(chipTool, "Too many ips."); + return; + } + data.numIPs = static_cast(nodeData.numIPs); + + if (nodeData.mrpRetryIntervalIdle.HasValue()) + { + data.mrpRetryIntervalIdle.SetValue(nodeData.mrpRetryIntervalIdle.Value().count()); + } + + if (nodeData.mrpRetryIntervalActive.HasValue()) + { + data.mrpRetryIntervalActive.SetValue(nodeData.mrpRetryIntervalActive.Value().count()); + } + + OnDiscoveryCommandsResults(data); +} diff --git a/src/app/tests/suites/commands/discovery/DiscoveryCommands.h b/src/app/tests/suites/commands/discovery/DiscoveryCommands.h new file mode 100644 index 00000000000000..d99cca90d8da07 --- /dev/null +++ b/src/app/tests/suites/commands/discovery/DiscoveryCommands.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include + +struct DiscoveryCommandResult +{ + chip::CharSpan hostName; + chip::CharSpan instanceName; + uint16_t longDiscriminator; + uint8_t shortDiscriminator; + uint16_t vendorId; + uint16_t productId; + uint8_t commissioningMode; + uint16_t deviceType; + chip::CharSpan deviceName; + chip::ByteSpan rotatingId; + uint64_t rotatingIdLen; + uint16_t pairingHint; + chip::CharSpan pairingInstruction; + bool supportsTcp; + uint8_t numIPs; + uint16_t port; + chip::Optional mrpRetryIntervalIdle; + chip::Optional mrpRetryIntervalActive; +}; + +class DiscoveryCommands : public chip::Dnssd::ResolverDelegate +{ +public: + DiscoveryCommands(){}; + virtual ~DiscoveryCommands(){}; + + virtual CHIP_ERROR ContinueOnChipMainThread() = 0; + + CHIP_ERROR FindCommissionable(); + CHIP_ERROR FindCommissionableByShortDiscriminator(uint64_t value); + CHIP_ERROR FindCommissionableByLongDiscriminator(uint64_t value); + CHIP_ERROR FindCommissionableByCommissioningMode(); + CHIP_ERROR FindCommissionableByVendorId(uint64_t vendorId); + CHIP_ERROR FindCommissionableByDeviceType(uint64_t deviceType); + + CHIP_ERROR FindCommissioner(); + CHIP_ERROR FindCommissionerByVendorId(uint64_t vendorId); + CHIP_ERROR FindCommissionerByDeviceType(uint64_t deviceType); + + CHIP_ERROR SetupDiscoveryCommands(); + CHIP_ERROR TearDownDiscoveryCommands(); + virtual void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData){}; + + /////////// ResolverDelegate Interface ///////// + void OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & nodeData) override{}; + void OnNodeIdResolutionFailed(const chip::PeerId & peerId, CHIP_ERROR error) override{}; + void OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) override; + +protected: + // This function initialize a random discriminator once and returns it all the time afterwards + uint16_t GetUniqueDiscriminator(); + +private: + bool mReady = false; + chip::Dnssd::ResolverProxy mDNSResolver; + uint16_t mDiscriminatorUseForFiltering = 0; +}; diff --git a/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js b/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js new file mode 100644 index 00000000000000..a154363b0c6ea1 --- /dev/null +++ b/src/app/zap-templates/common/simulated-clusters/clusters/DiscoveryCommands.js @@ -0,0 +1,162 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file declares test suite utility methods for discovery. + * + * Each method declared in this file needs to be implemented on a per-language + * basis and allows exposing methods to the test suites that are not part + * of the regular cluster set of APIs. + * + */ + +const kTypeArgument = { + name : 'type', + type : 'CHAR_STRING', +}; + +const kNumberValueArgument = { + name : 'value', + type : 'INT64U', +}; + +const kStringValueArgument = { + name : 'value', + type : 'CHAR_STRING', +}; + +const kDefaultResponse = { + arguments : [ + { name : 'hostName', type : 'CHAR_STRING', chipType : 'chip::CharSpan' }, // + { name : 'instanceName', type : 'CHAR_STRING', chipType : 'chip::CharSpan' }, // + { name : 'longDiscriminator', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'shortDiscriminator', type : 'INT8U', chipType : 'uint8_t' }, // + { name : 'vendorId', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'productId', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'commissioningMode', type : 'INT8U', chipType : 'uint8_t' }, // + { name : 'deviceType', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'deviceName', type : 'CHAR_STRING' }, // + { name : 'rotatingId', type : 'OCTET_STRING', chipType : 'chip::ByteSpan' }, // + { name : 'rotatingIdLen', type : 'INT64U', chipType : 'uint64_t' }, // + { name : 'pairingHint', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'pairingInstruction', type : 'CHAR_STRING' }, // + { name : 'supportsTcp', type : 'BOOLEAN', chipType : 'bool' }, // + { name : 'numIPs', type : 'INT8U', chipType : 'uint8_t' }, // + { name : 'port', type : 'INT16U', chipType : 'uint16_t' }, // + { name : 'mrpRetryIntervalIdle', type : 'INT32U', chipType : 'uint32_t', isOptional : true }, // + { name : 'mrpRetryIntervalActive', type : 'INT32U', chipType : 'uint32_t', isOptional : true }, // + ] +}; + +// +// Commissionable +// + +const FindCommissionable = { + name : 'FindCommissionable', + arguments : [], + response : kDefaultResponse +}; + +const FindCommissionableByShortDiscriminator = { + name : 'FindCommissionableByShortDiscriminator', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionableByLongDiscriminator = { + name : 'FindCommissionableByLongDiscriminator', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionableByCompressedFabricId = { + name : 'FindOperationalByCompressedFabricId', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionableByCommissioningMode = { + name : 'FindCommissionableByCommissioningMode', + arguments : [], + response : kDefaultResponse +}; + +const FindCommissionableByVendorId = { + name : 'FindCommissionableByVendorId', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionableByDeviceType = { + name : 'FindCommissionableByDeviceType', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionableByName = { + name : 'FindCommissionableByName', + arguments : [ kStringValueArgument ], + response : kDefaultResponse +}; + +// +// Commissioner +// + +const FindCommissioner = { + name : 'FindCommissioner', + arguments : [], + response : kDefaultResponse +}; + +const FindCommissionerByVendorId = { + name : 'FindCommissionableByVendorId', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const FindCommissionerByDeviceType = { + name : 'FindCommissionerByDeviceType', + arguments : [ kNumberValueArgument ], + response : kDefaultResponse +}; + +const commands = [ + // Commissionable + FindCommissionable, + FindCommissionableByShortDiscriminator, + FindCommissionableByLongDiscriminator, + FindCommissionableByCommissioningMode, + FindCommissionableByVendorId, + FindCommissionableByDeviceType, + FindCommissionableByName, + // Commissioner + FindCommissioner, + FindCommissionerByVendorId, + FindCommissionerByDeviceType, +]; + +const DiscoveryCommands = { + name : 'DiscoveryCommands', + commands : commands, +}; + +// +// Module exports +// +exports.cluster = DiscoveryCommands; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 43b0f49d3e90a4..f87ebe52b2e6f9 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -157,6 +157,7 @@ class TestList : public Command printf("TestClusterComplexTypes\n"); printf("TestConstraints\n"); printf("TestDelayCommands\n"); + printf("TestDiscovery\n"); printf("TestLogCommands\n"); printf("TestSaveAs\n"); printf("TestConfigVariables\n"); @@ -276,6 +277,14 @@ class Test_TC_BI_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -554,6 +563,14 @@ class Test_TC_BI_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -1052,6 +1069,14 @@ class Test_TC_BI_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -1413,6 +1438,14 @@ class Test_TC_BOOL_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -1662,6 +1695,14 @@ class Test_TC_BOOL_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -1869,6 +1910,14 @@ class Test_TC_BRAC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -2016,6 +2065,14 @@ class Test_TC_CC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -2800,6 +2857,14 @@ class Test_TC_CC_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -7949,6 +8014,14 @@ class Test_TC_CC_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -8333,6 +8406,14 @@ class Test_TC_CC_3_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -8670,6 +8751,14 @@ class Test_TC_CC_3_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -8943,6 +9032,14 @@ class Test_TC_CC_4_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -9203,6 +9300,14 @@ class Test_TC_CC_4_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -9602,6 +9707,14 @@ class Test_TC_CC_4_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -9875,6 +9988,14 @@ class Test_TC_CC_4_4 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -10116,6 +10237,14 @@ class Test_TC_CC_5_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -10361,6 +10490,14 @@ class Test_TC_CC_5_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -10630,6 +10767,14 @@ class Test_TC_CC_5_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -10871,6 +11016,14 @@ class Test_TC_CC_6_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -11135,6 +11288,14 @@ class Test_TC_CC_6_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -11581,6 +11742,14 @@ class Test_TC_CC_6_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -11874,6 +12043,14 @@ class Test_TC_CC_7_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -12259,6 +12436,14 @@ class Test_TC_CC_7_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -12631,6 +12816,14 @@ class Test_TC_CC_7_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -12904,6 +13097,14 @@ class Test_TC_CC_7_4 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -13189,6 +13390,14 @@ class Test_TC_CC_8_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -14248,6 +14457,14 @@ class Test_TC_CC_9_1 : public TestCommand uint16_t EnhancedCurrentHueValue4; uint16_t ColorLoopStoredEnhancedHue4; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -16236,6 +16453,14 @@ class Test_TC_CC_9_2 : public TestCommand uint16_t EnhancedCurrentHueValue; uint16_t ColorLoopStoredEnhancedHueValue; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -17092,6 +17317,14 @@ class Test_TC_CC_9_3 : public TestCommand uint16_t EnhancedCurrentHueValue; uint16_t ColorLoopStoredEnhancedHueValue; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -17880,6 +18113,14 @@ class Test_TC_DM_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -18601,6 +18842,14 @@ class Test_TC_DM_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -18755,6 +19004,14 @@ class Test_TC_DM_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -18991,6 +19248,14 @@ class Test_TC_EMR_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -19227,6 +19492,14 @@ class Test_TC_ETHDIAG_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -19295,6 +19568,14 @@ class Test_TC_ETHDIAG_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -19375,6 +19656,14 @@ class Test_TC_FLW_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -19590,6 +19879,14 @@ class Test_TC_FLW_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -20086,6 +20383,14 @@ class Test_TC_FLW_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -20240,6 +20545,14 @@ class Test_TC_ILL_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -20505,6 +20818,14 @@ class Test_TC_LVL_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -20859,6 +21180,14 @@ class Test_TC_LVL_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -21460,6 +21789,14 @@ class Test_TC_LVL_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -22073,6 +22410,14 @@ class Test_TC_LVL_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -22590,6 +22935,14 @@ class Test_TC_LVL_4_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -23126,6 +23479,14 @@ class Test_TC_LVL_5_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_4(error); @@ -23544,6 +23905,14 @@ class Test_TC_LVL_6_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_4(error); @@ -23886,6 +24255,14 @@ class Test_TC_MC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -24053,6 +24430,14 @@ class Test_TC_MC_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24147,6 +24532,14 @@ class Test_TC_MC_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24214,6 +24607,14 @@ class Test_TC_MC_3_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24281,6 +24682,14 @@ class Test_TC_MC_3_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24348,6 +24757,14 @@ class Test_TC_MC_3_4 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24415,6 +24832,14 @@ class Test_TC_MC_3_5 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24482,6 +24907,14 @@ class Test_TC_MC_3_6 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24549,6 +24982,14 @@ class Test_TC_MC_3_7 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24616,6 +25057,14 @@ class Test_TC_MC_3_8 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24683,6 +25132,14 @@ class Test_TC_MC_3_9 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24750,6 +25207,14 @@ class Test_TC_MC_3_10 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24817,6 +25282,14 @@ class Test_TC_MC_3_11 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -24888,6 +25361,14 @@ class Test_TC_MC_5_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -24995,6 +25476,14 @@ class Test_TC_MC_5_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -25008,7 +25497,7 @@ class Test_TC_MC_5_2 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("verify that the channel has changed on the device."); + return UserPrompt(" verify that the channel has changed on the device."); } }; @@ -25072,6 +25561,14 @@ class Test_TC_MC_5_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -25085,7 +25582,7 @@ class Test_TC_MC_5_3 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("verify that the channel has changed on the device"); + return UserPrompt(" verify that the channel has changed on the device"); } }; @@ -25165,6 +25662,14 @@ class Test_TC_MC_6_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -25188,13 +25693,13 @@ class Test_TC_MC_6_1 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that media is paused"); + return UserPrompt(" Verify that media is paused"); } CHIP_ERROR TestLogACommand_2() { SetIdentity(kIdentityAlpha); - return UserPrompt("Physically verify that the media is playing"); + return UserPrompt(" Physically verify that the media is playing"); } CHIP_ERROR TestReadsThePlaybackStateAttribute_3() @@ -25224,13 +25729,13 @@ class Test_TC_MC_6_1 : public TestCommand CHIP_ERROR TestLogACommand_4() { SetIdentity(kIdentityAlpha); - return UserPrompt("Physically verify that the media is paused"); + return UserPrompt(" Physically verify that the media is paused"); } CHIP_ERROR TestLogACommand_5() { SetIdentity(kIdentityAlpha); - return UserPrompt("Physically verify that the media is stoped"); + return UserPrompt(" Physically verify that the media is stoped"); } }; @@ -25322,6 +25827,14 @@ class Test_TC_MC_6_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -25345,13 +25858,13 @@ class Test_TC_MC_6_2 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that media is paused"); + return UserPrompt(" Verify that media is paused"); } CHIP_ERROR TestLogACommand_2() { SetIdentity(kIdentityAlpha); - return UserPrompt("Physically verify that the media is playing"); + return UserPrompt(" Physically verify that the media is playing"); } CHIP_ERROR TestReadsTheCurrentStateAttribute_3() @@ -25381,31 +25894,31 @@ class Test_TC_MC_6_2 : public TestCommand CHIP_ERROR TestLogACommand_4() { SetIdentity(kIdentityAlpha); - return UserPrompt("Physically verify that the media is started over"); + return UserPrompt(" Physically verify that the media is started over"); } CHIP_ERROR TestLogACommand_5() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the next media item in the queue has been loaded"); + return UserPrompt(" Verify that the next media item in the queue has been loaded"); } CHIP_ERROR TestLogACommand_6() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the previous media item in the queue has been loaded"); + return UserPrompt(" Verify that the previous media item in the queue has been loaded"); } CHIP_ERROR TestLogACommand_7() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media has skipped forward 10 seconds"); + return UserPrompt(" Verify that the media has skipped forward 10 seconds"); } CHIP_ERROR TestLogACommand_8() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media has skipped backward 10 seconds"); + return UserPrompt(" Verify that the media has skipped backward 10 seconds"); } }; @@ -25477,6 +25990,14 @@ class Test_TC_MC_6_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -25490,19 +26011,19 @@ class Test_TC_MC_6_3 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that media is paused"); + return UserPrompt(" Verify that media is paused"); } CHIP_ERROR TestLogACommand_2() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media has moved to 10 seconds from the starting point."); + return UserPrompt(" Verify that the media has moved to 10 seconds from the starting point."); } CHIP_ERROR TestLogACommand_3() { SetIdentity(kIdentityAlpha); - return UserPrompt("User prompt needed to enter the value beyond the furthest valid position"); + return UserPrompt(" User prompt needed to enter the value beyond the furthest valid position"); } }; @@ -25598,6 +26119,14 @@ class Test_TC_MC_6_4 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -25641,7 +26170,7 @@ class Test_TC_MC_6_4 : public TestCommand CHIP_ERROR TestLogACommand_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that media is paused"); + return UserPrompt(" Verify that media is paused"); } CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_2() @@ -25671,7 +26200,7 @@ class Test_TC_MC_6_4 : public TestCommand CHIP_ERROR TestLogACommand_3() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media is playing"); + return UserPrompt(" Verify that the media is playing"); } CHIP_ERROR TestReadsTheCurrentStateAttribute_4() @@ -25701,13 +26230,13 @@ class Test_TC_MC_6_4 : public TestCommand CHIP_ERROR TestLogACommand_5() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media play speed has increased"); + return UserPrompt(" Verify that the media play speed has increased"); } CHIP_ERROR TestLogACommand_6() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media play has reversed direction"); + return UserPrompt(" Verify that the media play has reversed direction"); } CHIP_ERROR TestReadsTheCurrentStateAttribute_7() @@ -25737,13 +26266,13 @@ class Test_TC_MC_6_4 : public TestCommand CHIP_ERROR TestLogACommand_8() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media play has reversed direction"); + return UserPrompt(" Verify that the media play has reversed direction"); } CHIP_ERROR TestLogACommand_9() { SetIdentity(kIdentityAlpha); - return UserPrompt("Verify that the media is has resumed playing forward at the default speed"); + return UserPrompt(" Verify that the media is has resumed playing forward at the default speed"); } }; @@ -25803,6 +26332,14 @@ class Test_TC_MC_7_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -25870,6 +26407,14 @@ class Test_TC_MC_7_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -25947,6 +26492,14 @@ class Test_TC_MC_8_1 : public TestCommand uint8_t currentTarget; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -26115,6 +26668,14 @@ class Test_TC_MC_9_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -26188,7 +26749,7 @@ class Test_TC_MC_9_1 : public TestCommand CHIP_ERROR TestPrecondition_1() { SetIdentity(kIdentityAlpha); - return Log("DUT has one or more Content Apps available"); + return Log(" DUT has one or more Content Apps available"); } CHIP_ERROR TestReadsTheVendorNameAttribute_2() @@ -26407,6 +26968,14 @@ class Test_TC_OCC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -26644,6 +27213,14 @@ class Test_TC_OCC_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -27032,6 +27609,14 @@ class Test_TC_OCC_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -27202,6 +27787,14 @@ class Test_TC_OO_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -27624,6 +28217,14 @@ class Test_TC_OO_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -28234,6 +28835,14 @@ class Test_TC_OO_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -29127,6 +29736,14 @@ class Test_TC_OO_2_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -30625,6 +31242,14 @@ class Test_TC_PS_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -30869,6 +31494,14 @@ class Test_TC_PRS_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -31069,6 +31702,14 @@ class Test_TC_PRS_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -31450,6 +32091,14 @@ class Test_TC_PCC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -31846,6 +32495,14 @@ class Test_TC_PCC_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -33611,6 +34268,14 @@ class Test_TC_PCC_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -33849,6 +34514,14 @@ class Test_TC_PCC_2_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -34209,6 +34882,14 @@ class Test_TC_RH_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -34391,6 +35072,14 @@ class Test_TC_RH_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -34617,6 +35306,14 @@ class Test_TC_RH_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -34777,6 +35474,14 @@ class Test_TC_SWTCH_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -35197,6 +35902,14 @@ class Test_TC_SWTCH_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -35230,13 +35943,13 @@ class Test_TC_SWTCH_2_2 : public TestCommand CHIP_ERROR TestUserInteractionNeeded_1() { SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to SwitchLatched event"); + return UserPrompt(" Set up subscription to SwitchLatched event"); } CHIP_ERROR TestUserInteractionNeeded_2() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to first position"); + return UserPrompt(" Operator sets switch to first position"); } CHIP_ERROR TestReadCurrentPositionAttribute_3() @@ -35266,19 +35979,19 @@ class Test_TC_SWTCH_2_2 : public TestCommand CHIP_ERROR TestUserInteractionNeeded_4() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to second position"); + return UserPrompt(" Operator sets switch to second position"); } CHIP_ERROR TestUserInteractionNeeded_5() { SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress event"); + return UserPrompt(" Set up subscription to InitialPress event"); } CHIP_ERROR TestUserInteractionNeeded_6() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); + return UserPrompt(" Operator does not operate switch"); } CHIP_ERROR TestReadCurrentPositionAttribute_7() @@ -35308,43 +36021,43 @@ class Test_TC_SWTCH_2_2 : public TestCommand CHIP_ERROR TestUserInteractionNeeded_8() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator sets switch to second position"); + return UserPrompt(" Operator sets switch to second position"); } CHIP_ERROR TestUserInteractionNeeded_9() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch (release switch)"); + return UserPrompt(" Operator does not operate switch (release switch)"); } CHIP_ERROR TestUserInteractionNeeded_10() { SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress and ShortRelease events"); + return UserPrompt(" Set up subscription to InitialPress and ShortRelease events"); } CHIP_ERROR TestUserInteractionNeeded_11() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); + return UserPrompt(" Operator does not operate switch"); } CHIP_ERROR TestUserInteractionNeeded_12() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); + return UserPrompt(" Operator operates switch (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_13() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_14() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch for 5 seconds"); + return UserPrompt(" Operator operates switch for 5 seconds"); } CHIP_ERROR TestWait3000ms_15() @@ -35356,37 +36069,37 @@ class Test_TC_SWTCH_2_2 : public TestCommand CHIP_ERROR TestUserInteractionNeeded_16() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_17() { SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); + return UserPrompt(" Set up subscription to InitialPress, LongPress, ShortRelease, LongRelease events"); } CHIP_ERROR TestUserInteractionNeeded_18() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); + return UserPrompt(" Operator does not operate switch"); } CHIP_ERROR TestUserInteractionNeeded_19() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); + return UserPrompt(" Operator operates switch (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_20() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_21() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch for 5 seconds"); + return UserPrompt(" Operator operates switch for 5 seconds"); } CHIP_ERROR TestWait3000ms_22() @@ -35398,91 +36111,92 @@ class Test_TC_SWTCH_2_2 : public TestCommand CHIP_ERROR TestUserInteractionNeeded_23() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_24() { SetIdentity(kIdentityAlpha); - return UserPrompt("Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); + return UserPrompt( + " Set up subscription to InitialPress, ShortRelease, MultiPressOngoing, MultiPressComplete events"); } CHIP_ERROR TestUserInteractionNeeded_25() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator does not operate switch"); + return UserPrompt(" Operator does not operate switch"); } CHIP_ERROR TestUserInteractionNeeded_26() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); + return UserPrompt(" Operator operates switch (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_27() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_28() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch (press briefly)"); + return UserPrompt(" Operator operates switch (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_29() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_30() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); + return UserPrompt(" Operator operates switch again (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_31() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_32() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); + return UserPrompt(" Operator operates switch again (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_33() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_34() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); + return UserPrompt(" Operator operates switch again (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_35() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } CHIP_ERROR TestUserInteractionNeeded_36() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator operates switch again (press briefly)"); + return UserPrompt(" Operator operates switch again (press briefly)"); } CHIP_ERROR TestUserInteractionNeeded_37() { SetIdentity(kIdentityAlpha); - return UserPrompt("Operator releases switch"); + return UserPrompt(" Operator releases switch"); } }; @@ -35563,6 +36277,14 @@ class Test_TC_TM_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -35807,6 +36529,14 @@ class Test_TC_TM_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -35961,6 +36691,14 @@ class Test_TC_TM_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -36114,6 +36852,14 @@ class Test_TC_TSTAT_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -36597,6 +37343,14 @@ class Test_TC_TSTAT_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -39158,6 +39912,14 @@ class Test_TC_TSTAT_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -40747,6 +41509,14 @@ class Test_TC_TSUIC_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -40975,6 +41745,14 @@ class Test_TC_TSUIC_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -41649,6 +42427,14 @@ class Test_TC_TSUIC_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -42042,6 +42828,14 @@ class Test_TC_DIAGTH_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -42283,6 +43077,14 @@ class Test_TC_WIFIDIAG_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -42390,6 +43192,14 @@ class Test_TC_WIFIDIAG_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -42488,6 +43298,14 @@ class Test_TC_WNCV_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -43038,6 +43856,14 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -44962,6 +45788,14 @@ class Test_TC_WNCV_2_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -45048,6 +45882,14 @@ class Test_TC_WNCV_2_4 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -45203,6 +46045,14 @@ class Test_TC_WNCV_2_5 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -45352,6 +46202,14 @@ class Test_TC_WNCV_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -45520,6 +46378,14 @@ class Test_TC_WNCV_3_2 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -45688,6 +46554,14 @@ class Test_TC_WNCV_3_3 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -45856,6 +46730,14 @@ class TV_TargetNavigatorCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -46061,6 +46943,14 @@ class TV_AudioOutputCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -46293,6 +47183,14 @@ class TV_ApplicationLauncherCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -46520,6 +47418,14 @@ class TV_KeypadInputCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -46633,6 +47539,14 @@ class TV_AccountLoginCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -46797,6 +47711,14 @@ class TV_WakeOnLanCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -46923,6 +47845,14 @@ class TV_ApplicationBasicCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -47263,6 +48193,14 @@ class TV_MediaPlaybackCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -47906,6 +48844,14 @@ class TV_ChannelCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -48132,6 +49078,14 @@ class TV_LowPowerCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -48243,6 +49197,14 @@ class TV_ContentLauncherCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -48523,6 +49485,14 @@ class TV_MediaInputCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -50821,6 +51791,14 @@ class TestCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + typedef void (*Test_TestCluster_list_int8u_ReportCallback)(void * context, const chip::app::DataModel::DecodableList & value); Test_TestCluster_list_int8u_ReportCallback mTest_TestCluster_list_int8u_Reported = nullptr; @@ -67163,6 +68141,14 @@ class TestClusterComplexTypes : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_7(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_7(error); @@ -67978,6 +68964,14 @@ class TestConstraints : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -68711,6 +69705,14 @@ class TestDelayCommands : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -68728,6 +69730,543 @@ class TestDelayCommands : public TestCommand } }; +class TestDiscovery : public TestCommand +{ +public: + TestDiscovery(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestDiscovery", credsIssuerConfig), mTestIndex(0) + { + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("productId", 0, UINT16_MAX, &mProductId); + AddArgument("deviceType", 0, UINT16_MAX, &mDeviceType); + } + + ~TestDiscovery() + { + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + deviceInstanceNameBeforeRebootBuffer = nullptr; + } + } + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestDiscovery\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestDiscovery\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 : Reboot target device\n"); + err = TestRebootTargetDevice_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Open Commissioning Window\n"); + err = TestOpenCommissioningWindow_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 1000ms for the mdns advertisement to be published\n"); + err = TestWait1000msForTheMdnsAdvertisementToBePublished_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check Instance Name\n"); + err = TestCheckInstanceName_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check Long Discriminator _L\n"); + err = TestCheckLongDiscriminatorL_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check Short Discriminator (_S)\n"); + err = TestCheckShortDiscriminatorS_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check Commissioning Mode (_CM)\n"); + err = TestCheckCommissioningModeCm_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check Vendor ID (_V)\n"); + if (ShouldSkip("VENDOR_SUBTYPE")) + { + NextTest(); + return; + } + err = TestCheckVendorIdV_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TXT key for discriminator (D)\n"); + err = TestTxtKeyForDiscriminatorD_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TXT key for Vendor ID and Product ID (VP)\n"); + if (ShouldSkip("VP_KEY")) + { + NextTest(); + return; + } + err = TestTxtKeyForVendorIdAndProductIdVp_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TXT key for Vendor ID and Product ID (VP)\n"); + if (ShouldSkip("VP_KEY")) + { + NextTest(); + return; + } + err = TestTxtKeyForVendorIdAndProductIdVp_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Optional TXT key for MRP Retry Interval Idle (CRI)\n"); + if (ShouldSkip("CRI_COMM_DISCOVERY_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForMrpRetryIntervalIdleCri_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Optional TXT key for MRP Retry Interval Active (CRA)\n"); + if (ShouldSkip("CRA_COMM_DISCOVERY_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForMrpRetryIntervalActiveCra_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TXT key for commissioning mode (CM)\n"); + err = TestTxtKeyForCommissioningModeCm_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Optional TXT key for device name (DN)\n"); + if (ShouldSkip("DN_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForDeviceNameDn_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Optional TXT key for rotating device identifier (RI)\n"); + if (ShouldSkip("RI_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForRotatingDeviceIdentifierRi_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Optional TXT key for pairing hint (PH)\n"); + if (ShouldSkip("PH_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForPairingHintPh_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Optional TXT key for pairing instructions (PI)\n"); + if (ShouldSkip("PI_KEY")) + { + NextTest(); + return; + } + err = TestOptionalTxtKeyForPairingInstructionsPi_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check IPs\n"); + err = TestCheckIPs_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Reboot target device\n"); + err = TestRebootTargetDevice_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Open Commissioning Window\n"); + err = TestOpenCommissioningWindow_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 1000ms for the mdns advertisement to be published\n"); + err = TestWait1000msForTheMdnsAdvertisementToBePublished_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Check Instance Name\n"); + err = TestCheckInstanceName_24(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 25; + + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mVendorId; + chip::Optional mProductId; + chip::Optional mDeviceType; + + char * deviceInstanceNameBeforeRebootBuffer = nullptr; + chip::CharSpan deviceInstanceNameBeforeReboot; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + if ((mTestIndex - 1) == 4) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMinLength("instanceName", nodeData.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintMaxLength("instanceName", nodeData.instanceName.size(), 16)); + + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + } + deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(nodeData.instanceName.size())); + memcpy(deviceInstanceNameBeforeRebootBuffer, nodeData.instanceName.data(), nodeData.instanceName.size()); + deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, nodeData.instanceName.size()); + } + if ((mTestIndex - 1) == 5) + { + isExpectedDnssdResult = true; + } + if ((mTestIndex - 1) == 6) + { + isExpectedDnssdResult = true; + } + if ((mTestIndex - 1) == 7) + { + isExpectedDnssdResult = true; + } + if ((mTestIndex - 1) == 8) + { + isExpectedDnssdResult = true; + } + if ((mTestIndex - 1) == 9) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValue("longDiscriminator", nodeData.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : GetUniqueDiscriminator())); + + VerifyOrReturn(CheckConstraintMinValue("longDiscriminator", nodeData.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("longDiscriminator", nodeData.longDiscriminator, 4096U)); + } + if ((mTestIndex - 1) == 10) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValue("vendorId", nodeData.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + if ((mTestIndex - 1) == 11) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValue("productId", nodeData.productId, mProductId.HasValue() ? mProductId.Value() : 32768U)); + } + if ((mTestIndex - 1) == 12) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValuePresent("mrpRetryIntervalIdle", nodeData.mrpRetryIntervalIdle)); + + VerifyOrReturn( + CheckConstraintMaxValue("mrpRetryIntervalIdle", nodeData.mrpRetryIntervalIdle.Value(), 3600000UL)); + } + if ((mTestIndex - 1) == 13) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValuePresent("mrpRetryIntervalActive", nodeData.mrpRetryIntervalActive)); + + VerifyOrReturn( + CheckConstraintMaxValue("mrpRetryIntervalActive", nodeData.mrpRetryIntervalActive.Value(), 3600000UL)); + } + if ((mTestIndex - 1) == 14) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckValue("commissioningMode", nodeData.commissioningMode, 1)); + } + if ((mTestIndex - 1) == 15) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMaxLength("deviceName", nodeData.deviceName.size(), 32)); + } + if ((mTestIndex - 1) == 16) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMaxValue("rotatingIdLen", nodeData.rotatingIdLen, 100ULL)); + } + if ((mTestIndex - 1) == 17) + { + isExpectedDnssdResult = true; + } + if ((mTestIndex - 1) == 18) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMaxLength("pairingInstruction", nodeData.pairingInstruction.size(), 128)); + } + if ((mTestIndex - 1) == 19) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMinValue("numIPs", nodeData.numIPs, 1)); + } + if ((mTestIndex - 1) == 24) + { + isExpectedDnssdResult = true; + + VerifyOrReturn(CheckConstraintMinLength("instanceName", nodeData.instanceName.size(), 16)); + VerifyOrReturn(CheckConstraintMaxLength("instanceName", nodeData.instanceName.size(), 16)); + + VerifyOrReturn(CheckConstraintNotValue("instanceName", nodeData.instanceName, deviceInstanceNameBeforeReboot)); + } + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + // + // Tests methods + // + + CHIP_ERROR TestRebootTargetDevice_0() + { + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : GetUniqueDiscriminator()); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_1() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestOpenCommissioningWindow_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; + + RequestType request; + request.commissioningTimeout = 120U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_2(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_2(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestWait1000msForTheMdnsAdvertisementToBePublished_3() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + + CHIP_ERROR TestCheckInstanceName_4() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestCheckLongDiscriminatorL_5() + { + SetIdentity(kIdentityAlpha); + return FindCommissionableByLongDiscriminator(mDiscriminator.HasValue() ? mDiscriminator.Value() : GetUniqueDiscriminator()); + } + + CHIP_ERROR TestCheckShortDiscriminatorS_6() + { + SetIdentity(kIdentityAlpha); + return FindCommissionableByShortDiscriminator(mDiscriminator.HasValue() ? mDiscriminator.Value() + : GetUniqueDiscriminator()); + } + + CHIP_ERROR TestCheckCommissioningModeCm_7() + { + SetIdentity(kIdentityAlpha); + return FindCommissionableByCommissioningMode(); + } + + CHIP_ERROR TestCheckVendorIdV_8() + { + SetIdentity(kIdentityAlpha); + return FindCommissionableByVendorId(mVendorId.HasValue() ? mVendorId.Value() : 65521U); + } + + CHIP_ERROR TestTxtKeyForDiscriminatorD_9() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestTxtKeyForVendorIdAndProductIdVp_10() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestTxtKeyForVendorIdAndProductIdVp_11() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForMrpRetryIntervalIdleCri_12() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForMrpRetryIntervalActiveCra_13() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestTxtKeyForCommissioningModeCm_14() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForDeviceNameDn_15() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForRotatingDeviceIdentifierRi_16() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForPairingHintPh_17() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestOptionalTxtKeyForPairingInstructionsPi_18() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestCheckIPs_19() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } + + CHIP_ERROR TestRebootTargetDevice_20() + { + SetIdentity(kIdentityAlpha); + return Reboot(mDiscriminator.HasValue() ? mDiscriminator.Value() : GetUniqueDiscriminator()); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_21() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestOpenCommissioningWindow_22() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type; + + RequestType request; + request.commissioningTimeout = 120U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_22(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_22(error); + }; + + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_22(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_22() { NextTest(); } + + CHIP_ERROR TestWait1000msForTheMdnsAdvertisementToBePublished_23() + { + SetIdentity(kIdentityAlpha); + return WaitForMs(1000); + } + + CHIP_ERROR TestCheckInstanceName_24() + { + SetIdentity(kIdentityAlpha); + return FindCommissionable(); + } +}; + class TestLogCommands : public TestCommand { public: @@ -68792,6 +70331,14 @@ class TestLogCommands : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -68805,13 +70352,13 @@ class TestLogCommands : public TestCommand CHIP_ERROR TestLogASimpleMessage_1() { SetIdentity(kIdentityAlpha); - return Log("This is a simple message"); + return Log(" This is a simple message"); } CHIP_ERROR TestDoASimpleUserPromptMessage_2() { SetIdentity(kIdentityAlpha); - return UserPrompt("This is a simple message"); + return UserPrompt(" This is a simple message"); } }; @@ -69363,6 +70910,14 @@ class TestSaveAs : public TestCommand uint8_t * readAttributeOctetStringNotDefaultValueBuffer = nullptr; chip::ByteSpan readAttributeOctetStringNotDefaultValue; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_4(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_4(error); @@ -72988,6 +74543,14 @@ class TestConfigVariables : public TestCommand uint8_t TestAddArgumentDefaultValue; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -73141,6 +74704,14 @@ class TestDescriptorCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -73439,6 +75010,14 @@ class TestBasicInformation : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -73716,6 +75295,14 @@ class TestIdentifyCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -73828,6 +75415,14 @@ class TestOperationalCredentialsCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -74069,6 +75664,14 @@ class TestModeSelectCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -74435,6 +76038,14 @@ class TestSystemCommands : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -74558,6 +76169,14 @@ class Test_TC_SWDIAG_1_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -74760,6 +76379,14 @@ class Test_TC_SWDIAG_2_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -74849,6 +76476,14 @@ class Test_TC_SWDIAG_3_1 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -75041,6 +76676,14 @@ class TestSubscribe_OnOff : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + typedef void (*Test_TestSubscribe_OnOff_OnOff_ReportCallback)(void * context, bool value); Test_TestSubscribe_OnOff_OnOff_ReportCallback mTest_TestSubscribe_OnOff_OnOff_Reported = nullptr; @@ -75771,6 +77414,14 @@ class DL_UsersAndCredentials : public TestCommand uint16_t NumberOfPINUsersSupported; uint16_t NumberOfRFIDUsersSupported; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -80774,6 +82425,14 @@ class DL_LockUnlock : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_3(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_3(error); @@ -81530,6 +83189,14 @@ class DL_Schedules : public TestCommand uint8_t NumberOfWeekDaySchedulesSupportedPerUser; uint8_t NumberOfYearDaySchedulesSupportedPerUser; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_2(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_2(error); @@ -84776,6 +86443,14 @@ class TestGroupMessaging : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_5(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_5(error); @@ -85333,6 +87008,14 @@ class TestGroupsCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -86121,6 +87804,14 @@ class TestGroupKeyManagementCluster : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + static void OnFailureCallback_1(void * context, CHIP_ERROR error) { (static_cast(context))->OnFailureResponse_1(error); @@ -86815,6 +88506,14 @@ class Test_TC_DD_1_5 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -86822,8 +88521,8 @@ class Test_TC_DD_1_5 : public TestCommand CHIP_ERROR TestStep1_0() { SetIdentity(kIdentityAlpha); - return Log("Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined by NFC " - "Forum in URI Record Type Definition RTD URI"); + return Log(" Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined " + "by NFC Forum in URI Record Type Definition RTD URI"); } }; @@ -86891,6 +88590,14 @@ class Test_TC_DD_1_6 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -86898,21 +88605,21 @@ class Test_TC_DD_1_6 : public TestCommand CHIP_ERROR TestStep1_0() { SetIdentity(kIdentityAlpha); - return Log("Scan the DUTs QR code using a QR code reader"); + return Log(" Scan the DUTs QR code using a QR code reader"); } CHIP_ERROR TestStep1Verification_1() { SetIdentity(kIdentityAlpha); - return Log( - "Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast respective to " - "surface material as to be readable with standard readers such as smartphones in normal lighting conditions"); + return Log(" Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast " + "respective to surface material as to be readable with standard readers such as smartphones in normal lighting " + "conditions"); } CHIP_ERROR TestStep2Verificaiton_2() { SetIdentity(kIdentityAlpha); - return Log("Verify QR code version is 1 or higher"); + return Log(" Verify QR code version is 1 or higher"); } }; @@ -86976,6 +88683,14 @@ class Test_TC_DD_1_7 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -86983,14 +88698,14 @@ class Test_TC_DD_1_7 : public TestCommand CHIP_ERROR TestPrecondition_0() { SetIdentity(kIdentityAlpha); - return Log("Verify manual pairing code is printed on the device or in additional provided materials"); + return Log(" Verify manual pairing code is printed on the device or in additional provided materials"); } CHIP_ERROR TestStep1_1() { SetIdentity(kIdentityAlpha); - return Log("Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points typically " - "producing a typeface height of 2.1 mm"); + return Log(" Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points " + "typically producing a typeface height of 2.1 mm"); } }; @@ -87054,6 +88769,14 @@ class Test_TC_DD_1_8 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -87061,13 +88784,14 @@ class Test_TC_DD_1_8 : public TestCommand CHIP_ERROR TestStep1_0() { SetIdentity(kIdentityAlpha); - return Log("Scan the device QR code using DUT"); + return Log(" Scan the device QR code using DUT"); } CHIP_ERROR TestStep1Verification_1() { SetIdentity(kIdentityAlpha); - return Log("Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network"); + return Log(" Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the " + "CHIP network"); } }; @@ -87135,6 +88859,14 @@ class Test_TC_DD_1_9 : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -87142,20 +88874,21 @@ class Test_TC_DD_1_9 : public TestCommand CHIP_ERROR TestPrecondition_0() { SetIdentity(kIdentityAlpha); - return Log("Verify that the manual pairing code is printed on the device or in additional provided materials"); + return Log(" Verify that the manual pairing code is printed on the device or in additional provided materials"); } CHIP_ERROR TestStep1_1() { SetIdentity(kIdentityAlpha); - return Log("Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT"); + return Log(" Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported " + "by DUT"); } CHIP_ERROR TestStep1Verification_2() { SetIdentity(kIdentityAlpha); - return Log( - "Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network"); + return Log(" Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the " + "CHIP network"); } }; @@ -87296,6 +89029,14 @@ class TestGroupDemoCommand : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -87748,6 +89489,14 @@ class TestGroupDemoConfig : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -87927,6 +89676,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h index 71b09e00a6144f..19cfcd6a95726e 100644 --- a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h @@ -157,6 +157,14 @@ class Test_TC_DM_1_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -170,7 +178,7 @@ class Test_TC_DM_1_3_Simulated : public TestCommand CHIP_ERROR TestLogOnOffTestStartup_1() { SetIdentity(kIdentityAlpha); - return Log("*** Basic Cluster Tests Ready"); + return Log(" *** Basic Cluster Tests Ready"); } CHIP_ERROR TestQueryDataModelRevision_2() @@ -478,6 +486,14 @@ class Test_TC_DM_3_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -650,6 +666,14 @@ class Test_TC_DM_2_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // diff --git a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h index 71b09e00a6144f..19cfcd6a95726e 100644 --- a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h @@ -157,6 +157,14 @@ class Test_TC_DM_1_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -170,7 +178,7 @@ class Test_TC_DM_1_3_Simulated : public TestCommand CHIP_ERROR TestLogOnOffTestStartup_1() { SetIdentity(kIdentityAlpha); - return Log("*** Basic Cluster Tests Ready"); + return Log(" *** Basic Cluster Tests Ready"); } CHIP_ERROR TestQueryDataModelRevision_2() @@ -478,6 +486,14 @@ class Test_TC_DM_3_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // @@ -650,6 +666,14 @@ class Test_TC_DM_2_3_Simulated : public TestCommand chip::Optional mCluster; chip::Optional mEndpoint; + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + // // Tests methods // From 9f504000bf6f154975310baa1e71cebeb3b65f79 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 8 Feb 2022 20:42:35 +0530 Subject: [PATCH 24/30] ota-provider-app: Adding SoftwareVersionString option to cli (#14880) --- examples/ota-provider-app/linux/main.cpp | 28 +++++++++++++++++++ .../OTAProviderExample.cpp | 11 ++++++-- .../ota-provider-common/OTAProviderExample.h | 4 ++- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/examples/ota-provider-app/linux/main.cpp b/examples/ota-provider-app/linux/main.cpp index 2c8a2b26e09289..3fc2e425d8db82 100644 --- a/examples/ota-provider-app/linux/main.cpp +++ b/examples/ota-provider-app/linux/main.cpp @@ -57,6 +57,7 @@ constexpr uint16_t kOptionUserConsentState = 'u'; constexpr uint16_t kOptionDelayedActionTimeSec = 't'; constexpr uint16_t kOptionDiscriminator = 'd'; constexpr uint16_t kOptionSoftwareVersion = 's'; +constexpr uint16_t kOptionSoftwareVersionStr = 'S'; constexpr uint16_t kOptionUserConsentNeeded = 'c'; static constexpr uint16_t kMaximumDiscriminatorValue = 0xFFF; @@ -70,6 +71,7 @@ static chip::ota::UserConsentState gUserConsentState = chip::ot static bool gUserConsentNeeded = false; static chip::Optional gSetupDiscriminator; static chip::Optional gSoftwareVersion; +static const char * gSoftwareVersionString = nullptr; // Parses the JSON filepath and extracts DeviceSoftwareVersionModel parameters static bool ParseJsonFileAndPopulateCandidates(const char * filepath, @@ -233,6 +235,22 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, case kOptionUserConsentNeeded: gUserConsentNeeded = true; break; + case kOptionSoftwareVersionStr: + if (aValue == NULL) + { + PrintArgError("%s: ERROR: NULL SoftwareVersionStr parameter\n", aProgram); + retval = false; + } + else if ((strlen(aValue) < 1 || strlen(aValue) > 64)) + { + PrintArgError("%s: ERROR: SoftwareVersionStr parameter length is out of range \n", aProgram); + retval = false; + } + else + { + gSoftwareVersionString = aValue; + } + break; default: PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); retval = false; @@ -250,6 +268,7 @@ OptionDef cmdLineOptionsDef[] = { { "UserConsentState", chip::ArgParser::kArgumentRequired, kOptionUserConsentState }, { "discriminator", chip::ArgParser::kArgumentRequired, kOptionDiscriminator }, { "softwareVersion", chip::ArgParser::kArgumentRequired, kOptionSoftwareVersion }, + { "softwareVersionStr", chip::ArgParser::kArgumentRequired, kOptionSoftwareVersionStr }, { "UserConsentNeeded", chip::ArgParser::kNoArgument, kOptionUserConsentNeeded }, {}, }; @@ -277,6 +296,11 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " If ota image list is present along with this option\n" " then value from ota image list is used.\n" " Otherwise, this value will be used is then value from that will be used\n" + " -S/--softwareVersionStr \n" + " Value of SoftwareVersionString in the Query Image Response\n" + " If ota image list is present along with this option\n" + " then value from ota image list is used.\n" + " Otherwise, this value will be used is then value from that will be used\n" " -c/--UserConsentNeeded\n" " If provided, value of UserConsentNeeded in the Query Image Response is set to true\n" }; @@ -349,6 +373,10 @@ int main(int argc, char * argv[]) { otaProvider.SetSoftwareVersion(gSoftwareVersion.Value()); } + if (gSoftwareVersionString) + { + otaProvider.SetSoftwareVersionString(gSoftwareVersionString); + } if (gUserConsentState != chip::ota::UserConsentState::kUnknown) { diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp index 3b3de5fea0b9c2..5044a6624f653d 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp @@ -180,9 +180,16 @@ EmberAfStatus OTAProviderExample::HandleQueryImage(chip::app::CommandHandler * c newSoftwareVersion = mSoftwareVersion.Value(); } + // If software version string is provided using command line then use it. + // Otherwise, use default string. newSoftwareVersionString = "Example-Image-V0.1"; - otaFilePath = mOTAFilePath; - queryStatus = OTAQueryStatus::kUpdateAvailable; + if (mSoftwareVersionString) + { + newSoftwareVersionString = mSoftwareVersionString; + } + + otaFilePath = mOTAFilePath; + queryStatus = OTAQueryStatus::kUpdateAvailable; } else if (!mCandidates.empty()) // If list of OTA candidates is supplied instead { diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h index 0b6efc6b12ee03..a2db9297adebc4 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h @@ -72,6 +72,7 @@ class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate void SetDelayedActionTimeSec(uint32_t time) { mDelayedActionTimeSec = time; } void SetUserConsentDelegate(chip::ota::UserConsentDelegate * delegate) { mUserConsentDelegate = delegate; } void SetSoftwareVersion(uint32_t softwareVersion) { mSoftwareVersion.SetValue(softwareVersion); } + void SetSoftwareVersionString(const char * versionString) { mSoftwareVersionString = versionString; } void SetUserConsentNeeded(bool needed) { mUserConsentNeeded = needed; } private: @@ -91,5 +92,6 @@ class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::DecodableType & commandData, uint32_t targetVersion); chip::Optional mSoftwareVersion; - bool mUserConsentNeeded = false; + const char * mSoftwareVersionString = nullptr; + bool mUserConsentNeeded = false; }; From 5947abd4f8f3bc7077d9a66d258da45b20d572c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Tue, 8 Feb 2022 16:24:42 +0100 Subject: [PATCH 25/30] [nrfconnect] Fix pigweed/protobuf compiler flags (#14876) Enhance the way Zephyr flags are passed to Pigweed and Protobuf components. It happened in the past that some MCU-related flags were not passed correctly causing crashes or build failures (e.g. with FPU enabled). --- examples/lighting-app/nrfconnect/CMakeLists.txt | 9 +++------ examples/lighting-app/nrfconnect/rpc.overlay | 5 +---- examples/pigweed-app/nrfconnect/CMakeLists.txt | 5 +++-- examples/pigweed-app/nrfconnect/README.md | 2 +- examples/pigweed-app/nrfconnect/prj.conf | 3 --- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 027ab711955a05..381af2dad59761 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -114,14 +114,13 @@ endif() if (CONFIG_CHIP_PW_RPC) +# Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags +link_libraries($) + set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) -# TODO: Remove this temporary fix needed to get RPC builds working. -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mthumb" CACHE INTERNAL "") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=cortex-m4 -mthumb" CACHE INTERNAL "") - pw_set_backend(pw_log pw_log_basic) pw_set_backend(pw_assert pw_assert_log) pw_set_backend(pw_sys_io pw_sys_io.nrfconnect) @@ -223,6 +222,4 @@ target_link_options(app "-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld" ) -target_link_libraries(pw_build INTERFACE zephyr_interface) - endif(CONFIG_CHIP_PW_RPC) diff --git a/examples/lighting-app/nrfconnect/rpc.overlay b/examples/lighting-app/nrfconnect/rpc.overlay index aee22afb4a39c5..f9f7c10f0b0954 100644 --- a/examples/lighting-app/nrfconnect/rpc.overlay +++ b/examples/lighting-app/nrfconnect/rpc.overlay @@ -26,9 +26,6 @@ CONFIG_CHIP_PW_RPC=y CONFIG_STD_CPP14=n CONFIG_STD_CPP17=y -# Disable HW floating point, as libprotobuf nano doesn't support building with it -CONFIG_FPU=n - # Add support for Zephyr console component to use it for Pigweed console purposes CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y @@ -48,4 +45,4 @@ CONFIG_LOG_BACKEND_UART=n CONFIG_LOG_BACKEND_RTT=n # Increase zephyr tty rx buffer -CONFIG_CONSOLE_GETCHAR_BUFSIZE=128 \ No newline at end of file +CONFIG_CONSOLE_GETCHAR_BUFSIZE=128 diff --git a/examples/pigweed-app/nrfconnect/CMakeLists.txt b/examples/pigweed-app/nrfconnect/CMakeLists.txt index e05628bcfd8af5..e5df573ad830ab 100644 --- a/examples/pigweed-app/nrfconnect/CMakeLists.txt +++ b/examples/pigweed-app/nrfconnect/CMakeLists.txt @@ -43,6 +43,9 @@ include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake) # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635 target_compile_options(app PRIVATE -Werror -Wno-error=maybe-uninitialized) +# Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags +link_libraries($) + include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) @@ -86,6 +89,4 @@ target_link_libraries(app PUBLIC pw_rpc.server ) -target_link_libraries(pw_build INTERFACE zephyr_interface) - include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake) diff --git a/examples/pigweed-app/nrfconnect/README.md b/examples/pigweed-app/nrfconnect/README.md index a66f536180480b..d226db40338513 100644 --- a/examples/pigweed-app/nrfconnect/README.md +++ b/examples/pigweed-app/nrfconnect/README.md @@ -326,7 +326,7 @@ to read more about flashing on the nRF52840 Dongle. Run the following command to start an interactive Python shell, where the Echo RPC commands can be invoked: - python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/echo.proto -o /tmp/pw_rpc.out + python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 --proto-globs $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/echo.proto -o /tmp/pw_rpc.out To send an Echo RPC message, type the following command, where the actual message is the text in quotation marks after the `msg=` phrase: diff --git a/examples/pigweed-app/nrfconnect/prj.conf b/examples/pigweed-app/nrfconnect/prj.conf index 0895493dcc8f72..58a0fe63277b34 100644 --- a/examples/pigweed-app/nrfconnect/prj.conf +++ b/examples/pigweed-app/nrfconnect/prj.conf @@ -30,9 +30,6 @@ CONFIG_CHIP_PW_RPC=y CONFIG_STD_CPP14=n CONFIG_STD_CPP17=y -# Disable HW floating point, as libprotobuf nano doesn't support building with it -CONFIG_FPU=n - # Add support for Zephyr console component to use it for Pigweed console purposes CONFIG_CONSOLE_SUBSYS=y CONFIG_CONSOLE_GETCHAR=y From b5dae1e8087b46f5ccf229b552ca78cb42e2aa02 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Tue, 8 Feb 2022 23:25:17 +0800 Subject: [PATCH 26/30] Add ephemeral node IDs for unsecured sessions (#14382) * Add ephemeral node IDs for unsecured sessions * Resolve comments * Apply suggestions from code review Co-authored-by: Michael Sandstedt Co-authored-by: Michael Sandstedt --- src/transport/SessionManager.cpp | 51 ++++++-- src/transport/SessionManager.h | 13 +- src/transport/UnauthenticatedSessionTable.h | 129 +++++++++++--------- 3 files changed, 123 insertions(+), 70 deletions(-) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 07684077880c93..ec6404727290ef 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -190,6 +190,16 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P uint32_t messageCounter = counter.Value(); ReturnErrorOnFailure(counter.Advance()); packetHeader.SetMessageCounter(messageCounter); + Transport::UnauthenticatedSession * session = sessionHandle->AsUnauthenticatedSession(); + switch (session->GetSessionRole()) + { + case Transport::UnauthenticatedSession::SessionRole::kInitiator: + packetHeader.SetSourceNodeId(session->GetEphemeralInitiatorNodeID()); + break; + case Transport::UnauthenticatedSession::SessionRole::kResponder: + packetHeader.SetDestinationNodeId(session->GetEphemeralInitiatorNodeID()); + break; + } // Trace after all headers are settled. CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, message->Start(), message->TotalLength()); @@ -401,7 +411,7 @@ void SessionManager::OnMessageReceived(const PeerAddress & peerAddress, System:: } else { - MessageDispatch(packetHeader, peerAddress, std::move(msg)); + UnauthenticatedMessageDispatch(packetHeader, peerAddress, std::move(msg)); } } @@ -437,18 +447,45 @@ void SessionManager::RefreshSessionOperationalData(const SessionHandle & session }); } -void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle && msg) +void SessionManager::UnauthenticatedMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg) { - Optional optionalSession = mUnauthenticatedSessions.FindOrAllocateEntry(peerAddress, GetLocalMRPConfig()); - if (!optionalSession.HasValue()) + Optional source = packetHeader.GetSourceNodeId(); + Optional destination = packetHeader.GetDestinationNodeId(); + if ((source.HasValue() && destination.HasValue()) || (!source.HasValue() && !destination.HasValue())) { - ChipLogError(Inet, "UnauthenticatedSession exhausted"); - return; + ChipLogProgress(Inet, + "Received malformed unsecure packet with source 0x" ChipLogFormatX64 " destination 0x" ChipLogFormatX64, + ChipLogValueX64(source.ValueOr(kUndefinedNodeId)), ChipLogValueX64(destination.ValueOr(kUndefinedNodeId))); + return; // ephemeral node id is only assigned to the initiator, there should be one and only one node id exists. + } + + Optional optionalSession; + if (source.HasValue()) + { + // Assume peer is the initiator, we are the responder. + optionalSession = mUnauthenticatedSessions.FindOrAllocateResponder(source.Value(), GetLocalMRPConfig()); + if (!optionalSession.HasValue()) + { + ChipLogError(Inet, "UnauthenticatedSession exhausted"); + return; + } + } + else + { + // Assume peer is the responder, we are the initiator. + optionalSession = mUnauthenticatedSessions.FindInitiator(destination.Value()); + if (!optionalSession.HasValue()) + { + ChipLogProgress(Inet, "Received unknown unsecure packet for initiator 0x" ChipLogFormatX64, + ChipLogValueX64(destination.Value())); + return; + } } const SessionHandle & session = optionalSession.Value(); Transport::UnauthenticatedSession * unsecuredSession = session->AsUnauthenticatedSession(); + unsecuredSession->SetPeerAddress(peerAddress); SessionMessageDelegate::DuplicateMessage isDuplicate = SessionMessageDelegate::DuplicateMessage::No; // Verify message counter diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index 5b4cda34960783..4adfdd90015fe5 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -206,7 +207,13 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate Optional CreateUnauthenticatedSession(const Transport::PeerAddress & peerAddress, const ReliableMessageProtocolConfig & config) { - return mUnauthenticatedSessions.FindOrAllocateEntry(peerAddress, config); + // Allocate ephemeralInitiatorNodeID in Operational Node ID range + NodeId ephemeralInitiatorNodeID; + do + { + ephemeralInitiatorNodeID = static_cast(Crypto::GetRandU64()); + } while (!IsOperationalNodeId(ephemeralInitiatorNodeID)); + return mUnauthenticatedSessions.AllocInitiator(ephemeralInitiatorNodeID, peerAddress, config); } // TODO: implements group sessions @@ -279,8 +286,8 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate void SecureGroupMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msg); - void MessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle && msg); + void UnauthenticatedMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg); void OnReceiveError(CHIP_ERROR error, const Transport::PeerAddress & source); diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index 8e7cbd1ec371fb..213afb1661235a 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -46,8 +46,15 @@ class UnauthenticatedSessionDeleter class UnauthenticatedSession : public Session, public ReferenceCounted { public: - UnauthenticatedSession(const PeerAddress & address, const ReliableMessageProtocolConfig & config) : - mPeerAddress(address), mLastActivityTime(System::SystemClock().GetMonotonicTimestamp()), mMRPConfig(config) + enum class SessionRole + { + kInitiator, + kResponder, + }; + + UnauthenticatedSession(SessionRole sessionRole, NodeId ephemeralInitiatorNodeID, const ReliableMessageProtocolConfig & config) : + mEphemeralInitiatorNodeId(ephemeralInitiatorNodeID), mSessionRole(sessionRole), + mLastActivityTime(System::SystemClock().GetMonotonicTimestamp()), mMRPConfig(config) {} ~UnauthenticatedSession() { NotifySessionReleased(); } @@ -88,8 +95,22 @@ class UnauthenticatedSession : public Session, public ReferenceCounted FindOrAllocateEntry(const PeerAddress & address, const ReliableMessageProtocolConfig & config) + Optional FindOrAllocateResponder(NodeId ephemeralInitiatorNodeID, const ReliableMessageProtocolConfig & config) { - UnauthenticatedSession * result = FindEntry(address); + UnauthenticatedSession * result = FindEntry(UnauthenticatedSession::SessionRole::kResponder, ephemeralInitiatorNodeID); if (result != nullptr) return MakeOptional(*result); - CHIP_ERROR err = AllocEntry(address, config, result); + CHIP_ERROR err = AllocEntry(UnauthenticatedSession::SessionRole::kResponder, ephemeralInitiatorNodeID, config, result); + if (err == CHIP_NO_ERROR) + { + return MakeOptional(*result); + } + else + { + return Optional::Missing(); + } + } + + CHECK_RETURN_VALUE Optional FindInitiator(NodeId ephemeralInitiatorNodeID) + { + UnauthenticatedSession * result = FindEntry(UnauthenticatedSession::SessionRole::kInitiator, ephemeralInitiatorNodeID); + if (result != nullptr) + { + return MakeOptional(*result); + } + else + { + return Optional::Missing(); + } + } + + CHECK_RETURN_VALUE Optional AllocInitiator(NodeId ephemeralInitiatorNodeID, const PeerAddress & peerAddress, + const ReliableMessageProtocolConfig & config) + { + UnauthenticatedSession * result = nullptr; + CHIP_ERROR err = AllocEntry(UnauthenticatedSession::SessionRole::kInitiator, ephemeralInitiatorNodeID, config, result); if (err == CHIP_NO_ERROR) { + result->SetPeerAddress(peerAddress); return MakeOptional(*result); } else @@ -148,10 +201,10 @@ class UnauthenticatedSessionTable * CHIP_ERROR_NO_MEMORY). */ CHECK_RETURN_VALUE - CHIP_ERROR AllocEntry(const PeerAddress & address, const ReliableMessageProtocolConfig & config, - UnauthenticatedSession *& entry) + CHIP_ERROR AllocEntry(UnauthenticatedSession::SessionRole sessionRole, NodeId ephemeralInitiatorNodeID, + const ReliableMessageProtocolConfig & config, UnauthenticatedSession *& entry) { - entry = mEntries.CreateObject(address, config); + entry = mEntries.CreateObject(sessionRole, ephemeralInitiatorNodeID, config); if (entry != nullptr) return CHIP_NO_ERROR; @@ -161,21 +214,16 @@ class UnauthenticatedSessionTable return CHIP_ERROR_NO_MEMORY; } - mEntries.ResetObject(entry, address, config); + mEntries.ResetObject(entry, sessionRole, ephemeralInitiatorNodeID, config); return CHIP_NO_ERROR; } - /** - * Get a session using given address - * - * @return the peer found, nullptr if not found - */ - CHECK_RETURN_VALUE - UnauthenticatedSession * FindEntry(const PeerAddress & address) + CHECK_RETURN_VALUE UnauthenticatedSession * FindEntry(UnauthenticatedSession::SessionRole sessionRole, + NodeId ephemeralInitiatorNodeID) { UnauthenticatedSession * result = nullptr; mEntries.ForEachActiveObject([&](UnauthenticatedSession * entry) { - if (MatchPeerAddress(entry->GetPeerAddress(), address)) + if (entry->GetSessionRole() == sessionRole && entry->GetEphemeralInitiatorNodeID() == ephemeralInitiatorNodeID) { result = entry; return Loop::Break; @@ -202,45 +250,6 @@ class UnauthenticatedSessionTable return result; } - // A temporary solution for #11120 - // Enforce interface match if not null - static bool MatchInterface(Inet::InterfaceId i1, Inet::InterfaceId i2) - { - if (i1.IsPresent() && i2.IsPresent()) - { - return i1 == i2; - } - else - { - // One of the interfaces is null. - return true; - } - } - - static bool MatchPeerAddress(const PeerAddress & a1, const PeerAddress & a2) - { - if (a1.GetTransportType() != a2.GetTransportType()) - return false; - - switch (a1.GetTransportType()) - { - case Transport::Type::kUndefined: - return false; - case Transport::Type::kUdp: - case Transport::Type::kTcp: - return a1.GetIPAddress() == a2.GetIPAddress() && a1.GetPort() == a2.GetPort() && - // Enforce interface equal-ness if the address is link-local, otherwise ignore interface - // Use MatchInterface for a temporary solution for #11120 - (a1.GetIPAddress().IsIPv6LinkLocal() ? a1.GetInterface() == a2.GetInterface() - : MatchInterface(a1.GetInterface(), a2.GetInterface())); - case Transport::Type::kBle: - // TODO: complete BLE address comparation - return true; - } - - return false; - } - ObjectPool mEntries; }; From 5834518b02d2248b053094705331b233bc290b38 Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Wed, 9 Feb 2022 00:02:00 +0800 Subject: [PATCH 27/30] [binding] Make binding table an attribute (#14874) * [binding] Make binding table an attribute * fix linux tv-app build --- .../all-clusters-app.matter | 15 +- .../all-clusters-common/all-clusters-app.zap | 70 +- .../src/bridged-actions-stub.cpp | 5 +- .../light-switch-app.matter | 17 - .../thermostat-common/thermostat.matter | 15 +- .../thermostat-common/thermostat.zap | 68 +- .../tv-app/linux/include/cluster-init.cpp | 3 +- examples/tv-app/linux/main.cpp | 2 +- examples/tv-app/tv-common/tv-app.matter | 30 +- examples/tv-app/tv-common/tv-app.zap | 34 +- .../tv-casting-common/tv-casting-app.matter | 15 +- .../tv-casting-common/tv-casting-app.zap | 85 +- src/app/AttributeAccessInterface.h | 9 +- src/app/app-platform/ContentAppPlatform.cpp | 17 +- src/app/app-platform/ContentAppPlatform.h | 8 +- .../access-control-server.cpp | 10 +- .../administrator-commissioning-server.cpp | 5 +- .../application-basic-server.cpp | 6 +- .../application-launcher-server.cpp | 6 +- .../audio-output-server.cpp | 6 +- src/app/clusters/basic/basic.cpp | 9 +- src/app/clusters/bindings/BindingManager.cpp | 7 +- src/app/clusters/bindings/bindings.cpp | 241 ++- .../channel-server/channel-server.cpp | 6 +- .../content-launch-server.cpp | 6 +- src/app/clusters/descriptor/descriptor.cpp | 5 +- .../ethernet-network-diagnostics-server.cpp | 5 +- .../fixed-label-server/fixed-label-server.cpp | 5 +- .../general-commissioning-server.cpp | 5 +- .../general-diagnostics-server.cpp | 5 +- .../group-key-mgmt-server.cpp | 4 +- .../localization-configuration-server.cpp | 5 +- .../media-input-server/media-input-server.cpp | 6 +- .../media-playback-server.cpp | 6 +- .../mode-select-server/mode-select-server.cpp | 5 +- .../network-commissioning-ember.cpp | 2 +- .../network-commissioning.cpp | 4 +- .../network-commissioning.h | 4 +- .../operational-credentials-server.cpp | 5 +- .../ota-requestor/ota-requestor-server.cpp | 10 +- .../power-source-configuration-server.cpp | 5 +- .../power-source-server.cpp | 5 +- .../software-diagnostics-server.cpp | 5 +- .../target-navigator-server.cpp | 6 +- .../test-cluster-server.cpp | 8 +- .../thread-network-diagnostics-server.cpp | 5 +- .../time-format-localization-server.cpp | 5 +- .../user-label-server/user-label-server.cpp | 10 +- .../wake-on-lan-server/wake-on-lan-server.cpp | 6 +- .../wifi-network-diagnostics-server.cpp | 5 +- .../util/ember-compatibility-functions.cpp | 9 +- .../zcl/data-model/chip/binding-cluster.xml | 29 +- .../data_model/controller-clusters.matter | 21 +- .../data_model/controller-clusters.zap | 35 +- .../CHIPAttributeTLVValueDecoder.cpp | 63 + .../java/zap-generated/CHIPCallbackTypes.h | 2 + .../java/zap-generated/CHIPClusters-JNI.cpp | 120 +- .../zap-generated/CHIPClustersWrite-JNI.cpp | 93 ++ .../java/zap-generated/CHIPReadCallbacks.cpp | 108 ++ .../java/zap-generated/CHIPReadCallbacks.h | 31 + .../chip/devicecontroller/ChipClusters.java | 93 +- .../chip/devicecontroller/ChipStructs.java | 35 + .../devicecontroller/ClusterInfoMapping.java | 89 +- .../devicecontroller/ClusterReadMapping.java | 13 + .../python/chip/clusters/CHIPClusters.py | 27 +- .../python/chip/clusters/Objects.py | 42 +- src/controller/tests/TestReadChunking.cpp | 12 +- .../CHIPAttributeTLVValueDecoder.mm | 30 + .../CHIP/zap-generated/CHIPCallbackBridge.mm | 43 + .../CHIPCallbackBridge_internal.h | 28 + .../CHIP/zap-generated/CHIPClustersObjc.h | 9 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 83 +- .../zap-generated/CHIPCommandPayloadsObjc.h | 16 - .../zap-generated/CHIPCommandPayloadsObjc.mm | 34 - .../CHIP/zap-generated/CHIPStructsObjc.h | 8 + .../CHIP/zap-generated/CHIPStructsObjc.mm | 17 + .../zap-generated/IMClusterCommandHandler.cpp | 49 - .../zap-generated/endpoint_config.h | 1310 +++++++++-------- .../app-common/zap-generated/af-structs.h | 9 + .../app-common/zap-generated/attribute-id.h | 1 + .../app-common/zap-generated/callback.h | 10 - .../zap-generated/cluster-objects.cpp | 60 +- .../zap-generated/cluster-objects.h | 95 +- .../app-common/zap-generated/command-id.h | 4 - .../app-common/zap-generated/ids/Attributes.h | 4 + .../app-common/zap-generated/ids/Commands.h | 14 - .../zap-generated/cluster/Commands.h | 59 +- .../cluster/ComplexArgumentParser.cpp | 33 + .../cluster/ComplexArgumentParser.h | 4 + .../cluster/logging/DataModelLogger.cpp | 45 + .../cluster/logging/DataModelLogger.h | 2 + .../zap-generated/CHIPClientCallbacks.h | 5 + .../zap-generated/IMClusterCommandHandler.cpp | 49 - .../zap-generated/endpoint_config.h | 44 +- .../zap-generated/IMClusterCommandHandler.cpp | 49 - .../zap-generated/endpoint_config.h | 630 ++++---- .../zap-generated/CHIPClientCallbacks.h | 5 + .../zap-generated/IMClusterCommandHandler.cpp | 49 - .../tv-app/zap-generated/endpoint_config.h | 804 +++++----- .../zap-generated/IMClusterCommandHandler.cpp | 49 - .../zap-generated/endpoint_config.h | 850 ++++++----- 101 files changed, 3206 insertions(+), 2948 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 5a3c79092a4f93..6bc0884da2e69e 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 @@ -235,24 +235,15 @@ server cluster BinaryInputBasic = 15 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster BooleanState = 69 { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index b7d934aab2759d..1e5e0e28d6477c 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -877,24 +877,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -922,6 +905,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8706,24 +8704,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8751,6 +8732,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -21103,4 +21099,4 @@ "deviceIdentifier": 256 } ] -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp index af3b4763054ef0..3b2e3a3391463f 100644 --- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp @@ -37,7 +37,7 @@ class BridgedActionsAttrAccess : public AttributeAccessInterface // Register for the Bridged Actions cluster on all endpoints. BridgedActionsAttrAccess() : AttributeAccessInterface(Optional::Missing(), BridgedActions::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: static constexpr uint16_t ClusterRevision = 1; @@ -75,7 +75,8 @@ CHIP_ERROR BridgedActionsAttrAccess::ReadClusterRevision(EndpointId endpoint, At BridgedActionsAttrAccess gAttrAccess; -CHIP_ERROR BridgedActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR BridgedActionsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == BridgedActions::Id); 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 aaf72e6e311630..f586034eae2f6c 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 @@ -143,23 +143,6 @@ server cluster Basic = 40 { server cluster Binding = 30 { readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; } client cluster ColorControl = 768 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 5cd74fd6e15500..c2220cca08caa8 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -142,24 +142,15 @@ server cluster Basic = 40 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Descriptor = 29 { diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index b44dca42e2df12..bb65191df516ee 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -854,24 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -899,6 +882,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8158,24 +8156,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8203,6 +8184,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/examples/tv-app/linux/include/cluster-init.cpp b/examples/tv-app/linux/include/cluster-init.cpp index bbb889d264404d..601388e1b8b2b3 100644 --- a/examples/tv-app/linux/include/cluster-init.cpp +++ b/examples/tv-app/linux/include/cluster-init.cpp @@ -42,7 +42,8 @@ class TvAttrAccess : public app::AttributeAccessInterface public: TvAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), AttrTypeInfo::GetClusterId()) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override { if (aPath.mAttributeId == AttrTypeInfo::GetAttributeId()) { diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp index 873eb3649de35b..32e0c9505f0c5f 100644 --- a/examples/tv-app/linux/main.cpp +++ b/examples/tv-app/linux/main.cpp @@ -135,7 +135,7 @@ class MyPostCommissioningListener : public PostCommissioningListener } /* Callback when command results in success */ - static void OnSuccessResponse(void * context, const chip::app::DataModel::NullObjectType &) + static void OnSuccessResponse(void * context) { ChipLogProgress(Controller, "OnSuccessResponse - Binding Add Successfully"); CommissionerDiscoveryController * cdc = GetCommissionerDiscoveryController(); diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 09eb6dc9dca4e4..1d30f9b2e613fc 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -277,45 +277,27 @@ server cluster Basic = 40 { } client cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster Channel = 1284 { diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 7e4d0b22fddab2..952d19cfbf179c 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -854,24 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -899,6 +882,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, 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 f526dac0c5e079..67b113ef35b096 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 @@ -276,24 +276,15 @@ server cluster BinaryInputBasic = 15 { } server cluster Binding = 30 { - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute int16u clusterRevision = 65533; } server cluster BridgedDeviceBasic = 57 { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 9c736399597490..ef73836b7ab3e4 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -854,41 +854,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "commands": [] }, { "name": "Binding", @@ -899,6 +865,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7990,24 +7971,7 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -8035,6 +7999,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h index d12ea80e25bce0..7d46efcc825276 100644 --- a/src/app/AttributeAccessInterface.h +++ b/src/app/AttributeAccessInterface.h @@ -382,7 +382,8 @@ class AttributeAccessInterface * involve reading from the attribute store or external attribute * callbacks. */ - virtual CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) = 0; + virtual CHIP_ERROR Read(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) = 0; /** * Callback for writing attributes. @@ -402,7 +403,11 @@ class AttributeAccessInterface * involve writing to the attribute store or external attribute * callbacks. */ - virtual CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) { return CHIP_NO_ERROR; } + virtual CHIP_ERROR Write(FabricIndex aAccessingFabricIndex, const ConcreteDataAttributePath & aPath, + AttributeValueDecoder & aDecoder) + { + return CHIP_NO_ERROR; + } /** * Mechanism for keeping track of a chain of AttributeAccessInterfaces. diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp index 3fadd8273562dd..fa8925abd09731 100644 --- a/src/app/app-platform/ContentAppPlatform.cpp +++ b/src/app/app-platform/ContentAppPlatform.cpp @@ -390,20 +390,17 @@ uint32_t ContentAppPlatform::GetPincodeFromContentApp(uint16_t vendorId, uint16_ CHIP_ERROR ContentAppPlatform::CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId, chip::NodeId bindingNodeId, chip::GroupId bindingGroupId, chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId, - CommandResponseSuccessCallback successCb, - CommandResponseFailureCallback failureCb) + Controller::WriteResponseSuccessCallback successCb, + Controller::WriteResponseFailureCallback failureCb) { chip::Controller::BindingCluster cluster; cluster.Associate(device, deviceEndpointId); - Binding::Commands::Bind::Type request; - request.nodeId = bindingNodeId; - request.groupId = bindingGroupId; - request.endpointId = bindingEndpointId; - request.clusterId = bindingClusterId; - ReturnErrorOnFailure(cluster.InvokeCommand(request, this, successCb, failureCb)); - - ChipLogDetail(Controller, "CreateBindingWithCallback: Sent Bind command request, waiting for response"); + Binding::Structs::BindingEntry::Type entries[1] = { { bindingNodeId, bindingGroupId, bindingEndpointId, bindingClusterId } }; + Binding::Attributes::BindingList::TypeInfo::Type bindingList(entries); + cluster.WriteAttribute(bindingList, nullptr, Binding::Id, Binding::Attributes::BindingList::Id, successCb, failureCb, + NullOptional); + ChipLogDetail(Controller, "CreateBindingWithCallback: Sent Bind write request, waiting for response"); return CHIP_NO_ERROR; } diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h index 81a364c022df37..bb135243fccdc2 100644 --- a/src/app/app-platform/ContentAppPlatform.h +++ b/src/app/app-platform/ContentAppPlatform.h @@ -127,16 +127,16 @@ class DLL_EXPORT ContentAppPlatform * @param[in] bindingGroupId The GroupId for the binding that will be created. * @param[in] bindingEndpointId The EndpointId for the binding that will be created. * @param[in] bindingClusterId The ClusterId for the binding that will be created. - * @param[in] onSuccessCallback The function to be called on success of adding the binding. - * @param[in] onFailureCallback The function to be called on failure of adding the binding. + * @param[in] successCb The function to be called on success of adding the binding. + * @param[in] failureCb The function to be called on failure of adding the binding. * * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error */ CHIP_ERROR CreateBindingWithCallback(OperationalDeviceProxy * device, chip::EndpointId deviceEndpointId, chip::NodeId bindingNodeId, chip::GroupId bindingGroupId, chip::EndpointId bindingEndpointId, chip::ClusterId bindingClusterId, - CommandResponseSuccessCallback successCb, - CommandResponseFailureCallback failureCb); + Controller::WriteResponseSuccessCallback successCb, + Controller::WriteResponseFailureCallback failureCb); protected: // requires vendorApp to be in the catalog of the platform diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 857b183f39827e..49fdff9d234c5d 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -291,8 +291,8 @@ class AccessControlAttribute : public chip::app::AttributeAccessInterface public: AccessControlAttribute() : AttributeAccessInterface(Optional(0), AccessControlCluster::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; static constexpr uint16_t ClusterRevision = 1; @@ -383,7 +383,8 @@ CHIP_ERROR LogAccessControlEvent(const AccessControl::Entry & entry, const Acces return err; } -CHIP_ERROR AccessControlAttribute::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR AccessControlAttribute::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) { @@ -421,7 +422,8 @@ CHIP_ERROR AccessControlAttribute::ReadExtension(AttributeValueEncoder & aEncode return aEncoder.EncodeEmptyList(); } -CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR AccessControlAttribute::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, + AttributeValueDecoder & aDecoder) { switch (aPath.mAttributeId) { diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index 16732722b3539f..ebc1218a551396 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -47,7 +47,7 @@ class AdministratorCommissioningAttrAccess : public AttributeAccessInterface AttributeAccessInterface(Optional::Missing(), Clusters::AdministratorCommissioning::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabric, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; // Vendor ID and Fabric Index of the admin that has opened the commissioning window uint16_t mVendorId; @@ -56,7 +56,8 @@ class AdministratorCommissioningAttrAccess : public AttributeAccessInterface AdministratorCommissioningAttrAccess gAdminCommissioningAttrAccess; -CHIP_ERROR AdministratorCommissioningAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR AdministratorCommissioningAttrAccess::Read(FabricIndex fabric, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == Clusters::AdministratorCommissioning::Id); diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index 3d3f89dc6b824b..cc3303c818a309 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -129,7 +129,8 @@ class ApplicationBasicAttrAccess : public app::AttributeAccessInterface public: ApplicationBasicAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ApplicationBasic::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadVendorNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -144,7 +145,8 @@ class ApplicationBasicAttrAccess : public app::AttributeAccessInterface ApplicationBasicAttrAccess gApplicationBasicAttrAccess; -CHIP_ERROR ApplicationBasicAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR ApplicationBasicAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 20733e06cda681..df15629d841b54 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -147,7 +147,8 @@ class ApplicationLauncherAttrAccess : public app::AttributeAccessInterface public: ApplicationLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ApplicationLauncher::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadCatalogListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -156,7 +157,8 @@ class ApplicationLauncherAttrAccess : public app::AttributeAccessInterface ApplicationLauncherAttrAccess gApplicationLauncherAttrAccess; -CHIP_ERROR ApplicationLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR ApplicationLauncherAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 38ba765ad725ff..3bbc1226338ca5 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -93,7 +93,8 @@ class AudioOutputAttrAccess : public app::AttributeAccessInterface AudioOutputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::AudioOutput::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadOutputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -102,7 +103,8 @@ class AudioOutputAttrAccess : public app::AttributeAccessInterface AudioOutputAttrAccess gAudioOutputAttrAccess; -CHIP_ERROR AudioOutputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR AudioOutputAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index b74a6885c7339d..9d6d6d66f53313 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -49,8 +49,8 @@ class BasicAttrAccess : public AttributeAccessInterface // Register for the Basic cluster on all endpoints. BasicAttrAccess() : AttributeAccessInterface(Optional::Missing(), Basic::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadDataModelRevision(AttributeValueEncoder & aEncoder); @@ -66,7 +66,7 @@ CHIP_ERROR EncodeStringOnSuccess(CHIP_ERROR status, AttributeValueEncoder & enco return encoder.Encode(chip::CharSpan(buf, strnlen(buf, maxBufSize))); } -CHIP_ERROR BasicAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR BasicAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != Basic::Id) { @@ -297,7 +297,8 @@ CHIP_ERROR BasicAttrAccess::ReadLocation(AttributeValueEncoder & aEncoder) return aEncoder.Encode(chip::CharSpan(location, codeLen)); } -CHIP_ERROR BasicAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR BasicAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, + AttributeValueDecoder & aDecoder) { VerifyOrDie(aPath.mClusterId == Basic::Id); diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp index a2817ca1576245..7ce106da08cb55 100644 --- a/src/app/clusters/bindings/BindingManager.cpp +++ b/src/app/clusters/bindings/BindingManager.cpp @@ -179,7 +179,7 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_NOT_FOUND); PeerId peer = fabricInfo->GetPeerIdForNode(entry.nodeId); OperationalDeviceProxy * peerDevice = mAppServer->GetCASESessionManager()->FindExistingSession(peer); - if (peerDevice != nullptr && mBoundDeviceChangedHandler) + if (peerDevice != nullptr && peerDevice->IsConnected() && mBoundDeviceChangedHandler) { // We already have an active connection mBoundDeviceChangedHandler(&entry, peerDevice, context); @@ -187,7 +187,10 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste else { mPendingNotificationMap.AddPendingNotification(i, context); - ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId)); + if (!peerDevice->IsConnecting()) + { + ReturnErrorOnFailure(EstablishConnection(entry.fabricIndex, entry.nodeId)); + } } } else if (entry.type == EMBER_MULTICAST_BINDING) diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp index cfe7ea5f81e773..f238daa9325646 100644 --- a/src/app/clusters/bindings/bindings.cpp +++ b/src/app/clusters/bindings/bindings.cpp @@ -20,27 +20,48 @@ * @brief Implementation for the Binding Server Cluster ***************************************************************************/ -#include - #include +#include +#include #include -#include +#include #include +#include #include #include using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; using namespace chip::app::Clusters::Binding; +using namespace chip::app::Clusters::Binding::Attributes; // TODO: add binding table to the persistent storage +namespace { -static EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * bindingIndex) +class BindingTableAccess : public AttributeAccessInterface +{ +public: + // Register for the User Label cluster on all endpoints. + BindingTableAccess() : AttributeAccessInterface(Optional::Missing(), Binding::Id) {} + + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) override; + +private: + CHIP_ERROR ReadBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueEncoder & encoder); + CHIP_ERROR WriteBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueDecoder & decoder); +}; + +BindingTableAccess gAttrAccess; + +EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) { EmberBindingTableEntry currentEntry; for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) { emberGetBinding(i, ¤tEntry); - if (currentEntry.type != EMBER_UNUSED_BINDING && currentEntry == newEntry) + if (currentEntry.type == EMBER_UNUSED_BINDING) { *bindingIndex = i; return EMBER_SUCCESS; @@ -50,31 +71,60 @@ static EmberStatus getBindingIndex(EmberBindingTableEntry & newEntry, uint8_t * return EMBER_NOT_FOUND; } -static EmberStatus getUnusedBindingIndex(uint8_t * bindingIndex) +bool BindingEntryMatches(FabricIndex fabricIndex, EndpointId endpoint, const EmberBindingTableEntry & entry, + const Structs::BindingEntry::Type & value) +{ + if (entry.local != endpoint || entry.fabricIndex != fabricIndex || entry.clusterId != value.clusterId) + { + return false; + } + return (entry.type == EMBER_UNICAST_BINDING && entry.nodeId == value.nodeId && entry.remote == value.endpointId) || + (entry.type == EMBER_MULTICAST_BINDING && entry.groupId == value.groupId); +} + +bool IsInBindingList(FabricIndex fabricIndex, EndpointId endpoint, const EmberBindingTableEntry & entry, + const BindingList::TypeInfo::DecodableType & bindingList) +{ + if (entry.type == EMBER_UNUSED_BINDING) + { + return false; + } + auto iter = bindingList.begin(); + while (iter.Next()) + { + if (BindingEntryMatches(fabricIndex, endpoint, entry, iter.GetValue())) + { + return true; + } + } + return false; +} + +bool IsInBindingTable(FabricIndex fabricIndex, EndpointId endpoint, + const Binding::Structs::BindingEntry::DecodableType & bindingEntry) { - EmberBindingTableEntry currentEntry; for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) { + EmberBindingTableEntry currentEntry; emberGetBinding(i, ¤tEntry); - if (currentEntry.type == EMBER_UNUSED_BINDING) + if (currentEntry.type != EMBER_UNUSED_BINDING) { - *bindingIndex = i; - return EMBER_SUCCESS; + if (BindingEntryMatches(fabricIndex, endpoint, currentEntry, bindingEntry)) + { + return true; + } } } - - return EMBER_NOT_FOUND; + return false; } -bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::Bind::DecodableType & commandData) +CHIP_ERROR AddBindingEntry(const Binding::Structs::BindingEntry::DecodableType & entry, FabricIndex fabricIndex, + EndpointId localEndpoint, uint8_t * outBindingIndex) { - NodeId nodeId = commandData.nodeId; - GroupId groupId = commandData.groupId; - ClusterId clusterId = commandData.clusterId; - EndpointId remoteEndpoint = commandData.endpointId; - EndpointId localEndpoint = commandPath.mEndpointId; - FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); + GroupId groupId = entry.groupId; + NodeId nodeId = entry.nodeId; + EndpointId remoteEndpoint = entry.endpointId; + ClusterId clusterId = entry.clusterId; EmberBindingTableEntry bindingEntry; ChipLogDetail(Zcl, "RX: BindCallback"); @@ -82,8 +132,7 @@ bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const a if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0) || (groupId != 0 && remoteEndpoint != 0)) { ChipLogError(Zcl, "Binding: Invalid request"); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); - return true; + return CHIP_ERROR_INVALID_ARGUMENT; } if (groupId) @@ -96,16 +145,10 @@ bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const a } uint8_t bindingIndex; - if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_NOT_FOUND) - { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_DUPLICATE_EXISTS); - return true; - } if (getUnusedBindingIndex(&bindingIndex) != EMBER_SUCCESS) { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INSUFFICIENT_SPACE); - return true; + return CHIP_ERROR_NO_MEMORY; } emberSetBinding(bindingIndex, &bindingEntry); @@ -120,55 +163,127 @@ bool emberAfBindingClusterBindCallback(app::CommandHandler * commandObj, const a } } - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); - return true; + return CHIP_NO_ERROR; } -bool emberAfBindingClusterUnbindCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::Unbind::DecodableType & commandData) -{ - NodeId nodeId = commandData.nodeId; - GroupId groupId = commandData.groupId; - ClusterId clusterId = commandData.clusterId; - EndpointId remoteEndpoint = commandData.endpointId; - EndpointId localEndpoint = commandPath.mEndpointId; - FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex(); - EmberBindingTableEntry bindingEntry; - - ChipLogDetail(Zcl, "RX: UnbindCallback"); +} // namespace - if ((groupId != 0 && nodeId != 0) || (groupId == 0 && nodeId == 0)) +CHIP_ERROR BindingTableAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & path, + AttributeValueEncoder & encoder) +{ + switch (path.mAttributeId) { - ChipLogError(Zcl, "Binding: Invalid request"); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_MALFORMED_COMMAND); - return true; + case BindingList::Id: + return ReadBindingTable(fabricIndex, path.mEndpointId, encoder); + default: + break; } - if (groupId) + return CHIP_NO_ERROR; +} + +CHIP_ERROR BindingTableAccess::ReadBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueEncoder & encoder) +{ + DeviceLayer::AttributeList bindingTable; + + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) { - bindingEntry = EmberBindingTableEntry::ForGroup(fabricIndex, groupId, localEndpoint, clusterId); + EmberBindingTableEntry entry; + emberGetBinding(i, &entry); + if (entry.type == EMBER_UNICAST_BINDING && entry.fabricIndex == fabricIndex) + { + Structs::BindingEntry::Type value = { + .nodeId = entry.nodeId, + .groupId = 0, + .endpointId = entry.remote, + .clusterId = entry.clusterId, + }; + bindingTable.add(value); + } + else if (entry.type == EMBER_MULTICAST_BINDING && entry.fabricIndex == fabricIndex) + { + Structs::BindingEntry::Type value = { + .nodeId = 0, + .groupId = entry.groupId, + .endpointId = 0, + .clusterId = entry.clusterId, + }; + bindingTable.add(value); + } } - else + return encoder.EncodeList([&bindingTable](const auto & subEncoder) { + for (auto & value : bindingTable) + { + ReturnErrorOnFailure(subEncoder.Encode(value)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR BindingTableAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & path, + AttributeValueDecoder & decoder) +{ + switch (path.mAttributeId) { - bindingEntry = EmberBindingTableEntry::ForNode(fabricIndex, nodeId, localEndpoint, remoteEndpoint, clusterId); + case BindingList::Id: + return WriteBindingTable(fabricIndex, path.mEndpointId, decoder); + default: + break; } + return CHIP_NO_ERROR; +} - uint8_t bindingIndex; - if (getBindingIndex(bindingEntry, &bindingIndex) != EMBER_SUCCESS) +CHIP_ERROR BindingTableAccess::WriteBindingTable(FabricIndex fabricIndex, EndpointId endpoint, AttributeValueDecoder & decoder) +{ + BindingList::TypeInfo::DecodableType newBindingList; + + ReturnErrorOnFailure(decoder.Decode(newBindingList)); + + // Add entries currently not in the binding table + auto iter = newBindingList.begin(); + CHIP_ERROR err = CHIP_NO_ERROR; + uint8_t addedBindingIndecies[EMBER_BINDING_TABLE_SIZE]; + uint8_t numAddedBindings = 0; + while (iter.Next()) { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_NOT_FOUND); - return true; + if (!IsInBindingTable(fabricIndex, endpoint, iter.GetValue())) + { + err = AddBindingEntry(iter.GetValue(), fabricIndex, endpoint, &addedBindingIndecies[numAddedBindings]); + if (err != CHIP_NO_ERROR) + { + break; + } + numAddedBindings++; + } } - - CHIP_ERROR err = BindingManager::GetInstance().UnicastBindingRemoved(bindingIndex); + // Revert the added entries upon error if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Binding: Failed to remove pending notification for unicast binding" ChipLogFormatX64 ": %s", - ChipLogValueX64(nodeId), err.AsString()); + for (uint8_t bindingIndex : addedBindingIndecies) + { + emberDeleteBinding(bindingIndex); + } } - emberDeleteBinding(bindingIndex); - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); - return true; + // Remove entries not in the new binding list + for (uint8_t i = 0; i < EMBER_BINDING_TABLE_SIZE; i++) + { + EmberBindingTableEntry entry; + emberGetBinding(i, &entry); + if (entry.type != EMBER_UNUSED_BINDING && entry.fabricIndex == fabricIndex && + !IsInBindingList(fabricIndex, endpoint, entry, newBindingList)) + { + if (entry.type == EMBER_UNICAST_BINDING && BindingManager::GetInstance().UnicastBindingRemoved(i) != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Binding: Failed to remove pending notification for unicast binding" ChipLogFormatX64 ": %s", + ChipLogValueX64(entry.nodeId), err.AsString()); + } + emberDeleteBinding(i); + } + } + return err; } -void MatterBindingPluginServerInitCallback() {} +void MatterBindingPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAttrAccess); +} diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 9ec8401090a082..9bd5bd079e1bc8 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -125,7 +125,8 @@ class ChannelAttrAccess : public app::AttributeAccessInterface public: ChannelAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), Channel::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadChannelListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -135,7 +136,8 @@ class ChannelAttrAccess : public app::AttributeAccessInterface ChannelAttrAccess gChannelAttrAccess; -CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR ChannelAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 7b8f932a883675..a69dff05d41a20 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -129,7 +129,8 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface public: ContentLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), ContentLauncher::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -138,7 +139,8 @@ class ContentLauncherAttrAccess : public app::AttributeAccessInterface ContentLauncherAttrAccess gContentLauncherAttrAccess; -CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR ContentLauncherAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index fb4b425bdc6c50..72315cc33602eb 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -42,7 +42,7 @@ class DescriptorAttrAccess : public AttributeAccessInterface // Register for the Descriptor cluster on all endpoints. DescriptorAttrAccess() : AttributeAccessInterface(Optional::Missing(), Descriptor::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: static constexpr uint16_t ClusterRevision = 1; @@ -123,7 +123,8 @@ CHIP_ERROR DescriptorAttrAccess::ReadClusterRevision(EndpointId endpoint, Attrib DescriptorAttrAccess gAttrAccess; -CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR DescriptorAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == Descriptor::Id); diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp index d79a3129335050..d0d453d012b6f9 100644 --- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp +++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp @@ -42,7 +42,7 @@ class EthernetDiagosticsAttrAccess : public AttributeAccessInterface // Register for the EthernetNetworkDiagnostics cluster on all endpoints. EthernetDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), EthernetNetworkDiagnostics::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: template @@ -128,7 +128,8 @@ CHIP_ERROR EthernetDiagosticsAttrAccess::ReadCarrierDetect(AttributeValueEncoder EthernetDiagosticsAttrAccess gAttrAccess; -CHIP_ERROR EthernetDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR EthernetDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != EthernetNetworkDiagnostics::Id) { diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp index 497c92108f3f52..06f1181be90c85 100644 --- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp +++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp @@ -44,7 +44,7 @@ class FixedLabelAttrAccess : public AttributeAccessInterface // Register for the Fixed Label cluster on all endpoints. FixedLabelAttrAccess() : AttributeAccessInterface(Optional::Missing(), FixedLabel::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder); @@ -76,7 +76,8 @@ CHIP_ERROR FixedLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeVal FixedLabelAttrAccess gAttrAccess; -CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR FixedLabelAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == FixedLabel::Id); diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 4bc13525cb1128..ad05aaee677a3c 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -58,7 +58,7 @@ class GeneralCommissioningAttrAccess : public AttributeAccessInterface // Register for the GeneralCommissioning cluster on all endpoints. GeneralCommissioningAttrAccess() : AttributeAccessInterface(Optional::Missing(), GeneralCommissioning::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadIfSupported(CHIP_ERROR (ConfigurationManager::*getter)(uint8_t &), AttributeValueEncoder & aEncoder); @@ -67,7 +67,8 @@ class GeneralCommissioningAttrAccess : public AttributeAccessInterface GeneralCommissioningAttrAccess gAttrAccess; -CHIP_ERROR GeneralCommissioningAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR GeneralCommissioningAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != GeneralCommissioning::Id) { diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index 9283182c9d9dcf..57bb6dccb9082c 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -51,7 +51,7 @@ class GeneralDiagosticsAttrAccess : public AttributeAccessInterface // Register for the GeneralDiagnostics cluster on all endpoints. GeneralDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), GeneralDiagnostics::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: template @@ -135,7 +135,8 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::ReadNetworkInterfaces(AttributeValueEnco GeneralDiagosticsAttrAccess gAttrAccess; -CHIP_ERROR GeneralDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR GeneralDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != GeneralDiagnostics::Id) { diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index f3d1406741e68e..9977080004a2e3 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -112,7 +112,7 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface // Register for the GroupKeyManagement cluster on all endpoints. GroupKeyManagementAttributeAccess() : AttributeAccessInterface(Optional(0), GroupKeyManagement::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override { VerifyOrDie(aPath.mClusterId == GroupKeyManagement::Id); @@ -134,7 +134,7 @@ class GroupKeyManagementAttributeAccess : public AttributeAccessInterface return CHIP_ERROR_READ_FAILED; } - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override { if (GroupKeyManagement::Attributes::GroupKeyMap::Id == aPath.mAttributeId) diff --git a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp index 6892016ed07d18..d294148566b59a 100644 --- a/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp +++ b/src/app/clusters/localization-configuration-server/localization-configuration-server.cpp @@ -46,7 +46,7 @@ class LocalizationConfigurationAttrAccess : public AttributeAccessInterface LocalizationConfigurationAttrAccess() : AttributeAccessInterface(Optional::Missing(), LocalizationConfiguration::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadSupportedLocales(AttributeValueEncoder & aEncoder); @@ -78,7 +78,8 @@ CHIP_ERROR LocalizationConfigurationAttrAccess::ReadSupportedLocales(AttributeVa return err; } -CHIP_ERROR LocalizationConfigurationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR LocalizationConfigurationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == LocalizationConfiguration::Id); diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index bc2ceb9dccb952..11f89a526661cb 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -92,7 +92,8 @@ class MediaInputAttrAccess : public app::AttributeAccessInterface public: MediaInputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaInput::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadInputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -101,7 +102,8 @@ class MediaInputAttrAccess : public app::AttributeAccessInterface MediaInputAttrAccess gMediaInputAttrAccess; -CHIP_ERROR MediaInputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR MediaInputAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 9a22d9cf42d6c8..e6b64460da46d4 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -110,7 +110,8 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface public: MediaPlaybackAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), MediaPlayback::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadCurrentStateAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -124,7 +125,8 @@ class MediaPlaybackAttrAccess : public app::AttributeAccessInterface MediaPlaybackAttrAccess gMediaPlaybackAttrAccess; -CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR MediaPlaybackAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index 67fd8e4718ede5..2f8bbb8b389305 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -42,12 +42,13 @@ class ModeSelectAttrAccess : public AttributeAccessInterface public: ModeSelectAttrAccess() : AttributeAccessInterface(Optional::Missing(), ModeSelect::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; }; ModeSelectAttrAccess gModeSelectAttrAccess; -CHIP_ERROR ModeSelectAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR ModeSelectAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == ModeSelect::Id); diff --git a/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp b/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp index 3904b7e0130e5a..cddd2b7613def5 100644 --- a/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp +++ b/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp @@ -53,7 +53,7 @@ class NetworkCommissioningAttributeAccess : public AttributeAccessInterface public: NetworkCommissioningAttributeAccess() : AttributeAccessInterface(Optional::Missing(), Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override { switch (aPath.mAttributeId) { diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 2cdcaba762e6ff..ceea07febfa6cf 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -149,7 +149,7 @@ void Instance::InvokeCommand(HandlerContext & ctxt) } } -CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR Instance::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) { @@ -212,7 +212,7 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu } } -CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR Instance::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) { switch (aPath.mAttributeId) { diff --git a/src/app/clusters/network-commissioning/network-commissioning.h b/src/app/clusters/network-commissioning/network-commissioning.h index 10b95a12cbe475..cf80a665bc732e 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.h +++ b/src/app/clusters/network-commissioning/network-commissioning.h @@ -50,8 +50,8 @@ class Instance : public CommandHandlerInterface, void InvokeCommand(HandlerContext & ctx) override; // AttributeAccessInterface - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; // WirelessDriver::ConnectCallback void OnResult(DeviceLayer::NetworkCommissioning::Status commissioningError, CharSpan errorText, diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 23e898c1f67cf7..397e18039d241c 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -89,7 +89,7 @@ class OperationalCredentialsAttrAccess : public AttributeAccessInterface AttributeAccessInterface(Optional::Missing(), Clusters::OperationalCredentials::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadNOCs(EndpointId endpoint, AttributeValueEncoder & aEncoder); @@ -193,7 +193,8 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadRootCertificates(EndpointId end OperationalCredentialsAttrAccess gAttrAccess; -CHIP_ERROR OperationalCredentialsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR OperationalCredentialsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == Clusters::OperationalCredentials::Id); diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp index b7916b643a6e04..8e11584c61e066 100644 --- a/src/app/clusters/ota-requestor/ota-requestor-server.cpp +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -43,13 +43,14 @@ class OtaSoftwareUpdateRequestorAttrAccess : public AttributeAccessInterface {} // TODO: Implement Read/Write for OtaSoftwareUpdateRequestorAttrAccess - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; }; OtaSoftwareUpdateRequestorAttrAccess gAttrAccess; -CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) { @@ -62,7 +63,8 @@ CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttribut return CHIP_NO_ERROR; } -CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, + AttributeValueDecoder & aDecoder) { switch (aPath.mAttributeId) { diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp index 6301b7fb98cc46..686a1a3f978380 100644 --- a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp +++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp @@ -43,12 +43,13 @@ class PowerSourceConfigurationAttrAccess : public AttributeAccessInterface PowerSourceConfigurationAttrAccess() : AttributeAccessInterface(Optional::Missing(), PowerSourceConfiguration::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; }; PowerSourceConfigurationAttrAccess gAttrAccess; -CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp index 95b19fd5be564a..9a3145064064fa 100644 --- a/src/app/clusters/power-source-server/power-source-server.cpp +++ b/src/app/clusters/power-source-server/power-source-server.cpp @@ -40,12 +40,13 @@ class PowerSourceAttrAccess : public AttributeAccessInterface // Register on all endpoints. PowerSourceAttrAccess() : AttributeAccessInterface(Optional::Missing(), PowerSource::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; }; PowerSourceAttrAccess gAttrAccess; -CHIP_ERROR PowerSourceAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR PowerSourceAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 62f0f3a8b18704..3f5f9d99a4c761 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -44,7 +44,7 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface // Register for the SoftwareDiagnostics cluster on all endpoints. SoftwareDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), SoftwareDiagnostics::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadIfSupported(CHIP_ERROR (DiagnosticDataProvider::*getter)(uint64_t &), AttributeValueEncoder & aEncoder); @@ -53,7 +53,8 @@ class SoftwareDiagosticsAttrAccess : public AttributeAccessInterface SoftwareDiagosticsAttrAccess gAttrAccess; -CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR SoftwareDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != SoftwareDiagnostics::Id) { diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 505fe5f4a9b947..c9c5f1fd344bf0 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -110,7 +110,8 @@ class TargetNavigatorAttrAccess : public app::AttributeAccessInterface public: TargetNavigatorAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), TargetNavigator::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadTargetListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -119,7 +120,8 @@ class TargetNavigatorAttrAccess : public app::AttributeAccessInterface TargetNavigatorAttrAccess gTargetNavigatorAttrAccess; -CHIP_ERROR TargetNavigatorAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR TargetNavigatorAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index fce8e432558bc3..87d0817f9e4ca0 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -71,8 +71,8 @@ class TestAttrAccess : public AttributeAccessInterface // Register for the Test Cluster cluster on all endpoints. TestAttrAccess() : AttributeAccessInterface(Optional::Missing(), TestCluster::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadListInt8uAttribute(AttributeValueEncoder & aEncoder); @@ -106,7 +106,7 @@ SimpleEnum gSimpleEnums[kAttributeListLength]; size_t gSimpleEnumCount = 0; Structs::NullablesAndOptionalsStruct::Type gNullablesAndOptionalsStruct; -CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR TestAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) { @@ -148,7 +148,7 @@ CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attribu return CHIP_NO_ERROR; } -CHIP_ERROR TestAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR TestAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) { switch (aPath.mAttributeId) { diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp index 8e5ff031f72d16..2c91ff512bd186 100644 --- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp +++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp @@ -46,12 +46,13 @@ class ThreadDiagosticsAttrAccess : public AttributeAccessInterface // Register for the ThreadNetworkDiagnostics cluster on all endpoints. ThreadDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), ThreadNetworkDiagnostics::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; }; ThreadDiagosticsAttrAccess gAttrAccess; -CHIP_ERROR ThreadDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR ThreadDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != ThreadNetworkDiagnostics::Id) { diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 8a68136829faa6..974e33c5b992fa 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -46,7 +46,7 @@ class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface // Register for the Time Format Localization cluster on all endpoints. TimeFormatLocalizationAttrAccess() : AttributeAccessInterface(Optional::Missing(), TimeFormatLocalization::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder); @@ -78,7 +78,8 @@ CHIP_ERROR TimeFormatLocalizationAttrAccess::ReadSupportedCalendarTypes(Attribut return err; } -CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == TimeFormatLocalization::Id); diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index 311eb8027c10b0..307a0c4ddbe139 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -44,8 +44,8 @@ class UserLabelAttrAccess : public AttributeAccessInterface // Register for the User Label cluster on all endpoints. UserLabelAttrAccess() : AttributeAccessInterface(Optional::Missing(), UserLabel::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder); @@ -96,7 +96,8 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(EndpointId endpoint, AttributeVal return DeviceLayer::PlatformMgr().SetUserLabelList(endpoint, labelList); } -CHIP_ERROR UserLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR UserLabelAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { VerifyOrDie(aPath.mClusterId == UserLabel::Id); @@ -110,7 +111,8 @@ CHIP_ERROR UserLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, At return CHIP_NO_ERROR; } -CHIP_ERROR UserLabelAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +CHIP_ERROR UserLabelAttrAccess::Write(FabricIndex fabricIndex, const ConcreteDataAttributePath & aPath, + AttributeValueDecoder & aDecoder) { VerifyOrDie(aPath.mClusterId == UserLabel::Id); diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index 658430cc873c1b..45e8980a4ee469 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -93,7 +93,8 @@ class WakeOnLanAttrAccess : public app::AttributeAccessInterface public: WakeOnLanAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::WakeOnLan::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; private: CHIP_ERROR ReadMacAddressAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); @@ -101,7 +102,8 @@ class WakeOnLanAttrAccess : public app::AttributeAccessInterface WakeOnLanAttrAccess gWakeOnLanAttrAccess; -CHIP_ERROR WakeOnLanAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR WakeOnLanAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { EndpointId endpoint = aPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp index 6149efe26b8f72..6a7704ed6a4953 100644 --- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp +++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp @@ -44,7 +44,7 @@ class WiFiDiagosticsAttrAccess : public AttributeAccessInterface // Register for the WiFiNetworkDiagnostics cluster on all endpoints. WiFiDiagosticsAttrAccess() : AttributeAccessInterface(Optional::Missing(), WiFiNetworkDiagnostics::Id) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: template @@ -91,7 +91,8 @@ CHIP_ERROR WiFiDiagosticsAttrAccess::ReadWiFiBssId(AttributeValueEncoder & aEnco WiFiDiagosticsAttrAccess gAttrAccess; -CHIP_ERROR WiFiDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR WiFiDiagosticsAttrAccess::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { if (aPath.mClusterId != WiFiNetworkDiagnostics::Id) { diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index f2b39780d5e003..6b720cc77265c6 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -340,10 +340,11 @@ class GlobalAttributeReader : public MandatoryGlobalAttributeReader public: GlobalAttributeReader(const EmberAfCluster * aCluster) : MandatoryGlobalAttributeReader(aCluster) {} - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; }; -CHIP_ERROR GlobalAttributeReader::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +CHIP_ERROR GlobalAttributeReader::Read(FabricIndex fabricIndex, const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) { using namespace Clusters::Globals::Attributes; // The id of the attributes below is not in the attribute metadata. @@ -406,7 +407,7 @@ CHIP_ERROR ReadViaAccessInterface(FabricIndex aAccessingFabricIndex, bool aIsFab DataVersion version = kUndefinedDataVersion; ReturnErrorOnFailure(ReadClusterDataVersion(aPath.mEndpointId, aPath.mClusterId, version)); AttributeValueEncoder valueEncoder(aAttributeReports, aAccessingFabricIndex, aPath, version, aIsFabricFiltered, state); - CHIP_ERROR err = aAccessInterface->Read(aPath, valueEncoder); + CHIP_ERROR err = aAccessInterface->Read(aAccessingFabricIndex, aPath, valueEncoder); if (err != CHIP_NO_ERROR) { @@ -951,7 +952,7 @@ CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, if (auto * attrOverride = findAttributeAccessOverride(aClusterInfo.mEndpointId, aClusterInfo.mClusterId)) { AttributeValueDecoder valueDecoder(aReader, aSubjectDescriptor); - ReturnErrorOnFailure(attrOverride->Write(aPath, valueDecoder)); + ReturnErrorOnFailure(attrOverride->Write(aSubjectDescriptor.fabricIndex, aPath, valueDecoder)); if (valueDecoder.TriedDecode()) { diff --git a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml index b7023d15ceb2b4..66d3cf33f5f6f3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml @@ -16,27 +16,22 @@ limitations under the License. --> + + + + + + + + + General Binding 0x001e BINDING_CLUSTER - true - true The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. - - Add a binding - - - - - - - Remove a binding - - - - - + binding list - \ No newline at end of file + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 87ccd1dd5708e1..9db8a7056202b5 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -325,27 +325,18 @@ client cluster BinaryInputBasic = 15 { } client cluster Binding = 30 { - readonly global attribute command_id serverGeneratedCommandList[] = 65528; - readonly global attribute command_id clientGeneratedCommandList[] = 65529; - readonly global attribute attrib_id attributeList[] = 65531; - readonly global attribute int16u clusterRevision = 65533; - - request struct BindRequest { + struct BindingEntry { NODE_ID nodeId = 0; GROUP_ID groupId = 1; ENDPOINT_NO endpointId = 2; CLUSTER_ID clusterId = 3; } - request struct UnbindRequest { - NODE_ID nodeId = 0; - GROUP_ID groupId = 1; - ENDPOINT_NO endpointId = 2; - CLUSTER_ID clusterId = 3; - } - - command Bind(BindRequest): DefaultSuccess = 0; - command Unbind(UnbindRequest): DefaultSuccess = 1; + attribute BindingEntry bindingList[] = 0; + readonly global attribute command_id serverGeneratedCommandList[] = 65528; + readonly global attribute command_id clientGeneratedCommandList[] = 65529; + readonly global attribute attrib_id attributeList[] = 65531; + readonly global attribute int16u clusterRevision = 65533; } client cluster BooleanState = 69 { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index d7583dabb2d8e5..01203314f00425 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1935,24 +1935,6 @@ "define": "BINDING_CLUSTER", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], "attributes": [ { "name": "ClusterRevision", @@ -1980,6 +1962,21 @@ "enabled": 0, "commands": [], "attributes": [ + { + "name": "binding list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ServerGeneratedCommandList", "code": 65528, @@ -17948,4 +17945,4 @@ } ], "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 f6dd50da150a25..9495f2414bc45e 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1816,6 +1816,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR using namespace app::Clusters::Binding; switch (aPath.mAttributeId) { + case Attributes::BindingList::Id: { + using TypeInfo = Attributes::BindingList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_nodeId; + std::string newElement_0_nodeIdClassName = "java/lang/Long"; + std::string newElement_0_nodeIdCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_nodeIdClassName.c_str(), + newElement_0_nodeIdCtorSignature.c_str(), + entry_0.nodeId, newElement_0_nodeId); + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), + entry_0.groupId, newElement_0_groupId); + jobject newElement_0_endpointId; + std::string newElement_0_endpointIdClassName = "java/lang/Integer"; + std::string newElement_0_endpointIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endpointIdClassName.c_str(), + newElement_0_endpointIdCtorSignature.c_str(), + entry_0.endpointId, newElement_0_endpointId); + jobject newElement_0_clusterId; + std::string newElement_0_clusterIdClassName = "java/lang/Long"; + std::string newElement_0_clusterIdCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_clusterIdClassName.c_str(), + newElement_0_clusterIdCtorSignature.c_str(), + entry_0.clusterId, newElement_0_clusterId); + + jclass bindingEntryStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$BindingClusterBindingEntry", bindingEntryStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterBindingEntry"); + return nullptr; + } + jmethodID bindingEntryStructCtor = env->GetMethodID( + bindingEntryStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;)V"); + if (bindingEntryStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterBindingEntry constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(bindingEntryStructClass, bindingEntryStructCtor, newElement_0_nodeId, + newElement_0_groupId, newElement_0_endpointId, newElement_0_clusterId); + chip::JniReferences::GetInstance().AddToArrayList(value, newElement_0); + } + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 77924fc27e5fc7..110aee92aa8dbd 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -196,6 +196,8 @@ typedef void (*CHIPBinaryInputBasicClusterAttributeListAttributeCallbackType)( typedef void (*CHIPBinaryInputBasicClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPBindingClusterBindingListAttributeCallbackType)( + void *, const chip::app::Clusters::Binding::Attributes::BindingList::TypeInfo::DecodableType &); typedef void (*CHIPBindingClusterServerGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::Binding::Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPBindingClusterClientGeneratedCommandListAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index feb21490f5bad9..654608cdae17fe 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -3735,116 +3735,40 @@ JNI_METHOD(jlong, BindingCluster, initWithDevice)(JNIEnv * env, jobject self, jl return reinterpret_cast(cppCluster); } -JNI_METHOD(void, BindingCluster, bind) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject nodeId, jobject groupId, jobject endpointId, - jobject clusterId, jobject timedInvokeTimeoutMs) +JNI_METHOD(void, BindingCluster, subscribeBindingListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - BindingCluster * cppCluster; - - ListFreer listFreer; - chip::app::Clusters::Binding::Commands::Bind::Type request; - - std::vector> cleanupByteArrays; - std::vector> cleanupStrings; - request.nodeId = - static_cast>(chip::JniReferences::GetInstance().LongToPrimitive(nodeId)); - request.groupId = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.endpointId = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(endpointId)); - request.clusterId = static_cast>( - chip::JniReferences::GetInstance().LongToPrimitive(clusterId)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, BindingCluster, unbind) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject nodeId, jobject groupId, jobject endpointId, - jobject clusterId, jobject timedInvokeTimeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - BindingCluster * cppCluster; - - ListFreer listFreer; - chip::app::Clusters::Binding::Commands::Unbind::Type request; - - std::vector> cleanupByteArrays; - std::vector> cleanupStrings; - request.nodeId = - static_cast>(chip::JniReferences::GetInstance().LongToPrimitive(nodeId)); - request.groupId = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.endpointId = static_cast>( - chip::JniReferences::GetInstance().IntegerToPrimitive(endpointId)); - request.clusterId = static_cast>( - chip::JniReferences::GetInstance().LongToPrimitive(clusterId)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + BindingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Binding::Attributes::BindingList::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - if (timedInvokeTimeoutMs == nullptr) - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - } - else - { - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, - chip::JniReferences::GetInstance().IntegerToPrimitive(timedInvokeTimeoutMs)); - } + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBindingBindingListAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index bb2aa7730058bc..fdef9fc3ba0ed4 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -582,6 +582,99 @@ JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) onFailure.release(); } +JNI_METHOD(void, BindingCluster, writeBindingListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Binding::Attributes::BindingList::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + jint valueSize; + chip::JniReferences::GetInstance().GetArrayListSize(value, valueSize); + if (valueSize != 0) + { + auto * listHolder_0 = new ListHolder(valueSize); + listFreer.add(listHolder_0); + + for (size_t i_0 = 0; i_0 < static_cast(valueSize); ++i_0) + { + jobject element_0; + chip::JniReferences::GetInstance().GetArrayListItem(value, i_0, element_0); + jobject element_0_nodeIdItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "nodeId", "Ljava/lang/Long;", element_0_nodeIdItem_1); + listHolder_0->mList[i_0].nodeId = static_castmList[i_0].nodeId)>>( + chip::JniReferences::GetInstance().LongToPrimitive(element_0_nodeIdItem_1)); + jobject element_0_groupIdItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "groupId", "Ljava/lang/Integer;", + element_0_groupIdItem_1); + listHolder_0->mList[i_0].groupId = static_castmList[i_0].groupId)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_groupIdItem_1)); + jobject element_0_endpointIdItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "endpointId", "Ljava/lang/Integer;", + element_0_endpointIdItem_1); + listHolder_0->mList[i_0].endpointId = + static_castmList[i_0].endpointId)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_endpointIdItem_1)); + jobject element_0_clusterIdItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "clusterId", "Ljava/lang/Long;", + element_0_clusterIdItem_1); + listHolder_0->mList[i_0].clusterId = + static_castmList[i_0].clusterId)>>( + chip::JniReferences::GetInstance().LongToPrimitive(element_0_clusterIdItem_1)); + } + cppValue = ListType_0(listHolder_0->mList, valueSize); + } + else + { + cppValue = ListType_0(); + } + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + BindingCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, BridgedDeviceBasicCluster, writeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 392223bc06e010..f7c303d3389439 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -3245,6 +3245,114 @@ void CHIPBinaryInputBasicAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPBindingBindingListAttributeCallback::CHIPBindingBindingListAttributeCallback(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"); + } +} + +CHIPBindingBindingListAttributeCallback::~CHIPBindingBindingListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBindingBindingListAttributeCallback::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; + jobject newElement_0_nodeId; + std::string newElement_0_nodeIdClassName = "java/lang/Long"; + std::string newElement_0_nodeIdCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_nodeIdClassName.c_str(), newElement_0_nodeIdCtorSignature.c_str(), entry_0.nodeId, newElement_0_nodeId); + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, + newElement_0_groupId); + jobject newElement_0_endpointId; + std::string newElement_0_endpointIdClassName = "java/lang/Integer"; + std::string newElement_0_endpointIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_endpointIdClassName.c_str(), + newElement_0_endpointIdCtorSignature.c_str(), + entry_0.endpointId, newElement_0_endpointId); + jobject newElement_0_clusterId; + std::string newElement_0_clusterIdClassName = "java/lang/Long"; + std::string newElement_0_clusterIdCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_clusterIdClassName.c_str(), + newElement_0_clusterIdCtorSignature.c_str(), + entry_0.clusterId, newElement_0_clusterId); + + jclass bindingEntryStructClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$BindingClusterBindingEntry", + bindingEntryStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterBindingEntry"); + return; + } + jmethodID bindingEntryStructCtor = env->GetMethodID( + bindingEntryStructClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;)V"); + if (bindingEntryStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterBindingEntry constructor"); + return; + } + + newElement_0 = env->NewObject(bindingEntryStructClass, bindingEntryStructCtor, newElement_0_nodeId, newElement_0_groupId, + newElement_0_endpointId, newElement_0_clusterId); + chip::JniReferences::GetInstance().AddToArrayList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPBindingServerGeneratedCommandListAttributeCallback::CHIPBindingServerGeneratedCommandListAttributeCallback(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 91f24b7ec5b8f7..0eb7cab6b9b951 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -1416,6 +1416,37 @@ class CHIPBinaryInputBasicAttributeListAttributeCallback bool keepAlive; }; +class CHIPBindingBindingListAttributeCallback : public chip::Callback::Callback +{ +public: + CHIPBindingBindingListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBindingBindingListAttributeCallback(); + + static void maybeDestroy(CHIPBindingBindingListAttributeCallback * 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 CHIPBindingServerGeneratedCommandListAttributeCallback : 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 390b587cfefe67..26b115e0215920 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -2159,63 +2159,14 @@ public BindingCluster(long devicePtr, int endpointId) { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void bind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId) { - bind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, null); - } - - public void bind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - int timedInvokeTimeoutMs) { - bind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, timedInvokeTimeoutMs); - } + public interface BindingListAttributeCallback { + void onSuccess(List valueList); - public void unbind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId) { - unbind(chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, null); - } + void onError(Exception ex); - public void unbind( - DefaultClusterCallback callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - int timedInvokeTimeoutMs) { - unbind( - chipClusterPtr, callback, nodeId, groupId, endpointId, clusterId, timedInvokeTimeoutMs); + default void onSubscriptionEstablished() {} } - private native void bind( - long chipClusterPtr, - DefaultClusterCallback Callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - @Nullable Integer timedInvokeTimeoutMs); - - private native void unbind( - long chipClusterPtr, - DefaultClusterCallback Callback, - Long nodeId, - Integer groupId, - Integer endpointId, - Long clusterId, - @Nullable Integer timedInvokeTimeoutMs); - public interface ServerGeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -2240,6 +2191,27 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished() {} } + public void readBindingListAttribute(BindingListAttributeCallback callback) { + readBindingListAttribute(chipClusterPtr, callback); + } + + public void writeBindingListAttribute( + DefaultClusterCallback callback, ArrayList value) { + writeBindingListAttribute(chipClusterPtr, callback, value, null); + } + + public void writeBindingListAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeBindingListAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeBindingListAttribute( + BindingListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBindingListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readServerGeneratedCommandListAttribute( ServerGeneratedCommandListAttributeCallback callback) { readServerGeneratedCommandListAttribute(chipClusterPtr, callback); @@ -2280,6 +2252,21 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + private native void readBindingListAttribute( + long chipClusterPtr, BindingListAttributeCallback callback); + + private native void writeBindingListAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeBindingListAttribute( + long chipClusterPtr, + BindingListAttributeCallback callback, + int minInterval, + int maxInterval); + private native void readServerGeneratedCommandListAttribute( long chipClusterPtr, ServerGeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index abf13f07de0a89..66de8f0826d773 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -225,6 +225,41 @@ public String toString() { } } + public static class BindingClusterBindingEntry { + public Long nodeId; + public Integer groupId; + public Integer endpointId; + public Long clusterId; + + public BindingClusterBindingEntry( + Long nodeId, Integer groupId, Integer endpointId, Long clusterId) { + this.nodeId = nodeId; + this.groupId = groupId; + this.endpointId = endpointId; + this.clusterId = clusterId; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("BindingClusterBindingEntry {\n"); + output.append("\tnodeId: "); + output.append(nodeId); + output.append("\n"); + output.append("\tgroupId: "); + output.append(groupId); + output.append("\n"); + output.append("\tendpointId: "); + output.append(endpointId); + output.append("\n"); + output.append("\tclusterId: "); + output.append(clusterId); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedActionsClusterActionStruct { public Integer actionID; public String name; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index ebedd116e7705d..0fdfd64b8345c0 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1052,6 +1052,31 @@ public void onError(Exception ex) { } } + public static class DelegatedBindingClusterBindingListAttributeCallback + implements ChipClusters.BindingCluster.BindingListAttributeCallback, + 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 DelegatedBindingClusterServerGeneratedCommandListAttributeCallback implements ChipClusters.BindingCluster.ServerGeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -7736,70 +7761,6 @@ public Map> getCommandMap() { Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); Map bindingClusterInteractionInfoMap = new LinkedHashMap<>(); - Map bindingbindCommandParams = - new LinkedHashMap(); - CommandParameterInfo bindingbindnodeIdCommandParameterInfo = - new CommandParameterInfo("nodeId", Long.class); - bindingbindCommandParams.put("nodeId", bindingbindnodeIdCommandParameterInfo); - - CommandParameterInfo bindingbindgroupIdCommandParameterInfo = - new CommandParameterInfo("groupId", Integer.class); - bindingbindCommandParams.put("groupId", bindingbindgroupIdCommandParameterInfo); - - CommandParameterInfo bindingbindendpointIdCommandParameterInfo = - new CommandParameterInfo("endpointId", Integer.class); - bindingbindCommandParams.put("endpointId", bindingbindendpointIdCommandParameterInfo); - - CommandParameterInfo bindingbindclusterIdCommandParameterInfo = - new CommandParameterInfo("clusterId", Long.class); - bindingbindCommandParams.put("clusterId", bindingbindclusterIdCommandParameterInfo); - - InteractionInfo bindingbindInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BindingCluster) cluster) - .bind( - (DefaultClusterCallback) callback, - (Long) commandArguments.get("nodeId"), - (Integer) commandArguments.get("groupId"), - (Integer) commandArguments.get("endpointId"), - (Long) commandArguments.get("clusterId")); - }, - () -> new DelegatedDefaultClusterCallback(), - bindingbindCommandParams); - bindingClusterInteractionInfoMap.put("bind", bindingbindInteractionInfo); - Map bindingunbindCommandParams = - new LinkedHashMap(); - CommandParameterInfo bindingunbindnodeIdCommandParameterInfo = - new CommandParameterInfo("nodeId", Long.class); - bindingunbindCommandParams.put("nodeId", bindingunbindnodeIdCommandParameterInfo); - - CommandParameterInfo bindingunbindgroupIdCommandParameterInfo = - new CommandParameterInfo("groupId", Integer.class); - bindingunbindCommandParams.put("groupId", bindingunbindgroupIdCommandParameterInfo); - - CommandParameterInfo bindingunbindendpointIdCommandParameterInfo = - new CommandParameterInfo("endpointId", Integer.class); - bindingunbindCommandParams.put("endpointId", bindingunbindendpointIdCommandParameterInfo); - - CommandParameterInfo bindingunbindclusterIdCommandParameterInfo = - new CommandParameterInfo("clusterId", Long.class); - bindingunbindCommandParams.put("clusterId", bindingunbindclusterIdCommandParameterInfo); - - InteractionInfo bindingunbindInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BindingCluster) cluster) - .unbind( - (DefaultClusterCallback) callback, - (Long) commandArguments.get("nodeId"), - (Integer) commandArguments.get("groupId"), - (Integer) commandArguments.get("endpointId"), - (Long) commandArguments.get("clusterId")); - }, - () -> new DelegatedDefaultClusterCallback(), - bindingunbindCommandParams); - bindingClusterInteractionInfoMap.put("unbind", bindingunbindInteractionInfo); commandMap.put("binding", bindingClusterInteractionInfoMap); Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 9e5d35df547e54..c369548f8b0024 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -1157,6 +1157,19 @@ public Map> getReadAttributeMap() { readBinaryInputBasicClusterRevisionAttributeInteractionInfo); readAttributeMap.put("binaryInputBasic", readBinaryInputBasicInteractionInfo); Map readBindingInteractionInfo = new LinkedHashMap<>(); + Map readBindingBindingListCommandParams = + new LinkedHashMap(); + InteractionInfo readBindingBindingListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BindingCluster) cluster) + .readBindingListAttribute( + (ChipClusters.BindingCluster.BindingListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBindingClusterBindingListAttributeCallback(), + readBindingBindingListCommandParams); + readBindingInteractionInfo.put( + "readBindingListAttribute", readBindingBindingListAttributeInteractionInfo); Map readBindingServerGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readBindingServerGeneratedCommandListAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index e8a1233ac7af04..b34baa7f5bdf99 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -686,28 +686,15 @@ class ChipClusters: "clusterName": "Binding", "clusterId": 0x0000001E, "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "Bind", - "args": { - "nodeId": "int", - "groupId": "int", - "endpointId": "int", - "clusterId": "int", - }, - }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "Unbind", - "args": { - "nodeId": "int", - "groupId": "int", - "endpointId": "int", - "clusterId": "int", - }, - }, }, "attributes": { + 0x00000000: { + "attributeName": "BindingList", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + "writable": True, + }, 0x0000FFF8: { "attributeName": "ServerGeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7f6431c23d4c9a..16c5beb8d9549c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5542,6 +5542,7 @@ class Binding(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ + ClusterObjectFieldDescriptor(Label="bindingList", Tag=0x00000000, Type=typing.List[Binding.Structs.BindingEntry]), ClusterObjectFieldDescriptor(Label="serverGeneratedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="clientGeneratedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -5549,6 +5550,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) + bindingList: 'typing.List[Binding.Structs.BindingEntry]' = None serverGeneratedCommandList: 'typing.List[uint]' = None clientGeneratedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -5556,14 +5558,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None - - class Commands: + class Structs: @dataclass - class Bind(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x001E - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = True - + class BindingEntry(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -5579,29 +5576,26 @@ def descriptor(cls) -> ClusterObjectDescriptor: endpointId: 'uint' = 0 clusterId: 'uint' = 0 + + + + class Attributes: @dataclass - class Unbind(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x001E - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = True + class BindingList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001E @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="nodeId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="endpointId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterId", Tag=3, Type=uint), - ]) + def attribute_id(cls) -> int: + return 0x00000000 - nodeId: 'uint' = 0 - groupId: 'uint' = 0 - endpointId: 'uint' = 0 - clusterId: 'uint' = 0 + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[Binding.Structs.BindingEntry]) + value: 'typing.List[Binding.Structs.BindingEntry]' = field(default_factory=lambda: []) - class Attributes: @dataclass class ServerGeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp index d704e16fb94f5e..5bb4b2ad11ddf2 100644 --- a/src/controller/tests/TestReadChunking.cpp +++ b/src/controller/tests/TestReadChunking.cpp @@ -145,13 +145,16 @@ class TestAttrAccess : public app::AttributeAccessInterface registerAttributeAccessOverride(this); } - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const app::ConcreteDataAttributePath & aPath, app::AttributeValueDecoder & aDecoder) override; + CHIP_ERROR Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(FabricIndex fabricIndex, const app::ConcreteDataAttributePath & aPath, + app::AttributeValueDecoder & aDecoder) override; }; TestAttrAccess gAttrAccess; -CHIP_ERROR TestAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +CHIP_ERROR TestAttrAccess::Read(FabricIndex fabricIndex, const app::ConcreteReadAttributePath & aPath, + app::AttributeValueEncoder & aEncoder) { switch (aPath.mAttributeId) { @@ -174,7 +177,8 @@ CHIP_ERROR TestAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, ap } } -CHIP_ERROR TestAttrAccess::Write(const app::ConcreteDataAttributePath & aPath, app::AttributeValueDecoder & aDecoder) +CHIP_ERROR TestAttrAccess::Write(FabricIndex fabricIndex, const app::ConcreteDataAttributePath & aPath, + app::AttributeValueDecoder & aDecoder) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 4f10709d4d62c1..4a7e94629ea28e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -1544,6 +1544,36 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::Binding::Id: { using namespace Clusters::Binding; switch (aPath.mAttributeId) { + case Attributes::BindingList::Id: { + using TypeInfo = Attributes::BindingList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPBindingClusterBindingEntry * newElement_0; + newElement_0 = [CHIPBindingClusterBindingEntry new]; + newElement_0.nodeId = [NSNumber numberWithUnsignedLongLong:entry_0.nodeId]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.endpointId = [NSNumber numberWithUnsignedShort:entry_0.endpointId]; + newElement_0.clusterId = [NSNumber numberWithUnsignedInt:entry_0.clusterId]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; + return value; + } case Attributes::ServerGeneratedCommandList::Id: { using TypeInfo = Attributes::ServerGeneratedCommandList::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 b5c7678e66cc28..8f9f00bd4a2174 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -2119,6 +2119,49 @@ } } +void CHIPBindingBindingListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPBindingClusterBindingEntry * newElement_0; + newElement_0 = [CHIPBindingClusterBindingEntry new]; + newElement_0.nodeId = [NSNumber numberWithUnsignedLongLong:entry_0.nodeId]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.endpointId = [NSNumber numberWithUnsignedShort:entry_0.endpointId]; + newElement_0.clusterId = [NSNumber numberWithUnsignedInt:entry_0.clusterId]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPBindingBindingListListAttributeCallbackSubscriptionBridge::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 CHIPBindingServerGeneratedCommandListListAttributeCallbackBridge::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 d3e4eb4758bb43..6991e08148c9ba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -2264,6 +2264,34 @@ class CHIPBinaryInputBasicAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPBindingBindingListListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPBindingBindingListListAttributeCallbackBridge(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 CHIPBindingBindingListListAttributeCallbackSubscriptionBridge : public CHIPBindingBindingListListAttributeCallbackBridge +{ +public: + CHIPBindingBindingListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPBindingBindingListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPBindingServerGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 008ab30d57bf17..5d5d93b81c566f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -792,8 +792,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBinding : CHIPCluster -- (void)bindWithParams:(CHIPBindingClusterBindParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)unbindWithParams:(CHIPBindingClusterUnbindParams *)params completionHandler:(StatusCompletion)completionHandler; +- (void)readAttributeBindingListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeBindingListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeBindingListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(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 5a94e913a00948..36a7e545288d3f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -2991,46 +2991,75 @@ @implementation CHIPBinding return &_cppCluster; } -- (void)bindWithParams:(CHIPBindingClusterBindParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)readAttributeBindingListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler { - ListFreer listFreer; - Binding::Commands::Bind::Type request; - request.nodeId = params.nodeId.unsignedLongLongValue; - request.groupId = params.groupId.unsignedShortValue; - request.endpointId = params.endpointId.unsignedShortValue; - request.clusterId = params.clusterId.unsignedIntValue; + new CHIPBindingBindingListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Binding::Attributes::BindingList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} - new CHIPCommandSuccessCallbackBridge( +- (void)writeAttributeBindingListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { + ^(id _Nullable ignored, NSError * _Nullable error) { completionHandler(error); }, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + ListFreer listFreer; + using TypeInfo = Binding::Attributes::BindingList::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:[CHIPBindingClusterBindingEntry class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPBindingClusterBindingEntry *) value[i_0]; + listHolder_0->mList[i_0].nodeId = element_0.nodeId.unsignedLongLongValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + listHolder_0->mList[i_0].endpointId = element_0.endpointId.unsignedShortValue; + listHolder_0->mList[i_0].clusterId = element_0.clusterId.unsignedIntValue; + } + 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.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)unbindWithParams:(CHIPBindingClusterUnbindParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)subscribeAttributeBindingListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - ListFreer listFreer; - Binding::Commands::Unbind::Type request; - request.nodeId = params.nodeId.unsignedLongLongValue; - request.groupId = params.groupId.unsignedShortValue; - request.endpointId = params.endpointId.unsignedShortValue; - request.clusterId = params.clusterId.unsignedIntValue; - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, + new CHIPBindingBindingListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + using TypeInfo = Binding::Attributes::BindingList::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPBindingBindingListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); } - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index f2e5f778596ee5..bcf8e790454459 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -470,22 +470,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPBindingClusterBindParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull nodeId; -@property (strong, nonatomic) NSNumber * _Nonnull groupId; -@property (strong, nonatomic) NSNumber * _Nonnull endpointId; -@property (strong, nonatomic) NSNumber * _Nonnull clusterId; -- (instancetype)init; -@end - -@interface CHIPBindingClusterUnbindParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull nodeId; -@property (strong, nonatomic) NSNumber * _Nonnull groupId; -@property (strong, nonatomic) NSNumber * _Nonnull endpointId; -@property (strong, nonatomic) NSNumber * _Nonnull clusterId; -- (instancetype)init; -@end - @interface CHIPPollControlClusterCheckInResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull startFastPolling; @property (strong, nonatomic) NSNumber * _Nonnull fastPollTimeout; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index 4193d8b38eae62..6108969a0ecf7a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -978,40 +978,6 @@ - (instancetype)init } @end -@implementation CHIPBindingClusterBindParams -- (instancetype)init -{ - if (self = [super init]) { - - _nodeId = @(0); - - _groupId = @(0); - - _endpointId = @(0); - - _clusterId = @(0); - } - return self; -} -@end - -@implementation CHIPBindingClusterUnbindParams -- (instancetype)init -{ - if (self = [super init]) { - - _nodeId = @(0); - - _groupId = @(0); - - _endpointId = @(0); - - _clusterId = @(0); - } - return self; -} -@end - @implementation CHIPPollControlClusterCheckInResponseParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index 1674178e29b652..99fba3e7745d87 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -61,6 +61,14 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPBindingClusterBindingEntry : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull nodeId; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull endpointId; +@property (strong, nonatomic) NSNumber * _Nonnull clusterId; +- (instancetype)init; +@end + @interface CHIPAccessControlClusterTarget : NSObject @property (strong, nonatomic) NSNumber * _Nullable cluster; @property (strong, nonatomic) NSNumber * _Nullable endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index aaf012124262be..03754efda6be53 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -100,6 +100,23 @@ - (instancetype)init } @end +@implementation CHIPBindingClusterBindingEntry +- (instancetype)init +{ + if (self = [super init]) { + + _nodeId = @(0); + + _groupId = @(0); + + _endpointId = @(0); + + _clusterId = @(0); + } + return self; +} +@end + @implementation CHIPAccessControlClusterTarget - (instancetype)init { diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index 4cf492b693448d..432cd50061c786 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -145,52 +145,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace BarrierControl -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(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 Binding - namespace ColorControl { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1817,9 +1771,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::BarrierControl::Id: Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::ColorControl::Id: Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index fbf58e77313643..59eddf9c93e1c0 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -29,12 +29,30 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), big-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ \ - /* 6 - SupportedLocales, */ \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ + \ + /* 260 - SupportedLocales, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -52,281 +70,299 @@ \ /* Endpoint: 0, Cluster: Unit Localization (server), big-endian */ \ \ - /* 260 - FeatureMap, */ \ + /* 514 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 264 - Breadcrumb, */ \ + /* 518 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 272 - FeatureMap, */ \ + /* 526 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 276 - Networks, */ \ + /* 530 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 288 - LastConnectErrorValue, */ \ + /* 542 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 546 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x02, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 296 - UpTime, */ \ + /* 550 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 304 - TotalOperationalHours, */ \ + /* 558 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 308 - CurrentHeapFree, */ \ + /* 562 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 316 - CurrentHeapUsed, */ \ + /* 570 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - CurrentHeapHighWatermark, */ \ + /* 578 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 332 - FeatureMap, */ \ + /* 586 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 336 - NetworkName, */ \ + /* 590 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 338 - ExtendedPanId, */ \ + /* 592 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 346 - OverrunCount, */ \ + /* 600 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 354 - PartitionId, */ \ + /* 608 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 358 - TxTotalCount, */ \ + /* 612 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 362 - TxUnicastCount, */ \ + /* 616 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - TxBroadcastCount, */ \ + /* 620 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 370 - TxAckRequestedCount, */ \ + /* 624 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - TxAckedCount, */ \ + /* 628 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxNoAckRequestedCount, */ \ + /* 632 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxDataCount, */ \ + /* 636 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxDataPollCount, */ \ + /* 640 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxBeaconCount, */ \ + /* 644 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxBeaconRequestCount, */ \ + /* 648 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxOtherCount, */ \ + /* 652 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxRetryCount, */ \ + /* 656 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDirectMaxRetryExpiryCount, */ \ + /* 660 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxIndirectMaxRetryExpiryCount, */ \ + /* 664 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxErrCcaCount, */ \ + /* 668 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxErrAbortCount, */ \ + /* 672 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxErrBusyChannelCount, */ \ + /* 676 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - RxTotalCount, */ \ + /* 680 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - RxUnicastCount, */ \ + /* 684 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - RxBroadcastCount, */ \ + /* 688 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - RxDataCount, */ \ + /* 692 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - RxDataPollCount, */ \ + /* 696 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxBeaconCount, */ \ + /* 700 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxBeaconRequestCount, */ \ + /* 704 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxOtherCount, */ \ + /* 708 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxAddressFilteredCount, */ \ + /* 712 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDestAddrFilteredCount, */ \ + /* 716 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxDuplicatedCount, */ \ + /* 720 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxErrNoFrameCount, */ \ + /* 724 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxErrUnknownNeighborCount, */ \ + /* 728 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxErrInvalidSrcAddrCount, */ \ + /* 732 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxErrSecCount, */ \ + /* 736 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxErrFcsCount, */ \ + /* 740 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrOtherCount, */ \ + /* 744 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - ActiveTimestamp, */ \ + /* 748 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - PendingTimestamp, */ \ + /* 756 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - delay, */ \ + /* 764 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ChannelMask, */ \ + /* 768 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 521 - FeatureMap, */ \ + /* 775 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 525 - BeaconLostCount, */ \ + /* 779 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 529 - BeaconRxCount, */ \ + /* 783 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 533 - PacketMulticastRxCount, */ \ + /* 787 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 537 - PacketMulticastTxCount, */ \ + /* 791 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - PacketUnicastRxCount, */ \ + /* 795 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - PacketUnicastTxCount, */ \ + /* 799 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - CurrentMaxRate, */ \ + /* 803 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - OverrunCount, */ \ + /* 811 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - FeatureMap, */ \ + /* 819 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 569 - PacketRxCount, */ \ + /* 823 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - PacketTxCount, */ \ + /* 831 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - TxErrCount, */ \ + /* 839 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 593 - CollisionCount, */ \ + /* 847 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - OverrunCount, */ \ + /* 855 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 609 - TimeSinceReset, */ \ + /* 863 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 617 - FeatureMap, */ \ + /* 871 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 621 - FeatureMap, */ \ + /* 875 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Level Control (server), big-endian */ \ \ - /* 625 - FeatureMap, */ \ + /* 879 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ + /* Endpoint: 1, Cluster: Binding (server), big-endian */ \ + \ + /* 883 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ \ - /* 629 - BatteryVoltage, */ \ + /* 1137 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 633 - BatteryTimeRemaining, */ \ + /* 1141 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - ActiveBatteryFaults, */ \ + /* 1145 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 645 - FeatureMap, */ \ + /* 1153 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 649 - Networks, */ \ + /* 1157 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 661 - LastConnectErrorValue, */ \ + /* 1169 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 665 - FeatureMap, */ \ + /* 1173 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ \ - /* 669 - SoftwareVersion, */ \ + /* 1177 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 673 - FeatureMap, */ \ + /* 1181 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 677 - label list, */ \ + /* 1185 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -344,58 +380,58 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 931 - Description, */ \ + /* 1439 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 938 - DoorOpenEvents, */ \ + /* 1446 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 942 - DoorClosedEvents, */ \ + /* 1450 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 946 - Language, */ \ + /* 1454 - Language, */ \ 2, 'e', 'n', \ \ - /* 949 - AutoRelockTime, */ \ + /* 1457 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x60, \ \ - /* 953 - FeatureMap, */ \ + /* 1461 - FeatureMap, */ \ 0x00, 0x00, 0x01, 0x03, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 957 - FeatureMap, */ \ + /* 1465 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 961 - LifetimeRunningHours, */ \ + /* 1469 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 964 - Power, */ \ + /* 1472 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 967 - LifetimeEnergyConsumed, */ \ + /* 1475 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 971 - FeatureMap, */ \ + /* 1479 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 975 - FeatureMap, */ \ + /* 1483 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 979 - IAS CIE address, */ \ + /* 1487 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 987 - channel list, */ \ + /* 1495 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -413,7 +449,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1241 - target navigator list, */ \ + /* 1749 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -431,24 +467,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1495 - start time, */ \ + /* 2003 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1503 - duration, */ \ + /* 2011 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1511 - playback speed, */ \ + /* 2019 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1515 - seek range end, */ \ + /* 2023 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1523 - seek range start, */ \ + /* 2031 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 1531 - media input list, */ \ + /* 2039 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -466,7 +502,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 1785 - accept header list, */ \ + /* 2293 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -482,12 +518,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2039 - supported streaming protocols, */ \ + /* 2547 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2043 - audio output list, */ \ + /* 2551 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -505,7 +541,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 2297 - application launcher list, */ \ + /* 2805 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -523,67 +559,67 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 2551 - allowed vendor list, */ \ + /* 3059 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 2583 - bitmap32, */ \ + /* 3091 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2587 - bitmap64, */ \ + /* 3095 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2595 - int24u, */ \ + /* 3103 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 2598 - int32u, */ \ + /* 3106 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2602 - int40u, */ \ + /* 3110 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2607 - int48u, */ \ + /* 3115 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2613 - int56u, */ \ + /* 3121 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2620 - int64u, */ \ + /* 3128 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2628 - int24s, */ \ + /* 3136 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 2631 - int32s, */ \ + /* 3139 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2635 - int40s, */ \ + /* 3143 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2640 - int48s, */ \ + /* 3148 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2646 - int56s, */ \ + /* 3154 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2653 - int64s, */ \ + /* 3161 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2661 - float_single, */ \ + /* 3169 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2665 - float_double, */ \ + /* 3173 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2673 - epoch_us, */ \ + /* 3181 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2681 - epoch_s, */ \ + /* 3189 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2685 - list_long_octet_string, */ \ + /* 3193 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -638,65 +674,65 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3685 - nullable_bitmap32, */ \ + /* 4193 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3689 - nullable_bitmap64, */ \ + /* 4197 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3697 - nullable_int24u, */ \ + /* 4205 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3700 - nullable_int32u, */ \ + /* 4208 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3704 - nullable_int40u, */ \ + /* 4212 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3709 - nullable_int48u, */ \ + /* 4217 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3715 - nullable_int56u, */ \ + /* 4223 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3722 - nullable_int64u, */ \ + /* 4230 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3730 - nullable_int24s, */ \ + /* 4238 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3733 - nullable_int32s, */ \ + /* 4241 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3737 - nullable_int40s, */ \ + /* 4245 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3742 - nullable_int48s, */ \ + /* 4250 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3748 - nullable_int56s, */ \ + /* 4256 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3755 - nullable_int64s, */ \ + /* 4263 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3763 - nullable_float_single, */ \ + /* 4271 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3767 - nullable_float_double, */ \ + /* 4275 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 3775 - measurement type, */ \ + /* 4283 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3779 - total active power, */ \ + /* 4287 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 3783 - FeatureMap, */ \ + /* 4291 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -704,12 +740,30 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), little-endian */ \ + \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ - /* 6 - SupportedLocales, */ \ + /* 260 - SupportedLocales, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -727,281 +781,299 @@ \ /* Endpoint: 0, Cluster: Unit Localization (server), little-endian */ \ \ - /* 260 - FeatureMap, */ \ + /* 514 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 264 - Breadcrumb, */ \ + /* 518 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 272 - FeatureMap, */ \ + /* 526 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 276 - Networks, */ \ + /* 530 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 288 - LastConnectErrorValue, */ \ + /* 542 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 546 - FeatureMap, */ \ 0x02, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 296 - UpTime, */ \ + /* 550 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 304 - TotalOperationalHours, */ \ + /* 558 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 308 - CurrentHeapFree, */ \ + /* 562 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 316 - CurrentHeapUsed, */ \ + /* 570 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - CurrentHeapHighWatermark, */ \ + /* 578 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 332 - FeatureMap, */ \ + /* 586 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 336 - NetworkName, */ \ + /* 590 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 338 - ExtendedPanId, */ \ + /* 592 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 346 - OverrunCount, */ \ + /* 600 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 354 - PartitionId, */ \ + /* 608 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 358 - TxTotalCount, */ \ + /* 612 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 362 - TxUnicastCount, */ \ + /* 616 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - TxBroadcastCount, */ \ + /* 620 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 370 - TxAckRequestedCount, */ \ + /* 624 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - TxAckedCount, */ \ + /* 628 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxNoAckRequestedCount, */ \ + /* 632 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxDataCount, */ \ + /* 636 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxDataPollCount, */ \ + /* 640 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxBeaconCount, */ \ + /* 644 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxBeaconRequestCount, */ \ + /* 648 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxOtherCount, */ \ + /* 652 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxRetryCount, */ \ + /* 656 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDirectMaxRetryExpiryCount, */ \ + /* 660 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxIndirectMaxRetryExpiryCount, */ \ + /* 664 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxErrCcaCount, */ \ + /* 668 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxErrAbortCount, */ \ + /* 672 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxErrBusyChannelCount, */ \ + /* 676 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - RxTotalCount, */ \ + /* 680 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - RxUnicastCount, */ \ + /* 684 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - RxBroadcastCount, */ \ + /* 688 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - RxDataCount, */ \ + /* 692 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - RxDataPollCount, */ \ + /* 696 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxBeaconCount, */ \ + /* 700 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxBeaconRequestCount, */ \ + /* 704 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxOtherCount, */ \ + /* 708 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxAddressFilteredCount, */ \ + /* 712 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDestAddrFilteredCount, */ \ + /* 716 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxDuplicatedCount, */ \ + /* 720 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxErrNoFrameCount, */ \ + /* 724 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxErrUnknownNeighborCount, */ \ + /* 728 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxErrInvalidSrcAddrCount, */ \ + /* 732 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxErrSecCount, */ \ + /* 736 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxErrFcsCount, */ \ + /* 740 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrOtherCount, */ \ + /* 744 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - ActiveTimestamp, */ \ + /* 748 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - PendingTimestamp, */ \ + /* 756 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - delay, */ \ + /* 764 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ChannelMask, */ \ + /* 768 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 521 - FeatureMap, */ \ + /* 775 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 525 - BeaconLostCount, */ \ + /* 779 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 529 - BeaconRxCount, */ \ + /* 783 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 533 - PacketMulticastRxCount, */ \ + /* 787 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 537 - PacketMulticastTxCount, */ \ + /* 791 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - PacketUnicastRxCount, */ \ + /* 795 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - PacketUnicastTxCount, */ \ + /* 799 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - CurrentMaxRate, */ \ + /* 803 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - OverrunCount, */ \ + /* 811 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - FeatureMap, */ \ + /* 819 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 569 - PacketRxCount, */ \ + /* 823 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - PacketTxCount, */ \ + /* 831 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - TxErrCount, */ \ + /* 839 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 593 - CollisionCount, */ \ + /* 847 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - OverrunCount, */ \ + /* 855 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 609 - TimeSinceReset, */ \ + /* 863 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 617 - FeatureMap, */ \ + /* 871 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 621 - FeatureMap, */ \ + /* 875 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Level Control (server), little-endian */ \ \ - /* 625 - FeatureMap, */ \ + /* 879 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Binding (server), little-endian */ \ + \ + /* 883 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ \ - /* 629 - BatteryVoltage, */ \ + /* 1137 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 633 - BatteryTimeRemaining, */ \ + /* 1141 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - ActiveBatteryFaults, */ \ + /* 1145 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 645 - FeatureMap, */ \ + /* 1153 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 649 - Networks, */ \ + /* 1157 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 661 - LastConnectErrorValue, */ \ + /* 1169 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 665 - FeatureMap, */ \ + /* 1173 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ \ - /* 669 - SoftwareVersion, */ \ + /* 1177 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 673 - FeatureMap, */ \ + /* 1181 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 677 - label list, */ \ + /* 1185 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1019,58 +1091,58 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 931 - Description, */ \ + /* 1439 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 938 - DoorOpenEvents, */ \ + /* 1446 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 942 - DoorClosedEvents, */ \ + /* 1450 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 946 - Language, */ \ + /* 1454 - Language, */ \ 2, 'e', 'n', \ \ - /* 949 - AutoRelockTime, */ \ + /* 1457 - AutoRelockTime, */ \ 0x60, 0x00, 0x00, 0x00, \ \ - /* 953 - FeatureMap, */ \ + /* 1461 - FeatureMap, */ \ 0x03, 0x01, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 957 - FeatureMap, */ \ + /* 1465 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 961 - LifetimeRunningHours, */ \ + /* 1469 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 964 - Power, */ \ + /* 1472 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 967 - LifetimeEnergyConsumed, */ \ + /* 1475 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 971 - FeatureMap, */ \ + /* 1479 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 975 - FeatureMap, */ \ + /* 1483 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 979 - IAS CIE address, */ \ + /* 1487 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 987 - channel list, */ \ + /* 1495 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1088,7 +1160,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1241 - target navigator list, */ \ + /* 1749 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1106,24 +1178,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1495 - start time, */ \ + /* 2003 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1503 - duration, */ \ + /* 2011 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1511 - playback speed, */ \ + /* 2019 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1515 - seek range end, */ \ + /* 2023 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1523 - seek range start, */ \ + /* 2031 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 1531 - media input list, */ \ + /* 2039 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1141,7 +1213,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 1785 - accept header list, */ \ + /* 2293 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1157,12 +1229,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2039 - supported streaming protocols, */ \ + /* 2547 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2043 - audio output list, */ \ + /* 2551 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1180,7 +1252,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 2297 - application launcher list, */ \ + /* 2805 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1198,67 +1270,67 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 2551 - allowed vendor list, */ \ + /* 3059 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 2583 - bitmap32, */ \ + /* 3091 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2587 - bitmap64, */ \ + /* 3095 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2595 - int24u, */ \ + /* 3103 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 2598 - int32u, */ \ + /* 3106 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2602 - int40u, */ \ + /* 3110 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2607 - int48u, */ \ + /* 3115 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2613 - int56u, */ \ + /* 3121 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2620 - int64u, */ \ + /* 3128 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2628 - int24s, */ \ + /* 3136 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 2631 - int32s, */ \ + /* 3139 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2635 - int40s, */ \ + /* 3143 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2640 - int48s, */ \ + /* 3148 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2646 - int56s, */ \ + /* 3154 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2653 - int64s, */ \ + /* 3161 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2661 - float_single, */ \ + /* 3169 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2665 - float_double, */ \ + /* 3173 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2673 - epoch_us, */ \ + /* 3181 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2681 - epoch_s, */ \ + /* 3189 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2685 - list_long_octet_string, */ \ + /* 3193 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1313,71 +1385,71 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3685 - nullable_bitmap32, */ \ + /* 4193 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3689 - nullable_bitmap64, */ \ + /* 4197 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3697 - nullable_int24u, */ \ + /* 4205 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3700 - nullable_int32u, */ \ + /* 4208 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3704 - nullable_int40u, */ \ + /* 4212 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3709 - nullable_int48u, */ \ + /* 4217 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3715 - nullable_int56u, */ \ + /* 4223 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3722 - nullable_int64u, */ \ + /* 4230 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3730 - nullable_int24s, */ \ + /* 4238 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3733 - nullable_int32s, */ \ + /* 4241 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3737 - nullable_int40s, */ \ + /* 4245 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3742 - nullable_int48s, */ \ + /* 4250 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3748 - nullable_int56s, */ \ + /* 4256 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3755 - nullable_int64s, */ \ + /* 4263 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3763 - nullable_float_single, */ \ + /* 4271 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3767 - nullable_float_double, */ \ + /* 4275 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 3775 - measurement type, */ \ + /* 4283 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3779 - total active power, */ \ + /* 4287 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 3783 - FeatureMap, */ \ + /* 4291 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (149) +#define GENERATED_DEFAULTS_COUNT (151) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1473,7 +1545,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 643 +#define GENERATED_ATTRIBUTE_COUNT 645 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1495,7 +1567,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(0) }, /* binding list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1556,9 +1629,9 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6) }, /* SupportedLocales */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_LONG_DEFAULTS_INDEX(254) }, /* ActiveLocale */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* SupportedLocales */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, \ @@ -1573,7 +1646,7 @@ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ @@ -1581,31 +1654,31 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(264) }, /* Breadcrumb */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(518) }, /* Breadcrumb */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(542) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(546) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(550) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(558) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -1616,23 +1689,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(562) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(570) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(578) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(586) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(590) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(592) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(600) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(608) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1645,50 +1718,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(612) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(616) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(620) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(624) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(628) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(636) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(640) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(644) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(648) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(652) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(660) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(664) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(668) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(672) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(676) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(680) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(684) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(688) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(692) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(696) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(700) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(704) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(708) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(712) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(716) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(720) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(724) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(728) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(732) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(736) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(740) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(744) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(748) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(756) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(764) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(768) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(775) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1697,28 +1770,28 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(779) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(783) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(787) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(791) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(795) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(799) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(803) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(811) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(819) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(823) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(831) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(839) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(847) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(855) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(863) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(871) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1788,7 +1861,7 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ @@ -1820,7 +1893,7 @@ { 0x00004000, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* start up current level */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(625) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(879) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ @@ -1838,6 +1911,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(883) }, /* binding list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ @@ -1848,28 +1922,28 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ - { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ - { 0x0000000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* BatteryVoltage */ \ - { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ - { 0x0000000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(633) }, /* BatteryTimeRemaining */ \ - { 0x0000000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ - { 0x00000012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(637) }, /* ActiveBatteryFaults */ \ - { 0x0000001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(645) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ + { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ + { 0x0000000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1137) }, /* BatteryVoltage */ \ + { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ + { 0x0000000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1141) }, /* BatteryTimeRemaining */ \ + { 0x0000000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ + { 0x00000012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1145) }, /* ActiveBatteryFaults */ \ + { 0x0000001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1153) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(1157) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(661) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(665) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1169) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1173) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ @@ -1882,7 +1956,7 @@ { 0x00000008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ { 0x00000009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(669) }, /* SoftwareVersion */ \ + ZAP_LONG_DEFAULTS_INDEX(1177) }, /* SoftwareVersion */ \ { 0x0000000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ { 0x0000000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ @@ -1895,15 +1969,15 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ - { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(673) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ + { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1181) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(677) }, /* label list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1185) }, /* label list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: User Label (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1919,17 +1993,17 @@ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x00000004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* Description */ \ + { 0x00000004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1439) }, /* Description */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(2) }, /* LockState */ \ - { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ - { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ - { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ - { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(938) }, /* DoorOpenEvents */ \ + { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(2) }, /* LockState */ \ + { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ + { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ + { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ + { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1446) }, /* DoorOpenEvents */ \ { 0x00000005, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(942) }, /* DoorClosedEvents */ \ + ZAP_LONG_DEFAULTS_INDEX(1450) }, /* DoorClosedEvents */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* OpenPeriod */ \ { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfTotalUsersSupported */ \ { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfPINUsersSupported */ \ @@ -1942,8 +2016,8 @@ { 0x00000019, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(20) }, /* MaxRFIDCodeLength */ \ { 0x0000001A, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(10) }, /* MinRFIDCodeLength */ \ { 0x0000001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(946) }, /* Language */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(949) }, /* AutoRelockTime */ \ + { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1454) }, /* Language */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1457) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1960,9 +2034,9 @@ { 0x00000031, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* UserCodeTemporaryDisableTime */ \ { 0x00000033, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* RequirePINforRemoteOperation */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(953) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ + ZAP_SIMPLE_DEFAULT(0) }, /* RequirePINforRemoteOperation */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1461) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ @@ -1995,10 +2069,10 @@ ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x00000017, ZAP_TYPE(BITMAP8), 1, \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* Mode */ \ - { 0x0000001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(957) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* Mode */ \ + { 0x0000001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1465) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier moving state */ \ @@ -2027,17 +2101,17 @@ { 0x00000013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x00000015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(961) }, /* LifetimeRunningHours */ \ - { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(964) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(1469) }, /* LifetimeRunningHours */ \ + { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1472) }, /* Power */ \ { 0x00000017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(967) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(1475) }, /* LifetimeEnergyConsumed */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* OperationMode */ \ { 0x00000021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* ControlMode */ \ - { 0x00000022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(971) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* ControlMode */ \ + { 0x00000022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1479) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* local temperature */ \ @@ -2062,12 +2136,12 @@ { 0x0000001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* control sequence of operation */ \ { 0x0000001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(19) }, /* system mode */ \ - { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ - { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ - { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(975) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(19) }, /* system mode */ \ + { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ + { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ + { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1483) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -2189,7 +2263,7 @@ { 0x00000001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x00000010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(979) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(1487) }, /* IAS CIE address */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -2198,25 +2272,25 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Channel (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(987) }, /* channel list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1495) }, /* channel list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1241) }, /* target navigator list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1749) }, /* target navigator list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current navigator target */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1495) }, /* start time */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1503) }, /* duration */ \ - { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1511) }, /* playback speed */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1515) }, /* seek range end */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1523) }, /* seek range start */ \ + { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2003) }, /* start time */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2011) }, /* duration */ \ + { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2019) }, /* playback speed */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2023) }, /* seek range end */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2031) }, /* seek range start */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1531) }, /* media input list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2039) }, /* media input list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2227,18 +2301,18 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1785) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2293) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2039) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2547) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2043) }, /* audio output list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2551) }, /* audio output list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2297) }, /* application launcher list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2805) }, /* application launcher list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ @@ -2248,7 +2322,7 @@ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2551) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3059) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Account Login (server) */ \ @@ -2258,28 +2332,28 @@ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x00000001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2583) }, /* bitmap32 */ \ - { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2587) }, /* bitmap64 */ \ + { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3091) }, /* bitmap32 */ \ + { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3095) }, /* bitmap64 */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2595) }, /* int24u */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2598) }, /* int32u */ \ - { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2602) }, /* int40u */ \ - { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2607) }, /* int48u */ \ - { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2613) }, /* int56u */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2620) }, /* int64u */ \ + { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3103) }, /* int24u */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3106) }, /* int32u */ \ + { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3110) }, /* int40u */ \ + { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3115) }, /* int48u */ \ + { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3121) }, /* int56u */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3128) }, /* int64u */ \ { 0x0000000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x0000000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2628) }, /* int24s */ \ - { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2631) }, /* int32s */ \ - { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2635) }, /* int40s */ \ - { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2640) }, /* int48s */ \ - { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2646) }, /* int56s */ \ - { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2653) }, /* int64s */ \ + { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3136) }, /* int24s */ \ + { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3139) }, /* int32s */ \ + { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3143) }, /* int40s */ \ + { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3148) }, /* int48s */ \ + { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3154) }, /* int56s */ \ + { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3161) }, /* int64s */ \ { 0x00000015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x00000016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2661) }, /* float_single */ \ - { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2665) }, /* float_double */ \ + { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3169) }, /* float_single */ \ + { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3173) }, /* float_double */ \ { 0x00000019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x0000001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -2292,8 +2366,8 @@ { 0x0000001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x0000001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2673) }, /* epoch_us */ \ - { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2681) }, /* epoch_s */ \ + { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3181) }, /* epoch_us */ \ + { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3189) }, /* epoch_s */ \ { 0x00000022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x00000023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -2308,7 +2382,7 @@ ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* range_restricted_int16u */ \ { 0x00000029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* range_restricted_int16s */ \ - { 0x0000002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(2685) }, /* list_long_octet_string */ \ + { 0x0000002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(3193) }, /* list_long_octet_string */ \ { 0x0000002B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_fabric_scoped */ \ { 0x00000030, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(MUST_USE_TIMED_WRITE), \ @@ -2324,49 +2398,49 @@ { 0x00008002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x00008003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3685) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(4193) }, /* nullable_bitmap32 */ \ { 0x00008004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3689) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(4197) }, /* nullable_bitmap64 */ \ { 0x00008005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x00008006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x00008007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3697) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(4205) }, /* nullable_int24u */ \ { 0x00008008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3700) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(4208) }, /* nullable_int32u */ \ { 0x00008009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3704) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(4212) }, /* nullable_int40u */ \ { 0x0000800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3709) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(4217) }, /* nullable_int48u */ \ { 0x0000800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3715) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(4223) }, /* nullable_int56u */ \ { 0x0000800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3722) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(4230) }, /* nullable_int64u */ \ { 0x0000800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x0000800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x0000800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3730) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(4238) }, /* nullable_int24s */ \ { 0x00008010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3733) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(4241) }, /* nullable_int32s */ \ { 0x00008011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3737) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(4245) }, /* nullable_int40s */ \ { 0x00008012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3742) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(4250) }, /* nullable_int48s */ \ { 0x00008013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3748) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(4256) }, /* nullable_int56s */ \ { 0x00008014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3755) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(4263) }, /* nullable_int64s */ \ { 0x00008015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x00008016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x00008017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3763) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(4271) }, /* nullable_float_single */ \ { 0x00008018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3767) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(4275) }, /* nullable_float_double */ \ { 0x00008019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x0000801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2391,8 +2465,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3775) }, /* measurement type */ \ - { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3779) }, /* total active power */ \ + { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4283) }, /* measurement type */ \ + { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4287) }, /* total active power */ \ { 0x00000505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x00000506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x00000507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2414,7 +2488,7 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3783) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4291) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2517,11 +2591,6 @@ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */\ /* client_generated */ \ 0x00000000 /* AnnounceOtaProvider */, \ @@ -2668,11 +2737,6 @@ 0x00000006 /* StepWithOnOff */, \ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Network Commissioning (server) */\ /* client_generated */ \ 0x00000000 /* ScanNetworks */, \ @@ -2901,17 +2965,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(10), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(11), \ + .attributes = ZAP_ATTRIBUTE_INDEX(12), \ .attributeCount = 3, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2922,7 +2986,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(14), \ + .attributes = ZAP_ATTRIBUTE_INDEX(15), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2933,7 +2997,7 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2944,18 +3008,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ .clusterId = 0x0000002A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(39), \ + .attributes = ZAP_ATTRIBUTE_INDEX(40), \ .attributeCount = 3, \ .clusterSize = 292, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2966,7 +3030,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(42), \ + .attributes = ZAP_ATTRIBUTE_INDEX(43), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2977,7 +3041,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(46), \ + .attributes = ZAP_ATTRIBUTE_INDEX(47), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2988,7 +3052,7 @@ { \ /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ .clusterId = 0x0000002E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(49), \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2999,40 +3063,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributes = ZAP_ATTRIBUTE_INDEX(52), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(67), \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(67), \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3043,84 +3107,84 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(76), \ + .attributes = ZAP_ATTRIBUTE_INDEX(77), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 41 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(82), \ + .attributes = ZAP_ATTRIBUTE_INDEX(83), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(147), \ + .attributes = ZAP_ATTRIBUTE_INDEX(148), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 45 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(162), \ + .attributes = ZAP_ATTRIBUTE_INDEX(163), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 47 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(173), \ + .attributes = ZAP_ATTRIBUTE_INDEX(174), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(184), \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ .attributeCount = 5, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 71 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(189), \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3131,7 +3195,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(191), \ + .attributes = ZAP_ATTRIBUTE_INDEX(192), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3142,7 +3206,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(193), \ + .attributes = ZAP_ATTRIBUTE_INDEX(194), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3153,51 +3217,51 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(197), \ + .attributes = ZAP_ATTRIBUTE_INDEX(198), \ .attributeCount = 3, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 79 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(200), \ + .attributes = ZAP_ATTRIBUTE_INDEX(201), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributes = ZAP_ATTRIBUTE_INDEX(203), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 97 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 105 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 94 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 102 ) ,\ },\ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(208), \ + .attributes = ZAP_ATTRIBUTE_INDEX(209), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 112 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 109 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ .clusterId = 0x00000007, \ - .attributes = ZAP_ATTRIBUTE_INDEX(215), \ + .attributes = ZAP_ATTRIBUTE_INDEX(216), \ .attributeCount = 3, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3208,18 +3272,18 @@ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(218), \ + .attributes = ZAP_ATTRIBUTE_INDEX(219), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 119 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(234), \ + .attributes = ZAP_ATTRIBUTE_INDEX(235), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3230,7 +3294,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(238), \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3241,18 +3305,18 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(243), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 128 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ .clusterId = 0x00000025, \ - .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributes = ZAP_ATTRIBUTE_INDEX(246), \ .attributeCount = 4, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3263,7 +3327,7 @@ { \ /* Endpoint: 1, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(248), \ + .attributes = ZAP_ATTRIBUTE_INDEX(250), \ .attributeCount = 11, \ .clusterSize = 88, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3274,18 +3338,18 @@ { \ /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(259), \ + .attributes = ZAP_ATTRIBUTE_INDEX(261), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 131 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ .clusterId = 0x00000039, \ - .attributes = ZAP_ATTRIBUTE_INDEX(269), \ + .attributes = ZAP_ATTRIBUTE_INDEX(271), \ .attributeCount = 16, \ .clusterSize = 679, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3296,7 +3360,7 @@ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(285), \ + .attributes = ZAP_ATTRIBUTE_INDEX(287), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3307,7 +3371,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(290), \ + .attributes = ZAP_ATTRIBUTE_INDEX(292), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3318,7 +3382,7 @@ { \ /* Endpoint: 1, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(292), \ + .attributes = ZAP_ATTRIBUTE_INDEX(294), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3329,7 +3393,7 @@ { \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ .clusterId = 0x00000045, \ - .attributes = ZAP_ATTRIBUTE_INDEX(294), \ + .attributes = ZAP_ATTRIBUTE_INDEX(296), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3340,51 +3404,51 @@ { \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ - .attributes = ZAP_ATTRIBUTE_INDEX(296), \ + .attributes = ZAP_ATTRIBUTE_INDEX(298), \ .attributeCount = 6, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 135 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(302), \ + .attributes = ZAP_ATTRIBUTE_INDEX(304), \ .attributeCount = 32, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 143 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 137 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(334), \ + .attributes = ZAP_ATTRIBUTE_INDEX(336), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 152 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(354), \ + .attributes = ZAP_ATTRIBUTE_INDEX(356), \ .attributeCount = 5, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 150 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(359), \ + .attributes = ZAP_ATTRIBUTE_INDEX(361), \ .attributeCount = 26, \ .clusterSize = 54, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3395,18 +3459,18 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(385), \ + .attributes = ZAP_ATTRIBUTE_INDEX(387), \ .attributeCount = 19, \ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 159 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(404), \ + .attributes = ZAP_ATTRIBUTE_INDEX(406), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3417,18 +3481,18 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(408), \ + .attributes = ZAP_ATTRIBUTE_INDEX(410), \ .attributeCount = 53, \ .clusterSize = 341, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 163 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(461), \ + .attributes = ZAP_ATTRIBUTE_INDEX(463), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3439,7 +3503,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(467), \ + .attributes = ZAP_ATTRIBUTE_INDEX(469), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3450,7 +3514,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(472), \ + .attributes = ZAP_ATTRIBUTE_INDEX(474), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3461,7 +3525,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(476), \ + .attributes = ZAP_ATTRIBUTE_INDEX(478), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3472,7 +3536,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(481), \ + .attributes = ZAP_ATTRIBUTE_INDEX(483), \ .attributeCount = 5, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3483,7 +3547,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(486), \ + .attributes = ZAP_ATTRIBUTE_INDEX(488), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3494,18 +3558,18 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(490), \ + .attributes = ZAP_ATTRIBUTE_INDEX(492), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 183 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 177 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(496), \ + .attributes = ZAP_ATTRIBUTE_INDEX(498), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3516,106 +3580,106 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(498), \ + .attributes = ZAP_ATTRIBUTE_INDEX(500), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 188 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(500), \ + .attributes = ZAP_ATTRIBUTE_INDEX(502), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(503), \ + .attributes = ZAP_ATTRIBUTE_INDEX(505), \ .attributeCount = 7, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 193 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(510), \ + .attributes = ZAP_ATTRIBUTE_INDEX(512), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 204 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 198 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(513), \ + .attributes = ZAP_ATTRIBUTE_INDEX(515), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 209 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 203 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(514), \ + .attributes = ZAP_ATTRIBUTE_INDEX(516), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 211 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 205 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(515), \ + .attributes = ZAP_ATTRIBUTE_INDEX(517), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 213 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 207 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(518), \ + .attributes = ZAP_ATTRIBUTE_INDEX(520), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 216 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 210 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(521), \ + .attributes = ZAP_ATTRIBUTE_INDEX(523), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 219 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 213 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(523), \ + .attributes = ZAP_ATTRIBUTE_INDEX(525), \ .attributeCount = 8, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3626,29 +3690,29 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(531), \ + .attributes = ZAP_ATTRIBUTE_INDEX(533), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 221 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 215 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(532), \ + .attributes = ZAP_ATTRIBUTE_INDEX(534), \ .attributeCount = 81, \ .clusterSize = 3285, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 242 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 217 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 236 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(613), \ + .attributes = ZAP_ATTRIBUTE_INDEX(615), \ .attributeCount = 12, \ .clusterSize = 28, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3659,29 +3723,29 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(625), \ + .attributes = ZAP_ATTRIBUTE_INDEX(627), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 251 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 258 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 252 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(627), \ + .attributes = ZAP_ATTRIBUTE_INDEX(629), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 263 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 257 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(634), \ + .attributes = ZAP_ATTRIBUTE_INDEX(636), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3692,7 +3756,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(639), \ + .attributes = ZAP_ATTRIBUTE_INDEX(641), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3711,7 +3775,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 26, 864 }, { ZAP_CLUSTER_INDEX(26), 46, 6876 }, { ZAP_CLUSTER_INDEX(72), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 26, 1118 }, { ZAP_CLUSTER_INDEX(26), 46, 7130 }, { ZAP_CLUSTER_INDEX(72), 4, 21 }, \ } // Largest attribute size is needed for various buffers @@ -3723,7 +3787,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (718) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7761) +#define ATTRIBUTE_MAX_SIZE (8269) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index bc17553e49e70a..dc375d282e5fc4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -202,6 +202,15 @@ typedef struct _BatFaultChangeType /* TYPE WARNING: array array defaults to */ uint8_t * previous; } BatFaultChangeType; +// Struct for BindingEntry +typedef struct _BindingEntry +{ + chip::NodeId nodeId; + chip::GroupId groupId; + chip::EndpointId endpointId; + chip::ClusterId clusterId; +} BindingEntry; + // Struct for ChannelInfo typedef struct _ChannelInfo { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 75fc255f267f19..58799ddb656b52 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -252,6 +252,7 @@ // Client attributes // Server attributes +#define ZCL_BINDING_LIST_ATTRIBUTE_ID (0x0000) // Attribute ids for cluster: Access Control diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 00c6799c9b5ab7..54c8cb0f00fbbe 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -13734,16 +13734,6 @@ bool emberAfApplianceControlClusterOverloadPauseCallback( bool emberAfApplianceControlClusterOverloadWarningCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ApplianceControl::Commands::OverloadWarning::DecodableType & commandData); -/** - * @brief Binding Cluster Bind Command callback (from client) - */ -bool emberAfBindingClusterBindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Binding::Commands::Bind::DecodableType & commandData); -/** - * @brief Binding Cluster Unbind Command callback (from client) - */ -bool emberAfBindingClusterUnbindCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Binding::Commands::Unbind::DecodableType & commandData); /** * @brief Poll Control Cluster CheckIn Command callback (from server) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 196f8dbc7d2374..2edf33b1d53c4d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -4437,9 +4437,8 @@ namespace Events { } // namespace Descriptor namespace Binding { - -namespace Commands { -namespace Bind { +namespace Structs { +namespace BindingEntry { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -4457,7 +4456,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); @@ -4482,55 +4482,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace Bind. -namespace Unbind { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNodeId)), nodeId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpointId)), endpointId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClusterId)), clusterId)); - ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; } -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNodeId): - ReturnErrorOnFailure(DataModel::Decode(reader, nodeId)); - break; - case to_underlying(Fields::kGroupId): - ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); - break; - case to_underlying(Fields::kEndpointId): - ReturnErrorOnFailure(DataModel::Decode(reader, endpointId)); - break; - case to_underlying(Fields::kClusterId): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterId)); - break; - default: - break; - } - } +} // namespace BindingEntry +} // namespace Structs - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace Unbind. +namespace Commands { } // namespace Commands namespace Attributes { @@ -4538,6 +4497,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { + case Attributes::BindingList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, bindingList)); + break; case Attributes::ServerGeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, serverGeneratedCommandList)); break; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 8ea1a6e196a7f3..8f5a26b898b726 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -6650,23 +6650,8 @@ struct TypeInfo } // namespace Descriptor namespace Binding { -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace Bind { -struct Type; -struct DecodableType; -} // namespace Bind - -namespace Unbind { -struct Type; -struct DecodableType; -} // namespace Unbind - -} // namespace Commands - -namespace Commands { -namespace Bind { +namespace Structs { +namespace BindingEntry { enum class Fields { kNodeId = 0, @@ -6678,80 +6663,37 @@ enum class Fields struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } - chip::NodeId nodeId = static_cast(0); chip::GroupId groupId = static_cast(0); chip::EndpointId endpointId = static_cast(0); chip::ClusterId clusterId = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } - - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace Bind -namespace Unbind { -enum class Fields -{ - kNodeId = 0, - kGroupId = 1, - kEndpointId = 2, - kClusterId = 3, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); + static constexpr bool kIsFabricScoped = false; +}; - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +using DecodableType = Type; - using ResponseType = DataModel::NullObjectType; +} // namespace BindingEntry +} // namespace Structs - static constexpr bool MustUseTimedInvoke() { return false; } -}; +namespace Attributes { -struct DecodableType +namespace BindingList { +struct TypeInfo { -public: - static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - chip::NodeId nodeId = static_cast(0); - chip::GroupId groupId = static_cast(0); - chip::EndpointId endpointId = static_cast(0); - chip::ClusterId clusterId = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::BindingList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } }; -}; // namespace Unbind -} // namespace Commands - -namespace Attributes { - +} // namespace BindingList namespace ServerGeneratedCommandList { struct TypeInfo { @@ -6821,6 +6763,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + Attributes::BindingList::TypeInfo::DecodableType bindingList; Attributes::ServerGeneratedCommandList::TypeInfo::DecodableType serverGeneratedCommandList; Attributes::ClientGeneratedCommandList::TypeInfo::DecodableType clientGeneratedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 96f0cd8fe5955e..9af383a1136477 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -130,10 +130,6 @@ #define ZCL_OVERLOAD_PAUSE_COMMAND_ID (0x04) #define ZCL_OVERLOAD_WARNING_COMMAND_ID (0x05) -// Commands for cluster: Binding -#define ZCL_BIND_COMMAND_ID (0x00) -#define ZCL_UNBIND_COMMAND_ID (0x01) - // Commands for cluster: Poll Control #define ZCL_CHECK_IN_COMMAND_ID (0x00) #define ZCL_CHECK_IN_RESPONSE_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 255f8256af8f78..b531cb4f74f2d7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -956,6 +956,10 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace Binding { namespace Attributes { +namespace BindingList { +static constexpr AttributeId Id = 0x00000000; +} // namespace BindingList + namespace ServerGeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::ServerGeneratedCommandList::Id; } // namespace ServerGeneratedCommandList diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index ff43c5a7551193..214494bc379098 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -403,20 +403,6 @@ static constexpr CommandId Id = 0x00000005; } // namespace Commands } // namespace ApplianceControl -namespace Binding { -namespace Commands { - -namespace Bind { -static constexpr CommandId Id = 0x00000000; -} // namespace Bind - -namespace Unbind { -static constexpr CommandId Id = 0x00000001; -} // namespace Unbind - -} // namespace Commands -} // namespace Binding - namespace PollControl { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 4fbcefa8193e8e..4cc276bdac2a1c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -786,10 +786,9 @@ class WriteBinaryInputBasicPresentValue : public WriteAttribute | Cluster Binding | 0x001E | |------------------------------------------------------------------------------| | Commands: | | -| * Bind | 0x00 | -| * Unbind | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | +| * BindingList | 0x0000 | | * ServerGeneratedCommandList | 0xFFF8 | | * ClientGeneratedCommandList | 0xFFF9 | | * AttributeList | 0xFFFB | @@ -798,56 +797,27 @@ class WriteBinaryInputBasicPresentValue : public WriteAttribute | Events: | | \*----------------------------------------------------------------------------*/ -/* - * Command Bind - */ -class BindingBind : public ClusterCommand +class WriteBindingBindingList : public WriteAttribute { public: - BindingBind(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("bind", credsIssuerConfig) + WriteBindingBindingList(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("BindingList", credsIssuerConfig), mComplex(&mValue) { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return ClusterCommand::SendCommand(device, endpointId, 0x0000001E, 0x00000000, mRequest); + AddArgument("attr-name", "binding-list"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); } -private: - chip::app::Clusters::Binding::Commands::Bind::Type mRequest; -}; - -/* - * Command Unbind - */ -class BindingUnbind : public ClusterCommand -{ -public: - BindingUnbind(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("unbind", credsIssuerConfig) - { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ClusterCommand::AddArguments(); - } + ~WriteBindingBindingList() {} CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return ClusterCommand::SendCommand(device, endpointId, 0x0000001E, 0x00000001, mRequest); + return WriteAttribute::SendCommand(device, endpointId, 0x0000001E, 0x00000000, mValue); } private: - chip::app::Clusters::Binding::Commands::Unbind::Type mRequest; + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; }; /*----------------------------------------------------------------------------*\ @@ -9839,12 +9809,11 @@ void registerClusterBinding(Commands & commands, CredentialIssuerCommands * cred // Commands // make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // // // Attributes // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "binding-list", Attributes::BindingList::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, @@ -9852,7 +9821,9 @@ void registerClusterBinding(Commands & commands, CredentialIssuerCommands * cred make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // + make_unique(Id, "binding-list", Attributes::BindingList::Id, credsIssuerConfig), // make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index da678af2c50459..c0de99ba55fa85 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -271,6 +271,39 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::PowerSource::Structs:: ComplexArgumentParser::Finalize(request.current); ComplexArgumentParser::Finalize(request.previous); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Binding::Structs::BindingEntry::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("BindingEntry.nodeId", value.isMember("nodeId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("BindingEntry.groupId", value.isMember("groupId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("BindingEntry.endpointId", value.isMember("endpointId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("BindingEntry.clusterId", value.isMember("clusterId"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "nodeId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.nodeId, value["nodeId"])); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "groupId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.groupId, value["groupId"])); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endpointId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endpointId, value["endpointId"])); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "clusterId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.clusterId, value["clusterId"])); + + return CHIP_NO_ERROR; +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Binding::Structs::BindingEntry::Type & request) +{ + ComplexArgumentParser::Finalize(request.nodeId); + ComplexArgumentParser::Finalize(request.groupId); + ComplexArgumentParser::Finalize(request.endpointId); + ComplexArgumentParser::Finalize(request.clusterId); +} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index cc593f2433f75b..228d0c0db9d3ff 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -55,6 +55,10 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::PowerSource::St Json::Value & value); static void Finalize(chip::app::Clusters::PowerSource::Structs::BatFaultChangeType::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Binding::Structs::BindingEntry::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Binding::Structs::BindingEntry::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8220cf4126665e..8ac6b5fd5d17a4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -288,6 +288,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Binding::Structs::BindingEntry::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("NodeId", indent + 1, value.nodeId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NodeId'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'GroupId'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("EndpointId", indent + 1, value.endpointId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EndpointId'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ClusterId", indent + 1, value.clusterId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ClusterId'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value) @@ -4356,6 +4396,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Id: { switch (path.mAttributeId) { + case Binding::Attributes::BindingList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("binding list", 1, value); + } case Binding::Attributes::ServerGeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 3431a1f14e0d37..cc6698ac9b318a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -36,6 +36,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PowerSource::Structs::BatChargeFaultChangeType::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PowerSource::Structs::BatFaultChangeType::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Binding::Structs::BindingEntry::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 4aa7eb72926196..88134cd284a0b7 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -191,6 +191,11 @@ void BinaryInputBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReade chip::Callback::Cancelable * onFailureCallback); typedef void (*BinaryInputBasicAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void BindingClusterBindingListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingBindingListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void BindingClusterServerGeneratedCommandListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp index ba95d7a6441c2b..daf9ad6e9d5aad 100644 --- a/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/light-switch-app/zap-generated/IMClusterCommandHandler.cpp @@ -99,52 +99,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(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 Binding - namespace DiagnosticLogs { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -687,9 +641,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::DiagnosticLogs::Id: Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h index f88f80ec7f95a2..59089d01723842 100644 --- a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h +++ b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h @@ -796,11 +796,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */\ /* client_generated */ \ 0x00000000 /* AnnounceOtaProvider */, \ @@ -881,11 +876,6 @@ /* server_generated */ \ 0x00000000 /* IdentifyQueryResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ } // clang-format on @@ -914,7 +904,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -958,7 +948,7 @@ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -980,8 +970,8 @@ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 2 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 6 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ @@ -991,8 +981,8 @@ .clusterSize = 48, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ @@ -1002,7 +992,7 @@ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1024,7 +1014,7 @@ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 24 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1035,7 +1025,7 @@ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1046,7 +1036,7 @@ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1057,7 +1047,7 @@ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1079,7 +1069,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ @@ -1090,8 +1080,8 @@ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1134,8 +1124,8 @@ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (client) */ \ @@ -1189,7 +1179,7 @@ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ diff --git a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp index 701b969e786373..2430d91869ab5d 100644 --- a/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/thermostat/zap-generated/IMClusterCommandHandler.cpp @@ -99,52 +99,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(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 Binding - namespace DiagnosticLogs { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -795,9 +749,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::DiagnosticLogs::Id: Clusters::DiagnosticLogs::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 6838bb0260e56c..c8d32f0f6cac27 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -29,243 +29,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), big-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), big-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x02, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -281,7 +299,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -299,7 +317,7 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 875 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ } @@ -307,243 +325,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), little-endian */ \ + \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), little-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x02, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -559,7 +595,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -577,13 +613,13 @@ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 875 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (75) +#define GENERATED_DEFAULTS_COUNT (76) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -631,7 +667,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 233 +#define GENERATED_ATTRIBUTE_COUNT 234 #define GENERATED_ATTRIBUTES \ { \ \ @@ -648,7 +684,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(0) }, /* binding list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -705,7 +742,7 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ + ZAP_LONG_DEFAULTS_INDEX(254) }, /* ActiveLocale */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedLocales */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -721,37 +758,37 @@ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(6) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(264) }, /* Breadcrumb */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ - { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ - { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ + { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ + { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(22) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(34) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(42) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(50) }, /* TotalOperationalHours */ \ - { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ + { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ { 0x00000006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ @@ -761,23 +798,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(54) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(62) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(70) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(78) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(82) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(84) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(92) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(100) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -790,50 +827,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(104) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(108) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(112) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(116) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(120) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(124) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(128) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(132) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(136) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(140) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(144) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(148) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(152) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(156) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(160) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(164) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(168) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(172) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(176) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(180) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(184) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(188) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(192) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(196) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(200) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(204) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(208) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(212) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(216) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(220) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(224) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(228) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(232) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(236) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(240) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(248) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(256) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(267) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -842,28 +879,28 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(271) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(275) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(279) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(283) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(287) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(291) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(295) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(303) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(311) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(315) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(323) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(339) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(347) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(355) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(363) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -885,8 +922,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(367) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -981,12 +1018,12 @@ { 0x0000001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* control sequence of operation */ \ { 0x0000001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* system mode */ \ - { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ - { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ - { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* system mode */ \ + { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ + { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ + { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ } // This is an array of EmberAfCluster structures. @@ -1031,11 +1068,6 @@ /* server_generated */ \ 0x00000000 /* IdentifyQueryResponse */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1192,17 +1224,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(7), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(8), \ + .attributes = ZAP_ATTRIBUTE_INDEX(9), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1213,7 +1245,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(12), \ + .attributes = ZAP_ATTRIBUTE_INDEX(13), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1224,18 +1256,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributes = ZAP_ATTRIBUTE_INDEX(33), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 8 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(33), \ + .attributes = ZAP_ATTRIBUTE_INDEX(34), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1246,7 +1278,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(36), \ + .attributes = ZAP_ATTRIBUTE_INDEX(37), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1257,7 +1289,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(40), \ + .attributes = ZAP_ATTRIBUTE_INDEX(41), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1268,40 +1300,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(43), \ + .attributes = ZAP_ATTRIBUTE_INDEX(44), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 17 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(49), \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(59), \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(59), \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1312,18 +1344,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributes = ZAP_ATTRIBUTE_INDEX(69), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(74), \ + .attributes = ZAP_ATTRIBUTE_INDEX(75), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1334,7 +1366,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(139), \ + .attributes = ZAP_ATTRIBUTE_INDEX(140), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1345,40 +1377,40 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(154), \ + .attributes = ZAP_ATTRIBUTE_INDEX(155), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(165), \ + .attributes = ZAP_ATTRIBUTE_INDEX(166), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(169), \ + .attributes = ZAP_ATTRIBUTE_INDEX(170), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(176), \ + .attributes = ZAP_ATTRIBUTE_INDEX(177), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1389,7 +1421,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1400,7 +1432,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1411,7 +1443,7 @@ { \ /* Endpoint: 1, Cluster: Identify (client) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributes = ZAP_ATTRIBUTE_INDEX(184), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1422,40 +1454,40 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributes = ZAP_ATTRIBUTE_INDEX(184), \ .attributeCount = 3, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(186), \ + .attributes = ZAP_ATTRIBUTE_INDEX(187), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 60 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(188), \ + .attributes = ZAP_ATTRIBUTE_INDEX(189), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 72 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(194), \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1466,12 +1498,12 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(214), \ + .attributes = ZAP_ATTRIBUTE_INDEX(215), \ .attributeCount = 19, \ .clusterSize = 34, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 87 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ } @@ -1485,7 +1517,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 22, 1103 }, { ZAP_CLUSTER_INDEX(22), 6, 89 }, \ + { ZAP_CLUSTER_INDEX(0), 22, 1357 }, { ZAP_CLUSTER_INDEX(22), 6, 89 }, \ } // Largest attribute size is needed for various buffers @@ -1497,7 +1529,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (78) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1192) +#define ATTRIBUTE_MAX_SIZE (1446) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h index 7034c1c80aac5a..94de3f107570b8 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClientCallbacks.h @@ -31,6 +31,11 @@ #include // List specific responses +void BindingClusterBindingListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*BindingBindingListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void NetworkCommissioningClusterNetworksListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index a0e42af3b61969..f1203224861977 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -255,52 +255,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AudioOutput -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(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 Binding - namespace Channel { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1226,9 +1180,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AudioOutput::Id: Clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::Channel::Id: Clusters::Channel::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index be4023311835a5..2ee38278d062f1 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -29,243 +29,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), big-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), big-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x02, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -281,7 +299,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -299,7 +317,7 @@ \ /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 875 - channel list, */ \ + /* 1129 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -317,7 +335,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1129 - target navigator list, */ \ + /* 1383 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -335,7 +353,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 1383 - media input list, */ \ + /* 1637 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -353,7 +371,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 1637 - accept header list, */ \ + /* 1891 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -369,12 +387,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1891 - supported streaming protocols, */ \ + /* 2145 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 1895 - application launcher list, */ \ + /* 2149 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -392,12 +410,12 @@ \ /* Endpoint: 2, Cluster: Level Control (server), big-endian */ \ \ - /* 2149 - FeatureMap, */ \ + /* 2403 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 2, Cluster: Audio Output (server), big-endian */ \ \ - /* 2153 - audio output list, */ \ + /* 2407 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -415,24 +433,24 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), big-endian */ \ \ - /* 2407 - start time, */ \ + /* 2661 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 2415 - duration, */ \ + /* 2669 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2423 - playback speed, */ \ + /* 2677 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2427 - seek range end, */ \ + /* 2681 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2435 - seek range start, */ \ + /* 2689 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2443 - accept header list, */ \ + /* 2697 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -448,18 +466,18 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2697 - supported streaming protocols, */ \ + /* 2951 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Application Basic (server), big-endian */ \ \ - /* 2701 - allowed vendor list, */ \ + /* 2955 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2733 - accept header list, */ \ + /* 2987 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -475,12 +493,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2987 - supported streaming protocols, */ \ + /* 3241 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Application Basic (server), big-endian */ \ \ - /* 2991 - allowed vendor list, */ \ + /* 3245 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } @@ -489,243 +507,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), little-endian */ \ + \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ + \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), little-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x02, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -741,7 +777,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -759,7 +795,7 @@ \ /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 875 - channel list, */ \ + /* 1129 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -777,7 +813,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1129 - target navigator list, */ \ + /* 1383 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -795,7 +831,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 1383 - media input list, */ \ + /* 1637 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -813,7 +849,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 1637 - accept header list, */ \ + /* 1891 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -829,12 +865,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1891 - supported streaming protocols, */ \ + /* 2145 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 1895 - application launcher list, */ \ + /* 2149 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -852,12 +888,12 @@ \ /* Endpoint: 2, Cluster: Level Control (server), little-endian */ \ \ - /* 2149 - FeatureMap, */ \ + /* 2403 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: Audio Output (server), little-endian */ \ \ - /* 2153 - audio output list, */ \ + /* 2407 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -875,24 +911,24 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), little-endian */ \ \ - /* 2407 - start time, */ \ + /* 2661 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2415 - duration, */ \ + /* 2669 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2423 - playback speed, */ \ + /* 2677 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2427 - seek range end, */ \ + /* 2681 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2435 - seek range start, */ \ + /* 2689 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2443 - accept header list, */ \ + /* 2697 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -908,18 +944,18 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2697 - supported streaming protocols, */ \ + /* 2951 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Application Basic (server), little-endian */ \ \ - /* 2701 - allowed vendor list, */ \ + /* 2955 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2733 - accept header list, */ \ + /* 2987 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -935,19 +971,19 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2987 - supported streaming protocols, */ \ + /* 3241 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Application Basic (server), little-endian */ \ \ - /* 2991 - allowed vendor list, */ \ + /* 3245 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (93) +#define GENERATED_DEFAULTS_COUNT (94) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -980,7 +1016,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 294 +#define GENERATED_ATTRIBUTE_COUNT 295 #define GENERATED_ATTRIBUTES \ { \ \ @@ -992,7 +1028,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(0) }, /* binding list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1049,7 +1086,7 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ + ZAP_LONG_DEFAULTS_INDEX(254) }, /* ActiveLocale */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedLocales */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -1065,37 +1102,37 @@ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(6) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(264) }, /* Breadcrumb */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ - { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ - { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ + { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ + { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(22) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(34) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(42) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(50) }, /* TotalOperationalHours */ \ - { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ + { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ { 0x00000006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ @@ -1105,23 +1142,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(54) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(62) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(70) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(78) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(82) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(84) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(92) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(100) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1134,50 +1171,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(104) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(108) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(112) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(116) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(120) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(124) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(128) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(132) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(136) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(140) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(144) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(148) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(152) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(156) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(160) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(164) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(168) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(172) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(176) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(180) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(184) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(188) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(192) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(196) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(200) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(204) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(208) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(212) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(216) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(220) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(224) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(228) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(232) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(236) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(240) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(248) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(256) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(267) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1186,28 +1223,28 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(271) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(275) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(279) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(283) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(287) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(291) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(295) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(303) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(311) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(315) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(323) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(339) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(347) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(355) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(363) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1229,8 +1266,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(367) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1264,7 +1301,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Channel (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* channel list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* channel list */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* channel lineup */ \ { 0x00000002, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1272,12 +1309,12 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* target navigator list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1383) }, /* target navigator list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* current navigator target */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1383) }, /* media input list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1637) }, /* media input list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1288,13 +1325,13 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1637) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1891) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1891) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2145) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1895) }, /* application launcher list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2149) }, /* application launcher list */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* application launcher app */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1326,7 +1363,7 @@ { 0x00004000, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* start up current level */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2149) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2403) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -1337,7 +1374,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Audio Output (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2153) }, /* audio output list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2407) }, /* audio output list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1350,19 +1387,19 @@ \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2407) }, /* start time */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2415) }, /* duration */ \ + { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2661) }, /* start time */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2669) }, /* duration */ \ { 0x00000003, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* position */ \ - { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2423) }, /* playback speed */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2427) }, /* seek range end */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2435) }, /* seek range start */ \ + { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2677) }, /* playback speed */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2681) }, /* seek range end */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2689) }, /* seek range start */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2443) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2697) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2697) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2951) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ @@ -1373,7 +1410,7 @@ { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2701) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2955) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Account Login (server) */ \ @@ -1387,9 +1424,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2733) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2987) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2987) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(3241) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ @@ -1400,7 +1437,7 @@ { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2991) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3245) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Descriptor (server) */ \ @@ -1448,11 +1485,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1677,17 +1709,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(5), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1698,7 +1730,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1709,18 +1741,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(31), \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1731,7 +1763,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1742,7 +1774,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(38), \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1753,7 +1785,7 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (client) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1764,18 +1796,18 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1786,29 +1818,29 @@ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1819,18 +1851,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributes = ZAP_ATTRIBUTE_INDEX(67), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(72), \ + .attributes = ZAP_ATTRIBUTE_INDEX(73), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1841,7 +1873,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(137), \ + .attributes = ZAP_ATTRIBUTE_INDEX(138), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1852,29 +1884,29 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(152), \ + .attributes = ZAP_ATTRIBUTE_INDEX(153), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributes = ZAP_ATTRIBUTE_INDEX(164), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -1885,18 +1917,18 @@ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1907,7 +1939,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1918,7 +1950,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1929,7 +1961,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1940,18 +1972,18 @@ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 54 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(187), \ + .attributes = ZAP_ATTRIBUTE_INDEX(188), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1962,7 +1994,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(192), \ + .attributes = ZAP_ATTRIBUTE_INDEX(193), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1973,106 +2005,106 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(194), \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ .attributeCount = 4, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 62 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 59 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(198), \ + .attributes = ZAP_ATTRIBUTE_INDEX(199), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 64 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(201), \ + .attributes = ZAP_ATTRIBUTE_INDEX(202), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(204), \ + .attributes = ZAP_ATTRIBUTE_INDEX(205), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(205), \ + .attributes = ZAP_ATTRIBUTE_INDEX(206), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 72 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(206), \ + .attributes = ZAP_ATTRIBUTE_INDEX(207), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 77 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 74 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 77 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(209), \ + .attributes = ZAP_ATTRIBUTE_INDEX(210), \ .attributeCount = 3, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 79 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(212), \ + .attributes = ZAP_ATTRIBUTE_INDEX(213), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 88 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(214), \ + .attributes = ZAP_ATTRIBUTE_INDEX(215), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(230), \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2083,18 +2115,18 @@ { \ /* Endpoint: 2, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(235), \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ .attributeCount = 3, \ .clusterSize = 257, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 98 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 3, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(238), \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2105,29 +2137,29 @@ { \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(243), \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ .attributeCount = 8, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 113 ) ,\ },\ { \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(251), \ + .attributes = ZAP_ATTRIBUTE_INDEX(252), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 118 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 121 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 115 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 118 ) ,\ },\ { \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(254), \ + .attributes = ZAP_ATTRIBUTE_INDEX(255), \ .attributeCount = 9, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2138,18 +2170,18 @@ { \ /* Endpoint: 3, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(263), \ + .attributes = ZAP_ATTRIBUTE_INDEX(264), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 123 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 120 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 124 ) ,\ },\ { \ /* Endpoint: 4, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(264), \ + .attributes = ZAP_ATTRIBUTE_INDEX(265), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2160,18 +2192,18 @@ { \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(269), \ + .attributes = ZAP_ATTRIBUTE_INDEX(270), \ .attributeCount = 3, \ .clusterSize = 260, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 126 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ) ,\ },\ { \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(272), \ + .attributes = ZAP_ATTRIBUTE_INDEX(273), \ .attributeCount = 9, \ .clusterSize = 138, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2182,7 +2214,7 @@ { \ /* Endpoint: 5, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(281), \ + .attributes = ZAP_ATTRIBUTE_INDEX(282), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2193,7 +2225,7 @@ { \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(286), \ + .attributes = ZAP_ATTRIBUTE_INDEX(287), \ .attributeCount = 8, \ .clusterSize = 106, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2212,7 +2244,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 26, 1107 }, { ZAP_CLUSTER_INDEX(26), 10, 1328 }, { ZAP_CLUSTER_INDEX(36), 4, 287 }, \ + { ZAP_CLUSTER_INDEX(0), 26, 1361 }, { ZAP_CLUSTER_INDEX(26), 10, 1328 }, { ZAP_CLUSTER_INDEX(36), 4, 287 }, \ { ZAP_CLUSTER_INDEX(40), 5, 439 }, { ZAP_CLUSTER_INDEX(45), 3, 398 }, { ZAP_CLUSTER_INDEX(48), 2, 106 }, \ } @@ -2225,7 +2257,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3665) +#define ATTRIBUTE_MAX_SIZE (3919) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (6) diff --git a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp index 9e567bc39083ba..15a1bc859154a5 100644 --- a/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/IMClusterCommandHandler.cpp @@ -145,52 +145,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace BarrierControl -namespace Binding { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBindingClusterUnbindCallback(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 Binding - namespace ColorControl { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1263,9 +1217,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::BarrierControl::Id: Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::Binding::Id: - Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::ColorControl::Id: Clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 89b3b75b5fb7ea..7ac45ff84d6000 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -29,243 +29,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), big-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), big-endian */ \ + \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), big-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x02, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -281,7 +299,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -299,12 +317,30 @@ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 875 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Binding (server), big-endian */ \ + \ + /* 1133 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 879 - label list, */ \ + /* 1387 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -322,52 +358,52 @@ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1133 - DoorOpenEvents, */ \ + /* 1641 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1137 - DoorClosedEvents, */ \ + /* 1645 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1141 - Language, */ \ + /* 1649 - Language, */ \ 2, 'e', 'n', \ \ - /* 1144 - AutoRelockTime, */ \ + /* 1652 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x10, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1148 - FeatureMap, */ \ + /* 1656 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1152 - IAS CIE address, */ \ + /* 1660 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 1160 - bitmap32, */ \ + /* 1668 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1164 - bitmap64, */ \ + /* 1672 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1172 - int32u, */ \ + /* 1680 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1176 - int64u, */ \ + /* 1684 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1184 - int32s, */ \ + /* 1692 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1188 - int64s, */ \ + /* 1696 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1196 - list_int8u, */ \ + /* 1704 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1206 - list_octet_string, */ \ + /* 1714 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -383,7 +419,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1460 - list_struct_octet_string, */ \ + /* 1968 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -404,243 +440,261 @@ #define GENERATED_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ + /* Endpoint: 0, Cluster: Binding (server), little-endian */ \ + \ + /* 0 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 0, Cluster: Localization Configuration (server), little-endian */ \ \ - /* 0 - ActiveLocale, */ \ - 5, 'e', 'n', '-', 'U', 'S', \ + /* 254 - ActiveLocale, */ \ + 5, 'e', 'n', '-', 'U', 'S', \ \ /* Endpoint: 0, Cluster: Unit Localization (server), little-endian */ \ \ - /* 6 - FeatureMap, */ \ + /* 260 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 10 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 18 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 22 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 34 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x02, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 42 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 50 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 54 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 62 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 70 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 78 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 82 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 84 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 92 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 100 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 104 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 108 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 112 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 116 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 120 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 124 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 128 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 132 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 136 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 140 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 144 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 148 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 152 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 156 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 160 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 164 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 168 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 172 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 176 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 180 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 184 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 188 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 192 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 196 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 200 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 204 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 208 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 212 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 216 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 220 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 224 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 228 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 232 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 236 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 240 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 248 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 256 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 260 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 267 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 271 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 275 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 279 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 283 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 287 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 291 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 295 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 303 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 311 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 315 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 323 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 331 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 339 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 347 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 355 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 363 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 367 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -656,7 +710,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -674,12 +728,30 @@ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 875 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Binding (server), little-endian */ \ + \ + /* 1133 - binding list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 879 - label list, */ \ + /* 1387 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -697,52 +769,52 @@ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1133 - DoorOpenEvents, */ \ + /* 1641 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1137 - DoorClosedEvents, */ \ + /* 1645 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1141 - Language, */ \ + /* 1649 - Language, */ \ 2, 'e', 'n', \ \ - /* 1144 - AutoRelockTime, */ \ + /* 1652 - AutoRelockTime, */ \ 0x10, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1148 - FeatureMap, */ \ + /* 1656 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1152 - IAS CIE address, */ \ + /* 1660 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 1160 - bitmap32, */ \ + /* 1668 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1164 - bitmap64, */ \ + /* 1672 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1172 - int32u, */ \ + /* 1680 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1176 - int64u, */ \ + /* 1684 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1184 - int32s, */ \ + /* 1692 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1188 - int64s, */ \ + /* 1696 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1196 - list_int8u, */ \ + /* 1704 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1206 - list_octet_string, */ \ + /* 1714 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -758,7 +830,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1460 - list_struct_octet_string, */ \ + /* 1968 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -777,7 +849,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (91) +#define GENERATED_DEFAULTS_COUNT (93) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -843,7 +915,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 416 +#define GENERATED_ATTRIBUTE_COUNT 418 #define GENERATED_ATTRIBUTES \ { \ \ @@ -855,7 +927,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(0) }, /* binding list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -912,7 +985,7 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ + ZAP_LONG_DEFAULTS_INDEX(254) }, /* ActiveLocale */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedLocales */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -928,37 +1001,37 @@ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(6) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_SIMPLE_DEFAULT(0) }, /* TemperatureUnit */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(264) }, /* Breadcrumb */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ - { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ - { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* BasicCommissioningInfo */ \ + { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ + { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(22) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(34) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(42) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(50) }, /* TotalOperationalHours */ \ - { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ + { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ { 0x00000006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ @@ -968,23 +1041,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(54) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(62) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(70) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(78) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(82) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(84) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(92) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(100) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -997,50 +1070,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(104) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(108) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(112) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(116) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(120) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(124) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(128) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(132) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(136) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(140) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(144) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(148) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(152) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(156) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(160) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(164) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(168) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(172) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(176) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(180) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(184) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(188) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(192) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(196) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(200) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(204) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(208) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(212) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(216) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(220) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(224) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(228) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(232) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(236) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(240) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(248) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(256) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(260) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(267) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1049,28 +1122,28 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(271) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(275) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(279) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(283) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(287) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(291) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(295) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(303) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(311) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(315) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(323) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(339) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(347) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(355) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(363) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -1092,8 +1165,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(367) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1134,7 +1207,7 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Level Control (server) */ \ @@ -1177,6 +1250,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1133) }, /* binding list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ @@ -1215,17 +1289,17 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(879) }, /* label list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1387) }, /* label list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(2) }, /* LockState */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ - { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1133) }, /* DoorOpenEvents */ \ + { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1641) }, /* DoorOpenEvents */ \ { 0x00000005, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1137) }, /* DoorClosedEvents */ \ + ZAP_LONG_DEFAULTS_INDEX(1645) }, /* DoorClosedEvents */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* OpenPeriod */ \ { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfTotalUsersSupported */ \ { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfPINUsersSupported */ \ @@ -1235,8 +1309,8 @@ { 0x00000017, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MaxPINCodeLength */ \ { 0x00000018, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MinPINCodeLength */ \ { 0x0000001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1141) }, /* Language */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1144) }, /* AutoRelockTime */ \ + { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1649) }, /* Language */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1652) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1306,7 +1380,7 @@ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1148) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1656) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ @@ -1401,7 +1475,7 @@ { 0x00000001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x00000010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1152) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(1660) }, /* IAS CIE address */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1413,24 +1487,24 @@ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x00000001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1160) }, /* bitmap32 */ \ - { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1164) }, /* bitmap64 */ \ + { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1668) }, /* bitmap32 */ \ + { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1672) }, /* bitmap64 */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1172) }, /* int32u */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1176) }, /* int64u */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1680) }, /* int32u */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1684) }, /* int64u */ \ { 0x0000000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x0000000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1184) }, /* int32s */ \ - { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1188) }, /* int64s */ \ + { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1692) }, /* int32s */ \ + { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1696) }, /* int64s */ \ { 0x00000015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x00000016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x00000019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ - { 0x0000001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1196) }, /* list_int8u */ \ + { 0x0000001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1704) }, /* list_int8u */ \ { 0x0000001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1206) }, /* list_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(1714) }, /* list_octet_string */ \ { 0x0000001C, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1460) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(1968) }, /* list_struct_octet_string */ \ { 0x0000001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_octet_string */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1508,11 +1582,6 @@ // clang-format off #define GENERATED_COMMANDS { \ - /* Endpoint: 0, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */\ /* client_generated */ \ 0x00000000 /* QueryImage */, \ @@ -1641,11 +1710,6 @@ 0x00000006 /* StepWithOnOff */, \ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Binding (server) */\ - /* client_generated */ \ - 0x00000000 /* Bind */, \ - 0x00000001 /* Unbind */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Door Lock (server) */\ /* client_generated */ \ 0x00000000 /* LockDoor */, \ @@ -1737,17 +1801,17 @@ /* Endpoint: 0, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ .attributes = ZAP_ATTRIBUTE_INDEX(5), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ .clusterId = 0x0000001F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1758,7 +1822,7 @@ { \ /* Endpoint: 0, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1769,18 +1833,18 @@ { \ /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ .clusterId = 0x00000029, \ - .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ .attributeCount = 1, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ .clusterId = 0x0000002B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(31), \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ .attributeCount = 3, \ .clusterSize = 38, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1791,7 +1855,7 @@ { \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ .clusterId = 0x0000002C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ .attributeCount = 4, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -1802,7 +1866,7 @@ { \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ .clusterId = 0x0000002D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(38), \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1813,40 +1877,40 @@ { \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ .clusterId = 0x00000030, \ - .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributes = ZAP_ATTRIBUTE_INDEX(48), \ .attributeCount = 10, \ .clusterSize = 60, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ .clusterId = 0x00000032, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ .clusterId = 0x00000033, \ - .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ .attributeCount = 9, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1857,18 +1921,18 @@ { \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ .clusterId = 0x00000034, \ - .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributes = ZAP_ATTRIBUTE_INDEX(67), \ .attributeCount = 6, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ .clusterId = 0x00000035, \ - .attributes = ZAP_ATTRIBUTE_INDEX(72), \ + .attributes = ZAP_ATTRIBUTE_INDEX(73), \ .attributeCount = 65, \ .clusterSize = 247, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1879,7 +1943,7 @@ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ .clusterId = 0x00000036, \ - .attributes = ZAP_ATTRIBUTE_INDEX(137), \ + .attributes = ZAP_ATTRIBUTE_INDEX(138), \ .attributeCount = 15, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1890,40 +1954,40 @@ { \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ .clusterId = 0x00000037, \ - .attributes = ZAP_ATTRIBUTE_INDEX(152), \ + .attributes = ZAP_ATTRIBUTE_INDEX(153), \ .attributeCount = 11, \ .clusterSize = 57, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ .clusterId = 0x0000003C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributes = ZAP_ATTRIBUTE_INDEX(164), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 31 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ .clusterId = 0x0000003E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ .attributeCount = 7, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 45 ) ,\ },\ { \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ .clusterId = 0x0000003F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ .attributeCount = 3, \ .clusterSize = 510, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1934,7 +1998,7 @@ { \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1945,7 +2009,7 @@ { \ /* Endpoint: 0, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ .attributeCount = 2, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1956,7 +2020,7 @@ { \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1967,62 +2031,62 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ .attributeCount = 2, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(187), \ + .attributes = ZAP_ATTRIBUTE_INDEX(188), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 62 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(189), \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayScenesServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ },\ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(195), \ + .attributes = ZAP_ATTRIBUTE_INDEX(196), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributes = ZAP_ATTRIBUTE_INDEX(203), \ .attributeCount = 15, \ .clusterSize = 23, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(217), \ + .attributes = ZAP_ATTRIBUTE_INDEX(218), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2033,7 +2097,7 @@ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(221), \ + .attributes = ZAP_ATTRIBUTE_INDEX(222), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2044,18 +2108,18 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(226), \ - .attributeCount = 1, \ - .clusterSize = 2, \ + .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributeCount = 2, \ + .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 98 ) ,\ + .clientGeneratedCommandList = nullptr ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ .clusterId = 0x00000039, \ - .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributes = ZAP_ATTRIBUTE_INDEX(229), \ .attributeCount = 15, \ .clusterSize = 36, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2066,7 +2130,7 @@ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(242), \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ .attributeCount = 3, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2077,7 +2141,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(245), \ + .attributes = ZAP_ATTRIBUTE_INDEX(247), \ .attributeCount = 2, \ .clusterSize = 256, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2088,62 +2152,62 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(247), \ + .attributes = ZAP_ATTRIBUTE_INDEX(249), \ .attributeCount = 28, \ .clusterSize = 46, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(275), \ + .attributes = ZAP_ATTRIBUTE_INDEX(277), \ .attributeCount = 19, \ .clusterSize = 31, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 110 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(294), \ + .attributes = ZAP_ATTRIBUTE_INDEX(296), \ .attributeCount = 5, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 114 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 108 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(299), \ + .attributes = ZAP_ATTRIBUTE_INDEX(301), \ .attributeCount = 10, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 117 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 111 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(309), \ + .attributes = ZAP_ATTRIBUTE_INDEX(311), \ .attributeCount = 51, \ .clusterSize = 337, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 121 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 115 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(360), \ + .attributes = ZAP_ATTRIBUTE_INDEX(362), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2154,7 +2218,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(364), \ + .attributes = ZAP_ATTRIBUTE_INDEX(366), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2165,7 +2229,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(368), \ + .attributes = ZAP_ATTRIBUTE_INDEX(370), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2176,7 +2240,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(372), \ + .attributes = ZAP_ATTRIBUTE_INDEX(374), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2187,18 +2251,18 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(376), \ + .attributes = ZAP_ATTRIBUTE_INDEX(378), \ .attributeCount = 6, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 136 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 130 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 132 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(382), \ + .attributes = ZAP_ATTRIBUTE_INDEX(384), \ .attributeCount = 2, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2209,7 +2273,7 @@ { \ /* Endpoint: 1, Cluster: Channel (client) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2220,7 +2284,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (client) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2231,7 +2295,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (client) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2242,7 +2306,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (client) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2253,7 +2317,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (client) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2264,7 +2328,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (client) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2275,7 +2339,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (client) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2286,7 +2350,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (client) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2297,7 +2361,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (client) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2308,7 +2372,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (client) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -2319,29 +2383,29 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 21, \ .clusterSize = 1582, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ) ,\ - .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 144 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 135 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(405), \ + .attributes = ZAP_ATTRIBUTE_INDEX(407), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ) ,\ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ) ,\ .serverGeneratedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(407), \ + .attributes = ZAP_ATTRIBUTE_INDEX(409), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2352,7 +2416,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(412), \ + .attributes = ZAP_ATTRIBUTE_INDEX(414), \ .attributeCount = 4, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2371,7 +2435,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 22, 1107 }, { ZAP_CLUSTER_INDEX(22), 33, 2457 }, { ZAP_CLUSTER_INDEX(55), 3, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 22, 1361 }, { ZAP_CLUSTER_INDEX(22), 33, 2711 }, { ZAP_CLUSTER_INDEX(55), 3, 8 }, \ } // Largest attribute size is needed for various buffers @@ -2383,7 +2447,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (75) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3572) +#define ATTRIBUTE_MAX_SIZE (4080) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) From fbde69981401a78833d9474f4c3e6fad65b574a4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 Feb 2022 11:10:53 -0500 Subject: [PATCH 28/30] Rename CHIP_CONFIG_MAX_DEVICE_ADMINS to CHIP_CONFIG_MAX_FABRICS. (#14851) That's what it really means. There can be multiple "admins" per fabric. --- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../qpg/project_include/CHIPProjectConfig.h | 10 +++++----- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../examples/ExampleAccessControlDelegate.cpp | 2 +- .../operational-credentials-server.cpp | 2 +- src/credentials/FabricTable.h | 11 ++++------- src/include/platform/CHIPDeviceConfig.h | 2 +- src/lib/core/CHIPConfig.h | 14 +++++++------- src/platform/CYW30739/CHIPPlatformConfig.h | 2 +- src/platform/CYW30739/KeyValueStoreManagerImpl.h | 2 +- src/platform/EFR32/CHIPPlatformConfig.h | 12 ++++++------ src/platform/cc13x2_26x2/CHIPPlatformConfig.h | 6 +++--- src/platform/nrfconnect/CHIPDevicePlatformConfig.h | 2 +- src/platform/nrfconnect/CHIPPlatformConfig.h | 4 ++-- src/platform/qpg/CHIPDevicePlatformConfig.h | 2 +- 16 files changed, 49 insertions(+), 52 deletions(-) diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index b0056fd0f95d7b..ddb2f24ecbb2e0 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -161,14 +161,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 7b2b57139300a0..71cb0c323eb144 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -161,14 +161,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 1000_ms32 diff --git a/examples/platform/qpg/project_include/CHIPProjectConfig.h b/examples/platform/qpg/project_include/CHIPProjectConfig.h index 749c47b148169f..b6252bc544d7a7 100644 --- a/examples/platform/qpg/project_include/CHIPProjectConfig.h +++ b/examples/platform/qpg/project_include/CHIPProjectConfig.h @@ -116,14 +116,14 @@ #define CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack /** * @name Interaction Model object pool configuration. diff --git a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 3790ed574daaf2..4867be87e586ad 100644 --- a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -168,14 +168,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 2 // 1 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 2 // 1 fabrics + 1 for rotation slack /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE diff --git a/src/access/examples/ExampleAccessControlDelegate.cpp b/src/access/examples/ExampleAccessControlDelegate.cpp index c461d55d585ab0..269600fe503ad3 100644 --- a/src/access/examples/ExampleAccessControlDelegate.cpp +++ b/src/access/examples/ExampleAccessControlDelegate.cpp @@ -353,7 +353,7 @@ class EntryStorage { public: // ACL support - static constexpr size_t kNumberOfFabrics = CHIP_CONFIG_MAX_DEVICE_ADMINS; + static constexpr size_t kNumberOfFabrics = CHIP_CONFIG_MAX_FABRICS; static constexpr size_t kEntriesPerFabric = CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC; static EntryStorage acl[kNumberOfFabrics * kEntriesPerFabric]; diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 397e18039d241c..b97e703dbb9db7 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -135,7 +135,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadNOCs(EndpointId endpoint, Attri CHIP_ERROR OperationalCredentialsAttrAccess::ReadSupportedFabrics(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - uint8_t fabricCount = CHIP_CONFIG_MAX_DEVICE_ADMINS; + uint8_t fabricCount = CHIP_CONFIG_MAX_FABRICS; return aEncoder.Encode(fabricCount); } diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index ee59c580bc3cc8..90086c26d22471 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -43,7 +43,7 @@ namespace chip { static constexpr FabricIndex kMinValidFabricIndex = 1; -static constexpr FabricIndex kMaxValidFabricIndex = std::min(UINT8_MAX - 1, CHIP_CONFIG_MAX_DEVICE_ADMINS); +static constexpr FabricIndex kMaxValidFabricIndex = std::min(UINT8_MAX - 1, CHIP_CONFIG_MAX_FABRICS); static constexpr uint8_t kFabricLabelMaxLengthInBytes = 32; // KVS store is sensitive to length of key strings, based on the underlying @@ -441,16 +441,13 @@ class DLL_EXPORT FabricTable uint8_t FabricCount() const { return mFabricCount; } - ConstFabricIterator cbegin() const { return ConstFabricIterator(mStates, 0, CHIP_CONFIG_MAX_DEVICE_ADMINS); } - ConstFabricIterator cend() const - { - return ConstFabricIterator(mStates, CHIP_CONFIG_MAX_DEVICE_ADMINS, CHIP_CONFIG_MAX_DEVICE_ADMINS); - } + ConstFabricIterator cbegin() const { return ConstFabricIterator(mStates, 0, CHIP_CONFIG_MAX_FABRICS); } + ConstFabricIterator cend() const { return ConstFabricIterator(mStates, CHIP_CONFIG_MAX_FABRICS, CHIP_CONFIG_MAX_FABRICS); } ConstFabricIterator begin() const { return cbegin(); } ConstFabricIterator end() const { return cend(); } private: - FabricInfo mStates[CHIP_CONFIG_MAX_DEVICE_ADMINS]; + FabricInfo mStates[CHIP_CONFIG_MAX_FABRICS]; FabricStorage * mStorage = nullptr; FabricTableDelegate * mDelegate = nullptr; diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 1ea8935400403e..8a3416441d3dd2 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -743,7 +743,7 @@ * Amount of services available for advertising using SRP. */ #ifndef CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #endif /** diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index a431c4b064bc0b..4e4cad403b690f 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1259,16 +1259,16 @@ #endif // CHIP_CONFIG_MAX_BINDINGS /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 16 -#endif // CHIP_CONFIG_MAX_DEVICE_ADMINS +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 16 +#endif // CHIP_CONFIG_MAX_FABRICS /** * @def CHIP_NON_PRODUCTION_MARKER diff --git a/src/platform/CYW30739/CHIPPlatformConfig.h b/src/platform/CYW30739/CHIPPlatformConfig.h index 2b3f19733d859a..dd8571846c9dbd 100644 --- a/src/platform/CYW30739/CHIPPlatformConfig.h +++ b/src/platform/CYW30739/CHIPPlatformConfig.h @@ -24,7 +24,7 @@ #pragma once #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_VALUE_LENGTH 2048 -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 +#define CHIP_CONFIG_MAX_FABRICS 4 #define CHIP_CONFIG_UNAUTHENTICATED_CONNECTION_POOL_SIZE 10 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING 1 diff --git a/src/platform/CYW30739/KeyValueStoreManagerImpl.h b/src/platform/CYW30739/KeyValueStoreManagerImpl.h index a166b876681b6a..ff99be1dc75389 100644 --- a/src/platform/CYW30739/KeyValueStoreManagerImpl.h +++ b/src/platform/CYW30739/KeyValueStoreManagerImpl.h @@ -47,7 +47,7 @@ class KeyValueStoreManagerImpl final : public KeyValueStoreManager private: static constexpr uint8_t mMaxEntryCount = 1 + /* For the global message counter */ 1 + /* For the admin key count */ - CHIP_CONFIG_MAX_DEVICE_ADMINS + 1 + /* For the session key count */ + CHIP_CONFIG_MAX_FABRICS + 1 + /* For the session key count */ CHIP_CONFIG_MAX_SESSION_KEYS; struct KeyEntry diff --git a/src/platform/EFR32/CHIPPlatformConfig.h b/src/platform/EFR32/CHIPPlatformConfig.h index 3c8dd7b2238f30..b11a45fc8db344 100644 --- a/src/platform/EFR32/CHIPPlatformConfig.h +++ b/src/platform/EFR32/CHIPPlatformConfig.h @@ -81,15 +81,15 @@ #endif // CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 // 4 fabrics + 1 for rotation slack +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 // 4 fabrics + 1 for rotation slack #endif // ==================== FreeRTOS Configuration Overrides ==================== diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h index 6763d43846e6c2..e22eef5189a422 100644 --- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h @@ -80,6 +80,6 @@ #endif // CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS // Limit the number of device admins to ensure enough ressources for handling them -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 -#endif // CHIP_CONFIG_MAX_DEVICE_ADMINS +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif // CHIP_CONFIG_MAX_FABRICS diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 1097f7b2ff8fd6..01fe0d0e72e934 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -90,7 +90,7 @@ #ifdef CONFIG_CHIP_ENABLE_DNSSD_SRP #define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 #ifdef CONFIG_CHIP_ENABLE_DNS_CLIENT diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index 9864374c88596c..589eaceabd7522 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -68,6 +68,6 @@ #define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1 #endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 #endif diff --git a/src/platform/qpg/CHIPDevicePlatformConfig.h b/src/platform/qpg/CHIPDevicePlatformConfig.h index ecbad8ade3443a..74be4b6bb2ff32 100644 --- a/src/platform/qpg/CHIPDevicePlatformConfig.h +++ b/src/platform/qpg/CHIPDevicePlatformConfig.h @@ -33,7 +33,7 @@ #if CHIP_ENABLE_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 #endif From 092e707588b777ae87b8a42fdeca06fe69989c56 Mon Sep 17 00:00:00 2001 From: Austin Hsieh <77706079+austinh0@users.noreply.github.com> Date: Tue, 8 Feb 2022 08:11:01 -0800 Subject: [PATCH 29/30] Set key length in example issuer to value length (#14869) --- src/controller/ExampleOperationalCredentialsIssuer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controller/ExampleOperationalCredentialsIssuer.cpp b/src/controller/ExampleOperationalCredentialsIssuer.cpp index 3d2530ddc3f61e..ff94a229009d1f 100644 --- a/src/controller/ExampleOperationalCredentialsIssuer.cpp +++ b/src/controller/ExampleOperationalCredentialsIssuer.cpp @@ -56,9 +56,11 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIssuerKeypairStorage, key, err = storage.SyncGetKeyValue(key, &serializedKey, keySize)); + serializedKey.SetLength(keySize); if (err != CHIP_NO_ERROR) { + ChipLogProgress(Controller, "Couldn't get %s from storage: %s", kOperationalCredentialsIssuerKeypairStorage, ErrorStr(err)); // Storage doesn't have an existing keypair. Let's create one and add it to the storage. ReturnErrorOnFailure(mIssuer.Initialize()); ReturnErrorOnFailure(mIssuer.Serialize(serializedKey)); @@ -78,9 +80,12 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::Initialize(PersistentStorageDele PERSISTENT_KEY_OP(mIndex, kOperationalCredentialsIntermediateIssuerKeypairStorage, key, err = storage.SyncGetKeyValue(key, &serializedKey, keySize)); + serializedKey.SetLength(keySize); if (err != CHIP_NO_ERROR) { + ChipLogProgress(Controller, "Couldn't get %s from storage: %s", kOperationalCredentialsIntermediateIssuerKeypairStorage, + ErrorStr(err)); // Storage doesn't have an existing keypair. Let's create one and add it to the storage. ReturnErrorOnFailure(mIntermediateIssuer.Initialize()); ReturnErrorOnFailure(mIntermediateIssuer.Serialize(serializedKey)); From 52d0b423a10e9af12cecce174da179a3208d6dd4 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 8 Feb 2022 11:12:14 -0500 Subject: [PATCH 30/30] Bulk read all the things (#14752) * Bulk read all the things. * Use the recommended value to arm failsafe. * Whoopsies - not all c++17 * Update src/controller/AutoCommissioner.h Co-authored-by: Boris Zbarsky * Update src/controller/CHIPDeviceController.cpp Co-authored-by: Boris Zbarsky * Update src/controller/CHIPDeviceController.cpp Co-authored-by: Boris Zbarsky * Don't read all the attributes from basic. * Fixup errors from code suggestions. Get calls need explicit templating. Co-authored-by: Boris Zbarsky --- src/controller/AutoCommissioner.cpp | 59 ++++----- src/controller/AutoCommissioner.h | 5 +- src/controller/CHIPDeviceController.cpp | 154 ++++++++++++------------ src/controller/CommissioningDelegate.h | 50 ++++---- 4 files changed, 126 insertions(+), 142 deletions(-) diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index e46f2772e26fca..3795a15cc20339 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -106,21 +106,8 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag switch (currentStage) { case CommissioningStage::kSecurePairing: - return CommissioningStage::kReadVendorId; - case CommissioningStage::kReadVendorId: - return CommissioningStage::kReadProductId; - case CommissioningStage::kReadProductId: - return CommissioningStage::kReadSoftwareVersion; - case CommissioningStage::kReadSoftwareVersion: - if (mNeedsNetworkSetup) - { - return CommissioningStage::kGetNetworkTechnology; - } - else - { - return CommissioningStage::kArmFailsafe; - } - case CommissioningStage::kGetNetworkTechnology: + return CommissioningStage::kReadCommissioningInfo; + case CommissioningStage::kReadCommissioningInfo: return CommissioningStage::kArmFailsafe; case CommissioningStage::kArmFailsafe: return CommissioningStage::kConfigRegulatory; @@ -146,17 +133,24 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag // operational network because the provisioning of certificates will trigger the device to start operational advertising. if (mNeedsNetworkSetup) { - if (mParams.GetWiFiCredentials().HasValue() && mNetworkEndpoints.wifi != kInvalidEndpointId) + if (mParams.GetWiFiCredentials().HasValue() && mDeviceCommissioningInfo.network.wifi != kInvalidEndpointId) { return CommissioningStage::kWiFiNetworkSetup; } - else if (mParams.GetThreadOperationalDataset().HasValue() && mNetworkEndpoints.thread != kInvalidEndpointId) + else if (mParams.GetThreadOperationalDataset().HasValue() && + mDeviceCommissioningInfo.network.thread != kInvalidEndpointId) { return CommissioningStage::kThreadNetworkSetup; } else { ChipLogError(Controller, "Required network information not provided in commissioning parameters"); + ChipLogError(Controller, "Parameters supplied: wifi (%s) thread (%s)", + mParams.GetWiFiCredentials().HasValue() ? "yes" : "no", + mParams.GetThreadOperationalDataset().HasValue() ? "yes" : "no"); + ChipLogError(Controller, "Device supports: wifi (%s) thread(%s)", + mDeviceCommissioningInfo.network.wifi == kInvalidEndpointId ? "no" : "yes", + mDeviceCommissioningInfo.network.thread == kInvalidEndpointId ? "no" : "yes"); lastErr = CHIP_ERROR_INVALID_ARGUMENT; return CommissioningStage::kCleanup; } @@ -171,7 +165,7 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag #endif } case CommissioningStage::kWiFiNetworkSetup: - if (mParams.GetThreadOperationalDataset().HasValue() && mNetworkEndpoints.thread != kInvalidEndpointId) + if (mParams.GetThreadOperationalDataset().HasValue() && mDeviceCommissioningInfo.network.thread != kInvalidEndpointId) { return CommissioningStage::kThreadNetworkSetup; } @@ -180,7 +174,7 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag return CommissioningStage::kWiFiNetworkEnable; } case CommissioningStage::kThreadNetworkSetup: - if (mParams.GetWiFiCredentials().HasValue() && mNetworkEndpoints.wifi != kInvalidEndpointId) + if (mParams.GetWiFiCredentials().HasValue() && mDeviceCommissioningInfo.network.wifi != kInvalidEndpointId) { return CommissioningStage::kWiFiNetworkEnable; } @@ -190,7 +184,7 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag } case CommissioningStage::kWiFiNetworkEnable: - if (mParams.GetThreadOperationalDataset().HasValue() && mNetworkEndpoints.thread != kInvalidEndpointId) + if (mParams.GetThreadOperationalDataset().HasValue() && mDeviceCommissioningInfo.network.thread != kInvalidEndpointId) { return CommissioningStage::kThreadNetworkEnable; } @@ -227,12 +221,10 @@ EndpointId AutoCommissioner::GetEndpoint(const CommissioningStage & stage) { case CommissioningStage::kWiFiNetworkSetup: case CommissioningStage::kWiFiNetworkEnable: - return mNetworkEndpoints.wifi; + return mDeviceCommissioningInfo.network.wifi; case CommissioningStage::kThreadNetworkSetup: case CommissioningStage::kThreadNetworkEnable: - return mNetworkEndpoints.thread; - case CommissioningStage::kGetNetworkTechnology: - return kInvalidEndpointId; + return mDeviceCommissioningInfo.network.thread; default: return kRootEndpointId; } @@ -315,17 +307,12 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio { switch (report.stageCompleted) { - case CommissioningStage::kReadVendorId: - mVendorId = report.Get().vendorId; - break; - case CommissioningStage::kReadProductId: - mProductId = report.Get().productId; - break; - case CommissioningStage::kReadSoftwareVersion: - mSoftwareVersion = report.Get().softwareVersion; - break; - case CommissioningStage::kGetNetworkTechnology: - mNetworkEndpoints = report.Get(); + case CommissioningStage::kReadCommissioningInfo: + mDeviceCommissioningInfo = report.Get(); + if (!mParams.GetFailsafeTimerSeconds().HasValue() && mDeviceCommissioningInfo.general.recommendedFailsafe > 0) + { + mParams.SetFailsafeTimerSeconds(mDeviceCommissioningInfo.general.recommendedFailsafe); + } break; case CommissioningStage::kSendPAICertificateRequest: SetPAI(report.Get().certificate); @@ -367,7 +354,7 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio mCommissioneeDeviceProxy = nullptr; mOperationalDeviceProxy = nullptr; mParams = CommissioningParameters(); - mNetworkEndpoints = NetworkClusters(); + mDeviceCommissioningInfo = ReadCommissioningInfo(); return CHIP_NO_ERROR; default: break; diff --git a/src/controller/AutoCommissioner.h b/src/controller/AutoCommissioner.h index 90438703ed9a29..199f201d0e2701 100644 --- a/src/controller/AutoCommissioner.h +++ b/src/controller/AutoCommissioner.h @@ -57,16 +57,13 @@ class AutoCommissioner : public CommissioningDelegate OperationalDeviceProxy * mOperationalDeviceProxy = nullptr; OperationalCredentialsDelegate * mOperationalCredentialsDelegate = nullptr; CommissioningParameters mParams = CommissioningParameters(); - VendorId mVendorId; - uint16_t mProductId; - uint32_t mSoftwareVersion; // Memory space for the commisisoning parameters that come in as ByteSpans - the caller is not guaranteed to retain this memory uint8_t mSsid[CommissioningParameters::kMaxSsidLen]; uint8_t mCredentials[CommissioningParameters::kMaxCredentialsLen]; uint8_t mThreadOperationalDataset[CommissioningParameters::kMaxThreadDatasetLen]; bool mNeedsNetworkSetup = false; - NetworkClusters mNetworkEndpoints; + ReadCommissioningInfo mDeviceCommissioningInfo; // TODO: Why were the nonces statically allocated, but the certs dynamically allocated? uint8_t * mDAC = nullptr; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index f74d4cb8ef5d82..1e4fb605f75dc5 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1556,43 +1556,58 @@ void DeviceCommissioner::SetupCluster(ClusterBase & base, DeviceProxy * proxy, E base.SetCommandTimeout(timeout); } -void BasicVendorCallback(void * context, VendorId vendorId) +// AttributeCache::Callback impl +void DeviceCommissioner::OnDone() { - DeviceCommissioner * commissioner = static_cast(context); - CommissioningDelegate::CommissioningReport report; - report.Set(vendorId); - commissioner->CommissioningStageComplete(CHIP_NO_ERROR, report); -} + CHIP_ERROR err; + CHIP_ERROR return_err = CHIP_NO_ERROR; + ReadCommissioningInfo info; -void BasicProductCallback(void * context, uint16_t productId) -{ - DeviceCommissioner * commissioner = static_cast(context); - CommissioningDelegate::CommissioningReport report; - report.Set(productId); - commissioner->CommissioningStageComplete(CHIP_NO_ERROR, report); -} + // Using ForEachAttribute because this attribute can be queried on any endpoint. + err = mAttributeCache->ForEachAttribute( + app::Clusters::GeneralCommissioning::Id, [this, &info](const app::ConcreteAttributePath & path) { + if (path.mAttributeId != app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfo::Id) + { + return CHIP_NO_ERROR; + } + app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfo::TypeInfo::DecodableType basicInfo; + ReturnErrorOnFailure( + this->mAttributeCache->Get( + path, basicInfo)); + info.general.recommendedFailsafe = basicInfo.failSafeExpiryLengthSeconds; + return CHIP_NO_ERROR; + }); -void BasicSoftwareCallback(void * context, uint32_t softwareVersion) -{ - DeviceCommissioner * commissioner = static_cast(context); - CommissioningDelegate::CommissioningReport report; - report.Set(softwareVersion); - commissioner->CommissioningStageComplete(CHIP_NO_ERROR, report); -} + // Try to parse as much as we can here before returning, even if this is an error. + return_err = err == CHIP_NO_ERROR ? return_err : err; -void AttributeReadFailure(void * context, CHIP_ERROR status) -{ - DeviceCommissioner * commissioner = static_cast(context); - commissioner->CommissioningStageComplete(status); -} + err = mAttributeCache->ForEachAttribute(app::Clusters::Basic::Id, [this, &info](const app::ConcreteAttributePath & path) { + if (path.mAttributeId != app::Clusters::Basic::Attributes::VendorID::Id && + path.mAttributeId != app::Clusters::Basic::Attributes::ProductID::Id && + path.mAttributeId != app::Clusters::Basic::Attributes::SoftwareVersion::Id) + { + // Continue on + return CHIP_NO_ERROR; + } -// AttributeCache::Callback impl -void DeviceCommissioner::OnDone() -{ - NetworkClusters clusters; + switch (path.mAttributeId) + { + case app::Clusters::Basic::Attributes::VendorID::Id: + return this->mAttributeCache->Get(path, info.basic.vendorId); + case app::Clusters::Basic::Attributes::ProductID::Id: + return this->mAttributeCache->Get(path, info.basic.productId); + case app::Clusters::Basic::Attributes::SoftwareVersion::Id: + return this->mAttributeCache->Get( + path, info.basic.softwareVersion); + default: + return CHIP_NO_ERROR; + } + }); + // Try to parse as much as we can here before returning, even if this is an error. + return_err = err == CHIP_NO_ERROR ? return_err : err; - CHIP_ERROR err = mAttributeCache->ForEachAttribute( - app::Clusters::NetworkCommissioning::Id, [this, &clusters](const app::ConcreteAttributePath & path) { + err = mAttributeCache->ForEachAttribute( + app::Clusters::NetworkCommissioning::Id, [this, &info](const app::ConcreteAttributePath & path) { if (path.mAttributeId != app::Clusters::NetworkCommissioning::Attributes::FeatureMap::Id) { return CHIP_NO_ERROR; @@ -1605,44 +1620,45 @@ void DeviceCommissioner::OnDone() { if (features.Has(app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kWiFiNetworkInterface)) { - clusters.wifi = path.mEndpointId; + info.network.wifi = path.mEndpointId; } else if (features.Has( app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kThreadNetworkInterface)) { - clusters.thread = path.mEndpointId; + info.network.thread = path.mEndpointId; } else if (features.Has( app::Clusters::NetworkCommissioning::NetworkCommissioningFeature::kEthernetNetworkInterface)) { - clusters.eth = path.mEndpointId; + info.network.eth = path.mEndpointId; } else { // TODO: Gross workaround for the empty feature map on all clusters. Remove. - if (clusters.thread == kInvalidEndpointId) + if (info.network.thread == kInvalidEndpointId) { - clusters.thread = path.mEndpointId; + info.network.thread = path.mEndpointId; } - if (clusters.wifi == kInvalidEndpointId) + if (info.network.wifi == kInvalidEndpointId) { - clusters.wifi = path.mEndpointId; + info.network.wifi = path.mEndpointId; } } } } return CHIP_NO_ERROR; }); + return_err = err == CHIP_NO_ERROR ? return_err : err; - if (err != CHIP_NO_ERROR) + if (return_err != CHIP_NO_ERROR) { - ChipLogError(Controller, "Error parsing Network commissioning features"); + ChipLogError(Controller, "Error parsing commissioning information"); } mAttributeCache = nullptr; mReadClient = nullptr; CommissioningDelegate::CommissioningReport report; - report.Set(clusters); - CommissioningStageComplete(err, report); + report.Set(info); + CommissioningStageComplete(return_err, report); } void DeviceCommissioner::OnArmFailSafe(void * context, const GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data) @@ -1707,48 +1723,36 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio switch (step) { - case CommissioningStage::kReadVendorId: { - ChipLogProgress(Controller, "Reading vendor ID"); - BasicCluster basic; - SetupCluster(basic, proxy, endpoint, timeout); - basic.ReadAttribute(this, BasicVendorCallback, - AttributeReadFailure); - } - break; - case CommissioningStage::kReadProductId: { - ChipLogProgress(Controller, "Reading product ID"); - BasicCluster basic; - SetupCluster(basic, proxy, endpoint, timeout); - basic.ReadAttribute(this, BasicProductCallback, - AttributeReadFailure); - } - break; - case CommissioningStage::kReadSoftwareVersion: { - ChipLogProgress(Controller, "Reading software version"); - BasicCluster basic; - SetupCluster(basic, proxy, endpoint, timeout); - basic.ReadAttribute(this, BasicSoftwareCallback, - AttributeReadFailure); - } - break; case CommissioningStage::kArmFailsafe: { - ChipLogProgress(Controller, "Arming failsafe"); - // TODO: should get the endpoint information from the descriptor cluster. GeneralCommissioning::Commands::ArmFailSafe::Type request; - request.expiryLengthSeconds = params.GetFailsafeTimerSeconds(); + request.expiryLengthSeconds = params.GetFailsafeTimerSeconds().ValueOr(kDefaultFailsafeTimeout); request.breadcrumb = breadcrumb; request.timeoutMs = kCommandTimeoutMs; + ChipLogProgress(Controller, "Arming failsafe (%u seconds)", request.expiryLengthSeconds); SendCommand(proxy, request, OnArmFailSafe, OnBasicFailure, endpoint, timeout); } break; - case CommissioningStage::kGetNetworkTechnology: { - ChipLogProgress(Controller, "Sending request for network cluster feature map"); + case CommissioningStage::kReadCommissioningInfo: { + ChipLogProgress(Controller, "Sending request for commissioning information"); app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); app::ReadPrepareParams readParams(proxy->GetSecureSession().Value()); - app::AttributePathParams readPath(app::Clusters::NetworkCommissioning::Id, - app::Clusters::NetworkCommissioning::Attributes::FeatureMap::Id); - readParams.mpAttributePathParamsList = &readPath; - readParams.mAttributePathParamsListSize = 1; + + app::AttributePathParams readPaths[5]; + // Read all the feature maps for all the networking clusters on any endpoint to determine what is supported + readPaths[0] = app::AttributePathParams(app::Clusters::NetworkCommissioning::Id, + app::Clusters::NetworkCommissioning::Attributes::FeatureMap::Id); + // Get the basic commissioning info from the general commissioning cluster on this endpoint (recommended failsafe time) + readPaths[1] = app::AttributePathParams(endpoint, app::Clusters::GeneralCommissioning::Id, + app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfo::Id); + // Read attributes from the basic info cluster (vendor id / product id / software version) + readPaths[2] = app::AttributePathParams(endpoint, app::Clusters::Basic::Id, app::Clusters::Basic::Attributes::VendorID::Id); + readPaths[3] = + app::AttributePathParams(endpoint, app::Clusters::Basic::Id, app::Clusters::Basic::Attributes::ProductID::Id); + readPaths[4] = + app::AttributePathParams(endpoint, app::Clusters::Basic::Id, app::Clusters::Basic::Attributes::SoftwareVersion::Id); + + readParams.mpAttributePathParamsList = readPaths; + readParams.mAttributePathParamsListSize = 5; if (timeout.HasValue()) { readParams.mTimeout = timeout.Value(); diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 16474ee08460c1..db0fe09a21bfc0 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -30,10 +30,7 @@ enum CommissioningStage : uint8_t { kError, kSecurePairing, - kReadVendorId, - kReadProductId, - kReadSoftwareVersion, - kGetNetworkTechnology, + kReadCommissioningInfo, kArmFailsafe, // kConfigTime, // NOT YET IMPLEMENTED // kConfigTimeZone, // NOT YET IMPLEMENTED @@ -70,16 +67,16 @@ struct NOCChainGenerationParameters ByteSpan nocsrElements; ByteSpan signature; }; -struct NOCerts -{ -}; + +constexpr uint16_t kDefaultFailsafeTimeout = 60; class CommissioningParameters { public: static constexpr size_t kMaxThreadDatasetLen = 254; static constexpr size_t kMaxSsidLen = 32; static constexpr size_t kMaxCredentialsLen = 64; - uint16_t GetFailsafeTimerSeconds() const { return mFailsafeTimerSeconds; } + + const Optional GetFailsafeTimerSeconds() const { return mFailsafeTimerSeconds; } const Optional GetCSRNonce() const { return mCSRNonce; } const Optional GetAttestationNonce() const { return mAttestationNonce; } const Optional GetWiFiCredentials() const { return mWiFiCreds; } @@ -101,7 +98,7 @@ class CommissioningParameters CommissioningParameters & SetFailsafeTimerSeconds(uint16_t seconds) { - mFailsafeTimerSeconds = seconds; + mFailsafeTimerSeconds.SetValue(seconds); return *this; } @@ -188,7 +185,7 @@ class CommissioningParameters void SetCompletionStatus(CHIP_ERROR err) { completionStatus = err; } private: - uint16_t mFailsafeTimerSeconds = 60; + Optional mFailsafeTimerSeconds; Optional mCSRNonce; ///< CSR Nonce passed by the commissioner Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner Optional mWiFiCreds; @@ -239,37 +236,36 @@ struct OperationalNodeFoundData OperationalDeviceProxy * operationalProxy; }; -struct BasicVendor +struct NetworkClusters { - BasicVendor(VendorId id) : vendorId(id) {} - VendorId vendorId; + EndpointId wifi = kInvalidEndpointId; + EndpointId thread = kInvalidEndpointId; + EndpointId eth = kInvalidEndpointId; }; - -struct BasicProduct +struct BasicClusterInfo { - BasicProduct(uint16_t id) : productId(id) {} - uint16_t productId; + VendorId vendorId = VendorId::Common; + uint16_t productId = 0; + uint32_t softwareVersion = 0; }; - -struct BasicSoftware +struct GeneralCommissioningInfo { - BasicSoftware(uint32_t version) : softwareVersion(version) {} - uint32_t softwareVersion; + uint16_t recommendedFailsafe = 0; }; -struct NetworkClusters +struct ReadCommissioningInfo { - EndpointId wifi = kInvalidEndpointId; - EndpointId thread = kInvalidEndpointId; - EndpointId eth = kInvalidEndpointId; + NetworkClusters network; + BasicClusterInfo basic; + GeneralCommissioningInfo general; }; class CommissioningDelegate { public: virtual ~CommissioningDelegate(){}; - struct CommissioningReport : Variant + struct CommissioningReport + : Variant { CommissioningReport() : stageCompleted(CommissioningStage::kError) {} CommissioningStage stageCompleted;