diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 24cdeaa092f691..67a6d1d8fac3e4 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -74,10 +74,7 @@ ApplyUpdate applyUpdateAction ApplyUpdateRequest ApplyUpdateResponse -appParameters -AppParameters approver -AppServer appspot appwrite aps @@ -194,11 +191,6 @@ capacitive CarbonDioxideConcentrationMeasurement CarbonMonoxideConcentrationMeasurement CaseAdminNode -castingApp -CastingApp -castingAppDidReceiveRequestForDeviceAttestationCredentials -CastingClient -CastingPlayer CatalogVendorId CBB cbd @@ -212,7 +204,6 @@ CCXML CDEEDC CDVersionNumber ced -certificationDeclaration cfg CFLAGS cgit @@ -236,8 +227,6 @@ ChipEchoResponder ChipImInitiator ChipImResponder ChipLight -ChipLogError -ChipLogProgress ChipMessageLayer CHIPOBLE CHIPProjectAppConfig @@ -288,9 +277,7 @@ Commissionable CommissionableDataProvider commissionables commissionee -commissionersCount CommissioningFlow -CommonCaseDeviceServerInitParamsProvider commondatastorage CONF CONFIG @@ -334,7 +321,6 @@ crypto cryptographic CSA csg -csrData csrrequest csu csv @@ -347,7 +333,6 @@ CurrentSaturation customAcl customizations cvfJ -CXE cxx CY CYW @@ -359,7 +344,6 @@ DAPLINK DataFrame datamodel DataModelRevision -DataProvider dataset datasets DataVersion @@ -385,7 +369,6 @@ DefaultOTARequestor DefaultOTARequestorDriver DefaultOTARequestorStorage DefaultSuccess -defaultTestPasscode definedValue DehumidificationControl DelayedActionTime @@ -405,7 +388,6 @@ dev devcontainer devCtrl DevelopmentCerts -deviceAttestationCert DeviceAttestationCredentialsProvider DeviceAttestationCredsExample DeviceCaCerts @@ -436,7 +418,6 @@ DHCPv dhrishi DiagnosticLogs dialout -didReceiveRequestToSignCertificateRequest diffstat diffsyms dimmable @@ -445,8 +426,6 @@ dirs disableNotifyUpdateApplied disambiguated discoverable -DiscoveryDelegate -DiscoveryDelegateImpl DispatchEvent DispatchEventToApplication DissolvedOxygenConcentrationMeasurement @@ -572,7 +551,6 @@ fffff Fi filepath fini -firmwareInformation FixedLabel flashdebug FlowMeasurement @@ -588,12 +566,10 @@ fstab fsync ftd fullclean -func fuzzer FW gbl gcloud -gCommissionableDataProvider GDB gdbgui gdbserver @@ -607,20 +583,12 @@ GenericPlatformManagerImpl GenericThreadConfigurationManagerImpl GenericThreadStackManagerImpl GenericWiFiConfigurationManagerImpl -GetDefaultDACVerifier GetDeviceId GetDeviceInfo GetDns -GetExampleDACProvider -GetId -GetInstance GetIP -GetLongValue getManualTests -GetRandU -GetSetupPasscode getstarted -GetTestAttestationTrustStore getTests GH ghcr @@ -655,8 +623,6 @@ Gv gz gzbf HaloaceticAcidsConcentrationMeasurement -HandleOnAdded -HandleOnUpdated hardcoded hardknott hardwarever @@ -720,7 +686,6 @@ Infineon ini init InitArgs -InitCommissionableDataProvider inlined InputLoop installDebug @@ -768,14 +733,10 @@ kAdminister kbd kBusy kCase -kCertificationDeclaration Kconfig kDacPublicKey -kDevelopmentDAC KeypadInput keyset -KeyValueStoreMgr -KeyValueStoreMgrImpl kGroup kInvalidCommandId KitProg @@ -784,17 +745,8 @@ kNewButton kNodeIdNotSpecified knownissues kOperate -KPAI kPAKEParameterError kPase -kQ -kRotatingDeviceIDUniqueIDLength -kSecAttrKeyClass -kSecAttrKeyClassPrivate -kSecAttrKeySizeInBits -kSecAttrKeyType -kSecAttrKeyTypeECSECPrimeRandom -kSpake kView KVS kWindowNotOpen @@ -837,15 +789,12 @@ LightingApp LightingColor LightingState LinkSoftwareAndDocumentationPack -LinuxCommissionableDataProvider -LinuxDeviceOptions LocalConfigDisabled localedef localhost LocalizationConfiguration localstatedir LockingState -LogDetail loopback LowPower LPC @@ -918,8 +867,6 @@ microcontroller microcontrollers MicroSD middleware -MII -MIIB minApplicableSoftwareVersion Minicom MinInterval @@ -943,15 +890,12 @@ MoveWithOnOff MPSL MRP MTD -MTRDeviceAttestationCredentials MTU Multiband Multicast multilib Multiprotocol multithreaded -MutableByteSpan -MutableByteSpanDataProvider mutexes mv MX @@ -995,8 +939,6 @@ nrfconnect nrfdks nrfutil nrfxlib -NSData -NSDictionary NTAG nullable nullptr @@ -1007,7 +949,6 @@ nwdiag nwk NXP objcopy -objectivec OccupancySensing OctetString OECORE @@ -1080,7 +1021,6 @@ params PartNumber PASE Passcode -passRetained PBKDF pbuf pbufs @@ -1097,15 +1037,13 @@ pem percentageLiftValue perfetto periodicQueryTimeout -PersistedStorage pexpect pickString PID Pigweed PinCode pinrequest -pIterationCount -pIterations +PIXIT pkgconfig PKI plaintext @@ -1127,11 +1065,7 @@ pre preprocessor Presetup PressureMeasurement -privateKey -PrivateKey -privateKeyRef prj -productAttestationIntermediateCert ProductID ProductLabel ProductName @@ -1149,17 +1083,14 @@ ProxyValid ProxyView PRs PSA -pSalt PSCAN PSECT PSK PSoC PTR pts -PublicKey PulseWidthModulation PumpConfigurationAndControl -pVerifier pwd PWM PXXXF @@ -1180,7 +1111,6 @@ QPG QRCode qrcodetool QRCodeUrl -qrYA QSPI QueryImage QueryImageResponse @@ -1234,10 +1164,6 @@ rmw rodata Rollershade rootfs -rotatingDeviceIdUniqueId -RotatingDeviceIdUniqueId -RotatingDeviceIdUniqueIdProvider -rotatingDeviceIdUniqueIdSpan RPC RPCs RPi @@ -1258,6 +1184,7 @@ runArgs RUNAS RunMain runtime +RVC rw RXD sandboxed @@ -1280,8 +1207,6 @@ sdkconfig SDKs SDKTARGETSYSROOT sdl -SecKey -SecKeyCreateWithData SecureCertDACProvider SED SEGGER @@ -1292,7 +1217,6 @@ sendto seqdiag SERIALDEVICE SerialNumber -serverInitParamsProvider ServiceId SetDns SetImageProcessorDelegate @@ -1302,10 +1226,8 @@ setpin setpoint SetpointRaiseLower SetRequestorInstance -setupPasscode SetUpPINCode SetupQRCode -SetValue sexualized sfv SHA @@ -1322,7 +1244,6 @@ SimpleFileExFlags SimpleLink SiWx sizedb -sizeof sl SLAAC SLTB @@ -1419,7 +1340,6 @@ TestGenExample TestGroupDemoConfig TestMultiRead TestName -TestOnlyCommissionableDataProvider TESTPASSWD TestPICS TESTSSID @@ -1510,7 +1430,6 @@ unfocus Unicast UniFlash UnitLocalization -Unmanaged unpair unprovisioned Unsecure @@ -1549,8 +1468,6 @@ venv ver Verifier Verifiers -VerifyOrDie -VerifyOrReturnValue VID vids virtualenv @@ -1647,6 +1564,4 @@ zephyrproject zhengyaohan Zigbee zigbeealliance -zigbeethread -PIXIT -RVC \ No newline at end of file +zigbeethread \ No newline at end of file diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 0597a844badf92..35b5628351b8e6 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -64,31 +64,31 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-chip-tool build" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - name: Build Android arm-tv-casting-app run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-tv-casting-app build" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar - name: Build Android arm-tv-server run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm-tv-server build" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar - name: Build Android arm64-tv-casting-app run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/tv-casting-app/android/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - name: Build Android arm64-tv-server run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-server build" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar - name: Build Android arm64-chip-tool run: | ./scripts/run_in_build_env.sh \ @@ -98,7 +98,7 @@ jobs: ./scripts/run_in_build_env.sh \ "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar # - name: Build Android Studio build (arm64 only) # run: | # ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 189d91b2197546..7dca5c975bb36e 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -58,12 +58,16 @@ jobs: ./scripts/run_in_build_env.sh \ "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" - name: Clean out build output - run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* + run: rm -rf ./out examples/android/CHIPTool/app/libs/jniLibs/* examples/android/CHIPTool/app/libs/*.jar - name: Build Android arm64-tv-casting-app run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" + - name: Clean out build output + run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar - name: Build Android arm64-tv-server run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-server build" + - name: Clean out build output + run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7d4ae2bfbe2b46..2274cd3a30872f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -184,7 +184,7 @@ jobs: " - name: Build Apps run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv --include_yamltests' + scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv' ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \ diff --git a/.gitmodules b/.gitmodules index 6a98ceb1c26ec4..b5d7c5dc253ca2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -322,6 +322,5 @@ [submodule "third_party/st/STM32CubeWB"] path = third_party/st/STM32CubeWB url = https://github.com/STMicroelectronics/STM32CubeWB.git - branch = v1.17.0 - platform = stm32 - + branch = v1.17.0 + platforms = stm32 diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index d8312e18c62f3e..9933e961ffbfb5 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -261,4 +261,45 @@ config OPENTHREAD_EXTERNAL_HEAP config GETOPT_LONG default y +# Disable not used shell modules + +config SHELL_WILDCARD + default n + +config SHELL_VT100_COLORS + default n + +config SHELL_STATS + default n + +config KERNEL_SHELL + default n + +config SENSOR_SHELL + default n + +config DEVICE_SHELL + default n + +config DATE_SHELL + default n + +config DEVMEM_SHELL + default n + +config MCUBOOT_SHELL + default n + +config FLASH_SHELL + default n + +config HWINFO_SHELL + default n + +config PWM_SHELL + default n + +config OPENTHREAD_SHELL + default n + endif diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index aed1407429aacc..b32bc2f642afd5 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 99f4e03632f489..4b5bef308bf47c 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 @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index e6858070f9c11e..29b2c68c9592ca 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/android/CHIPTest/app/build.gradle b/examples/android/CHIPTest/app/build.gradle index 8e3762408147ea..e7aa3be805d55f 100644 --- a/examples/android/CHIPTest/app/build.gradle +++ b/examples/android/CHIPTest/app/build.gradle @@ -8,7 +8,7 @@ println 'matterBuildSrcDir='+matterBuildSrcDir println 'matterUTestLib='+matterUTestLib android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.3" ndkPath System.getenv("ANDROID_NDK_HOME") @@ -77,4 +77,4 @@ dependencies { testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} \ No newline at end of file +} diff --git a/examples/android/CHIPTool/chip-library/build.gradle b/examples/android/CHIPTool/chip-library/build.gradle index 429577ee6060aa..5c18949b2a7cb7 100644 --- a/examples/android/CHIPTool/chip-library/build.gradle +++ b/examples/android/CHIPTool/chip-library/build.gradle @@ -5,7 +5,7 @@ plugins { apply from: "../../../../third_party/android_deps/android_deps.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { minSdkVersion 24 diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 5111e370e1a985..71b7791d3c4a01 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 05dc8ef9696a65..f560c771f59393 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index d047d19cf62177..6635935a84d117 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 935fe575f95dd9..ae21196a30953f 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 6cb07c0bc2364f..76afa694bb33fb 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum DelayedAllOffEffectVariantEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 0bb886f9804e4a..1bc3ed413ecda7 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index dfdf48097d8871..25402566d5e360 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 6f350800db93f9..222682b18b083c 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 9b34dea09793a6..b752b02d5769c6 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 54584bea85dfe8..f48f36451129eb 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 738dffa4521ed6..a97091df8dc683 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 8b17e4eb415bf6..2749f6b4423392 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index fc2d8466dac9d4..3425f449179ad8 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index d140d844339064..b5491547cf79aa 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 78a6e2871e3e20..1a59a41d817ff4 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 1683218696d69e..8a66414808175d 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 4284111ef34f11..ac2cd94a298b9b 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index b4d210ca10357f..b2204465318bf0 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 4397a34688c88e..0613fc37f755ad 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 0ea88c693193ac..420e328187f2a8 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 6b2dcdab7f8581..df9db80c1080c7 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index c607ab395a9581..49df479ae9653b 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index afe7fc7aed327f..d41712e737ee06 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 9b474971040bae..fcb40893dd7e3e 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index ed927511f501a9..c4022bb1a01e54 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 23069ca02f6a43..2303aa4c0c70a1 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index be757b542b1c20..2945ee6e8c58dc 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index f9ccfdc9f07097..7fc13a5a1aa413 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 7f841620035687..a197a0af47133b 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index eb67e68af1954c..f835984d9cf5ef 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index f9519fee3c5b46..5234c44c59d173 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index a68e13deb32468..464bc8a3905235 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 20aedc8f59562a..444e7a12872270 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index feefec055ee7f2..0f09001fdb5bef 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -92,6 +92,8 @@ target_sources(app PRIVATE ${CHEF}/nrfconnect/main.cpp ${CHEF}/common/stubs.cpp ${CHEF}/common/chef-channel-manager.cpp + ${CHEF}/common/chef-air-quality.cpp + ${CHEF}/common/chef-concentration-measurement.cpp ${CHEF}/common/chef-rvc-mode-delegate.cpp ${CHEF}/common/chef-rvc-operational-state-delegate.cpp ) diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 3a3d89a3d60f10..a3c80032573b25 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 3d53b4ac173568..d3d9dcb2f04581 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -53,6 +53,9 @@ "Test_AddNewFabricFromExistingFabric", "Disabled because darwin-framework-tool does not support EqualityCommands pseudo-cluster", "Test_TC_TCCM_3_1", - "Test_TC_TCTL_2_1" + "Test_TC_TCTL_2_1", + "Disabled because darwin-framework-tool does not support constraints arithmetic operations", + "Test_TC_FLW_2_1", + "Test_TC_RH_2_1" ] } diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 5374c1f6f53af2..45543e7c7fb677 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 5bc18df102f218..faea21aea6a5fc 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 @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 3c9d19ebb931fa..0a5e4b343560da 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index cf72c88dfbd1e8..ee7b61209d19af 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 82bf340ab3ff40..99edc71fdff2a2 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 0a5a81e6156137..dd21ff69f24b6b 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 26175dc20230e7..7b773be3ddf524 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index e6fff86a3fc409..3118ca16d5dbdf 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index aa115f0d2f7f4a..227c72d986bf53 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index b4d06928893147..2d6ba3b041704c 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 51d3ca92d6df48..94fcf03083ef2c 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index ab94389c823e9a..b0937e65bc771b 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 66432c88ff824a..0a3cd720726449 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 5f58a971cb2ac8..2602033540ac6a 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 8a57b436acf377..8b234b1f09991e 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 44664ec830b86d..f3f0d45332b626 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app1/ciTests.json b/examples/placeholder/linux/apps/app1/ciTests.json index 66abad400a442f..63ba1ad875563c 100644 --- a/examples/placeholder/linux/apps/app1/ciTests.json +++ b/examples/placeholder/linux/apps/app1/ciTests.json @@ -14,7 +14,6 @@ "Test_TC_CC_7_5_Simulated", "Test_TC_CC_9_4_Simulated", "Test_TC_DGTHREAD_3_4_Simulated", - "Test_TC_LVL_2_3_Simulated", "Test_TC_OO_3_2_Simulated" ], "collection": ["Test"] diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index e0c658d8c7f27d..e47fdb1cb39a1e 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 6b12e603a9780d..002a70ca922eca 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/platform/asr/init_asrPlatform.cpp b/examples/platform/asr/init_asrPlatform.cpp index 2992015c1abd97..d54cdd2a3530a9 100755 --- a/examples/platform/asr/init_asrPlatform.cpp +++ b/examples/platform/asr/init_asrPlatform.cpp @@ -140,6 +140,9 @@ void init_asrPlatform(void) // ota roll back,just for flash_remapping ota_roll_back_pro(); + // disable wdg + ota_wdg_disable(); + // register uart for printf log, the used uart should be init before. printf_uart_register(LEGA_UART1_INDEX); // register uart for at log, the used uart should be init before. @@ -161,6 +164,11 @@ void init_asrPlatform(void) #if defined CFG_PLF_RV32 || defined CFG_PLF_DUET lega_wlan_efuse_read(); +#ifdef CFG_PLF_DUET + // set certifacation type before rf init, param 0x00 is old srrc, 0x10 is new srrc + lega_wlan_set_cert_type(0x00); +#endif + lega_sram_rf_pta_init(); lega_recovery_phy_fsm_config(); diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index b1a6ba1c9fe095..d272e6d299d5d6 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 3c87212a10cd6a..9d6e0ac97c4dfd 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 3c87212a10cd6a..9d6e0ac97c4dfd 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index c94f2234a4a9a2..6d3bd4bc983153 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 @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 06ea2bbd2c184c..e23f1f5572c1e8 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index 60ebc011244e03..40769a4e8623ae 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index a337abfc3f47f2..a0dd73982acf36 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp index d450a635e2e978..da7a8bcccbd262 100644 --- a/examples/rvc-app/rvc-common/src/rvc-device.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -13,6 +13,7 @@ void RvcDevice::SetDeviceToIdleState() { if (mCharging) { + mDocked = true; mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)); } else if (mDocked) @@ -44,6 +45,8 @@ void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::Ch return; } + mCharging = false; + mDocked = false; mRunModeInstance.UpdateCurrentMode(newMode); mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); response.status = to_underlying(ModeBase::StatusCode::kSuccess); diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 4ad4b30b4c9b89..7e9812625b7fbe 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index e0e990bbe3e8da..fa0943bb98bf71 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index e48a17032a5491..2cf173233532b6 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 7ab6da7482e14c..a3d2f0a8901e91 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum DelayedAllOffEffectVariantEnum : ENUM8 { diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index 2e9ecc191eb0a8..8a6212540be2f2 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -51,11 +51,11 @@ The steps to start a casting session are: 1. [Discover](#discover-casting-players) `CastingPlayer` devices using Matter Commissioner discovery. 1. [Connect](#connect-to-a-casting-player) to the `CastingPlayer` to discover - available endpoints. By connecting, the 'CastingClient' will send a User - Directed Commissioning (UDC) request to the 'CastingPlayer' device in order - to make a Matter commissioning request. The 'CastingPlayer' will then obtain - the appropriate user consent to allow a connection from this 'CastingClient' - and obtain the setup code needed to commission the 'CastingClient'. The setup + available endpoints. By connecting, the `CastingClient` will send a User + Directed Commissioning (UDC) request to the `CastingPlayer` device in order + to make a Matter commissioning request. The `CastingPlayer` will then obtain + the appropriate user consent to allow a connection from this `CastingClient` + and obtain the setup code needed to commission the `CastingClient`. The setup code will typically come from a corresponding TV content app or be input by the user. 1. [Select](#select-an-endpoint-on-the-casting-player) an available `Endpoint` @@ -82,7 +82,7 @@ _{Complete Initialization examples: [Linux](linux/simple-app.cpp) | | [iOS](darwin/TvCasting/TvCasting/MTRInitializationExample.swift)}_ A Casting Client must first initialize the Matter SDK and define the following -"DataProvider" objects for the the Matter Casting library to use throughout the +`DataProvider` objects for the the Matter Casting library to use throughout the client's lifecycle: 1. **Rotating Device Identifier** - Refer to the Matter specification for @@ -91,10 +91,10 @@ client's lifecycle: Then, instantiate a `DataProvider` object as described below. On Linux, define a `RotatingDeviceIdUniqueIdProvider` to provide the Casting - Client's RotatingDeviceIdUniqueId, by implementing a + Client's `RotatingDeviceIdUniqueId`, by implementing a `matter:casting::support::MutableByteSpanDataProvider`: - ```c++ + ```c class RotatingDeviceIdUniqueIdProvider : public MutableByteSpanDataProvider { private: chip::MutableByteSpan rotatingDeviceIdUniqueIdSpan; @@ -114,7 +114,7 @@ client's lifecycle: ``` On Android, define a `rotatingDeviceIdUniqueIdProvider` to provide the - Casting Client's RotatingDeviceIdUniqueId, by implementing a + Casting Client's `RotatingDeviceIdUniqueId`, by implementing a `com.matter.casting.support.DataSource`: ```java @@ -146,16 +146,16 @@ client's lifecycle: ``` 2. **Commissioning Data** - This object contains the passcode, discriminator, - etc which identify the app and are provided to the CastingPlayer during the - commissioning process. Refer to the Matter specification's + etc which identify the app and are provided to the `CastingPlayer` during + the commissioning process. Refer to the Matter specification's [Onboarding Payload](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/qr_code/OnboardingPayload.adoc#ref_OnboardingPayload) section for details on commissioning data. On Linux, define a function `InitCommissionableDataProvider` to initialize initialize a `LinuxCommissionableDataProvider` that can provide the required - values to the CastingApp. + values to the `CastingApp`. - ```c++ + ```c CHIP_ERROR InitCommissionableDataProvider(LinuxCommissionableDataProvider & provider, LinuxDeviceOptions & options) { chip::Optional setupPasscode; @@ -179,7 +179,7 @@ client's lifecycle: ``` On Android, define a `commissioningDataProvider` that can provide the - required values to the CastingApp. + required values to the `CastingApp`. ```java private static final DataProvider commissionableDataProvider = @@ -270,7 +270,7 @@ client's lifecycle: `castingAppDidReceiveRequestForDeviceAttestationCredentials` and `didReceiveRequestToSignCertificateRequest` to the `MTRAppParametersDataSource` class defined above, that can return - MTRDeviceAttestationCredentials and sign messages for the Casting Client, + `MTRDeviceAttestationCredentials` and sign messages for the Casting Client, respectively. ```objectivec @@ -312,12 +312,12 @@ initialize the Casting App as described below. Note: When you initialize the Casting client, make sure your code initializes it only once, before it starts a Matter casting session. -On Linux, create an AppParameters object using the +On Linux, create an `AppParameters` object using the `RotatingDeviceIdUniqueIdProvider`, `LinuxCommissionableDataProvider`, `CommonCaseDeviceServerInitParamsProvider`, `ExampleDACProvider` and `DefaultDACVerifier`, and call `CastingApp::GetInstance()->Initialize` with it. -```c++ +```c LinuxCommissionableDataProvider gCommissionableDataProvider; int main(int argc, char * argv[]) { // Create AppParameters that need to be passed to CastingApp.Initialize() @@ -351,7 +351,7 @@ int main(int argc, char * argv[]) { } ``` -On Android, create an AppParameters object using the +On Android, create an `AppParameters` object using the `rotatingDeviceIdUniqueIdProvider`, `commissioningDataProvider`, `dacProvider` and `DataProvider`, and call `CastingApp.getInstance().initialize` with it. @@ -408,13 +408,13 @@ func initialize() -> MatterError { _{Complete Discovery examples: [Linux](linux/simple-app.cpp)}_ The Casting Client discovers `CastingPlayers` using Matter Commissioner -discovery over DNS-SD by listening for CastingPlayer events as they are +discovery over DNS-SD by listening for `CastingPlayer` events as they are discovered, updated, or lost from the network. On Linux, define a `DiscoveryDelegateImpl` that implements the `matter::casting::core::DiscoveryDelegate`. -```c++ +```c class DiscoveryDelegateImpl : public DiscoveryDelegate { private: int commissionersCount = 0; @@ -439,11 +439,11 @@ public: Finally, register these listeners and start discovery. On Linux, register an instance of the `DiscoveryDelegateImpl` with -`matter::casting::core::CastingPlayerDiscovery` by calling SetDelegate on its +`matter::casting::core::CastingPlayerDiscovery` by calling `SetDelegate` on its singleton instance. Then, call `StartDiscovery` by optionally specifying the `kTargetPlayerDeviceType` to filter results by. -```c++ +```c DiscoveryDelegateImpl delegate; CastingPlayerDiscovery::GetInstance()->SetDelegate(&delegate); VerifyOrReturnValue(err == CHIP_NO_ERROR, 0, 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 e4b0b8b25d0d42..66280a2817fde8 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 @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 78ca16545266ff..b531606023c6aa 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 83a0cb11131a9f..91ba6208dd6b53 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/scripts/build_python.sh b/scripts/build_python.sh index e0fa8303f72403..6965cecad3dd6f 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -68,7 +68,6 @@ Input Options: src/python_testing scripts. Defaults to yes. --extra_packages PACKAGES Install extra Python packages from PyPI - --include_yamltests Whether to install the matter_yamltests wheel. -z --pregen_dir DIRECTORY Directory where generated zap files have been pre-generated. " } @@ -129,9 +128,6 @@ while (($#)); do extra_packages=$2 shift ;; - --include_yamltests) - include_yamltests="yes" - ;; --pregen_dir | -z) pregen_dir=$2 shift @@ -187,15 +183,6 @@ else WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl) fi -if [ -n "$include_yamltests" ]; then - YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel" - - # Add wheels from pw_python_package or pw_python_distribution templates. - WHEEL+=( - "$(ls -tr "$(wheel_output_dir "$YAMLTESTS_GN_LABEL")"/*.whl | head -n 1)" - ) -fi - if [ -n "$extra_packages" ]; then WHEEL+=("$extra_packages") fi @@ -217,7 +204,14 @@ if [ -n "$install_virtual_env" ]; then "$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${WHEEL[@]}" if [ "$install_pytest_requirements" = "yes" ]; then + YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel" + # Add wheels from pw_python_package or pw_python_distribution templates. + YAMLTEST_WHEEL=( + "$(ls -tr "$(wheel_output_dir "$YAMLTESTS_GN_LABEL")"/*.whl | head -n 1)" + ) + echo_blue "Installing python test dependencies ..." + "$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${YAMLTEST_WHEEL[@]}" "$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/scripts/tests/requirements.txt" "$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/src/python_testing/requirements.txt" fi diff --git a/scripts/py_matter_idl/matter_idl/backwards_compatibility.py b/scripts/py_matter_idl/matter_idl/backwards_compatibility.py index 8ecf45afc26eb8..36898f1029849b 100644 --- a/scripts/py_matter_idl/matter_idl/backwards_compatibility.py +++ b/scripts/py_matter_idl/matter_idl/backwards_compatibility.py @@ -97,7 +97,8 @@ def _check_field_lists_are_the_same(self, location: str, original: List[Field], def _check_enum_compatible(self, cluster_name: str, original: Enum, updated: Optional[Enum]): if not updated: - self._mark_incompatible(f"Enumeration {cluster_name}::{original.name} was deleted") + self._mark_incompatible( + f"Enumeration {cluster_name}::{original.name} was deleted") return if original.base_type != updated.base_type: @@ -107,16 +108,19 @@ def _check_enum_compatible(self, cluster_name: str, original: Enum, updated: Opt # Validate that all old entries exist for entry in original.entries: # old entry must exist and have identical code - existing = [item for item in updated.entries if item.name == entry.name] + existing = [ + item for item in updated.entries if item.name == entry.name] if len(existing) == 0: - self._mark_incompatible(f"Enumeration {cluster_name}::{original.name} removed entry {entry.name}") + self._mark_incompatible( + f"Enumeration {cluster_name}::{original.name} removed entry {entry.name}") elif existing[0].code != entry.code: self._mark_incompatible( f"Enumeration {cluster_name}::{original.name} changed code for entry {entry.name} from {entry.code} to {existing[0].code}") def _check_bitmap_compatible(self, cluster_name: str, original: Bitmap, updated: Optional[Bitmap]): if not updated: - self._mark_incompatible(f"Bitmap {cluster_name}::{original.name} was deleted") + self._mark_incompatible( + f"Bitmap {cluster_name}::{original.name} was deleted") return if original.base_type != updated.base_type: @@ -126,27 +130,33 @@ def _check_bitmap_compatible(self, cluster_name: str, original: Bitmap, updated: # Validate that all old entries exist for entry in original.entries: # old entry must exist and have identical code - existing = [item for item in updated.entries if item.name == entry.name] + existing = [ + item for item in updated.entries if item.name == entry.name] if len(existing) == 0: - self._mark_incompatible(f"Bitmap {original.name} removed entry {entry.name}") + self._mark_incompatible( + f"Bitmap {original.name} removed entry {entry.name}") elif existing[0].code != entry.code: self._mark_incompatible( f"Bitmap {original.name} changed code for entry {entry.name} from {entry.code} to {existing[0].code}") def _check_event_compatible(self, cluster_name: str, event: Event, updated_event: Optional[Event]): if not updated_event: - self._mark_incompatible(f"Event {cluster_name}::{event.name} was removed") + self._mark_incompatible( + f"Event {cluster_name}::{event.name} was removed") return if event.code != updated_event.code: - self._mark_incompatible(f"Event {cluster_name}::{event.name} code changed from {event.code} to {updated_event.code}") + self._mark_incompatible( + f"Event {cluster_name}::{event.name} code changed from {event.code} to {updated_event.code}") - self._check_field_lists_are_the_same(f"Event {cluster_name}::{event.name}", event.fields, updated_event.fields) + self._check_field_lists_are_the_same( + f"Event {cluster_name}::{event.name}", event.fields, updated_event.fields) def _check_command_compatible(self, cluster_name: str, command: Command, updated_command: Optional[Command]): self.logger.debug(f" Checking command {cluster_name}::{command.name}") if not updated_command: - self._mark_incompatible(f"Command {cluster_name}::{command.name} was removed") + self._mark_incompatible( + f"Command {cluster_name}::{command.name} was removed") return if command.code != updated_command.code: @@ -168,49 +178,62 @@ def _check_command_compatible(self, cluster_name: str, command: Command, updated def _check_struct_compatible(self, cluster_name: str, original: Struct, updated: Optional[Struct]): self.logger.debug(f" Checking struct {original.name}") if not updated: - self._mark_incompatible(f"Struct {cluster_name}::{original.name} has been deleted.") + self._mark_incompatible( + f"Struct {cluster_name}::{original.name} has been deleted.") return - self._check_field_lists_are_the_same(f"Struct {cluster_name}::{original.name}", original.fields, updated.fields) + self._check_field_lists_are_the_same( + f"Struct {cluster_name}::{original.name}", original.fields, updated.fields) if original.tag != updated.tag: - self._mark_incompatible(f"Struct {cluster_name}::{original.name} has modified tags") + self._mark_incompatible( + f"Struct {cluster_name}::{original.name} has modified tags") if original.code != updated.code: - self._mark_incompatible(f"Struct {cluster_name}::{original.name} has modified code (likely resnopse difference)") + self._mark_incompatible( + f"Struct {cluster_name}::{original.name} has modified code (likely resnopse difference)") if original.qualities != updated.qualities: - self._mark_incompatible(f"Struct {cluster_name}::{original.name} has modified qualities") + self._mark_incompatible( + f"Struct {cluster_name}::{original.name} has modified qualities") def _check_attribute_compatible(self, cluster_name: str, original: Attribute, updated: Optional[Attribute]): - self.logger.debug(f" Checking attribute {cluster_name}::{original.definition.name}") + self.logger.debug( + f" Checking attribute {cluster_name}::{original.definition.name}") if not updated: - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} has been deleted.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} has been deleted.") return if original.definition.code != updated.definition.code: - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} changed its code.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} changed its code.") if original.definition.data_type != updated.definition.data_type: - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} changed its data type.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} changed its data type.") if original.definition.is_list != updated.definition.is_list: - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} changed its list status.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} changed its list status.") if original.definition.qualities != updated.definition.qualities: # optional/nullable - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} changed its data type qualities.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} changed its data type qualities.") if original.qualities != updated.qualities: # read/write/subscribe/timed status - self._mark_incompatible(f"Attribute {cluster_name}::{original.definition.name} changed its qualities.") + self._mark_incompatible( + f"Attribute {cluster_name}::{original.definition.name} changed its qualities.") def _check_enum_list_compatible(self, cluster_name: str, original: List[Enum], updated: List[Enum]): updated_enums = group_list_by_name(updated) for original_enum in original: updated_enum = updated_enums.get(original_enum.name) - self._check_enum_compatible(cluster_name, original_enum, updated_enum) + self._check_enum_compatible( + cluster_name, original_enum, updated_enum) def _check_bitmap_list_compatible(self, cluster_name: str, original: List[Bitmap], updated: List[Bitmap]): updated_bitmaps = {} @@ -219,20 +242,23 @@ def _check_bitmap_list_compatible(self, cluster_name: str, original: List[Bitmap for original_bitmap in original: updated_bitmap = updated_bitmaps.get(original_bitmap.name) - self._check_bitmap_compatible(cluster_name, original_bitmap, updated_bitmap) + self._check_bitmap_compatible( + cluster_name, original_bitmap, updated_bitmap) def _check_struct_list_compatible(self, cluster_name: str, original: List[Struct], updated: List[Struct]): updated_structs = group_list_by_name(updated) for struct in original: - self._check_struct_compatible(cluster_name, struct, updated_structs.get(struct.name)) + self._check_struct_compatible( + cluster_name, struct, updated_structs.get(struct.name)) def _check_command_list_compatible(self, cluster_name: str, original: List[Command], updated: List[Command]): updated_commands = group_list_by_name(updated) for command in original: updated_command = updated_commands.get(command.name) - self._check_command_compatible(cluster_name, command, updated_command) + self._check_command_compatible( + cluster_name, command, updated_command) def _check_event_list_compatible(self, cluster_name: str, original: List[Event], updated: List[Event]): updated_events = group_list_by_name(updated) @@ -245,39 +271,48 @@ def _check_attribute_list_compatible(self, cluster_name: str, original: List[Att updated_attributes = group_list(updated, attribute_name) for attribute in original: - self._check_attribute_compatible(cluster_name, attribute, updated_attributes.get(attribute_name(attribute))) + self._check_attribute_compatible( + cluster_name, attribute, updated_attributes.get(attribute_name(attribute))) def _check_cluster_list_compatible(self, original: List[Cluster], updated: List[Cluster]): updated_clusters = group_list(updated, full_cluster_name) for original_cluster in original: - updated_cluster = updated_clusters.get(full_cluster_name(original_cluster)) + updated_cluster = updated_clusters.get( + full_cluster_name(original_cluster)) self._check_cluster_compatible(original_cluster, updated_cluster) def _check_cluster_compatible(self, original_cluster: Cluster, updated_cluster: Optional[Cluster]): - self.logger.debug(f"Checking cluster {full_cluster_name(original_cluster)}") + self.logger.debug( + f"Checking cluster {full_cluster_name(original_cluster)}") if not updated_cluster: - self._mark_incompatible(f"Cluster {full_cluster_name(original_cluster)} was deleted") + self._mark_incompatible( + f"Cluster {full_cluster_name(original_cluster)} was deleted") return if original_cluster.code != updated_cluster.code: self._mark_incompatible( f"Cluster {full_cluster_name(original_cluster)} has different codes {original_cluster.code} != {updated_cluster.code}") - self._check_enum_list_compatible(original_cluster.name, original_cluster.enums, updated_cluster.enums) - self._check_struct_list_compatible(original_cluster.name, original_cluster.structs, updated_cluster.structs) - self._check_bitmap_list_compatible(original_cluster.name, original_cluster.bitmaps, updated_cluster.bitmaps) - self._check_command_list_compatible(original_cluster.name, original_cluster.commands, updated_cluster.commands) - self._check_event_list_compatible(original_cluster.name, original_cluster.events, updated_cluster.events) - self._check_attribute_list_compatible(original_cluster.name, original_cluster.attributes, updated_cluster.attributes) + self._check_enum_list_compatible( + original_cluster.name, original_cluster.enums, updated_cluster.enums) + self._check_struct_list_compatible( + original_cluster.name, original_cluster.structs, updated_cluster.structs) + self._check_bitmap_list_compatible( + original_cluster.name, original_cluster.bitmaps, updated_cluster.bitmaps) + self._check_command_list_compatible( + original_cluster.name, original_cluster.commands, updated_cluster.commands) + self._check_event_list_compatible( + original_cluster.name, original_cluster.events, updated_cluster.events) + self._check_attribute_list_compatible( + original_cluster.name, original_cluster.attributes, updated_cluster.attributes) def check(self): # assume ok, and then validate self.compatible = Compatibility.COMPATIBLE - self._check_enum_list_compatible("", self._original_idl.enums, self._updated_idl.enums) - self._check_struct_list_compatible("", self._original_idl.structs, self._updated_idl.structs) - self._check_cluster_list_compatible(self._original_idl.clusters, self._updated_idl.clusters) + self._check_cluster_list_compatible( + self._original_idl.clusters, self._updated_idl.clusters) return self.compatible diff --git a/scripts/py_matter_idl/matter_idl/generators/types.py b/scripts/py_matter_idl/matter_idl/generators/types.py index c5428a92ff6636..29d496b48315bb 100644 --- a/scripts/py_matter_idl/matter_idl/generators/types.py +++ b/scripts/py_matter_idl/matter_idl/generators/types.py @@ -295,16 +295,14 @@ def find_bitmap(self, name) -> Optional[matter_idl_types.Bitmap]: @property def all_enums(self): """ - All enumerations, ordered by lookup priority. + All enumerations defined within this lookup context. - If an enum A is defined both in the cluster and globally, this WILL - return both instances, however it will return the cluster version first. + enums are only defined at cluster level. If lookup context does not + include a cluster, the enum list will be empty. """ if self.cluster: for e in self.cluster.enums: yield e - for e in self.idl.enums: - yield e @property def all_bitmaps(self): @@ -312,7 +310,7 @@ def all_bitmaps(self): All bitmaps defined within this lookup context. bitmaps are only defined at cluster level. If lookup context does not - include a cluster, the bitmal list will be empty. + include a cluster, the bitmap list will be empty. """ if self.cluster: for b in self.cluster.bitmaps: @@ -320,16 +318,14 @@ def all_bitmaps(self): @property def all_structs(self): - """All structs, ordered by lookup prioroty. + """All structs defined within this lookup context. - If a struct A is defined both in the cluster and globally, this WILL - return both instances, however it will return the cluster version first. + structs are only defined at cluster level. If lookup context does not + include a cluster, the struct list will be empty. """ if self.cluster: for e in self.cluster.structs: yield e - for e in self.idl.structs: - yield e def is_enum_type(self, name: str): """ diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 6116e7cbf08071..03f17472f4c077 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -102,7 +102,7 @@ POSITIVE_INTEGER: /\d+/ HEX_INTEGER: /0x[A-Fa-f0-9]+/ ID: /[a-zA-Z_][a-zA-Z0-9_]*/ -idl: (struct|enum|cluster|endpoint)* +idl: (cluster|endpoint)* %import common.ESCAPED_STRING %import common.WS diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index f4ba7059bf605d..45e180c65c5a88 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -474,21 +474,18 @@ def cluster(self, meta, side, name, code, *content): return result def idl(self, items): - idl = Idl() + clusters = [] + endpoints = [] for item in items: - if type(item) == Enum: - idl.enums.append(item) - elif type(item) == Struct: - idl.structs.append(item) - elif type(item) == Cluster: - idl.clusters.append(item) + if type(item) == Cluster: + clusters.append(item) elif type(item) == Endpoint: - idl.endpoints.append(item) + endpoints.append(item) else: raise Exception("UNKNOWN idl content item: %r" % item) - return idl + return Idl(clusters=clusters, endpoints=endpoints) def prefix_doc_comment(self): print("TODO: prefix") diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index 3a680058c5e24d..56886abb91d903 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -266,9 +266,6 @@ class Endpoint: @dataclass class Idl: - # Enums and structs represent globally used items - enums: List[Enum] = field(default_factory=list) - structs: List[Struct] = field(default_factory=list) clusters: List[Cluster] = field(default_factory=list) endpoints: List[Endpoint] = field(default_factory=list) diff --git a/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py b/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py index f50c4f06b03684..0c002410fd1261 100755 --- a/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py +++ b/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py @@ -77,10 +77,12 @@ def ValidateUpdate(self, name: str, old: str, new: str, flags: Compatibility): with self.subTest(validate=name): # Validate compatibility and that no changes are always compatible with self.subTest(direction="Forward"): - self._AssumeCompatiblity(old, new, old_idl, new_idl, Compatibility.FORWARD_FAIL not in flags) + self._AssumeCompatiblity( + old, new, old_idl, new_idl, Compatibility.FORWARD_FAIL not in flags) with self.subTest(direction="Backward"): - self._AssumeCompatiblity(new, old, new_idl, old_idl, Compatibility.BACKWARD_FAIL not in flags) + self._AssumeCompatiblity( + new, old, new_idl, old_idl, Compatibility.BACKWARD_FAIL not in flags) with self.subTest(direction="NEW-to-NEW"): self._AssumeCompatiblity(new, new, new_idl, new_idl, True) @@ -88,54 +90,40 @@ def ValidateUpdate(self, name: str, old: str, new: str, flags: Compatibility): with self.subTest(direction="OLD-to-OLD"): self._AssumeCompatiblity(old, old, old_idl, old_idl, True) - def test_top_level_enums_delete(self): - self.ValidateUpdate( - "delete a top level enum", - "enum A: ENUM8{} enum B: ENUM8{}", - "enum A: ENUM8{}", - Compatibility.FORWARD_FAIL) - - def test_top_level_enums_change(self): + def test_basic_clusters_enum(self): self.ValidateUpdate( - "change an enum type", - "enum A: ENUM8{}", - "enum A: ENUM16{}", - Compatibility.FORWARD_FAIL | Compatibility.BACKWARD_FAIL) + "Adding an enum is ok. Also validates code formatting", + "server cluster A = 16 {}", + "server cluster A = 0x10 { enum X : ENUM8 {} }", + Compatibility.BACKWARD_FAIL) - def test_top_level_enums_add_remove(self): + def test_clusters_enum_add_remove(self): self.ValidateUpdate( - "Adding enum values is ok, removing values is not", - "enum A: ENUM8 {A = 1; B = 2;}", - "enum A: ENUM8 {A = 1; }", + "Adding an enum is ok. Also validates code formatting", + "server cluster A = 16 { enum X : ENUM8 { A = 1; B = 2; }}", + "server cluster A = 16 { enum X : ENUM8 { A = 1; }}", Compatibility.FORWARD_FAIL) - def test_top_level_enums_code(self): - self.ValidateUpdate( - "Switching enum codes is never ok", - "enum A: ENUM8 {A = 1; B = 2; }", - "enum A: ENUM8 {A = 1; B = 3; }", - Compatibility.FORWARD_FAIL | Compatibility.BACKWARD_FAIL) - - def test_basic_clusters_code(self): + def test_clusters_enum_code(self): self.ValidateUpdate( - "Switching cluster codes is never ok", - "client cluster A = 1 {}", - "client cluster A = 2 {}", + "Adding an enum is ok. Also validates code formatting", + "server cluster A = 16 { enum X : ENUM8 { A = 1; B = 2; }}", + "server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; }}", Compatibility.FORWARD_FAIL | Compatibility.BACKWARD_FAIL) - def test_basic_clusters_remove(self): + def test_clusters_enum_delete(self): self.ValidateUpdate( - "Removing a cluster is not ok", - "client cluster A = 1 {} client cluster B = 2 {}", - "client cluster A = 1 {}", + "Adding an enum is ok. Also validates code formatting", + "server cluster A = 16 { enum X : ENUM8 {}}", + "server cluster A = 16 { }", Compatibility.FORWARD_FAIL) - def test_basic_clusters_enum(self): + def test_clusters_enum_change(self): self.ValidateUpdate( "Adding an enum is ok. Also validates code formatting", - "server cluster A = 16 {}", - "server cluster A = 0x10 { enum X : ENUM8 {} }", - Compatibility.BACKWARD_FAIL) + "server cluster A = 16 { enum X : ENUM16 {}}", + "server cluster A = 16 { enum X : ENUM8 {}}", + Compatibility.FORWARD_FAIL | Compatibility.BACKWARD_FAIL) def test_basic_clusters_side(self): self.ValidateUpdate( diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index 2a3cfea87e76b1..0cabc435d54f37 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -29,7 +29,7 @@ from matter_idl.matter_idl_types import (AccessPrivilege, Attribute, AttributeInstantiation, AttributeQuality, AttributeStorage, Bitmap, Cluster, ClusterSide, Command, CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, FieldQuality, Idl, - ParseMetaData, ServerClusterInstantiation, Struct, StructQuality, StructTag) + ParseMetaData, ServerClusterInstantiation, Struct, StructTag) def parseText(txt, skip_meta=True): @@ -51,71 +51,6 @@ def test_skips_comments(self): self.assertEqual(actual, expected) - def test_global_enum(self): - actual = parseText(""" - enum GlobalEnum : ENUM8 { - kValue1 = 1; - kOther = 0x12; /* hex numbers tested sporadically */ - } - """) - - expected = Idl(enums=[ - Enum(name='GlobalEnum', base_type='ENUM8', - entries=[ - ConstantEntry(name="kValue1", code=1), - ConstantEntry(name="kOther", code=0x12), - ])] - ) - self.assertEqual(actual, expected) - - def test_global_struct(self): - actual = parseText(""" - struct Something { - CHAR_STRING astring = 1; - optional CLUSTER_ID idlist[] = 2; - nullable int valueThatIsNullable = 0x123; - char_string<123> sized_string = 222; - } - """) - - expected = Idl(structs=[ - Struct(name='Something', - fields=[ - Field( - data_type=DataType(name="CHAR_STRING"), code=1, name="astring", ), - Field(data_type=DataType(name="CLUSTER_ID"), code=2, name="idlist", - is_list=True, qualities=FieldQuality.OPTIONAL), - Field(data_type=DataType(name="int"), code=0x123, - name="valueThatIsNullable", qualities=FieldQuality.NULLABLE), - Field(data_type=DataType(name="char_string", max_length=123), - code=222, name="sized_string"), - ])] - ) - self.assertEqual(actual, expected) - - def test_fabric_scoped_struct(self): - actual = parseText(""" - fabric_scoped struct FabricStruct { - CHAR_STRING astring = 1; - optional CLUSTER_ID idlist[] = 2; - nullable fabric_sensitive int nullablesensitive = 0x123; - } - """) - - expected = Idl(structs=[ - Struct(name='FabricStruct', - qualities=StructQuality.FABRIC_SCOPED, - fields=[ - Field( - data_type=DataType(name="CHAR_STRING"), code=1, name="astring", ), - Field(data_type=DataType(name="CLUSTER_ID"), code=2, name="idlist", - is_list=True, qualities=FieldQuality.OPTIONAL), - Field(data_type=DataType(name="int"), code=0x123, name="nullablesensitive", - qualities=FieldQuality.NULLABLE | FieldQuality.FABRIC_SENSITIVE), - ])] - ) - self.assertEqual(actual, expected) - def test_cluster_attribute(self): actual = parseText(""" server cluster MyCluster = 0x321 { diff --git a/scripts/py_matter_idl/matter_idl/test_xml_parser.py b/scripts/py_matter_idl/matter_idl/test_xml_parser.py index 6f42ca3c71d6b7..8a845a05e42216 100755 --- a/scripts/py_matter_idl/matter_idl/test_xml_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_xml_parser.py @@ -244,11 +244,6 @@ def testEnum(self): Test110 Test220 - - - - - @@ -262,14 +257,6 @@ def testEnum(self): ''') - e1 = Enum( - name='GlobalEnum', - base_type="ENUM8", - entries=[ - ConstantEntry(name="First", code=0), - ConstantEntry(name="Second", code=1), - ] - ) e2 = Enum( name='OneCluster', base_type="ENUM8", @@ -291,7 +278,6 @@ def testEnum(self): name='Test1', code=10, enums=[e2, e3]), Cluster(side=ClusterSide.CLIENT, name='Test2', code=20, enums=[e3])], - enums=[e1], )) def testStruct(self): diff --git a/scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter b/scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter index bb325d28501d67..447a49a362e1ca 100644 --- a/scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter +++ b/scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter @@ -1,9 +1,9 @@ -struct LabelStruct { - CHAR_STRING<16> label = 0; - CHAR_STRING<16> value = 1; -} - client cluster DemoCluster = 0x12 { + struct LabelStruct { + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; + } + attribute LabelStruct singleLabel = 0x20; attribute LabelStruct someLabels[] = 0x21; } diff --git a/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter b/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter index bd73950bd94dcc..6687139a8cf557 100644 --- a/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter +++ b/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter @@ -1,11 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { kBlink = 0; @@ -1730,12 +1725,21 @@ server cluster GroupKeyManagement = 63 { } server cluster FixedLabel = 64 { + struct LabelStruct { + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; + } readonly attribute LabelStruct labelList[] = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { + struct LabelStruct { + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter b/scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter index c0c8391d6a93c8..4fae3caa9e0aa3 100644 --- a/scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter +++ b/scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter @@ -1,11 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { kBlink = 0; @@ -1418,12 +1413,22 @@ server cluster GroupKeyManagement = 63 { } server cluster FixedLabel = 64 { + struct LabelStruct { + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; + } + readonly attribute LabelStruct labelList[] = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; } server cluster UserLabel = 65 { + struct LabelStruct { + CHAR_STRING<16> label = 0; + CHAR_STRING<16> value = 1; + } + attribute access(write: manage) LabelStruct labelList[] = 0; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index 8150924efe1c4c..477d7f2ff330fa 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -225,19 +225,20 @@ def FinalizeProcessing(self, idl: Idl): # We have two choices of adding a struct: # - inside a cluster if a code exists # - inside top level if no codes were associated - if self._cluster_codes: - for code in self._cluster_codes: - found = False - for c in idl.clusters: - if c.code == code: - c.structs.append(self._struct) - found = True - - if not found: - LOGGER.error('Enum %s could not find cluster (code %d/0x%X)' % - (self._struct.name, code, code)) - else: - idl.structs.append(self._struct) + if not self._cluster_codes: + LOGGER.error('Struct %s has no cluster codes' % self._struct.name) + return + + for code in self._cluster_codes: + found = False + for c in idl.clusters: + if c.code == code: + c.structs.append(self._struct) + found = True + + if not found: + LOGGER.error('Struct %s could not find cluster (code %d/0x%X)' % + (self._struct.name, code, code)) def EndProcessing(self): self.context.AddIdlPostProcessor(self) @@ -269,22 +270,19 @@ def GetNextProcessor(self, name, attrs): return BaseHandler(self.context) def FinalizeProcessing(self, idl: Idl): - # We have two choices of adding an enum: - # - inside a cluster if a code exists - # - inside top level if a code does not exist - if not self._cluster_codes: - idl.enums.append(self._enum) - else: - found = set() - for c in idl.clusters: - if c.code in self._cluster_codes: - c.enums.append(self._enum) - found.add(c.code) + LOGGER.error("Found enum without a cluster code: %s" % + (self._enum.name)) + return + found = set() + for c in idl.clusters: + if c.code in self._cluster_codes: + c.enums.append(self._enum) + found.add(c.code) - if found != self._cluster_codes: - LOGGER.error('Enum %s could not find its clusters (codes: %r)' % - (self._enum.name, self._cluster_codes - found)) + if found != self._cluster_codes: + LOGGER.error('Enum %s could not find its clusters (codes: %r)' % + (self._enum.name, self._cluster_codes - found)) def EndProcessing(self): self.context.AddIdlPostProcessor(self) diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 3bee9a23d046a0..457ebb1d969c91 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -195,6 +195,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "TestClusterMultiFabric.yaml", "Test_TC_ACL_2_5.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884 "Test_TC_ACL_2_6.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884 + "Test_TC_RVCCLEANM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster } diff --git a/scripts/tests/yaml/runner.py b/scripts/tests/yaml/runner.py index 746fc01656f135..87a57c76f296c7 100755 --- a/scripts/tests/yaml/runner.py +++ b/scripts/tests/yaml/runner.py @@ -344,7 +344,10 @@ def chip_repl(parser_group: ParserGroup, adapter: str, stop_on_error: bool, stop runner_hooks = TestRunnerLogger(show_adapter_logs, show_adapter_logs_on_error, use_test_harness_log_format) runner_config = TestRunnerConfig(adapter, parser_group.pseudo_clusters, runner_options, runner_hooks) - runner = __import__(runner, fromlist=[None]).Runner(repl_storage_path, commission_on_network_dut) + node_id_to_commission = None + if commission_on_network_dut: + node_id_to_commission = parser_group.builder_config.parser_config.config_override['nodeId'] + runner = __import__(runner, fromlist=[None]).Runner(repl_storage_path, node_id_to_commission=node_id_to_commission) loop = asyncio.get_event_loop() return loop.run_until_complete(runner.run(parser_group.builder_config, runner_config)) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 646a9aaaa47043..db68712796d160 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -7156,51 +7156,13 @@ PICS: # server / manually # - label: "Does the device support the TemperatureUnit Fahrenheit ?" - id: LUNIT.TempUnit.Fahrenheit + id: LUNIT.S.M.Fahrenheit - label: "Does the device support the TemperatureUnit Celsius ?" - id: LUNIT.TempUnit.Celsius + id: LUNIT.S.M.Celsius - label: "Does the device support the TemperatureUnit Kelvin ?" - id: LUNIT.TempUnit.Kelvin - - # - # client / attributes - # - - label: - "Does the DUT(client) have access privileges for the TemperatureUnit - attribute implemented on the server ?" - id: LUNIT.C.A0000 - - - label: - "Does the DUT(client) have access privileges for the (0xFFF8) - GeneratedCommandList attribute implemented on the server ?" - id: LUNIT.C.Afff8 - - - label: - "Does the DUT(client) have access privileges for the (0xFFF9) - AcceptedCommandList attribute implemented on the server ?" - id: LUNIT.C.Afff9 - - - label: - "Does the DUT(client) have access privileges for the (0xFFFA) - EventList attribute implemented on the server ?" - id: LUNIT.C.Afffa - - - label: - "Does the DUT(client) have access privileges for the (0xFFFB) - AttributeList attribute implemented on the server ?" - id: LUNIT.C.Afffb - - - label: - "Does the DUT(client) have access privileges for the (0xFFFC) - FeatureMap attribute implemented on the server ?" - id: LUNIT.C.Afffc - - - label: - "Does the DUT(client) have access privileges for the (0xFFFD) - ClusterRevision attribute implemented on the server ?" - id: LUNIT.C.Afffd + id: LUNIT.S.M.Kelvin # User Label Cluster Test Plan - label: "Does the device implement the User Label cluster as a server?" @@ -7342,74 +7304,6 @@ PICS: of packets on the ethernet interface." id: DGWIFI.S.F01 - # - # client / attributes - # - - label: - "Does the DUT(client) have access privileges for the BSSID attribute - implemented on the server?" - id: DGWIFI.C.A0000 - - - label: - "Does the DUT(client) have access privileges for the SecurityType - attribute implemented on the server?" - id: DGWIFI.C.A0001 - - - label: - "Does the DUT(client) have access privileges for the WiFiVersion - attribute implemented on the server?" - id: DGWIFI.C.A0002 - - - label: - "Does the DUT(client) have access privileges for the ChannelNumber - attribute implemented on the server?" - id: DGWIFI.C.A0003 - - - label: - "Does the DUT(client) have access privileges for the RSSI attribute - implemented on the server?" - id: DGWIFI.C.A0004 - - - label: - "Does the DUT(client) have access privileges for the BeaconLostCount - attribute implemented on the server?" - id: DGWIFI.C.A0005 - - - label: - "Does the DUT(client) have access privileges for the BeaconRxCount - attribute implemented on the server?" - id: DGWIFI.C.A0006 - - - label: - "Does the DUT(client) have access privileges for the - PacketMulticastRxCount attribute implemented on the server?" - id: DGWIFI.C.A0007 - - - label: - "Does the DUT(client) have access privileges for the - PacketMulticastTxCount attribute implemented on the server?" - id: DGWIFI.C.A0008 - - - label: - "Does the DUT(client) have access privileges for the - PacketUnicastRxCount attribute implemented on the server?" - id: DGWIFI.C.A0009 - - - label: - "Does the DUT(client) have access privileges for the - PacketUnicastTxCount attribute implemented on the server?" - id: DGWIFI.C.A000a - - - label: - "Does the DUT(client) have access privileges for the CurrentMaxRate - attribute implemented on the server?" - id: DGWIFI.C.A000b - - - label: - "Does the DUT(client) have access privileges for the OverrunCount - attribute implemented on the server?" - id: DGWIFI.C.A000c - # # client / commandsGenerated # @@ -7417,13 +7311,7 @@ PICS: "Reset the following attributes to 0; BeaconLostCount, BeaconRxCount, PacketMulticastRxCount, PacketMulticastTxCount, PacketUnicastRxCount, PacketUnicastTxCount" - id: DGWIFI.C.C00.Tx - - # - # client / manually - # - - label: "" - id: DGWIFI.C.A + id: DGWIFI.S.C00.Tx # Window Covering Cluster Test Plan - label: diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml index baa544bca18818..2dac5acd518d17 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml @@ -457,11 +457,11 @@ tests: value: "y" - label: - "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute" + "Step 10:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute" PICS: ACL.S.A0000 - command: "writeAttribute" + command: "readAttribute" attribute: "ACL" - arguments: + response: value: [ { @@ -639,11 +639,11 @@ tests: value: "y" - label: - "Step 16:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute" + "Step 16:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute" PICS: ACL.S.A0000 - command: "writeAttribute" + command: "readAttribute" attribute: "ACL" - arguments: + response: value: [ { diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml index c08bba0b65f47f..bd173e7eb81427 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml @@ -773,82 +773,68 @@ tests: TARGETS)" PICS: ACL.S.A0000 && PICS_SKIP_SAMPLE_APP verification: | - ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, { "privilege": 3, "authMode": 2, "subjects": null, "targets":[{ "cluster": 40, "endpoint": null, "deviceType": null },{ "cluster": 28, "endpoint": null, "deviceType": null }]}]' 1 0 + ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, { "privilege": 3, "authMode": 2, "subjects": null, "targets":[{ "cluster": 40, "endpoint": null, "deviceType": null },{ "cluster": 28, "endpoint": null, "deviceType": null },{ "cluster": 30, "endpoint": null, "deviceType": null }]}]' 1 0 - On TH1(Chiptool), Verify that the status is success when writing the AccessControl cluster ACL attribute with a value is list of AccessControlEntryStruct containing 2 elements with Subjects as null and and Target as TARGETS + Via the TH (chip-tool), Verify that the status is success when writing the AccessControl cluster ACL attribute with a value is list of AccessControlEntryStruct containing 2 elements. - [1657542520.140869][3499:3504] CHIP:DMG: { - [1657542520.140922][3499:3504] CHIP:DMG: AttributeStatusIBs = - [1657542520.140966][3499:3504] CHIP:DMG: [ - [1657542520.140999][3499:3504] CHIP:DMG: AttributeStatusIB = - [1657542520.141036][3499:3504] CHIP:DMG: { - [1657542520.141077][3499:3504] CHIP:DMG: AttributePathIB = - [1657542520.141119][3499:3504] CHIP:DMG: { - [1657542520.141163][3499:3504] CHIP:DMG: Endpoint = 0x0, - [1657542520.141207][3499:3504] CHIP:DMG: Cluster = 0x1f, - [1657542520.141255][3499:3504] CHIP:DMG: Attribute = 0x0000_0000, - [1657542520.141300][3499:3504] CHIP:DMG: } - [1657542520.141346][3499:3504] CHIP:DMG: - [1657542520.141385][3499:3504] CHIP:DMG: StatusIB = - [1657542520.141426][3499:3504] CHIP:DMG: { - [1657542520.141468][3499:3504] CHIP:DMG: status = 0x00 (SUCCESS), - [1657542520.141509][3499:3504] CHIP:DMG: }, - [1657542520.141550][3499:3504] CHIP:DMG: - [1657542520.141584][3499:3504] CHIP:DMG: }, - [1657542520.141630][3499:3504] CHIP:DMG: - [1657542520.141663][3499:3504] CHIP:DMG: AttributeStatusIB = - [1657542520.141697][3499:3504] CHIP:DMG: { - [1657542520.141731][3499:3504] CHIP:DMG: AttributePathIB = - [1657542520.141770][3499:3504] CHIP:DMG: { - [1657542520.141811][3499:3504] CHIP:DMG: Endpoint = 0x0, - [1657542520.141855][3499:3504] CHIP:DMG: Cluster = 0x1f, - [1657542520.141940][3499:3504] CHIP:DMG: Attribute = 0x0000_0000, - [1657542520.142024][3499:3504] CHIP:DMG: ListIndex = Null, - [1657542520.142106][3499:3504] CHIP:DMG: } - [1662015973.912273][3126:3132] CHIP:DMG: { - [1662015973.912301][3126:3132] CHIP:DMG: AttributeStatusIBs = - [1662015973.912375][3126:3132] CHIP:DMG: [ - [1662015973.912409][3126:3132] CHIP:DMG: AttributeStatusIB = - [1662015973.912452][3126:3132] CHIP:DMG: { - [1662015973.912488][3126:3132] CHIP:DMG: AttributePathIB = - [1662015973.912534][3126:3132] CHIP:DMG: { - [1662015973.912577][3126:3132] CHIP:DMG: Endpoint = 0x0, - [1662015973.912640][3126:3132] CHIP:DMG: Cluster = 0x1f, - [1662015973.912687][3126:3132] CHIP:DMG: Attribute = 0x0000_0000, - [1662015973.912743][3126:3132] CHIP:DMG: } - [1662015973.912792][3126:3132] CHIP:DMG: - [1662015973.912849][3126:3132] CHIP:DMG: StatusIB = - [1662015973.912893][3126:3132] CHIP:DMG: { - [1662015973.912948][3126:3132] CHIP:DMG: status = 0x00 (SUCCESS), - [1662015973.912992][3126:3132] CHIP:DMG: }, - [1662015973.913046][3126:3132] CHIP:DMG: - [1662015973.913082][3126:3132] CHIP:DMG: }, - [1662015973.913142][3126:3132] CHIP:DMG: - [1662015973.913173][3126:3132] CHIP:DMG: AttributeStatusIB = - [1662015973.913225][3126:3132] CHIP:DMG: { - [1662015973.913260][3126:3132] CHIP:DMG: AttributePathIB = - [1662015973.913315][3126:3132] CHIP:DMG: { - [1662015973.913360][3126:3132] CHIP:DMG: Endpoint = 0x0, - [1662015973.913421][3126:3132] CHIP:DMG: Cluster = 0x1f, - [1662015973.913465][3126:3132] CHIP:DMG: Attribute = 0x0000_0000, - [1662015973.913518][3126:3132] CHIP:DMG: ListIndex = Null, - [1662015973.913561][3126:3132] CHIP:DMG: } - [1662015973.913622][3126:3132] CHIP:DMG: - [1662015973.913662][3126:3132] CHIP:DMG: StatusIB = - [1662015973.913716][3126:3132] CHIP:DMG: { - [1662015973.913759][3126:3132] CHIP:DMG: status = 0x00 (SUCCESS), - [1662015973.913814][3126:3132] CHIP:DMG: }, - [1662015973.913855][3126:3132] CHIP:DMG: - [1662015973.913902][3126:3132] CHIP:DMG: }, - [1662015973.913952][3126:3132] CHIP:DMG: - [1662015973.913983][3126:3132] CHIP:DMG: AttributeStatusIB = - [1662015973.914021][3126:3132] CHIP:DMG: { - [1662015973.914056][3126:3132] CHIP:DMG: AttributePathIB = - [1662015973.914095][3126:3132] CHIP:DMG: { - [1662015973.914139][3126:3132] CHIP:DMG: Endpoint = 0x0, - [1662015973.914183][3126:3132] CHIP:DMG: Cluster = 0x1f, - [1662015973.914228][3126:3132] CHIP:DMG: Attribute = 0x0000_0000, - [1662015973.914270][3126:3132] CHIP:DMG: ListIndex = Null, + [1686292221.429177][33589:33591] CHIP:DMG: WriteResponseMessage = + [1686292221.429234][33589:33591] CHIP:DMG: { + [1686292221.429283][33589:33591] CHIP:DMG: AttributeStatusIBs = + [1686292221.429355][33589:33591] CHIP:DMG: [ + [1686292221.429411][33589:33591] CHIP:DMG: AttributeStatusIB = + [1686292221.429475][33589:33591] CHIP:DMG: { + [1686292221.429534][33589:33591] CHIP:DMG: AttributePathIB = + [1686292221.429691][33589:33591] CHIP:DMG: { + [1686292221.429771][33589:33591] CHIP:DMG: Endpoint = 0x0, + [1686292221.429847][33589:33591] CHIP:DMG: Cluster = 0x1f, + [1686292221.429923][33589:33591] CHIP:DMG: Attribute = 0x0000_0000, + [1686292221.429989][33589:33591] CHIP:DMG: } + [1686292221.430067][33589:33591] CHIP:DMG: + [1686292221.430136][33589:33591] CHIP:DMG: StatusIB = + [1686292221.430206][33589:33591] CHIP:DMG: { + [1686292221.430277][33589:33591] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292221.430346][33589:33591] CHIP:DMG: }, + [1686292221.430415][33589:33591] CHIP:DMG: + [1686292221.430474][33589:33591] CHIP:DMG: }, + [1686292221.430558][33589:33591] CHIP:DMG: + [1686292221.430614][33589:33591] CHIP:DMG: AttributeStatusIB = + [1686292221.430675][33589:33591] CHIP:DMG: { + [1686292221.430734][33589:33591] CHIP:DMG: AttributePathIB = + [1686292221.430801][33589:33591] CHIP:DMG: { + [1686292221.430870][33589:33591] CHIP:DMG: Endpoint = 0x0, + [1686292221.430944][33589:33591] CHIP:DMG: Cluster = 0x1f, + [1686292221.431020][33589:33591] CHIP:DMG: Attribute = 0x0000_0000, + [1686292221.431263][33589:33591] CHIP:DMG: ListIndex = Null, + [1686292221.431342][33589:33591] CHIP:DMG: } + [1686292221.431419][33589:33591] CHIP:DMG: + [1686292221.431486][33589:33591] CHIP:DMG: StatusIB = + [1686292221.431554][33589:33591] CHIP:DMG: { + [1686292221.431635][33589:33591] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292221.431705][33589:33591] CHIP:DMG: }, + [1686292221.431774][33589:33591] CHIP:DMG: + [1686292221.431833][33589:33591] CHIP:DMG: }, + [1686292221.431918][33589:33591] CHIP:DMG: + [1686292221.431973][33589:33591] CHIP:DMG: AttributeStatusIB = + [1686292221.432035][33589:33591] CHIP:DMG: { + [1686292221.432093][33589:33591] CHIP:DMG: AttributePathIB = + [1686292221.432161][33589:33591] CHIP:DMG: { + [1686292221.432231][33589:33591] CHIP:DMG: Endpoint = 0x0, + [1686292221.432305][33589:33591] CHIP:DMG: Cluster = 0x1f, + [1686292221.432381][33589:33591] CHIP:DMG: Attribute = 0x0000_0000, + [1686292221.432453][33589:33591] CHIP:DMG: ListIndex = Null, + [1686292221.432523][33589:33591] CHIP:DMG: } + [1686292221.432600][33589:33591] CHIP:DMG: + [1686292221.432666][33589:33591] CHIP:DMG: StatusIB = + [1686292221.432734][33589:33591] CHIP:DMG: { + [1686292221.432803][33589:33591] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292221.432873][33589:33591] CHIP:DMG: }, + [1686292221.432949][33589:33591] CHIP:DMG: + [1686292221.433008][33589:33591] CHIP:DMG: }, + [1686292221.433077][33589:33591] CHIP:DMG: + [1686292221.433132][33589:33591] CHIP:DMG: ], + [1686292221.433218][33589:33591] CHIP:DMG: + [1686292221.433273][33589:33591] CHIP:DMG: InteractionModelRevision = 1 + [1686292221.433327][33589:33591] CHIP:DMG: } cluster: "LogCommands" command: "UserPrompt" arguments: @@ -863,33 +849,41 @@ tests: PICS: ACL.S.A0000 && PICS_SKIP_SAMPLE_APP verification: | ./chip-tool accesscontrol read acl 1 0 - On TH1(Chiptool) , Verify that the AccessControlEntryStruct contains 2 elements with Subjects as null and and Target as TARGETS - [1662016086.501582][3138:3143] CHIP:TOO: ACL: 2 entries - [1662016086.501643][3138:3143] CHIP:TOO: [1]: { - [1662016086.501673][3138:3143] CHIP:TOO: Privilege: 5 - [1662016086.501698][3138:3143] CHIP:TOO: AuthMode: 2 - [1662016086.501727][3138:3143] CHIP:TOO: Subjects: 1 entries - [1662016086.501758][3138:3143] CHIP:TOO: [1]: 112233 - [1662016086.501786][3138:3143] CHIP:TOO: Targets: null - [1662016086.501811][3138:3143] CHIP:TOO: FabricIndex: 1 - [1662016086.501835][3138:3143] CHIP:TOO: } - [1662016086.501873][3138:3143] CHIP:TOO: [2]: { - [1662016086.501899][3138:3143] CHIP:TOO: Privilege: 3 - [1662016086.501924][3138:3143] CHIP:TOO: AuthMode: 2 - [1662016086.501948][3138:3143] CHIP:TOO: Subjects: null - [1662016086.501979][3138:3143] CHIP:TOO: Targets: 2 entries - [1662016086.502016][3138:3143] CHIP:TOO: [1]: { - [1662016086.502043][3138:3143] CHIP:TOO: Cluster: 40 - [1662016086.502069][3138:3143] CHIP:TOO: Endpoint: null - [1662016086.502094][3138:3143] CHIP:TOO: DeviceType: null - [1662016086.502117][3138:3143] CHIP:TOO: } - [1662016086.502148][3138:3143] CHIP:TOO: [2]: { - [1662016086.502174][3138:3143] CHIP:TOO: Cluster: 28 - [1662016086.502198][3138:3143] CHIP:TOO: Endpoint: null - [1662016086.502223][3138:3143] CHIP:TOO: DeviceType: null - [1662016086.502247][3138:3143] CHIP:TOO: } - [1662016086.502273][3138:3143] CHIP:TOO: FabricIndex: 1 + Via the TH (chip-tool), Verify that the AccessControlEntryStruct contains 4 elements. + + [1686292292.890253][33601:33603] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2420291518 + [1686292292.890488][33601:33603] CHIP:TOO: ACL: 2 entries + [1686292292.890620][33601:33603] CHIP:TOO: [1]: { + [1686292292.890708][33601:33603] CHIP:TOO: Privilege: 5 + [1686292292.890762][33601:33603] CHIP:TOO: AuthMode: 2 + [1686292292.890850][33601:33603] CHIP:TOO: Subjects: 1 entries + [1686292292.890918][33601:33603] CHIP:TOO: [1]: 112233 + [1686292292.890976][33601:33603] CHIP:TOO: Targets: null + [1686292292.891028][33601:33603] CHIP:TOO: FabricIndex: 1 + [1686292292.891078][33601:33603] CHIP:TOO: } + [1686292292.891170][33601:33603] CHIP:TOO: [2]: { + [1686292292.891220][33601:33603] CHIP:TOO: Privilege: 3 + [1686292292.891272][33601:33603] CHIP:TOO: AuthMode: 2 + [1686292292.891324][33601:33603] CHIP:TOO: Subjects: null + [1686292292.891397][33601:33603] CHIP:TOO: Targets: 3 entries + [1686292292.891480][33601:33603] CHIP:TOO: [1]: { + [1686292292.891536][33601:33603] CHIP:TOO: Cluster: 40 + [1686292292.891590][33601:33603] CHIP:TOO: Endpoint: null + [1686292292.891642][33601:33603] CHIP:TOO: DeviceType: null + [1686292292.891692][33601:33603] CHIP:TOO: } + [1686292292.891760][33601:33603] CHIP:TOO: [2]: { + [1686292292.891815][33601:33603] CHIP:TOO: Cluster: 28 + [1686292292.891866][33601:33603] CHIP:TOO: Endpoint: null + [1686292292.891916][33601:33603] CHIP:TOO: DeviceType: null + [1686292292.891966][33601:33603] CHIP:TOO: } + [1686292292.892032][33601:33603] CHIP:TOO: [3]: { + [1686292292.892087][33601:33603] CHIP:TOO: Cluster: 30 + [1686292292.892138][33601:33603] CHIP:TOO: Endpoint: null + [1686292292.892188][33601:33603] CHIP:TOO: DeviceType: null + [1686292292.892238][33601:33603] CHIP:TOO: } + [1686292292.892293][33601:33603] CHIP:TOO: FabricIndex: 1 + [1686292292.892345][33601:33603] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" arguments: @@ -908,6 +902,7 @@ tests: response: saveAs: MAXENTRIES + #Made following steps as prompt, As at the moment YAML doesn't support sending the elements based on the MAXENTRIES from the previous steps. - label: "Step 27:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute, value is list of AccessControlEntryStruct containing @@ -915,64 +910,160 @@ tests: field: CASE (2) Subjects field: [N1] Targets field: null 2.struct Privilege field: Operate (3) AuthMode field: CASE (2) Subjects field: null Targets field: null subsequent elements same as second element" - PICS: ACL.S.A0000 - command: "writeAttribute" - attribute: "ACL" + PICS: ACL.S.A0000 && PICS_SKIP_SAMPLE_APP + verification: | + ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, { "privilege": 3, "authMode": 2, "subjects": null, "targets":null}, { "privilege": 3, "authMode": 2, "subjects": null, "targets":null},{ "privilege": 3, "authMode": 2, "subjects": null, "targets":null}]' 1 0 + + Via the TH (chip-tool), Verify that the status is success when writing the AccessControl cluster ACL attribute with a value is list of AccessControlEntryStruct containing MAXENTRIES elements. + + [1686292560.130383][33642:33644] CHIP:DMG: WriteClient moving to [ResponseRe] + [1686292560.130530][33642:33644] CHIP:DMG: WriteResponseMessage = + [1686292560.130588][33642:33644] CHIP:DMG: { + [1686292560.130671][33642:33644] CHIP:DMG: AttributeStatusIBs = + [1686292560.130749][33642:33644] CHIP:DMG: [ + [1686292560.130807][33642:33644] CHIP:DMG: AttributeStatusIB = + [1686292560.130893][33642:33644] CHIP:DMG: { + [1686292560.130955][33642:33644] CHIP:DMG: AttributePathIB = + [1686292560.131045][33642:33644] CHIP:DMG: { + [1686292560.131119][33642:33644] CHIP:DMG: Endpoint = 0x0, + [1686292560.131216][33642:33644] CHIP:DMG: Cluster = 0x1f, + [1686292560.131293][33642:33644] CHIP:DMG: Attribute = 0x0000_0000, + [1686292560.131387][33642:33644] CHIP:DMG: } + [1686292560.131469][33642:33644] CHIP:DMG: + [1686292560.131535][33642:33644] CHIP:DMG: StatusIB = + [1686292560.131628][33642:33644] CHIP:DMG: { + [1686292560.131702][33642:33644] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292560.131793][33642:33644] CHIP:DMG: }, + [1686292560.131865][33642:33644] CHIP:DMG: + [1686292560.131947][33642:33644] CHIP:DMG: }, + [1686292560.132033][33642:33644] CHIP:DMG: + [1686292560.132107][33642:33644] CHIP:DMG: AttributeStatusIB = + [1686292560.132181][33642:33644] CHIP:DMG: { + [1686292560.132241][33642:33644] CHIP:DMG: AttributePathIB = + [1686292560.132330][33642:33644] CHIP:DMG: { + [1686292560.132400][33642:33644] CHIP:DMG: Endpoint = 0x0, + [1686292560.132497][33642:33644] CHIP:DMG: Cluster = 0x1f, + [1686292560.132573][33642:33644] CHIP:DMG: Attribute = 0x0000_0000, + [1686292560.132666][33642:33644] CHIP:DMG: ListIndex = Null, + [1686292560.132738][33642:33644] CHIP:DMG: } + [1686292560.132843][33642:33644] CHIP:DMG: + [1686292560.132911][33642:33644] CHIP:DMG: StatusIB = + [1686292560.132979][33642:33644] CHIP:DMG: { + [1686292560.133074][33642:33644] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292560.133146][33642:33644] CHIP:DMG: }, + [1686292560.133237][33642:33644] CHIP:DMG: + [1686292560.133297][33642:33644] CHIP:DMG: }, + [1686292560.133402][33642:33644] CHIP:DMG: + [1686292560.133461][33642:33644] CHIP:DMG: AttributeStatusIB = + [1686292560.133522][33642:33644] CHIP:DMG: { + [1686292560.133708][33642:33644] CHIP:DMG: AttributePathIB = + [1686292560.133801][33642:33644] CHIP:DMG: { + [1686292560.133873][33642:33644] CHIP:DMG: Endpoint = 0x0, + [1686292560.133947][33642:33644] CHIP:DMG: Cluster = 0x1f, + [1686292560.134046][33642:33644] CHIP:DMG: Attribute = 0x0000_0000, + [1686292560.134119][33642:33644] CHIP:DMG: ListIndex = Null, + [1686292560.134210][33642:33644] CHIP:DMG: } + [1686292560.134288][33642:33644] CHIP:DMG: + [1686292560.134372][33642:33644] CHIP:DMG: StatusIB = + [1686292560.134440][33642:33644] CHIP:DMG: { + [1686292560.134531][33642:33644] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292560.134601][33642:33644] CHIP:DMG: }, + [1686292560.134690][33642:33644] CHIP:DMG: + [1686292560.134751][33642:33644] CHIP:DMG: }, + [1686292560.134837][33642:33644] CHIP:DMG: + [1686292560.134914][33642:33644] CHIP:DMG: AttributeStatusIB = + [1686292560.134976][33642:33644] CHIP:DMG: { + [1686292560.135063][33642:33644] CHIP:DMG: AttributePathIB = + [1686292560.135132][33642:33644] CHIP:DMG: { + [1686292560.135221][33642:33644] CHIP:DMG: Endpoint = 0x0, + [1686292560.135297][33642:33644] CHIP:DMG: Cluster = 0x1f, + [1686292560.135372][33642:33644] CHIP:DMG: Attribute = 0x0000_0000, + [1686292560.135466][33642:33644] CHIP:DMG: ListIndex = Null, + [1686292560.135537][33642:33644] CHIP:DMG: } + [1686292560.135634][33642:33644] CHIP:DMG: + [1686292560.135701][33642:33644] CHIP:DMG: StatusIB = + [1686292560.135789][33642:33644] CHIP:DMG: { + [1686292560.135859][33642:33644] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292560.135967][33642:33644] CHIP:DMG: }, + [1686292560.136043][33642:33644] CHIP:DMG: + [1686292560.136102][33642:33644] CHIP:DMG: }, + [1686292560.136210][33642:33644] CHIP:DMG: + [1686292560.136266][33642:33644] CHIP:DMG: AttributeStatusIB = + [1686292560.136349][33642:33644] CHIP:DMG: { + [1686292560.136409][33642:33644] CHIP:DMG: AttributePathIB = + [1686292560.136496][33642:33644] CHIP:DMG: { + [1686292560.136567][33642:33644] CHIP:DMG: Endpoint = 0x0, + [1686292560.136642][33642:33644] CHIP:DMG: Cluster = 0x1f, + [1686292560.136739][33642:33644] CHIP:DMG: Attribute = 0x0000_0000, + [1686292560.136811][33642:33644] CHIP:DMG: ListIndex = Null, + [1686292560.136900][33642:33644] CHIP:DMG: } + [1686292560.136979][33642:33644] CHIP:DMG: + [1686292560.137065][33642:33644] CHIP:DMG: StatusIB = + [1686292560.137134][33642:33644] CHIP:DMG: { + [1686292560.137201][33642:33644] CHIP:DMG: status = 0x00 (SUCCESS), + [1686292560.137295][33642:33644] CHIP:DMG: }, + [1686292560.137366][33642:33644] CHIP:DMG: + [1686292560.137451][33642:33644] CHIP:DMG: }, + [1686292560.137522][33642:33644] CHIP:DMG: + [1686292560.137630][33642:33644] CHIP:DMG: ], + [1686292560.137740][33642:33644] CHIP:DMG: + [1686292560.137816][33642:33644] CHIP:DMG: InteractionModelRevision = 1 + [1686292560.137873][33642:33644] CHIP:DMG: } + cluster: "LogCommands" + command: "UserPrompt" arguments: - value: - [ - { - Privilege: 5, - AuthMode: 2, - Subjects: [CommissionerNodeId], - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - { - Privilege: 3, - AuthMode: 2, - Subjects: null, - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - { - Privilege: 3, - AuthMode: 2, - Subjects: null, - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - ] + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 28:TH1 reads AccessControl cluster ACL attribute" - PICS: ACL.S.A0000 - command: "readAttribute" - attribute: "ACL" - response: - value: - [ - { - Privilege: 5, - AuthMode: 2, - Subjects: [CommissionerNodeId], - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - { - Privilege: 3, - AuthMode: 2, - Subjects: null, - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - { - Privilege: 3, - AuthMode: 2, - Subjects: null, - Targets: null, - FabricIndex: CurrentFabricIndexValue, - }, - ] + PICS: ACL.S.A0000 && PICS_SKIP_SAMPLE_APP + verification: | + ./chip-tool accesscontrol read acl 1 0 + + Via the TH (chip-tool), Verify that the AccessControlEntryStruct containing MAXENTRIES elements. + + [1686292633.355733][33659:33661] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2420291523 + [1686292633.355957][33659:33661] CHIP:TOO: ACL: 4 entries + [1686292633.356089][33659:33661] CHIP:TOO: [1]: { + [1686292633.356177][33659:33661] CHIP:TOO: Privilege: 5 + [1686292633.356262][33659:33661] CHIP:TOO: AuthMode: 2 + [1686292633.356356][33659:33661] CHIP:TOO: Subjects: 1 entries + [1686292633.356450][33659:33661] CHIP:TOO: [1]: 112233 + [1686292633.356510][33659:33661] CHIP:TOO: Targets: null + [1686292633.356599][33659:33661] CHIP:TOO: FabricIndex: 1 + [1686292633.356652][33659:33661] CHIP:TOO: } + [1686292633.356726][33659:33661] CHIP:TOO: [2]: { + [1686292633.356803][33659:33661] CHIP:TOO: Privilege: 3 + [1686292633.356855][33659:33661] CHIP:TOO: AuthMode: 2 + [1686292633.356905][33659:33661] CHIP:TOO: Subjects: null + [1686292633.356977][33659:33661] CHIP:TOO: Targets: null + [1686292633.357024][33659:33661] CHIP:TOO: FabricIndex: 1 + [1686292633.357073][33659:33661] CHIP:TOO: } + [1686292633.357166][33659:33661] CHIP:TOO: [3]: { + [1686292633.357221][33659:33661] CHIP:TOO: Privilege: 3 + [1686292633.357272][33659:33661] CHIP:TOO: AuthMode: 2 + [1686292633.357345][33659:33661] CHIP:TOO: Subjects: null + [1686292633.357395][33659:33661] CHIP:TOO: Targets: null + [1686292633.357446][33659:33661] CHIP:TOO: FabricIndex: 1 + [1686292633.357513][33659:33661] CHIP:TOO: } + [1686292633.357659][33659:33661] CHIP:TOO: [4]: { + [1686292633.357717][33659:33661] CHIP:TOO: Privilege: 3 + [1686292633.357793][33659:33661] CHIP:TOO: AuthMode: 2 + [1686292633.357845][33659:33661] CHIP:TOO: Subjects: null + [1686292633.357895][33659:33661] CHIP:TOO: Targets: null + [1686292633.357963][33659:33661] CHIP:TOO: FabricIndex: 1 + [1686292633.358021][33659:33661] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 29:TH1 writes DUT Endpoint 0 AccessControl cluster ACL @@ -1073,8 +1164,8 @@ tests: FabricIndex: CurrentFabricIndexValue, }, { - Privilege: "6", - AuthMode: 3, + Privilege: 6, + AuthMode: 2, Subjects: null, Targets: null, FabricIndex: CurrentFabricIndexValue, @@ -1100,8 +1191,8 @@ tests: FabricIndex: CurrentFabricIndexValue, }, { - Privilege: "6", - AuthMode: "4", + Privilege: 3, + AuthMode: 4, Subjects: null, Targets: null, FabricIndex: CurrentFabricIndexValue, diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml index 981ebc8c5d30d6..e9a8bfc830c999 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml @@ -33,7 +33,7 @@ config: defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" tests: - - label: "Step 1: TH commissions DUT using admin node ID N1" + - label: "Step 1: TH1 commissions DUT using admin node ID N1" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -50,7 +50,7 @@ tests: saveAs: CommissionerNodeId - label: - "Step 2: TH reads DUT Endpoint 0 OperationalCredentials cluster + "Step 2: TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute" command: "readAttribute" cluster: "Operational Credentials" @@ -60,7 +60,7 @@ tests: #Issue: https://github.com/project-chip/connectedhomeip/issues/24081 - label: - "Step 3: TH reads DUT Endpoint 0 AccessControl cluster + "Step 3: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" verification: | ./chip-tool accesscontrol read-event access-control-extension-changed 1 0 @@ -87,7 +87,7 @@ tests: value: "y" - label: - "Step 4: TH writes DUT Endpoint 0 AccessControl cluster Extension + "Step 4: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element struct Data field: D_OK_EMPTY" PICS: ACL.S.A0001 @@ -97,7 +97,7 @@ tests: value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }] - label: - "Step 5: TH reads DUT Endpoint 0 AccessControl cluster + "Step 5: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" @@ -118,7 +118,7 @@ tests: } - label: - "Step 6: TH writes DUT Endpoint 0 AccessControl cluster Extension + "Step 6: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element struct Data field: D_OK_SINGLE" PICS: ACL.S.A0001 @@ -128,7 +128,7 @@ tests: value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }] - label: - "Step 7: TH reads DUT Endpoint 0 AccessControl cluster + "Step 7: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" @@ -163,7 +163,7 @@ tests: } - label: - "Step 8: TH writes DUT Endpoint 0 AccessControl cluster Extension + "Step 8: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element struct Data field: D_BAD_LENGTH" PICS: ACL.S.A0001 @@ -175,7 +175,7 @@ tests: error: CONSTRAINT_ERROR - label: - "Step 9: TH reads DUT Endpoint 0 AccessControl cluster + "Step 9: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" @@ -196,7 +196,7 @@ tests: } - label: - "Step 10: TH writes DUT Endpoint 0 AccessControl cluster Extension + "Step 10: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 2 elements struct Data field: D_OK_EMPTY struct Data field: D_OK_SINGLE" PICS: ACL.S.A0001 @@ -212,7 +212,7 @@ tests: error: CONSTRAINT_ERROR - label: - "Step 11: TH reads DUT Endpoint 0 AccessControl cluster + "Step 11: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" @@ -233,7 +233,7 @@ tests: } - label: - "Step 12: TH writes DUT Endpoint 0 AccessControl cluster Extension + "Step 12: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list" PICS: ACL.S.A0001 command: "writeAttribute" @@ -242,7 +242,7 @@ tests: value: [] - label: - "Step 13: TH reads DUT Endpoint 0 AccessControl cluster + "Step 13: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml index 946c1e0fdeda1b..d5cc1c31b30101 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml @@ -23,7 +23,7 @@ config: endpoint: 0 tests: - - label: "Step 1: TH commissions DUT using admin node ID N1" + - label: "Step 1: TH1 commissions DUT using admin node ID N1" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -40,7 +40,7 @@ tests: saveAs: CommissionerNodeId - label: - "Step 2: TH reads DUT Endpoint 0 OperationalCredentials cluster + "Step 2: TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute" command: "readAttribute" cluster: "Operational Credentials" @@ -49,7 +49,7 @@ tests: saveAs: CurrentFabricIndexValue - label: - "Step 3: TH reads DUT Endpoint 0 AccessControl cluster + "Step 3: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event" PICS: ACL.S.E00 command: "readEvent" @@ -73,10 +73,10 @@ tests: } - label: - "Step 4: TH writes DUT Endpoint 0 AccessControl cluster ACL attribute, - value is list of AccessControlEntryStruct containing 2 elements - 1.struct Privilege field: Administer (5) AuthMode field: CASE (2) - Subjects field: [N1] Targets field: null 2struct Privilege field: + "Step 4: TH1 writes DUT Endpoint 0 AccessControl cluster ACL + attribute, value is list of AccessControlEntryStruct containing 2 + elements 1.struct Privilege field: Administer (5) AuthMode field: CASE + (2) Subjects field: [N1] Targets field: null 2struct Privilege field: Operate (3) AuthMode field: Group (3) Subjects field: null Targets field: null" PICS: ACL.S.E00 @@ -102,7 +102,7 @@ tests: ] - label: - "Step 5: TH reads DUT Endpoint 0 AccessControl cluster + "Step 5: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event" PICS: ACL.S.E00 command: "readEvent" @@ -159,13 +159,13 @@ tests: } - label: - "Step 6: TH writes DUT Endpoint 0 AccessControl cluster ACL attribute, - value is list of AccessControlEntryStruct containing 2 elements. The - first item is valid, the second item is invalid due to group ID 0 - being used, which is illegal. 1.struct Privilege field: Administer (5) - AuthMode field: CASE (2) Subjects field: [N1] Targets field: null - 2.struct Privilege field: Operate (3) AuthMode field: Group (3) - Subjects field: [0] Targets field: null" + "Step 6: TH1 writes DUT Endpoint 0 AccessControl cluster ACL + attribute, value is list of AccessControlEntryStruct containing 2 + elements. The first item is valid, the second item is invalid due to + group ID 0 being used, which is illegal. 1.struct Privilege field: + Administer (5) AuthMode field: CASE (2) Subjects field: [N1] Targets + field: null 2.struct Privilege field: Operate (3) AuthMode field: + Group (3) Subjects field: [0] Targets field: null" PICS: ACL.S.E00 command: "writeAttribute" attribute: "ACL" @@ -191,7 +191,7 @@ tests: error: CONSTRAINT_ERROR - label: - "Step 7: TH reads DUT Endpoint 0 AccessControl cluster + "Step 7: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event" PICS: ACL.S.E00 command: "readEvent" diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml index 195e2fbf5c5d51..949d2f3831e884 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml @@ -45,7 +45,7 @@ config: defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" tests: - - label: "Step 1:Wait for the commissioned device to be retrieved" + - label: "Step 1: TH1 commissions DUT using admin node ID N1" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -62,7 +62,7 @@ tests: saveAs: TH1CommissionerNodeId - label: - "Step 2:TH1 reads OperationalCredentials cluster CurrentFabricIndex + "Step 2: TH1 reads OperationalCredentials cluster CurrentFabricIndex attribute" command: "readAttribute" cluster: "Operational Credentials" @@ -70,7 +70,7 @@ tests: response: saveAs: TH1FabricIndex - - label: "Step 3:TH1 puts DUT into commissioning mode" + - label: "Step 3a: TH1 puts DUT into commissioning mode" cluster: "Administrator Commissioning" command: "OpenCommissioningWindow" timedInteractionTimeoutMs: 10000 @@ -128,7 +128,7 @@ tests: - name: "ms" value: waitAfterCommissioning - - label: "Step 4:TH2 starts a commissioning process with DUT" + - label: "Step 3b:TH2 starts a commissioning process with DUT" identity: "beta" PICS: PICS_SDK_CI_ONLY cluster: "CommissionerCommands" @@ -161,7 +161,7 @@ tests: saveAs: TH2CommissionerNodeId - label: - "Step 5:TH2 reads OperationalCredentials cluster CurrentFabricIndex + "Step 4: TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute" identity: "beta" PICS: PICS_SDK_CI_ONLY @@ -172,7 +172,7 @@ tests: saveAs: TH2FabricIndex - label: - "Step 5:TH2 reads OperationalCredentials cluster CurrentFabricIndex + "Step 4: TH2 reads OperationalCredentials cluster CurrentFabricIndex attribute" verification: | ./chip-tool operationalcredentials read current-fabric-index 2 0 --commissioner-name beta --commissioner-nodeid 223344 @@ -191,7 +191,7 @@ tests: value: "y" - label: - "Step 6:TH1 writes DUT Endpoint 0 AccessControl cluster Extension + "Step 5: TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element" PICS: ACL.S.A0001 @@ -201,7 +201,7 @@ tests: value: [{ Data: D_OK_EMPTY, FabricIndex: TH1FabricIndex }] - label: - "Step 7:TH2 writes DUT Endpoint 0 AccessControl cluster Extension + "Step 6: TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element" PICS: ACL.S.A0001 && PICS_SDK_CI_ONLY @@ -213,7 +213,7 @@ tests: #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 - label: - "Step 7:TH2 writes DUT Endpoint 0 AccessControl cluster Extension + "Step 6: TH2 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element" verification: | @@ -272,14 +272,14 @@ tests: - name: "expectedValue" value: "y" - - label: "Step 8:TH1 reads AccessControl cluster Extension attribute" + - label: "Step 7: TH1 reads AccessControl cluster Extension attribute" PICS: ACL.S.A0001 command: "readAttribute" attribute: "Extension" response: value: [{ Data: D_OK_EMPTY, FabricIndex: TH1FabricIndex }] - - label: "Step 9:TH2 reads AccessControl cluster Extension attribute" + - label: "Step 8: TH2 reads AccessControl cluster Extension attribute" PICS: ACL.S.A0001 && PICS_SDK_CI_ONLY identity: "beta" command: "readAttribute" @@ -288,7 +288,7 @@ tests: value: [{ Data: D_OK_SINGLE, FabricIndex: TH2FabricIndex }] #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 - - label: "Step 9:TH2 reads AccessControl cluster Extension attribute" + - label: "Step 8: TH2 reads AccessControl cluster Extension attribute" verification: | ./chip-tool accesscontrol read extension 2 0 --commissioner-name beta --commissioner-nodeid 223344 @@ -310,7 +310,7 @@ tests: value: "y" - label: - "Step 10:TH1 reads DUT Endpoint 0 AccessControl cluster + "Step 9: TH1 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 command: "readEvent" @@ -327,7 +327,7 @@ tests: } - label: - "Step 11:TH2 reads DUT Endpoint 0 AccessControl cluster + "Step 10: TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" PICS: ACL.S.E01 && PICS_SDK_CI_ONLY identity: "beta" @@ -346,7 +346,7 @@ tests: #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 - label: - "Step 11:TH2 reads DUT Endpoint 0 AccessControl cluster + "Step 10: TH2 reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" verification: | ./chip-tool accesscontrol read-event access-control-extension-changed 2 0 --commissioner-name beta --commissioner-nodeid 223344 diff --git a/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml index bc14534503a9c1..905d7f1b03f3ad 100644 --- a/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml @@ -28,5 +28,5 @@ tests: # command: "WaitForCommissioning" - label: "DUT sends ResetCounts command to TH" - PICS: DGTHREAD.C.C00.Tx + PICS: DGWIFI.S.C00.Tx wait: "ResetCounts" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml index bd593dadbf973c..bece149e34ed32 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml @@ -35,6 +35,7 @@ tests: - label: "Create new user" command: "SetUser" + PICS: DRLK.S.F08 && DRLK.S.F00 timedInteractionTimeoutMs: 1000 arguments: values: @@ -55,6 +56,7 @@ tests: - label: "Read the user back and verify its fields" command: "GetUser" + PICS: DRLK.S.F08 && DRLK.S.F00 arguments: values: - name: "UserIndex" @@ -84,6 +86,7 @@ tests: - label: "Create new PIN credential and lock/unlock user" command: "SetCredential" + PICS: DRLK.S.F08 && DRLK.S.F00 timedInteractionTimeoutMs: 1000 arguments: values: @@ -109,6 +112,7 @@ tests: value: 2 - label: "Verify created PIN credential" + PICS: DRLK.S.F08 && DRLK.S.F00 command: "GetCredentialStatus" arguments: values: @@ -183,7 +187,8 @@ tests: - label: "Step 2b: TH sends the Unlock with Timeout argument value as 60 seconds" - PICS: DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP + PICS: + " DRLK.S.F08 && DRLK.S.F00 && DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP " command: "UnlockWithTimeout" timedInteractionTimeoutMs: 1000 arguments: @@ -193,6 +198,19 @@ tests: - name: "PINCode" value: "123456" + - label: + "Step 2b: TH sends the Unlock with Timeout argument value as 60 + seconds" + PICS: + " (!DRLK.S.F08 || !DRLK.S.F00) && DRLK.S.C03.Rsp && + PICS_SKIP_SAMPLE_APP " + command: "UnlockWithTimeout" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "Timeout" + value: 60 + - label: "Wait for AutoRelockTime Expires" cluster: "DelayCommands" command: "WaitForMs" @@ -221,6 +239,7 @@ tests: - label: "Cleanup the created user" command: "ClearUser" + PICS: DRLK.S.F08 && DRLK.S.F00 timedInteractionTimeoutMs: 1000 arguments: values: @@ -228,7 +247,7 @@ tests: value: 1 - label: "Clean the created credential" - PICS: DRLK.S.C26.Rsp + PICS: DRLK.S.F08 && DRLK.S.F00 && DRLK.S.C26.Rsp command: "ClearCredential" timedInteractionTimeoutMs: 1000 arguments: diff --git a/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml deleted file mode 100755 index a3b051b576e571..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DT_1_1.yaml +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 57.1.1. [TC-DT-1.1] Base Device Type [DUT as Server] - -PICS: - - MCORE.DT.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes and endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - disabled: true - - - label: "Step 2: Verify that each endpoint includes a Descriptor cluster" - verification: | - On TH(chip-tool), Verify that the ReportDataMessage with each endpoint(endpoint 0, endpoint 1 and endpoint 2) includes a Descriptor cluster( Cluster: 0x0000_001D) - below is the sample log provided for the raspi platform: - - [1690185276.189270][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 - [1690185276.189273][40055:40057] CHIP:TOO: ClientList: 1 entries - [1690185276.189275][40055:40057] CHIP:TOO: [1]: 41 - [1690185276.189286][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 - [1690185276.189290][40055:40057] CHIP:TOO: PartsList: 2 entries - [1690185276.189293][40055:40057] CHIP:TOO: [1]: 1 - [1690185276.189295][40055:40057] CHIP:TOO: [2]: 2 - [1690185276.189298][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 - [1690185276.189300][40055:40057] CHIP:TOO: FeatureMap: 0 - [1690185276.189309][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 1390630643 - [1690185276.189311][40055:40057] CHIP:TOO: ClusterRevision: 1 - [1690185276.189326][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 1390630643 - [1690185276.189329][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries - [1690185276.189339][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 1390630643 - [1690185276.189341][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries - [1690185276.189353][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 1390630643 - [1690185276.189356][40055:40057] CHIP:TOO: EventList: 0 entries - [1690185276.189374][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 1390630643 - [1690185276.189378][40055:40057] CHIP:TOO: AttributeList: 10 entries - [1690185276.189380][40055:40057] CHIP:TOO: [1]: 0 - [1690185276.189382][40055:40057] CHIP:TOO: [2]: 1 - [1690185276.189384][40055:40057] CHIP:TOO: [3]: 2 - [1690185276.189386][40055:40057] CHIP:TOO: [4]: 3 - [1690185276.189388][40055:40057] CHIP:TOO: [5]: 65528 - [1690185276.189390][40055:40057] CHIP:TOO: [6]: 65529 - [1690185276.189392][40055:40057] CHIP:TOO: [7]: 65530 - [1690185276.189394][40055:40057] CHIP:TOO: [8]: 65531 - [1690185276.189396][40055:40057] CHIP:TOO: [9]: 65532 - [1690185276.189398][40055:40057] CHIP:TOO: [10]: 65533 - [1690185276.189408][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 3752520678 - [1690185276.189411][40055:40057] CHIP:TOO: Binding: 0 entries - [1690185276.189414][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFC DataVersion: 3752520678 - - - - [1690185276.266589][40055:40057] CHIP:TOO: [68]: 4294048773 - [1690185276.266629][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 2743502132 - [1690185276.266634][40055:40057] CHIP:TOO: ClientList: 1 entries - [1690185276.266636][40055:40057] CHIP:TOO: [1]: 6 - [1690185276.266646][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2743502132 - [1690185276.266652][40055:40057] CHIP:TOO: PartsList: 0 entries - [1690185276.266656][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 2743502132 - [1690185276.266660][40055:40057] CHIP:TOO: FeatureMap: 0 - [1690185276.266668][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 2743502132 - [1690185276.266670][40055:40057] CHIP:TOO: ClusterRevision: 1 - [1690185276.266686][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 2743502132 - [1690185276.266689][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries - [1690185276.266699][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 2743502132 - [1690185276.266702][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries - [1690185276.266714][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 2743502132 - [1690185276.266717][40055:40057] CHIP:TOO: EventList: 0 entries - [1690185276.266737][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 2743502132 - [1690185276.266742][40055:40057] CHIP:TOO: AttributeList: 10 entries - [1690185276.266744][40055:40057] CHIP:TOO: [1]: 0 - [1690185276.266746][40055:40057] CHIP:TOO: [2]: 1 - [1690185276.266748][40055:40057] CHIP:TOO: [3]: 2 - [1690185276.266750][40055:40057] CHIP:TOO: [4]: 3 - [1690185276.266752][40055:40057] CHIP:TOO: [5]: 65528 - [1690185276.266755][40055:40057] CHIP:TOO: [6]: 65529 - [1690185276.266757][40055:40057] CHIP:TOO: [7]: 65530 - [1690185276.266759][40055:40057] CHIP:TOO: [8]: 65531 - [1690185276.266761][40055:40057] CHIP:TOO: [9]: 65532 - [1690185276.266762][40055:40057] CHIP:TOO: [10]: 65533 - [1690185276.266774][40055:40057] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 523636689 - [1690185276.266779][40055:40057] CHIP:TOO: Binding: 0 entries - - - [1690185276.399194][40055:40057] CHIP:TOO: Revision: 1 - [1690185276.399196][40055:40057] CHIP:TOO: } - [1690185276.399212][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 516620155 - [1690185276.399216][40055:40057] CHIP:TOO: ServerList: 5 entries - [1690185276.399218][40055:40057] CHIP:TOO: [1]: 4 - [1690185276.399220][40055:40057] CHIP:TOO: [2]: 6 - [1690185276.399222][40055:40057] CHIP:TOO: [3]: 29 - [1690185276.399223][40055:40057] CHIP:TOO: [4]: 47 - [1690185276.399225][40055:40057] CHIP:TOO: [5]: 1030 - [1690185276.399235][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 - [1690185276.399238][40055:40057] CHIP:TOO: ClientList: 0 entries - [1690185276.399247][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 516620155 - [1690185276.399251][40055:40057] CHIP:TOO: PartsList: 0 entries - [1690185276.399254][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 516620155 - [1690185276.399256][40055:40057] CHIP:TOO: FeatureMap: 0 - [1690185276.399265][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 516620155 - [1690185276.399267][40055:40057] CHIP:TOO: ClusterRevision: 1 - [1690185276.399282][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 516620155 - [1690185276.399285][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries - [1690185276.399294][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 516620155 - [1690185276.399297][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries - [1690185276.399309][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 516620155 - [1690185276.399311][40055:40057] CHIP:TOO: EventList: 0 entries - [1690185276.399329][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 516620155 - [1690185276.399334][40055:40057] CHIP:TOO: AttributeList: 10 entries - [1690185276.399336][40055:40057] CHIP:TOO: [1]: 0 - [1690185276.399338][40055:40057] CHIP:TOO: [2]: 1 - [1690185276.399340][40055:40057] CHIP:TOO: [3]: 2 - [1690185276.399341][40055:40057] CHIP:TOO: [4]: 3 - [1690185276.399343][40055:40057] CHIP:TOO: [5]: 65528 - [1690185276.399345][40055:40057] CHIP:TOO: [6]: 65529 - [1690185276.399347][40055:40057] CHIP:TOO: [7]: 65530 - [1690185276.399349][40055:40057] CHIP:TOO: [8]: 65531 - [1690185276.399350][40055:40057] CHIP:TOO: [9]: 65532 - [1690185276.399352][40055:40057] CHIP:TOO: [10]: 65533 - [1690185276.399354][40055:40057] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_002F Attribute 0x0000_0000 DataVersion: 850311415 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml index 8e5b360a93592c..bad927c19b6ba6 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml @@ -50,7 +50,7 @@ tests: saveAs: MaxMeasuredVariable constraints: type: int16u - minValue: MinMeasuredVariable + minValue: MinMeasuredVariable + 1 maxValue: 65534 - label: "Step 4: Read the mandatory attribute: MeasuredValue" diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml index 3cef4c28dd6e4b..f6d17635840779 100644 --- a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml @@ -170,7 +170,7 @@ tests: saveAs: MaxGroupKeysPerFabricValue constraints: type: int16u - minValue: 0 + minValue: 1 maxValue: 65535 - label: diff --git a/src/app/tests/suites/certification/Test_TC_IDM_10_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_10_1.yaml deleted file mode 100644 index 12d5a1140aa187..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_IDM_10_1.yaml +++ /dev/null @@ -1,290 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 32.6.8. [TC-IDM-10.1] Cluster requirements - Global attributes [DUT as - Server] - -PICS: - - MCORE.IDM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes and endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - - Please store the log for use in the next step validation. - disabled: true - - - label: - "Step 2: For every cluster on every endpoint verify that the cluster - includes all the mandatory global attributes: ClusterRevision, - FeatureMap, AttributeList, AcceptedCommandList, GeneratedCommandList, - EventList" - verification: | - The following log is an example of the output obtained for Identify Cluster on Endpoint 0. Descriptor cluster on Endpoint 1 and Occupancy cluster on Endpoint 2. - Pls repeat this for every cluster on every endpoint. The log represents the attributes of clusters found on different endpoints. - - Verify the presence of all mandatory global attributes for every cluster on every endpoint: - 1. ClusterRevision - 2. FeatureMap - 3. EventList - 4. AttributeList - 5. AcceptedCommandList - 6. GeneratedCommandList - - Verification Instructions: - Please use the provided example log as a guide to verify the attributes for other clusters and endpoints in a similar manner. - - Example verification log for 'Identify Cluster' (0x0000_0003) on Endpoint 0 : - [1690267325.176118][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3031281428 - [1690267325.176127][9552:9554] CHIP:TOO: IdentifyType: 2 - [1690267325.176149][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 3031281428 - [1690267325.176152][9552:9554] CHIP:TOO: FeatureMap: 0 - [1690267325.176160][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3031281428 - [1690267325.176163][9552:9554] CHIP:TOO: ClusterRevision: 4 - [1690267325.176182][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3031281428 - [1690267325.176186][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.176202][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3031281428 - [1690267325.176206][9552:9554] CHIP:TOO: AcceptedCommandList: 2 entries - [1690267325.176208][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.176216][9552:9554] CHIP:TOO: [2]: 64 - [1690267325.176228][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFA DataVersion: 3031281428 - [1690267325.176231][9552:9554] CHIP:TOO: EventList: 0 entries - [1690267325.176250][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3031281428 - [1690267325.176254][9552:9554] CHIP:TOO: AttributeList: 8 entries - [1690267325.176256][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.176258][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.176261][9552:9554] CHIP:TOO: [3]: 65528 - [1690267325.176262][9552:9554] CHIP:TOO: [4]: 65529 - [1690267325.176264][9552:9554] CHIP:TOO: [5]: 65530 - [1690267325.176267][9552:9554] CHIP:TOO: [6]: 65531 - [1690267325.176269][9552:9554] CHIP:TOO: [7]: 65532 - [1690267325.176272][9552:9554] CHIP:TOO: [8]: 65533 - [1690267325.176274][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_0000 DataVersion: 800446264 - [1690267325.176277][9552:9554] CHIP:TOO: NameSupport: 128 - - Example verification log for ' Descriptor cluster ' (0x0000_001D) on Endpoint 1 : - [1690267325.249870][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 762289150 - [1690267325.249874][9552:9554] CHIP:TOO: PartsList: 0 entries - [1690267325.249878][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 762289150 - [1690267325.249881][9552:9554] CHIP:TOO: FeatureMap: 0 - [1690267325.249891][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 762289150 - [1690267325.249893][9552:9554] CHIP:TOO: ClusterRevision: 1 - [1690267325.249910][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 762289150 - [1690267325.249914][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.249926][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 762289150 - [1690267325.249929][9552:9554] CHIP:TOO: AcceptedCommandList: 0 entries - [1690267325.249942][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 762289150 - [1690267325.249946][9552:9554] CHIP:TOO: EventList: 0 entries - [1690267325.249965][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 762289150 - [1690267325.249972][9552:9554] CHIP:TOO: AttributeList: 10 entries - [1690267325.249975][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.249978][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.249980][9552:9554] CHIP:TOO: [3]: 2 - [1690267325.249982][9552:9554] CHIP:TOO: [4]: 3 - [1690267325.249986][9552:9554] CHIP:TOO: [5]: 65528 - [1690267325.249989][9552:9554] CHIP:TOO: [6]: 65529 - [1690267325.249992][9552:9554] CHIP:TOO: [7]: 65530 - [1690267325.249995][9552:9554] CHIP:TOO: [8]: 65531 - [1690267325.249999][9552:9554] CHIP:TOO: [9]: 65532 - [1690267325.250002][9552:9554] CHIP:TOO: [10]: 65533 - [1690267325.250017][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 3536645262 - - Example verification log for ' Occupancy cluster ' (0x0000_0406) on Endpoint 2 : - - [1690267325.401773][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0000 DataVersion: 3381359521 - [1690267325.401776][9552:9554] CHIP:TOO: Occupancy: 0 - [1690267325.401785][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0001 DataVersion: 3381359521 - [1690267325.401787][9552:9554] CHIP:TOO: OccupancySensorType: 0 - [1690267325.401795][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0002 DataVersion: 3381359521 - [1690267325.401798][9552:9554] CHIP:TOO: OccupancySensorTypeBitmap: 1 - [1690267325.401806][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFC DataVersion: 3381359521 - [1690267325.401808][9552:9554] CHIP:TOO: FeatureMap: 0 - [1690267325.401816][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFD DataVersion: 3381359521 - [1690267325.401819][9552:9554] CHIP:TOO: ClusterRevision: 3 - [1690267325.401834][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFF8 DataVersion: 3381359521 - [1690267325.401837][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.401848][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFF9 DataVersion: 3381359521 - [1690267325.401850][9552:9554] CHIP:TOO: AcceptedCommandList: 0 entries - [1690267325.401861][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFA DataVersion: 3381359521 - [1690267325.401864][9552:9554] CHIP:TOO: EventList: 0 entries - [1690267325.401876][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFB DataVersion: 3381359521 - [1690267325.401880][9552:9554] CHIP:TOO: AttributeList: 9 entries - [1690267325.401882][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.401884][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.401886][9552:9554] CHIP:TOO: [3]: 2 - [1690267325.401888][9552:9554] CHIP:TOO: [4]: 65528 - [1690267325.401890][9552:9554] CHIP:TOO: [5]: 65529 - [1690267325.401892][9552:9554] CHIP:TOO: [6]: 65530 - [1690267325.401894][9552:9554] CHIP:TOO: [7]: 65531 - [1690267325.401896][9552:9554] CHIP:TOO: [8]: 65532 - [1690267325.401898][9552:9554] CHIP:TOO: [9]: 65533 - [1690267325.401975][9552:9554] CHIP:EM: <<< [E:6807i S:13119 M:239700033 (Ack:147952547)] (S) Msg TX to 1:0000000000000001 [83EA] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690267325.401983][9552:9554] CHIP:IN: (S) Sending msg 239700033 on secure session with LSID: 13119 - [1690267325.402014][9552:9554] CHIP:EM: Flushed pending ack for MessageCounter:147952547 on exchange 6807i - disabled: true - - - label: - "Step 3: For every cluster on every endpoint, verify that each - attribute reported in the AttributeList exactly matches the set of - received attributes from the wildcard read. In other words, if an - attribute ID is present in the AttributeList, a report for that path - must have been seen in the read of step 1, and if an attribute path - exists in the read of step 1, its ID must be present in the - AttributeList of the associated cluster within the hierarchy." - verification: | - The following log is an example of the output obtained For every cluster on every endpoint. The log represents the attributes of clusters found on different endpoints. - - Verify AttributeList for Each Cluster on Every Endpoint, follow the verification process: - 1. Examine the AttributeList reported for the specific cluster. - 2. Cross-reference the attributes listed in the AttributeList with the set of received attributes from the wildcard read (Step 1). - 3. Ensure that each attribute ID present in the AttributeList is also seen in the received attributes from the wildcard read, and vice versa. - - Verification Instructions: - Please use the provided example log as a guide to verify the attributes for other clusters and endpoints in a similar manner. - - - Example verification log for 'Identify Cluster' (0x0000_0003) on Endpoint 0 : - - AttributeList: [0, 1, 65528, 65529, 65530, 65531, 65532, 65532] - - Wildcard Read Received Attributes: [0, 1, 65528, 65529, 65530, 65531, 65532, 65532] - - All attribute IDs in the AttributeList are present in the received attributes from the wildcard read. - - All received attributes from the wildcard read have their corresponding attribute IDs listed in the AttributeList. - [1690267325.175008][9552:9554] CHIP:DMG: InteractionModelRevision = 1 - [1690267325.175013][9552:9554] CHIP:DMG: } - [1690267325.175842][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3031281428 - [1690267325.175868][9552:9554] CHIP:TOO: IdentifyTime: 0 - [1690267325.176118][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3031281428 - [1690267325.176127][9552:9554] CHIP:TOO: IdentifyType: 2 - [1690267325.176149][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 3031281428 - [1690267325.176152][9552:9554] CHIP:TOO: FeatureMap: 0 - [1690267325.176160][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3031281428 - [1690267325.176163][9552:9554] CHIP:TOO: ClusterRevision: 4 - [1690267325.176182][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3031281428 - [1690267325.176186][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.176202][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3031281428 - [1690267325.176206][9552:9554] CHIP:TOO: AcceptedCommandList: 2 entries - [1690267325.176208][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.176216][9552:9554] CHIP:TOO: [2]: 64 - [1690267325.176228][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFA DataVersion: 3031281428 - [1690267325.176231][9552:9554] CHIP:TOO: EventList: 0 entries - [1690267325.176250][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3031281428 - [1690267325.176254][9552:9554] CHIP:TOO: AttributeList: 8 entries - [1690267325.176256][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.176258][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.176261][9552:9554] CHIP:TOO: [3]: 65528 - [1690267325.176262][9552:9554] CHIP:TOO: [4]: 65529 - [1690267325.176264][9552:9554] CHIP:TOO: [5]: 65530 - [1690267325.176267][9552:9554] CHIP:TOO: [6]: 65531 - [1690267325.176269][9552:9554] CHIP:TOO: [7]: 65532 - [1690267325.176272][9552:9554] CHIP:TOO: [8]: 65533 - [1690267325.176274][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_0000 DataVersion: 800446264 - [1690267325.176277][9552:9554] CHIP:TOO: NameSupport: 128 - [1690267325.176285][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFC DataVersion: 800446264 - [1690267325.176290][9552:9554] CHIP:TOO: FeatureMap: 1 - [1690267325.176298][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFD DataVersion: 800446264 - [1690267325.176301][9552:9554] CHIP:TOO: ClusterRevision: 4 - [1690267325.176324][9552:9554] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFF8 DataVersion: 800446264 - [1690267325.176328][9552:9554] CHIP:TOO: GeneratedCommandList: 4 entries - - - Example verification log for ' SWITCH cluster ' (0x0000_003B) on Endpoint 1 : - - AttributeList: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65532] - - Wildcard Read Received Attributes: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65532] - - All attribute IDs in the AttributeList are present in the received attributes from the wildcard read. - - All received attributes from the wildcard read have their corresponding attribute IDs listed in the AttributeList. - - [1690267325.252505][9552:9554] CHIP:TOO: [12]: 65532 - [1690267325.252507][9552:9554] CHIP:TOO: [13]: 65533 - [1690267325.252510][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0000 DataVersion: 279843917 - [1690267325.252512][9552:9554] CHIP:TOO: NumberOfPositions: 2 - [1690267325.252520][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 279843917 - [1690267325.252522][9552:9554] CHIP:TOO: CurrentPosition: 0 - [1690267325.252531][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0002 DataVersion: 279843917 - [1690267325.252533][9552:9554] CHIP:TOO: MultiPressMax: 2 - [1690267325.252541][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFFC DataVersion: 279843917 - [1690267325.252543][9552:9554] CHIP:TOO: FeatureMap: 1 - [1690267325.252551][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFFD DataVersion: 279843917 - [1690267325.252553][9552:9554] CHIP:TOO: ClusterRevision: 1 - [1690267325.252569][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFF8 DataVersion: 279843917 - [1690267325.252571][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.252580][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFF9 DataVersion: 279843917 - [1690267325.252583][9552:9554] CHIP:TOO: AcceptedCommandList: 0 entries - [1690267325.252596][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFFA DataVersion: 279843917 - [1690267325.252598][9552:9554] CHIP:TOO: EventList: 1 entries - [1690267325.252601][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.252620][9552:9554] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_FFFB DataVersion: 279843917 - [1690267325.252625][9552:9554] CHIP:TOO: AttributeList: 9 entries - [1690267325.252627][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.252629][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.252630][9552:9554] CHIP:TOO: [3]: 2 - [1690267325.252632][9552:9554] CHIP:TOO: [4]: 65528 - [1690267325.252634][9552:9554] CHIP:TOO: [5]: 65529 - [1690267325.252636][9552:9554] CHIP:TOO: [6]: 65530 - [1690267325.252638][9552:9554] CHIP:TOO: [7]: 65531 - [1690267325.252640][9552:9554] CHIP:TOO: [8]: 65532 - [1690267325.252642][9552:9554] CHIP:TOO: [9]: 65533 - [1690267325.252687][9552:9554] CHIP:EM: <<< [E:6807i S:13119 M:239699999 (Ack:147952513)] (S) Msg TX to 1:0000000000000001 [83EA] --- Type 0001:01 (IM:StatusResponse) - [1690267325.252691][9552:9554] CHIP:IN: (S) Sending msg 239699999 on secure session with LSID: 13119 - - Example verification log for ' Occupancy cluster ' (0x0000_0406) on Endpoint 2 : - - AttributeList: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65532] - - Wildcard Read Received Attributes: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65532] - - All attribute IDs in the AttributeList are present in the received attributes from the wildcard read. - - All received attributes from the wildcard read have their corresponding attribute IDs listed in the AttributeList. - [1690267325.401762][9552:9554] CHIP:TOO: [8]: 65528 - [1690267325.401764][9552:9554] CHIP:TOO: [9]: 65529 - [1690267325.401765][9552:9554] CHIP:TOO: [10]: 65530 - [1690267325.401767][9552:9554] CHIP:TOO: [11]: 65531 - [1690267325.401769][9552:9554] CHIP:TOO: [12]: 65532 - [1690267325.401771][9552:9554] CHIP:TOO: [13]: 65533 - [1690267325.401773][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0000 DataVersion: 3381359521 - [1690267325.401776][9552:9554] CHIP:TOO: Occupancy: 0 - [1690267325.401785][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0001 DataVersion: 3381359521 - [1690267325.401787][9552:9554] CHIP:TOO: OccupancySensorType: 0 - [1690267325.401795][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_0002 DataVersion: 3381359521 - [1690267325.401798][9552:9554] CHIP:TOO: OccupancySensorTypeBitmap: 1 - [1690267325.401806][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFC DataVersion: 3381359521 - [1690267325.401808][9552:9554] CHIP:TOO: FeatureMap: 0 - [1690267325.401816][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFD DataVersion: 3381359521 - [1690267325.401819][9552:9554] CHIP:TOO: ClusterRevision: 3 - [1690267325.401834][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFF8 DataVersion: 3381359521 - [1690267325.401837][9552:9554] CHIP:TOO: GeneratedCommandList: 0 entries - [1690267325.401848][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFF9 DataVersion: 3381359521 - [1690267325.401850][9552:9554] CHIP:TOO: AcceptedCommandList: 0 entries - [1690267325.401861][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFA DataVersion: 3381359521 - [1690267325.401864][9552:9554] CHIP:TOO: EventList: 0 entries - [1690267325.401876][9552:9554] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0406 Attribute 0x0000_FFFB DataVersion: 3381359521 - [1690267325.401880][9552:9554] CHIP:TOO: AttributeList: 9 entries - [1690267325.401882][9552:9554] CHIP:TOO: [1]: 0 - [1690267325.401884][9552:9554] CHIP:TOO: [2]: 1 - [1690267325.401886][9552:9554] CHIP:TOO: [3]: 2 - [1690267325.401888][9552:9554] CHIP:TOO: [4]: 65528 - [1690267325.401890][9552:9554] CHIP:TOO: [5]: 65529 - [1690267325.401892][9552:9554] CHIP:TOO: [6]: 65530 - [1690267325.401894][9552:9554] CHIP:TOO: [7]: 65531 - [1690267325.401896][9552:9554] CHIP:TOO: [8]: 65532 - [1690267325.401898][9552:9554] CHIP:TOO: [9]: 65533 - [1690267325.401975][9552:9554] CHIP:EM: <<< [E:6807i S:13119 M:239700033 (Ack:147952547)] (S) Msg TX to 1:0000000000000001 [83EA] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690267325.401983][9552:9554] CHIP:IN: (S) Sending msg 239700033 on secure session with LSID: 13119 - [1690267325.402014][9552:9554] CHIP:EM: Flushed pending ack for MessageCounter:147952547 on exchange 6807i - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_11_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_11_1.yaml deleted file mode 100644 index 1598e76f4d0d2d..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_IDM_11_1.yaml +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 32.6.9. [TC-IDM-11.1] Data types - attribute strings [DUT as Server] - data - model - -PICS: - - MCORE.IDM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes and endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - - Please store the log for use in the next step validation. - disabled: true - - - label: - "Step 2: For every returned attribute, if the attribute type is string - and the returned value is not Null or empty, ensure the returned value - is a valid UTF-8-encoded string. It is not permitted to have partially - encoded codepoints between the last legally-encoded codepoint and the - end of the string." - verification: | - From the privious step log, Verify UTF-8 Encoding for Each Returned String Attribute. - For each returned attribute with the attribute type "string," follow the verification process: - 1. Check if the returned value is not Null or empty. - 2. If the returned value is not Null or empty, validate that it is a valid UTF-8-encoded string. - 3. Ensure that there are no partially encoded codepoints between the last legally-encoded codepoint and the end of the string. - - The following log is an example of the output obtained for Basic Inforamtion Cluster. Pls repeat this for every cluster on every endpoint. The log represents the attributes of clusters found on different endpoints. - - Verification Instructions: - Please use the provided example log as a guide to verify the attributes for other clusters and endpoints in a similar manner. - - Example verification log for 'Basic information Cluster' (0x0000_0028) on Endpoint 0 : - [1690271126.212327][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0000 DataVersion: 338522070 - [1690271126.212330][10587:10589] CHIP:TOO: DataModelRevision: 1 - [1690271126.212344][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0001 DataVersion: 338522070 - [1690271126.212348][10587:10589] CHIP:TOO: VendorName: TEST_VENDOR - [1690271126.212358][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0002 DataVersion: 338522070 - [1690271126.212361][10587:10589] CHIP:TOO: VendorID: 65521 - [1690271126.212369][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0003 DataVersion: 338522070 - [1690271126.212371][10587:10589] CHIP:TOO: ProductName: TEST_PRODUCT - [1690271126.212379][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0004 DataVersion: 338522070 - [1690271126.212382][10587:10589] CHIP:TOO: ProductID: 32769 - [1690271126.212390][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 338522070 - [1690271126.212392][10587:10589] CHIP:TOO: NodeLabel: - [1690271126.212401][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 338522070 - [1690271126.212403][10587:10589] CHIP:TOO: Location: XX - [1690271126.212411][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0007 DataVersion: 338522070 - [1690271126.212413][10587:10589] CHIP:TOO: HardwareVersion: 0 - [1690271126.212422][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0008 DataVersion: 338522070 - [1690271126.212424][10587:10589] CHIP:TOO: HardwareVersionString: TEST_VERSION - [1690271126.212432][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0009 DataVersion: 338522070 - [1690271126.212434][10587:10589] CHIP:TOO: SoftwareVersion: 1 - [1690271126.212443][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_000A DataVersion: 338522070 - [1690271126.212445][10587:10589] CHIP:TOO: SoftwareVersionString: 1.0 - [1690271126.212453][10587:10589] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_000B DataVersion: 338522070 - [1690271126.212455][10587:10589] CHIP:TOO: ManufacturingDate: 20200101 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml index 6075e7897f4d27..316518847aee6a 100644 --- a/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LUNIT_3_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 105.3.1. [TC-LUNIT-3.1] Read and Write Unit Localization Cluster Attributes @@ -43,7 +42,7 @@ tests: type: enum8 - label: "Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit + PICS: LUNIT.S.A0000 && LUNIT.S.M.Fahrenheit cluster: "Unit Localization" command: "writeAttribute" attribute: "TemperatureUnit" @@ -51,14 +50,14 @@ tests: value: 0 - label: "Step 3: TH reads TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit + PICS: LUNIT.S.A0000 && LUNIT.S.M.Fahrenheit command: "readAttribute" attribute: "TemperatureUnit" response: value: 0 - label: "Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Celsius + PICS: LUNIT.S.A0000 && LUNIT.S.M.Celsius cluster: "Unit Localization" command: "writeAttribute" attribute: "TemperatureUnit" @@ -66,14 +65,14 @@ tests: value: 1 - label: "Step 5: TH reads TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Celsius + PICS: LUNIT.S.A0000 && LUNIT.S.M.Celsius command: "readAttribute" attribute: "TemperatureUnit" response: value: 1 - label: "Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin + PICS: LUNIT.S.A0000 && LUNIT.S.M.Kelvin cluster: "Unit Localization" command: "writeAttribute" attribute: "TemperatureUnit" @@ -81,7 +80,7 @@ tests: value: 2 - label: "Step 7: TH reads TemperatureUnit attribute" - PICS: LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin + PICS: LUNIT.S.A0000 && LUNIT.S.M.Kelvin command: "readAttribute" attribute: "TemperatureUnit" response: diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_3_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_3_Simulated.yaml deleted file mode 100644 index dfb6ad9787fcf5..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LVL_2_3_Simulated.yaml +++ /dev/null @@ -1,584 +0,0 @@ -# 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: 21.2.3. [TC-LVL-2.3] Attributes with client as DUT - -PICS: - - LVL.C - - LVL.C.AM-READ - - LVL.C.AO-READ - - LVL.C.AM-WRITE - - LVL.C.AO-WRITE - -config: - nodeId: 0x12344321 - cluster: "Level Control" - endpoint: 1 - -tests: - #- label: "Wait for the device to be commissioned" - # cluster: "DelayCommands" - # command: "WaitForCommissioning" - - - label: "Read mandatory attribute CurrentLevel" - wait: "readAttribute" - attribute: "CurrentLevel" - - - label: "Read mandatory attribute OnLevel" - wait: "readAttribute" - attribute: "OnLevel" - - - label: "Read mandatory attribute Options" - wait: "readAttribute" - attribute: "Options" - - - label: "Read optional attribute RemainingTime" - wait: "readAttribute" - attribute: "RemainingTime" - - - label: "Read optional attribute StartUpCurrentLevel" - wait: "readAttribute" - attribute: "StartUpCurrentLevel" - - - label: "Read optional attribute CurrentFrequency" - wait: "readAttribute" - attribute: "CurrentFrequency" - - - label: "Read optional attribute MinFrequency" - wait: "readAttribute" - attribute: "MinFrequency" - - - label: "Read optional attribute MaxFrequency" - wait: "readAttribute" - attribute: "MaxFrequency" - - - label: "Read optional attribute MinLevel" - wait: "readAttribute" - attribute: "MinLevel" - - - label: "Read optional attribute MaxLevel" - wait: "readAttribute" - attribute: "MaxLevel" - - - label: "Read optional attribute OnOffTransitionTime" - wait: "readAttribute" - attribute: "OnOffTransitionTime" - - - label: "Read optional attribute OnTransitionTime" - wait: "readAttribute" - attribute: "OnTransitionTime" - - - label: "Read optional attribute OffTransitionTime" - wait: "readAttribute" - attribute: "OffTransitionTime" - - - label: "Read optional attribute DefaultMoveRate" - wait: "readAttribute" - attribute: "DefaultMoveRate" - - - label: "Write mandatory attribute OnLevel" - wait: "writeAttribute" - attribute: "OnLevel" - arguments: - value: - - - label: "Write mandatory attribute Options" - wait: "writeAttribute" - attribute: "Options" - arguments: - value: - - - label: "Write optional attribute OnOffTransitionTime" - wait: "writeAttribute" - attribute: "OnOffTransitionTime" - arguments: - value: - - - label: "Write optional attribute OnTransitionTime" - wait: "writeAttribute" - attribute: "OnTransitionTime" - arguments: - value: - - - label: "Write optional attribute OffTransitionTime" - wait: "writeAttribute" - attribute: "OffTransitionTime" - arguments: - value: - - - label: "Write optional attribute DefaultMoveRate" - wait: "writeAttribute" - attribute: "DefaultMoveRate" - arguments: - value: - - - label: "Write optional attribute StartUpCurrentLevel" - wait: "writeAttribute" - attribute: "StartUpCurrentLevel" - arguments: - value: - - - label: - "Configure TH such that it implements mandatory and none of the - optional attributes of the server-side of the cluster, and that it - also reflects this in global attributes such as FeatureMap and - AttributeList.Commission DUT to TH again" - verification: | - Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner/Client) - - ./chip-tool levelcontrol read current-level 1 1 - Verify DUT receives current-level attribute response on the TH(all-clusters-minimal-app) Log: - [1657913862.815749][3126:3126] CHIP:IM: Received Read request - [1657913862.815884][3126:3126] CHIP:DMG: ReadRequestMessage = - [1657913862.815935][3126:3126] CHIP:DMG: { - [1657913862.815975][3126:3126] CHIP:DMG: AttributePathIBs = - [1657913862.816023][3126:3126] CHIP:DMG: [ - [1657913862.816107][3126:3126] CHIP:DMG: AttributePathIB = - [1657913862.816161][3126:3126] CHIP:DMG: { - [1657913862.816212][3126:3126] CHIP:DMG: Endpoint = 0x1, - [1657913862.816268][3126:3126] CHIP:DMG: Cluster = 0x8, - [1657913862.816325][3126:3126] CHIP:DMG: Attribute = 0x0000_0000, - [1657913862.816377][3126:3126] CHIP:DMG: } - [1657913862.816431][3126:3126] CHIP:DMG: - [1657913862.816477][3126:3126] CHIP:DMG: ], - [1657913862.816527][3126:3126] CHIP:DMG: - [1657913862.816573][3126:3126] CHIP:DMG: isFabricFiltered = true, - [1657913862.816619][3126:3126] CHIP:DMG: InteractionModelRevision = 1 - [1657913862.816662][3126:3126] CHIP:DMG: }, - - - ./chip-tool levelcontrol read on-level 1 1 - Verify DUT receives on-level attribute response on the TH(all-clusters-minimal-app) Log: - [1657913877.850398][3126:3126] CHIP:IM: Received Read request - [1657913877.850525][3126:3126] CHIP:DMG: ReadRequestMessage = - [1657913877.850574][3126:3126] CHIP:DMG: { - [1657913877.850614][3126:3126] CHIP:DMG: AttributePathIBs = - [1657913877.850725][3126:3126] CHIP:DMG: [ - [1657913877.850771][3126:3126] CHIP:DMG: AttributePathIB = - [1657913877.850821][3126:3126] CHIP:DMG: { - [1657913877.850872][3126:3126] CHIP:DMG: Endpoint = 0x1, - [1657913877.850932][3126:3126] CHIP:DMG: Cluster = 0x8, - [1657913877.850989][3126:3126] CHIP:DMG: Attribute = 0x0000_0011, - [1657913877.851048][3126:3126] CHIP:DMG: } - [1657913877.851103][3126:3126] CHIP:DMG: - [1657913877.851153][3126:3126] CHIP:DMG: ], - [1657913877.851203][3126:3126] CHIP:DMG: - [1657913877.851251][3126:3126] CHIP:DMG: isFabricFiltered = true, - [1657913877.851297][3126:3126] CHIP:DMG: InteractionModelRevision = 1 - [1657913877.851343][3126:3126] CHIP:DMG: }, - [1657913877.851471][3126:3126] CHIP:DMG: IM - - - ./chip-tool levelcontrol read options 1 1 - Verify DUT receives options attribute response on the TH(all-clusters-minimal-app) Log: - [1657913895.195563][3126:3126] CHIP:IM: Received Read request - [1657913895.195705][3126:3126] CHIP:DMG: ReadRequestMessage = - [1657913895.195732][3126:3126] CHIP:DMG: { - [1657913895.195754][3126:3126] CHIP:DMG: AttributePathIBs = - [1657913895.195780][3126:3126] CHIP:DMG: [ - [1657913895.195803][3126:3126] CHIP:DMG: AttributePathIB = - [1657913895.195901][3126:3126] CHIP:DMG: { - [1657913895.195932][3126:3126] CHIP:DMG: Endpoint = 0x1, - [1657913895.195963][3126:3126] CHIP:DMG: Cluster = 0x8, - [1657913895.195993][3126:3126] CHIP:DMG: Attribute = 0x0000_000F, - [1657913895.196022][3126:3126] CHIP:DMG: } - [1657913895.196073][3126:3126] CHIP:DMG: - [1657913895.196101][3126:3126] CHIP:DMG: ], - [1657913895.196161][3126:3126] CHIP:DMG: - [1657913895.196189][3126:3126] CHIP:DMG: isFabricFiltered = true, - [1657913895.196214][3126:3126] CHIP:DMG: InteractionModelRevision = 1 - [1657913895.196236][3126:3126] CHIP:DMG: }, - - - ./chip-tool levelcontrol read attribute-list 1 1 - Verify DUT receives attribute-list attribute response on the TH(all-clusters-minimal-app) Log: - [1657913906.648918][3126:3126] CHIP:IM: Received Read request - [1657913906.649061][3126:3126] CHIP:DMG: ReadRequestMessage = - [1657913906.649115][3126:3126] CHIP:DMG: { - [1657913906.649162][3126:3126] CHIP:DMG: AttributePathIBs = - [1657913906.649225][3126:3126] CHIP:DMG: [ - [1657913906.649273][3126:3126] CHIP:DMG: AttributePathIB = - [1657913906.649330][3126:3126] CHIP:DMG: { - [1657913906.649389][3126:3126] CHIP:DMG: Endpoint = 0x1, - [1657913906.649462][3126:3126] CHIP:DMG: Cluster = 0x8, - [1657913906.649529][3126:3126] CHIP:DMG: Attribute = 0x0000_FFFB, - [1657913906.649569][3126:3126] CHIP:DMG: } - [1657913906.649593][3126:3126] CHIP:DMG: - [1657913906.649618][3126:3126] CHIP:DMG: ], - [1657913906.649645][3126:3126] CHIP:DMG: - [1657913906.649731][3126:3126] CHIP:DMG: isFabricFiltered = true, - [1657913906.649757][3126:3126] CHIP:DMG: InteractionModelRevision = 1 - [1657913906.649781][3126:3126] CHIP:DMG: }, - - - ./chip-tool levelcontrol read feature-map 1 1 - Verify DUT receives feature-map attribute response on the TH(all-clusters-minimal-app) Log: - [1663070713.467153][4422:4422] CHIP:IM: Received Read request - [1663070713.467242][4422:4422] CHIP:DMG: ReadRequestMessage = - [1663070713.467275][4422:4422] CHIP:DMG: { - [1663070713.467300][4422:4422] CHIP:DMG: AttributePathIBs = - [1663070713.467329][4422:4422] CHIP:DMG: [ - [1663070713.467355][4422:4422] CHIP:DMG: AttributePathIB = - [1663070713.467390][4422:4422] CHIP:DMG: { - [1663070713.467422][4422:4422] CHIP:DMG: Endpoint = 0x1, - [1663070713.467455][4422:4422] CHIP:DMG: Cluster = 0x8, - [1663070713.467487][4422:4422] CHIP:DMG: Attribute = 0x0000_FFFC, - [1663070713.467517][4422:4422] CHIP:DMG: } - [1663070713.467548][4422:4422] CHIP:DMG: - [1663070713.467576][4422:4422] CHIP:DMG: ], - [1663070713.467606][4422:4422] CHIP:DMG: - [1663070713.467635][4422:4422] CHIP:DMG: isFabricFiltered = true, - [1663070713.467663][4422:4422] CHIP:DMG: InteractionModelRevision = 1 - [1663070713.467689][4422:4422] CHIP:DMG: }, - [1663070713.467767][4422:4422] CHIP:DMG: IM RH moving to [GeneratingReports] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "DUT reads all supported optional attributes from TH one at a time in - a manufacturer specific order" - verification: | - Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner/Client) - - TH all-clusters-minimal-app does not support optional attributes - - ./chip-tool levelcontrol read remaining-time 1 1 - Verify DUT(chip-tool) receives remaining-time attribute response on the TH(all-clusters-minimal-app) Log: - [1663147148.155292][37702:37702] CHIP:IM: Received Read request - [1663147148.155312][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147148.155315][37702:37702] CHIP:DMG: { - [1663147148.155317][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147148.155320][37702:37702] CHIP:DMG: [ - [1663147148.155323][37702:37702] CHIP:DMG: AttributePathIB = - [1663147148.155326][37702:37702] CHIP:DMG: { - [1663147148.155328][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147148.155331][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147148.155334][37702:37702] CHIP:DMG: Attribute = 0x0000_0001, - [1663147148.155338][37702:37702] CHIP:DMG: } - [1663147148.155341][37702:37702] CHIP:DMG: - [1663147148.155343][37702:37702] CHIP:DMG: ], - [1663147148.155346][37702:37702] CHIP:DMG: - [1663147148.155349][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147148.155351][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147148.155353][37702:37702] CHIP:DMG: }, - [1663147148.155366][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - [1663147148.155376][37702:37702] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - - - - ./chip-tool levelcontrol read min-level 1 1 - Verify DUT(chip-tool) receives min-level attribute response on the TH(all-clusters-minimal-app) Log: - [1663147176.255360][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147176.255364][37702:37702] CHIP:DMG: { - [1663147176.255368][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147176.255373][37702:37702] CHIP:DMG: [ - [1663147176.255376][37702:37702] CHIP:DMG: AttributePathIB = - [1663147176.255381][37702:37702] CHIP:DMG: { - [1663147176.255385][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147176.255389][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147176.255393][37702:37702] CHIP:DMG: Attribute = 0x0000_0002, - [1663147176.255396][37702:37702] CHIP:DMG: } - [1663147176.255401][37702:37702] CHIP:DMG: - [1663147176.255404][37702:37702] CHIP:DMG: ], - [1663147176.255409][37702:37702] CHIP:DMG: - [1663147176.255413][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147176.255416][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147176.255419][37702:37702] CHIP:DMG: }, - [1663147176.255436][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - [1663147176.255451][37702:37702] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - - - ./chip-tool levelcontrol read max-level 1 1 - Verify DUT(chip-tool) receives max-level attribute response on the TH(all-clusters-minimal-app) Log: - [1663147204.133512][37702:37702] CHIP:IM: Received Read request - [1663147204.133528][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147204.133531][37702:37702] CHIP:DMG: { - [1663147204.133533][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147204.133536][37702:37702] CHIP:DMG: [ - [1663147204.133538][37702:37702] CHIP:DMG: AttributePathIB = - [1663147204.133541][37702:37702] CHIP:DMG: { - [1663147204.133543][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147204.133546][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147204.133549][37702:37702] CHIP:DMG: Attribute = 0x0000_0003, - [1663147204.133551][37702:37702] CHIP:DMG: } - [1663147204.133553][37702:37702] CHIP:DMG: - [1663147204.133555][37702:37702] CHIP:DMG: ], - [1663147204.133558][37702:37702] CHIP:DMG: - [1663147204.133561][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147204.133563][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147204.133565][37702:37702] CHIP:DMG: }, - [1663147204.133577][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - [1663147204.133587][37702:37702] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - - ./chip-tool levelcontrol read current-frequency 1 1 - Verify DUT(chip-tool) receives current-frequency attribute response on the TH(all-clusters-minimal-app) Log: - [1663147223.228680][37702:37702] CHIP:IM: Received Read request - [1663147223.228702][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147223.228706][37702:37702] CHIP:DMG: { - [1663147223.228710][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147223.228714][37702:37702] CHIP:DMG: [ - [1663147223.228717][37702:37702] CHIP:DMG: AttributePathIB = - [1663147223.228722][37702:37702] CHIP:DMG: { - [1663147223.228726][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147223.228730][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147223.228734][37702:37702] CHIP:DMG: Attribute = 0x0000_0004, - [1663147223.228738][37702:37702] CHIP:DMG: } - [1663147223.228742][37702:37702] CHIP:DMG: - [1663147223.228746][37702:37702] CHIP:DMG: ], - [1663147223.228751][37702:37702] CHIP:DMG: - [1663147223.228754][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147223.228758][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147223.228761][37702:37702] CHIP:DMG: }, - [1663147223.228780][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - - ./chip-tool levelcontrol read min-frequency 1 1 - Verify DUT(chip-tool) receives min-frequency attribute response on the TH(all-clusters-minimal-app) Log: - [1663147242.442251][37702:37702] CHIP:IM: Received Read request - [1663147242.442277][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147242.442282][37702:37702] CHIP:DMG: { - [1663147242.442287][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147242.442293][37702:37702] CHIP:DMG: [ - [1663147242.442298][37702:37702] CHIP:DMG: AttributePathIB = - [1663147242.442304][37702:37702] CHIP:DMG: { - [1663147242.442309][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147242.442315][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147242.442320][37702:37702] CHIP:DMG: Attribute = 0x0000_0005, - [1663147242.442324][37702:37702] CHIP:DMG: } - [1663147242.442331][37702:37702] CHIP:DMG: - [1663147242.442336][37702:37702] CHIP:DMG: ], - [1663147242.442342][37702:37702] CHIP:DMG: - [1663147242.442347][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147242.442352][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147242.442355][37702:37702] CHIP:DMG: }, - [1663147242.442378][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - - ./chip-tool levelcontrol read max-frequency 1 1 - Verify DUT(chip-tool) receives max-frequency attribute response on the TH(all-clusters-minimal-app) Log: - [1663147259.687422][37702:37702] CHIP:IM: Received Read request - [1663147259.687445][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147259.687450][37702:37702] CHIP:DMG: { - [1663147259.687454][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147259.687458][37702:37702] CHIP:DMG: [ - [1663147259.687463][37702:37702] CHIP:DMG: AttributePathIB = - [1663147259.687469][37702:37702] CHIP:DMG: { - [1663147259.687474][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147259.687478][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147259.687481][37702:37702] CHIP:DMG: Attribute = 0x0000_0006, - [1663147259.687485][37702:37702] CHIP:DMG: } - [1663147259.687490][37702:37702] CHIP:DMG: - [1663147259.687494][37702:37702] CHIP:DMG: ], - [1663147259.687500][37702:37702] CHIP:DMG: - [1663147259.687504][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147259.687509][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147259.687513][37702:37702] CHIP:DMG: }, - [1663147259.687532][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - - ./chip-tool levelcontrol read on-off-transition-time 1 1 - Verify DUT(chip-tool) receives on-off-transition-time attribute response on the TH(all-clusters-minimal-app) Log: - [1663147276.525081][37702:37702] CHIP:IM: Received Read request - [1663147276.525105][37702:37702] CHIP:DMG: ReadRequestMessage = - [1663147276.525110][37702:37702] CHIP:DMG: { - [1663147276.525115][37702:37702] CHIP:DMG: AttributePathIBs = - [1663147276.525120][37702:37702] CHIP:DMG: [ - [1663147276.525124][37702:37702] CHIP:DMG: AttributePathIB = - [1663147276.525129][37702:37702] CHIP:DMG: { - [1663147276.525133][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147276.525138][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147276.525143][37702:37702] CHIP:DMG: Attribute = 0x0000_0010, - [1663147276.525148][37702:37702] CHIP:DMG: } - [1663147276.525155][37702:37702] CHIP:DMG: - [1663147276.525159][37702:37702] CHIP:DMG: ], - [1663147276.525166][37702:37702] CHIP:DMG: - [1663147276.525171][37702:37702] CHIP:DMG: isFabricFiltered = true, - [1663147276.525177][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147276.525181][37702:37702] CHIP:DMG: }, - [1663147276.525202][37702:37702] CHIP:DMG: IM RH moving to [GeneratingReports] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "DUT writes a suitable value to all supported optional attributes on - the TH one at a time in a manufacturer specific order" - verification: | - Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner/Client) - - TH all-clusters-minimal-app does not support optional attributes - - ./chip-tool levelcontrol write on-off-transition-time 5 1 1 - Verify DUT(chip-tool) receives on-off-transition-time attribute response on the TH(all-clusters-minimal-app) Log: - [1663147558.231731][37702:37702] CHIP:IM: Received Write request - [1663147558.231735][37702:37702] CHIP:DMG: IM WH moving to [Initialized] - [1663147558.231746][37702:37702] CHIP:DMG: WriteRequestMessage = - [1663147558.231749][37702:37702] CHIP:DMG: { - [1663147558.231753][37702:37702] CHIP:DMG: suppressResponse = false, - [1663147558.231757][37702:37702] CHIP:DMG: timedRequest = false, - [1663147558.231760][37702:37702] CHIP:DMG: AttributeDataIBs = - [1663147558.231765][37702:37702] CHIP:DMG: [ - [1663147558.231767][37702:37702] CHIP:DMG: AttributeDataIB = - [1663147558.231771][37702:37702] CHIP:DMG: { - [1663147558.231773][37702:37702] CHIP:DMG: AttributePathIB = - [1663147558.231777][37702:37702] CHIP:DMG: { - [1663147558.231781][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147558.231784][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147558.231789][37702:37702] CHIP:DMG: Attribute = 0x0000_0010, - [1663147558.231792][37702:37702] CHIP:DMG: } - [1663147558.231795][37702:37702] CHIP:DMG: - [1663147558.231798][37702:37702] CHIP:DMG: Data = 5, - [1663147558.231801][37702:37702] CHIP:DMG: }, - [1663147558.231805][37702:37702] CHIP:DMG: - [1663147558.231809][37702:37702] CHIP:DMG: ], - [1663147558.231813][37702:37702] CHIP:DMG: - [1663147558.231816][37702:37702] CHIP:DMG: moreChunkedMessages = false, - [1663147558.231820][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147558.231822][37702:37702] CHIP:DMG: }, - [1663147558.231844][37702:37702] CHIP:DMG: IM WH moving to [AddStatus] - - ./chip-tool levelcontrol write on-transition-time 5 1 1 - Verify DUT(chip-tool) receives on-transition-time attribute response on the TH(all-clusters-minimal-app) Log: - [1663147582.702165][37702:37702] CHIP:IM: Received Write request - [1663147582.702168][37702:37702] CHIP:DMG: IM WH moving to [Initialized] - [1663147582.702179][37702:37702] CHIP:DMG: WriteRequestMessage = - [1663147582.702182][37702:37702] CHIP:DMG: { - [1663147582.702185][37702:37702] CHIP:DMG: suppressResponse = false, - [1663147582.702188][37702:37702] CHIP:DMG: timedRequest = false, - [1663147582.702191][37702:37702] CHIP:DMG: AttributeDataIBs = - [1663147582.702196][37702:37702] CHIP:DMG: [ - [1663147582.702199][37702:37702] CHIP:DMG: AttributeDataIB = - [1663147582.702202][37702:37702] CHIP:DMG: { - [1663147582.702205][37702:37702] CHIP:DMG: AttributePathIB = - [1663147582.702209][37702:37702] CHIP:DMG: { - [1663147582.702212][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147582.702216][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147582.702219][37702:37702] CHIP:DMG: Attribute = 0x0000_0012, - [1663147582.702222][37702:37702] CHIP:DMG: } - [1663147582.702226][37702:37702] CHIP:DMG: - [1663147582.702230][37702:37702] CHIP:DMG: Data = 5, - [1663147582.702233][37702:37702] CHIP:DMG: }, - [1663147582.702236][37702:37702] CHIP:DMG: - [1663147582.702239][37702:37702] CHIP:DMG: ], - [1663147582.702243][37702:37702] CHIP:DMG: - [1663147582.702246][37702:37702] CHIP:DMG: moreChunkedMessages = false, - [1663147582.702248][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147582.702252][37702:37702] CHIP:DMG: }, - [1663147582.702271][37702:37702] CHIP:DMG: IM WH moving to [AddStatus] - - ./chip-tool levelcontrol write off-transition-time 5 1 1 - Verify DUT(chip-tool) receives off-transition-time attribute response on the TH(all-clusters-minimal-app) Log: - [1663147605.317885][37702:37702] CHIP:IM: Received Write request - [1663147605.317891][37702:37702] CHIP:DMG: IM WH moving to [Initialized] - [1663147605.317910][37702:37702] CHIP:DMG: WriteRequestMessage = - [1663147605.317915][37702:37702] CHIP:DMG: { - [1663147605.317920][37702:37702] CHIP:DMG: suppressResponse = false, - [1663147605.317925][37702:37702] CHIP:DMG: timedRequest = false, - [1663147605.317930][37702:37702] CHIP:DMG: AttributeDataIBs = - [1663147605.317936][37702:37702] CHIP:DMG: [ - [1663147605.317941][37702:37702] CHIP:DMG: AttributeDataIB = - [1663147605.317945][37702:37702] CHIP:DMG: { - [1663147605.317950][37702:37702] CHIP:DMG: AttributePathIB = - [1663147605.317956][37702:37702] CHIP:DMG: { - [1663147605.317962][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147605.317968][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147605.317973][37702:37702] CHIP:DMG: Attribute = 0x0000_0013, - [1663147605.317978][37702:37702] CHIP:DMG: } - [1663147605.317985][37702:37702] CHIP:DMG: - [1663147605.317990][37702:37702] CHIP:DMG: Data = 5, - [1663147605.317996][37702:37702] CHIP:DMG: }, - [1663147605.318002][37702:37702] CHIP:DMG: - [1663147605.318007][37702:37702] CHIP:DMG: ], - [1663147605.318014][37702:37702] CHIP:DMG: - [1663147605.318018][37702:37702] CHIP:DMG: moreChunkedMessages = false, - [1663147605.318024][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147605.318028][37702:37702] CHIP:DMG: }, - [1663147605.318058][37702:37702] CHIP:DMG: IM WH moving to [AddStatus] - - ./chip-tool levelcontrol write default-move-rate 5 1 1 - Verify DUT(chip-tool) receives default-move-rate attribute response on the TH(all-clusters-minimal-app) Log: - [1663147644.857538][37702:37702] CHIP:IM: Received Write request - [1663147644.857541][37702:37702] CHIP:DMG: IM WH moving to [Initialized] - [1663147644.857552][37702:37702] CHIP:DMG: WriteRequestMessage = - [1663147644.857555][37702:37702] CHIP:DMG: { - [1663147644.857557][37702:37702] CHIP:DMG: suppressResponse = false, - [1663147644.857560][37702:37702] CHIP:DMG: timedRequest = false, - [1663147644.857562][37702:37702] CHIP:DMG: AttributeDataIBs = - [1663147644.857566][37702:37702] CHIP:DMG: [ - [1663147644.857568][37702:37702] CHIP:DMG: AttributeDataIB = - [1663147644.857571][37702:37702] CHIP:DMG: { - [1663147644.857574][37702:37702] CHIP:DMG: AttributePathIB = - [1663147644.857577][37702:37702] CHIP:DMG: { - [1663147644.857580][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147644.857582][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147644.857585][37702:37702] CHIP:DMG: Attribute = 0x0000_0014, - [1663147644.857587][37702:37702] CHIP:DMG: } - [1663147644.857591][37702:37702] CHIP:DMG: - [1663147644.857594][37702:37702] CHIP:DMG: Data = 5, - [1663147644.857596][37702:37702] CHIP:DMG: }, - [1663147644.857601][37702:37702] CHIP:DMG: - [1663147644.857603][37702:37702] CHIP:DMG: ], - [1663147644.857606][37702:37702] CHIP:DMG: - [1663147644.857609][37702:37702] CHIP:DMG: moreChunkedMessages = false, - [1663147644.857611][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147644.857613][37702:37702] CHIP:DMG: }, - [1663147644.857629][37702:37702] CHIP:DMG: IM WH moving to [AddStatus] - - ./chip-tool levelcontrol write start-up-current-level 5 1 1 - Verify DUT(chip-tool) receives start-up-current-level attribute response on the TH(all-clusters-minimal-app) Log: - [1663147665.149448][37702:37702] CHIP:IM: Received Write request - [1663147665.149453][37702:37702] CHIP:DMG: IM WH moving to [Initialized] - [1663147665.149474][37702:37702] CHIP:DMG: WriteRequestMessage = - [1663147665.149480][37702:37702] CHIP:DMG: { - [1663147665.149486][37702:37702] CHIP:DMG: suppressResponse = false, - [1663147665.149492][37702:37702] CHIP:DMG: timedRequest = false, - [1663147665.149497][37702:37702] CHIP:DMG: AttributeDataIBs = - [1663147665.149506][37702:37702] CHIP:DMG: [ - [1663147665.149511][37702:37702] CHIP:DMG: AttributeDataIB = - [1663147665.149520][37702:37702] CHIP:DMG: { - [1663147665.149525][37702:37702] CHIP:DMG: AttributePathIB = - [1663147665.149532][37702:37702] CHIP:DMG: { - [1663147665.149539][37702:37702] CHIP:DMG: Endpoint = 0x1, - [1663147665.149545][37702:37702] CHIP:DMG: Cluster = 0x8, - [1663147665.149552][37702:37702] CHIP:DMG: Attribute = 0x0000_4000, - [1663147665.149558][37702:37702] CHIP:DMG: } - [1663147665.149565][37702:37702] CHIP:DMG: - [1663147665.149572][37702:37702] CHIP:DMG: Data = 5, - [1663147665.149578][37702:37702] CHIP:DMG: }, - [1663147665.149586][37702:37702] CHIP:DMG: - [1663147665.149590][37702:37702] CHIP:DMG: ], - [1663147665.149598][37702:37702] CHIP:DMG: - [1663147665.149604][37702:37702] CHIP:DMG: moreChunkedMessages = false, - [1663147665.149609][37702:37702] CHIP:DMG: InteractionModelRevision = 1 - [1663147665.149614][37702:37702] CHIP:DMG: }, - [1663147665.149652][37702:37702] CHIP:DMG: IM WH moving to [AddStatus] - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml index f254239933333e..a133eb9a975531 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 223.2.1. [TC-REFALM-2.1] Attributes with DUT as Server +name: 222.2.1. [TC-REFALM-2.1] Attributes with DUT as Server PICS: - REFALM.S @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)" @@ -35,7 +40,7 @@ tests: "Step 2: Ensure that the door alarm is not locally suppressed and the door is closed" verification: | - + Ensure that the door alarm is not locally suppressed and the door is closed disabled: true - label: "Step 3: TH reads from the DUT the Mask attribute" diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml index ac82c955979496..da9473dc7e9d22 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)" diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml index ef4b026cf81dc5..be1df892bd9bcb 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml @@ -35,58 +35,93 @@ tests: - label: "Step 2: Ensure that the door on the DUT is closed" verification: | - + Ensure that the door on the DUT is closed disabled: true - label: "Step 3: TH reads from the DUT the State attribute" PICS: REFALM.S.A0002 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 0 + ./chip-tool refrigeratoralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. + + [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 + [1688447820.603415][4247:4249] CHIP:TOO: State: 0 + [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 4: TH reads from the DUT the Mask attribute" PICS: REFALM.S.A0000 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 1 + ./chip-tool refrigeratoralarm read mask 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. + + [1688447677.832882][4229:4231] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0000 DataVersion: 1795162772 + [1688447677.833165][4229:4231] CHIP:TOO: Mask: 1 + [1688447677.833494][4229:4231] CHIP:EM: <<< [E:27636i S:5449 M:199797248 (Ack:151091416)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 5: Manually open the door on the DUT" verification: | - + Manually open the door on the DUT disabled: true - label: "Step 6: Wait for the time defined in PIXIT.REFALM.AlarmThreshold" verification: | - + Wait for the time defined in PIXIT.REFALM.AlarmThreshold disabled: true - label: "Step 7: TH reads from the DUT the State attribute" PICS: REFALM.S.A0002 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 1 + ./chip-tool refrigeratoralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. + + [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 + [1688447820.603415][4247:4249] CHIP:TOO: State: 1 + [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 8: Invoke the on DUT sequence to suppress the alarm, do not close the door" verification: | - + Invoke the on DUT sequence to suppress the alarm, do not close the door disabled: true - label: "Step 9: TH reads from the DUT the State attribute" PICS: REFALM.S.A0002 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 0 + ./chip-tool refrigeratoralarm read state 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. + + [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 + [1688447820.603415][4247:4249] CHIP:TOO: State: 0 + [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 10: TH reads from the DUT the Mask attribute" PICS: REFALM.S.A0000 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 0 + ./chip-tool refrigeratoralarm read mask 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. + + [1688447677.832882][4229:4231] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0000 DataVersion: 1795162772 + [1688447677.833165][4229:4231] CHIP:TOO: Mask: 0 + [1688447677.833494][4229:4231] CHIP:EM: <<< [E:27636i S:5449 M:199797248 (Ack:151091416)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 11: TH reads from the DUT the Supported attribute" PICS: REFALM.S.A0003 verification: | - Verify that the DUT response contains a 32-bit value with bit 0 set to 1 + ./chip-tool refrigeratoralarm read supported 1 1 + On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. + + [1689677642.708638][18413:18415] CHIP:DMG: SuppressResponse = true, + [1689677642.708645][18413:18415] CHIP:DMG: InteractionModelRevision = 1 + [1689677642.708651][18413:18415] CHIP:DMG: } + [1689677642.708726][18413:18415] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0003 DataVersion: 1517282962 + [1689677642.708773][18413:18415] CHIP:TOO: Supported: 1 + [1689677642.708845][18413:18415] CHIP:EM: <<< [E:32432i S:53289 M:29829407 (Ack:142651059)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689677642.708859][18413:18415] CHIP:IN: (S) Sending msg 29829407 on secure session with LSID: 53289 + [1689677642.708900][18413:18415] CHIP:EM: Flushed pending ack for MessageCounter:142651059 on exchange 32432i disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml index 52fb1470313d36..5e6ac9becd140c 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml @@ -50,7 +50,7 @@ tests: saveAs: CurrentMaxMeasured constraints: type: int16u - minValue: CurrentMinMeasured + minValue: CurrentMinMeasured + 1 maxValue: 10000 - label: "Step 4: TH reads the MeasuredValue attribute from the DUT" diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml index 3a50dca22d51a7..7fa5f670b18342 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_3.yaml @@ -18,7 +18,9 @@ name: as Server PICS: - - RVCCLEANM.S + - RVCCLEANM.S.A0002 + - RVCCLEANM.S.A0003 + - RVCCLEANM.S.F00 config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml index 14583bde4cdf79..fe353a9ffa7801 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml @@ -752,7 +752,10 @@ tests: verification: | Run the below open-commissioning-window in TH Terminal - ./chip-tool pairing open-commissioning-window 1 1 200 2000 3840 + The user needs to change this command to match the longDiscriminator override. + use the same discriminator as the longDiscriminator of the DUT. + + ./chip-tool pairing open-commissioning-window 1 1 200 2000 verify success on TH (Chip-tool) logs: @@ -1062,7 +1065,9 @@ tests: DUT should start to send Commissionable Node Discovery DNS-SD advertisements" verification: | - If the device supports Discovery for an extended period of time, the Device should continue to advertise. Use the avahi-browse command and you should see the _matterc._udp advertisement + If the device supports Extended Discovery, pass the PROMPT before the extended time period expires. + + the Device should continue to advertise. Use the avahi-browse command and you should see the _matterc._udp advertisement Reference Raspberrypi device is not supporting extended discovery. cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml index 812dd4732ba046..7bfb258663ed7c 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml @@ -97,11 +97,11 @@ tests: GroupKeySetID: 0x01a3, GroupKeySecurityPolicy: 0, EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime0: 2220000, + EpochStartTime0: 1, EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime1: 2220001, + EpochStartTime1: 18446744073709551613, EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime2: 2220002, + EpochStartTime2: 18446744073709551614, } - label: "Step 3: TH binds GroupId to GroupKeySet" @@ -176,11 +176,11 @@ tests: GroupKeySetID: 0x01a3, GroupKeySecurityPolicy: 0, EpochKey0: null, - EpochStartTime0: 2220000, + EpochStartTime0: 1, EpochKey1: null, - EpochStartTime1: 2220001, + EpochStartTime1: 18446744073709551613, EpochKey2: null, - EpochStartTime2: 2220002, + EpochStartTime2: 18446744073709551614, } - label: diff --git a/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml b/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml index d6fa8b817564f0..2e138b9cac6680 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 26.1.2. [TC-SC-5.2] Receiving a group message - TH to DUT @@ -77,11 +76,11 @@ tests: GroupKeySetID: 0x01a3, GroupKeySecurityPolicy: 0, EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime0: 2220000, + EpochStartTime0: 1, EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime1: 2220001, + EpochStartTime1: 18446744073709551613, EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime2: 2220002, + EpochStartTime2: 18446744073709551614, } - label: "Step 3: TH binds GroupId to GroupKeySet" diff --git a/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml deleted file mode 100755 index 9929d3531f41b3..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_SM_1_1.yaml +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 54.1.1. [TC-SM-1.1] Device composition - Root Node [DUT as Server] - -PICS: - - MCORE.SM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes and endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - disabled: true - - - label: - "Step 2: C.2.10, Verify that endpoint 0 exists in the returned data" - verification: | - On TH(chip-tool), Verify that endpoint 0 exists in the returned report data Message - below is the sample log provided for the raspi platform: - - [1690185276.189258][40055:40057] CHIP:TOO: [28]: 4294048774 - [1690185276.189270][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 - [1690185276.189273][40055:40057] CHIP:TOO: ClientList: 1 entries - [1690185276.189275][40055:40057] CHIP:TOO: [1]: 41 - [1690185276.189286][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 - [1690185276.189290][40055:40057] CHIP:TOO: PartsList: 2 entries - [1690185276.189293][40055:40057] CHIP:TOO: [1]: 1 - [1690185276.189295][40055:40057] CHIP:TOO: [2]: 2 - [1690185276.189298][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 - [1690185276.189300][40055:40057] CHIP:TOO: FeatureMap: 0 - [1690185276.189309][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 1390630643 - [1690185276.189311][40055:40057] CHIP:TOO: ClusterRevision: 1 - [1690185276.189326][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 1390630643 - [1690185276.189329][40055:40057] CHIP:TOO: GeneratedCommandList: 0 entries - [1690185276.189339][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 1390630643 - [1690185276.189341][40055:40057] CHIP:TOO: AcceptedCommandList: 0 entries - [1690185276.189353][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 1390630643 - [1690185276.189356][40055:40057] CHIP:TOO: EventList: 0 entries - [1690185276.189374][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 1390630643 - [1690185276.189378][40055:40057] CHIP:TOO: AttributeList: 10 entries - [1690185276.189380][40055:40057] CHIP:TOO: [1]: 0 - [1690185276.189382][40055:40057] CHIP:TOO: [2]: 1 - [1690185276.189384][40055:40057] CHIP:TOO: [3]: 2 - [1690185276.189386][40055:40057] CHIP:TOO: [4]: 3 - [1690185276.189388][40055:40057] CHIP:TOO: [5]: 65528 - [1690185276.189390][40055:40057] CHIP:TOO: [6]: 65529 - [1690185276.189392][40055:40057] CHIP:TOO: [7]: 65530 - [1690185276.189394][40055:40057] CHIP:TOO: [8]: 65531 - [1690185276.189396][40055:40057] CHIP:TOO: [9]: 65532 - [1690185276.189398][40055:40057] CHIP:TOO: [10]: 65533 - [1690185276.189408][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 3752520678 - [1690185276.189411][40055:40057] CHIP:TOO: Binding: 0 entries - [1690185276.189414][40055:40057] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001E Attribute 0x0000_FFFC DataVersion: 3752520678 - [1690185276.189416][40055:40057] CHIP:TOO: FeatureMap: 0 - disabled: true - - - label: - "Step 3: C.2.10, Verify that the endpoint 0 descriptor cluster - DeviceTypeList includes the Root Node device type id (0x0016)" - verification: | - On TH(chip-tool), Verify that the endpoint 0 descriptor cluster DeviceTypeList includes the Root Node device type id - 0x0016(22) in the returned report data Message - below is the sample log provided for the raspi platform: - [1690191137.963592][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFA DataVersion: 2221012748 - [1690191137.963595][40907:40909] CHIP:TOO: EventList: 0 entries - [1690191137.963612][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Attribute 0x0000_FFFB DataVersion: 2221012748 - [1690191137.963616][40907:40909] CHIP:TOO: AttributeList: 7 entries - [1690191137.963619][40907:40909] CHIP:TOO: [1]: 0 - [1690191137.963621][40907:40909] CHIP:TOO: [2]: 65528 - [1690191137.963623][40907:40909] CHIP:TOO: [3]: 65529 - [1690191137.963625][40907:40909] CHIP:TOO: [4]: 65530 - [1690191137.963627][40907:40909] CHIP:TOO: [5]: 65531 - [1690191137.963629][40907:40909] CHIP:TOO: [6]: 65532 - [1690191137.963631][40907:40909] CHIP:TOO: [7]: 65533 - [1690191137.963649][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1390630643 - [1690191137.963657][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries - [1690191137.963663][40907:40909] CHIP:TOO: [1]: { - [1690191137.963665][40907:40909] CHIP:TOO: DeviceType: 22 - [1690191137.963667][40907:40909] CHIP:TOO: Revision: 1 - [1690191137.963669][40907:40909] CHIP:TOO: } - [1690191137.963704][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1390630643 - [1690191137.963712][40907:40909] CHIP:TOO: ServerList: 28 entries - [1690191137.963714][40907:40909] CHIP:TOO: [1]: 3 - [1690191137.963716][40907:40909] CHIP:TOO: [2]: 4 - [1690191137.963717][40907:40909] CHIP:TOO: [3]: 29 - [1690191137.963719][40907:40909] CHIP:TOO: [4]: 30 - [1690191137.963721][40907:40909] CHIP:TOO: [5]: 31 - [1690191137.963723][40907:40909] CHIP:TOO: [6]: 40 - [1690191137.963725][40907:40909] CHIP:TOO: [7]: 42 - [1690191137.963727][40907:40909] CHIP:TOO: [8]: 43 - [1690191137.963729][40907:40909] CHIP:TOO: [9]: 44 - [1690191137.963731][40907:40909] CHIP:TOO: [10]: 45 - disabled: true - - - label: - "Step 4: {REF_SM_ENDPOINT}, For each of the non-root endpoints, verify - that the descriptor cluster DeviceTypeList does NOT include the Root - Node device type id (0x0016)" - verification: | - On TH(chip-tool), For each of the non-root endpoints(endpoint - 1 and endpoint 2), verify that the descriptor cluster DeviceTypeList does NOT include the Root Node device type id - 0x0016(22) in the returned report data Message - below is the sample log provided for the raspi platform: - - [1690191138.044893][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_000F Attribute 0x0000_FFFB DataVersion: 4049418703 - [1690191138.044897][40907:40909] CHIP:TOO: AttributeList: 9 entries - [1690191138.044900][40907:40909] CHIP:TOO: [1]: 81 - [1690191138.044902][40907:40909] CHIP:TOO: [2]: 85 - [1690191138.044904][40907:40909] CHIP:TOO: [3]: 111 - [1690191138.044906][40907:40909] CHIP:TOO: [4]: 65528 - [1690191138.044908][40907:40909] CHIP:TOO: [5]: 65529 - [1690191138.044910][40907:40909] CHIP:TOO: [6]: 65530 - [1690191138.044912][40907:40909] CHIP:TOO: [7]: 65531 - [1690191138.044914][40907:40909] CHIP:TOO: [8]: 65532 - [1690191138.044916][40907:40909] CHIP:TOO: [9]: 65533 - [1690191138.044941][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2743502132 - [1690191138.044945][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries - [1690191138.044950][40907:40909] CHIP:TOO: [1]: { - [1690191138.044952][40907:40909] CHIP:TOO: DeviceType: 256 - [1690191138.044954][40907:40909] CHIP:TOO: Revision: 1 - [1690191138.044956][40907:40909] CHIP:TOO: } - [1690191138.045023][40907:40909] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 2743502132 - [1690191138.045038][40907:40909] CHIP:TOO: ServerList: 68 entries - [1690191138.045040][40907:40909] CHIP:TOO: [1]: 3 - [1690191138.045042][40907:40909] CHIP:TOO: [2]: 4 - - [1690191138.208428][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_0006 Attribute 0x0000_FFFB DataVersion: 1862188847 - [1690191138.208435][40907:40909] CHIP:TOO: AttributeList: 11 entries - [1690191138.208438][40907:40909] CHIP:TOO: [1]: 0 - [1690191138.208442][40907:40909] CHIP:TOO: [2]: 16384 - [1690191138.208445][40907:40909] CHIP:TOO: [3]: 16385 - [1690191138.208447][40907:40909] CHIP:TOO: [4]: 16386 - [1690191138.208450][40907:40909] CHIP:TOO: [5]: 16387 - [1690191138.208454][40907:40909] CHIP:TOO: [6]: 65528 - [1690191138.208456][40907:40909] CHIP:TOO: [7]: 65529 - [1690191138.208459][40907:40909] CHIP:TOO: [8]: 65530 - [1690191138.208462][40907:40909] CHIP:TOO: [9]: 65531 - [1690191138.208465][40907:40909] CHIP:TOO: [10]: 65532 - [1690191138.208467][40907:40909] CHIP:TOO: [11]: 65533 - [1690191138.208488][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 516620155 - [1690191138.208494][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries - [1690191138.208500][40907:40909] CHIP:TOO: [1]: { - [1690191138.208502][40907:40909] CHIP:TOO: DeviceType: 256 - [1690191138.208505][40907:40909] CHIP:TOO: Revision: 1 - [1690191138.208508][40907:40909] CHIP:TOO: } - [1690191138.208524][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 516620155 - [1690191138.208530][40907:40909] CHIP:TOO: ServerList: 5 entries - [1690191138.208532][40907:40909] CHIP:TOO: [1]: 4 - [1690191138.208536][40907:40909] CHIP:TOO: [2]: 6 - [1690191138.208539][40907:40909] CHIP:TOO: [3]: 29 - [1690191138.208542][40907:40909] CHIP:TOO: [4]: 47 - [1690191138.208546][40907:40909] CHIP:TOO: [5]: 1030 - [1690191138.208557][40907:40909] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 - [1690191138.208561][40907:40909] CHIP:TOO: ClientList: 0 entries - disabled: true - - - label: - "Step 5: C.2.10, Validate all the mandatory clusters for the Root Node - Device Type exist on the Root Node endpoint" - verification: | - On TH(chip-tool), Validate all the mandatory clusters(Basic Information(40), Access Control(31), Group Key Management(63) General Commissioning(48), Administrator Commissioning(60), Node Operational Credentials(62), Localization Configuration(43), Time Format Localization(44), Unit Localization(45), General Diagnostics(51), and ICD Management(70)) for the Root Node Device Type exist on the Root Node endpoint(endpoint 0) - - [1690191137.963649][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1390630643 - [1690191137.963657][40907:40909] CHIP:TOO: DeviceTypeList: 1 entries - [1690191137.963663][40907:40909] CHIP:TOO: [1]: { - [1690191137.963665][40907:40909] CHIP:TOO: DeviceType: 22 - [1690191137.963667][40907:40909] CHIP:TOO: Revision: 1 - [1690191137.963669][40907:40909] CHIP:TOO: } - [1690191137.963704][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1390630643 - [1690191137.963712][40907:40909] CHIP:TOO: ServerList: 28 entries - [1690191137.963714][40907:40909] CHIP:TOO: [1]: 3 - [1690191137.963716][40907:40909] CHIP:TOO: [2]: 4 - [1690191137.963717][40907:40909] CHIP:TOO: [3]: 29 - [1690191137.963719][40907:40909] CHIP:TOO: [4]: 30 - [1690191137.963721][40907:40909] CHIP:TOO: [5]: 31 - [1690191137.963723][40907:40909] CHIP:TOO: [6]: 40 - [1690191137.963725][40907:40909] CHIP:TOO: [7]: 42 - [1690191137.963727][40907:40909] CHIP:TOO: [8]: 43 - [1690191137.963729][40907:40909] CHIP:TOO: [9]: 44 - [1690191137.963731][40907:40909] CHIP:TOO: [10]: 45 - [1690191137.963733][40907:40909] CHIP:TOO: [11]: 47 - [1690191137.963735][40907:40909] CHIP:TOO: [12]: 48 - [1690191137.963737][40907:40909] CHIP:TOO: [13]: 49 - [1690191137.963739][40907:40909] CHIP:TOO: [14]: 50 - [1690191137.963742][40907:40909] CHIP:TOO: [15]: 51 - [1690191137.963744][40907:40909] CHIP:TOO: [16]: 52 - [1690191137.963745][40907:40909] CHIP:TOO: [17]: 53 - [1690191137.963747][40907:40909] CHIP:TOO: [18]: 54 - [1690191137.963749][40907:40909] CHIP:TOO: [19]: 55 - [1690191137.963751][40907:40909] CHIP:TOO: [20]: 56 - [1690191137.963753][40907:40909] CHIP:TOO: [21]: 60 - [1690191137.963754][40907:40909] CHIP:TOO: [22]: 62 - [1690191137.963756][40907:40909] CHIP:TOO: [23]: 63 - [1690191137.963758][40907:40909] CHIP:TOO: [24]: 64 - [1690191137.963760][40907:40909] CHIP:TOO: [25]: 65 - [1690191137.963762][40907:40909] CHIP:TOO: [26]: 70 - [1690191137.963764][40907:40909] CHIP:TOO: [27]: 1029 - [1690191137.963766][40907:40909] CHIP:TOO: [28]: 4294048774 - [1690191137.963778][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 - [1690191137.963781][40907:40909] CHIP:TOO: ClientList: 1 entries - [1690191137.963783][40907:40909] CHIP:TOO: [1]: 41 - [1690191137.963795][40907:40909] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 - [1690191137.963799][40907:40909] CHIP:TOO: PartsList: 2 entries - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml deleted file mode 100755 index 05286d1a00b825..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_SM_1_2.yaml +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 54.1.2. [TC-SM-1.2] Device composition - Topology [DUT as Server] - -PICS: - - MCORE.IDM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes on all - endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - disabled: true - - - label: - "Step 2: Verify the Descriptor cluster PartsList on endpoint 0 exactly - lists all the other (non-0) endpoints on the DUT - i.e. the endpoints - returned in step 1 (except EP 0) must be listed in the PartsList, and - all endpoints listed in the PartsList must be amongst the endpoint(s) - returned in step 1" - verification: | - On TH(chip-tool), Verify the Descriptor cluster PartsList on endpoint 0 exactly lists all the other (non-0) endpoints in the returned report data Message - below is the sample log provided for the raspi platform: - - [1690193538.813187][43091:43093] CHIP:TOO: [28]: 4294048774 - [1690193538.813213][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 - [1690193538.813220][43091:43093] CHIP:TOO: ClientList: 1 entries - [1690193538.813224][43091:43093] CHIP:TOO: [1]: 41 - [1690193538.813254][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 - [1690193538.813262][43091:43093] CHIP:TOO: PartsList: 2 entries - [1690193538.813268][43091:43093] CHIP:TOO: [1]: 1 - [1690193538.813276][43091:43093] CHIP:TOO: [2]: 2 - [1690193538.813281][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 - [1690193538.813283][43091:43093] CHIP:TOO: FeatureMap: 0 - disabled: true - - - label: - "Step 4: For each endpoint on the DUT (including EP 0), verify the - PartsList in the Descriptor cluster on that endpoint does not include - itself" - verification: | - On TH(chip-tool), verify the PartsList in the Descriptor cluster on that endpoint does not include itself For each endpoint on the DUT (including EP 0) in the returned report data Message - below is the sample log provided for the raspi platform: - - [1690193538.813187][43091:43093] CHIP:TOO: [28]: 4294048774 - [1690193538.813213][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1390630643 - [1690193538.813220][43091:43093] CHIP:TOO: ClientList: 1 entries - [1690193538.813224][43091:43093] CHIP:TOO: [1]: 41 - [1690193538.813254][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1390630643 - [1690193538.813262][43091:43093] CHIP:TOO: PartsList: 2 entries - [1690193538.813268][43091:43093] CHIP:TOO: [1]: 1 - [1690193538.813276][43091:43093] CHIP:TOO: [2]: 2 - [1690193538.813281][43091:43093] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 1390630643 - [1690193538.813283][43091:43093] CHIP:TOO: FeatureMap: 0 - - - [1690193538.869392][43091:43093] CHIP:TOO: [68]: 4294048773 - [1690193538.869403][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 2743502132 - [1690193538.869406][43091:43093] CHIP:TOO: ClientList: 1 entries - [1690193538.869408][43091:43093] CHIP:TOO: [1]: 6 - [1690193538.869417][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2743502132 - [1690193538.869420][43091:43093] CHIP:TOO: PartsList: 0 entries - [1690193538.869423][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 2743502132 - [1690193538.869425][43091:43093] CHIP:TOO: FeatureMap: 0 - [1690193538.869433][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 2743502132 - [1690193538.869435][43091:43093] CHIP:TOO: ClusterRevision: 1 - [1690193538.869450][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 2743502132 - [1690193538.869453][43091:43093] CHIP:TOO: GeneratedCommandList: 0 entries - [1690193538.869462][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFF9 DataVersion: 2743502132 - [1690193538.869464][43091:43093] CHIP:TOO: AcceptedCommandList: 0 entries - [1690193538.869476][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFA DataVersion: 2743502132 - [1690193538.869478][43091:43093] CHIP:TOO: EventList: 0 entries - [1690193538.869496][43091:43093] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_FFFB DataVersion: 2743502132 - - - [1690193539.051392][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 516620155 - [1690193539.051395][43091:43093] CHIP:TOO: ClientList: 0 entries - [1690193539.051410][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 516620155 - [1690193539.051414][43091:43093] CHIP:TOO: PartsList: 0 entries - [1690193539.051418][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFC DataVersion: 516620155 - [1690193539.051421][43091:43093] CHIP:TOO: FeatureMap: 0 - [1690193539.051435][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFFD DataVersion: 516620155 - [1690193539.051438][43091:43093] CHIP:TOO: ClusterRevision: 1 - [1690193539.051459][43091:43093] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_FFF8 DataVersion: 516620155 - [1690193539.051462][43091:43093] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true - - - label: - "Step 5: Create two empty list variables flat and tree, For each - non-root endpoint on the DUT, If the DeviceTypeList attribute in the - Descriptor cluster for that endpoint includes the Aggregator device - type(0x000e), add the endpoint id to the flat list, Otherwise, add - the endpoint id to the tree list" - verification: | - - disabled: true - - - label: - "Step 6: For each endpoint e in the tree list, walk the entire - PartsList tree and ensure e does not appear in any descendants." - verification: | - - disabled: true - - - label: - "Step 7: For each endpoint e in the flat list: * for each endpoint id - sub_id present in the in the PartsList of e, ensure that every id - listed in the PartsList for endpoint sub_id appears in the PartsList - of e" - verification: | - - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml index 41c94bc0ad274a..e0f6df2d917fb4 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml @@ -75,7 +75,7 @@ tests: response: constraints: type: list - contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - label: "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml index 0a88b2982d45ba..680b359d2b7d32 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_1_1.yaml @@ -75,7 +75,7 @@ tests: be 1 if and only if TCTL.S.F02(A_STEP) & TCTL.S.F00(TN)" command: "readAttribute" attribute: "FeatureMap" - PICS: TCTL.S.F02 && !TCTL.S.F00 + PICS: TCTL.S.F02 && TCTL.S.F00 response: constraints: type: bitmap32 diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index f6d1aae6b8a9b2..2081e133f84876 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -553,8 +553,16 @@ tests: type: list contains: [30] + - label: "Step 5a: Read the mandatory commands in AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: - "Step 5a: Read Feature dependent(TSTAT.S.F03(SCH)) commands in + "Step 5b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList" PICS: TSTAT.S.F03 command: "readAttribute" @@ -562,9 +570,11 @@ tests: response: constraints: type: list - contains: [0, 1, 2, 3] + contains: [1, 2, 3] - - label: "Step 5b: Read the optional attribute: AcceptedCommandList" + - label: + "Step 5c: Read the optional (GetRelayStatusLog) command in + AcceptedCommandList" PICS: TSTAT.S.C04.Rsp command: "readAttribute" attribute: "AcceptedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml index 574725b5c06b84..4d4ee2d4c7b70b 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml @@ -1736,20 +1736,52 @@ tests: anyOf: [4, 5] - label: - "Step 12: Write Attribute command for ControlSequenceOfOperation with - a new valid value" + "Step 12: TH writes value 1 for attribute ControlSequenceOfOperation. + If TSTAT.S.F01 is true & TSTAT.S.F00 is false" command: "writeAttribute" attribute: "ControlSequenceOfOperation" - PICS: TSTAT.S.F00 || TSTAT.S.F01 + PICS: TSTAT.S.F01 && !TSTAT.S.F00 arguments: - value: 2 + value: 1 - label: "Step 12: Read it back again to confirm the successful write" command: "readAttribute" attribute: "ControlSequenceOfOperation" - PICS: TSTAT.S.F00 || TSTAT.S.F01 + PICS: TSTAT.S.F01 && !TSTAT.S.F00 + response: + value: 1 + + - label: + "Step 12: TH writes value 3 for attribute ControlSequenceOfOperation. + If TSTAT.S.F00 is true & TSTAT.S.F01 is false" + command: "writeAttribute" + attribute: "ControlSequenceOfOperation" + PICS: TSTAT.S.F00 && !TSTAT.S.F01 + arguments: + value: 3 + + - label: "Step 12: Read it back again to confirm the successful write" + command: "readAttribute" + attribute: "ControlSequenceOfOperation" + PICS: TSTAT.S.F00 && !TSTAT.S.F01 + response: + value: 3 + + - label: + "Step 12: TH writes value 4 for attribute ControlSequenceOfOperation. + If TSTAT.S.F01 & TSTAT.S.F00 are true" + command: "writeAttribute" + attribute: "ControlSequenceOfOperation" + PICS: TSTAT.S.F00 && TSTAT.S.F01 + arguments: + value: 4 + + - label: "Step 12: Read it back again to confirm the successful write" + command: "readAttribute" + attribute: "ControlSequenceOfOperation" + PICS: TSTAT.S.F00 && TSTAT.S.F01 response: - value: 2 + value: 4 - label: "Writes MaxHeatSetpointLimit attribute to default value of 2950 to diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml index e88ffbd7703897..56d387720a5e23 100644 --- a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml @@ -31,7 +31,7 @@ tests: - name: "nodeId" value: nodeId - - label: "Step 2: TH read ClusterRevision attribute from the DUT" + - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." command: "readAttribute" attribute: "ClusterRevision" response: @@ -39,7 +39,7 @@ tests: constraints: type: int16u - - label: "Step 3: Read FeatureMap attribute from the DUT" + - label: "Step 3: TH reads from the DUT the FeatureMap attribute." command: "readAttribute" attribute: "FeatureMap" response: @@ -47,25 +47,36 @@ tests: constraints: type: bitmap32 - - label: "Step 4: Read the global attribute: AttributeList" + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: PICS_EVENT_LIST_ENABLED command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Step 4: Read the global attribute: AttributeList" + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: "!PICS_EVENT_LIST_ENABLED" command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - label: "Step 5: Read the global attribute: AcceptedCommandList" + - label: + "Step 4b: TH reads optional attribute(ScheduleProgrammingVisibility) + in AttributeList" + PICS: TSUIC.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "Step 5: TH reads from the DUT the AcceptedCommandList attribute." command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -73,7 +84,7 @@ tests: constraints: type: list - - label: "Step 6: Read the global attribute: GeneratedCommandList" + - label: "Step 6: TH reads from the DUT the GeneratedCommandList attribute." command: "readAttribute" attribute: "GeneratedCommandList" response: diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_4.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_4.yaml index 1a2431a63c9386..7f0951646ba01b 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_4.yaml @@ -25,7 +25,7 @@ config: endpoint: 1 fastMotionDuration: type: int16u - defaultValue: 3000 + defaultValue: 5000 fullMotionDuration: type: int16u defaultValue: 6000 diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_5.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_5.yaml index 54ce50c8176b59..735fb0aaff648f 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_5.yaml @@ -25,7 +25,7 @@ config: endpoint: 1 fastMotionDuration: type: int16u - defaultValue: 3000 + defaultValue: 5000 fullMotionDuration: type: int16u defaultValue: 6000 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 509c37ed6fd293..63caa7841d3ccf 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -784,16 +784,9 @@ LUNIT.S=1 LUNIT.S.F00=1 LUNIT.S.A0000=1 -LUNIT.TempUnit.Fahrenheit=1 -LUNIT.TempUnit.Celsius=1 -LUNIT.TempUnit.Kelvin=1 -LUNIT.C.A0000=1 -LUNIT.C.Afff8=1 -LUNIT.C.Afff9=1 -LUNIT.C.Afffa=1 -LUNIT.C.Afffb=1 -LUNIT.C.Afffc=1 -LUNIT.C.Afffd=1 +LUNIT.S.M.Fahrenheit=1 +LUNIT.S.M.Celsius=1 +LUNIT.S.M.Kelvin=1 LUNIT.C=1 @@ -1148,21 +1141,7 @@ DGWIFI.S.A000b=1 DGWIFI.S.A000c=1 # Client DGWIFI.C=1 -DGWIFI.C.A=0 -DGWIFI.C.A0000=1 -DGWIFI.C.A0001=1 -DGWIFI.C.A0002=1 -DGWIFI.C.A0003=1 -DGWIFI.C.A0004=1 -DGWIFI.C.A0005=1 -DGWIFI.C.A0006=1 -DGWIFI.C.A0007=1 -DGWIFI.C.A0008=1 -DGWIFI.C.A0009=1 -DGWIFI.C.A000a=1 -DGWIFI.C.A000b=1 -DGWIFI.C.A000c=1 -DGWIFI.C.C00.Tx=0 +DGWIFI.S.C00.Tx=0 # Events DGWIFI.S.E00=1 DGWIFI.S.E01=1 diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index b6a4f38f9c90d2..e5c4da8fc77b85 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -136,9 +136,7 @@ "Test_TC_IDM_6_3", "Test_TC_IDM_6_4", "Test_TC_IDM_7_1", - "Test_TC_IDM_8_1", - "Test_TC_IDM_10_1", - "Test_TC_IDM_11_1" + "Test_TC_IDM_8_1" ], "MediaControl": [ "Test_TC_LOWPOWER_2_2", diff --git a/src/app/zap-templates/templates/app/MatterIDL_Client.zapt b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt index 50d59f4fc2f38e..6902609e2f76bd 100644 --- a/src/app/zap-templates/templates/app/MatterIDL_Client.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt @@ -1,12 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{>idl_structure_definition extraIndent=0}} - -{{/if}} -{{/zcl_structs}} {{#zcl_clusters~}} {{>idl_cluster_definition generateClientCluster=1}} {{/zcl_clusters}} diff --git a/src/app/zap-templates/templates/app/MatterIDL_Server.zapt b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt index 02e857d8c43f08..0e36361bef1a5f 100644 --- a/src/app/zap-templates/templates/app/MatterIDL_Server.zapt +++ b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt @@ -1,12 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{>idl_structure_definition extraIndent=0}} - -{{/if}} -{{/zcl_structs}} {{#all_user_clusters~}} {{#if (is_client side)~}} {{>idl_cluster_definition generateClientCluster=1}} diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 06f81c08a52b23..5d9ec2b27415b7 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1,38 +1,6 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. -struct ModeTagStruct { - optional vendor_id mfgCode = 0; - enum16 value = 1; -} - -struct ModeOptionStruct { - char_string<64> label = 0; - int8u mode = 1; - ModeTagStruct modeTags[] = 2; -} - -struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; -} - -struct ErrorStateStruct { - enum8 errorStateID = 0; - optional char_string<64> errorStateLabel = 1; - optional char_string<64> errorStateDetails = 2; -} - -struct LabelStruct { - char_string<16> label = 0; - char_string<16> value = 1; -} - -struct OperationalStateStruct { - enum8 operationalStateID = 0; - optional char_string<64> operationalStateLabel = 1; -} - /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py b/src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py index 40f19221358f68..aecba0b2c454e0 100644 --- a/src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py +++ b/src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py @@ -28,12 +28,12 @@ class Runner(TestRunner): - def __init__(self, repl_storage_path: str, commission_on_network_dut: bool): + def __init__(self, repl_storage_path: str, node_id_to_commission: int = None): self._repl_runner = None self._chip_stack = None self._certificate_authority_manager = None self._repl_storage_path = repl_storage_path - self._commission_on_network_dut = commission_on_network_dut + self._node_id_to_commission = node_id_to_commission async def start(self): chip.native.Init() @@ -43,13 +43,8 @@ async def start(self): chip_stack, chip_stack.GetStorageManager()) certificate_authority_manager.LoadAuthoritiesFromStorage() - commission_device = False if len(certificate_authority_manager.activeCaList) == 0: - if self._commission_on_network_dut is False: - raise Exception( - 'Provided repl storage does not contain certificate. Without commission_on_network_dut, there is no reachable DUT') certificate_authority_manager.NewCertificateAuthority() - commission_device = True if len(certificate_authority_manager.activeCaList[0].adminList) == 0: certificate_authority_manager.activeCaList[0].NewFabricAdmin( @@ -58,9 +53,13 @@ async def start(self): ca_list = certificate_authority_manager.activeCaList dev_ctrl = ca_list[0].adminList[0].NewController() - if commission_device: - # These magic values are the defaults expected for YAML tests - dev_ctrl.CommissionWithCode('MT:-24J0AFN00KA0648G00', 0x12344321) + + # Unfortunately there is no convenient way to confirm if the provided node_id has + # already been commissioned. At this point we blindly trust that we should commission + # device with the provided node id. + if self._node_id_to_commission is not None: + # Magic value is the defaults expected for YAML tests. + dev_ctrl.CommissionWithCode('MT:-24J0AFN00KA0648G00', self._node_id_to_commission) self._chip_stack = chip_stack self._certificate_authority_manager = certificate_authority_manager diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index 9c60ee42c1019d..2abc6e2795fd38 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -15,7 +15,9 @@ import("//build_overrides/chip.gni") import("//build_overrides/nlassert.gni") import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/lib/core/core.gni") import("${chip_root}/src/platform/device.gni") + declare_args() { chip_build_example_creds = true } @@ -126,6 +128,24 @@ static_library("credentials") { ] } +source_set("test_paa_store") { + sources = [ + "attestation_verifier/TestPAAStore.cpp", + "attestation_verifier/TestPAAStore.h", + ] + + public_deps = [ + "${chip_root}/src/lib/core:chip_config_header", # for lib/support/Span.h + "${nlassert_root}:nlassert", # for lib/support/Span.h + ] + if (chip_pw_tokenizer_logging) { + import("//build_overrides/pigweed.gni") + public_deps += [ + "${dir_pw_tokenizer}", # for /lib/support/Span.h + ] + } +} + static_library("default_attestation_verifier") { output_name = "libDefaultAttestationVerifier" @@ -144,6 +164,7 @@ static_library("default_attestation_verifier") { public_deps = [ ":credentials", + ":test_paa_store", "${chip_root}/src/crypto", "${nlassert_root}:nlassert", ] diff --git a/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp b/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp index 7a5ac72b203168..0d7f67ff82b0f6 100644 --- a/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp +++ b/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -29,14 +30,8 @@ #include #include -namespace chip { -namespace TestCerts { -extern const Span kTestAttestationTrustStoreRoots; -} // namespace TestCerts -} // namespace chip - using namespace chip::Crypto; -using chip::TestCerts::kTestAttestationTrustStoreRoots; +using chip::TestCerts::GetTestPaaRootStore; namespace chip { namespace Credentials { @@ -274,9 +269,7 @@ constexpr std::array gCdSigningKeys = { { struct TestAttestationTrustStore final : public ArrayAttestationTrustStore { - TestAttestationTrustStore() : - ArrayAttestationTrustStore(kTestAttestationTrustStoreRoots.data(), kTestAttestationTrustStoreRoots.size()) - {} + TestAttestationTrustStore() : ArrayAttestationTrustStore(GetTestPaaRootStore().data(), GetTestPaaRootStore().size()) {} }; Global gTestAttestationTrustStore; diff --git a/src/credentials/attestation_verifier/TestPAAStore.cpp b/src/credentials/attestation_verifier/TestPAAStore.cpp new file mode 100644 index 00000000000000..76637c130b547d --- /dev/null +++ b/src/credentials/attestation_verifier/TestPAAStore.cpp @@ -0,0 +1,93 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace chip { +namespace TestCerts { + +// ${chip_root}/credentials/test/attestation/Chip-Test-PAA-FFF1-Cert.pem + +constexpr uint8_t sTestCert_PAA_FFF1_Cert_Array[] = { + 0x30, 0x82, 0x01, 0xbd, 0x30, 0x82, 0x01, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4e, 0xa8, 0xe8, 0x31, 0x82, 0xd4, + 0x1c, 0x1c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, + 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, + 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, + 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xb6, 0xcb, 0x63, 0x72, 0x88, 0x7f, 0x29, 0x28, 0xf5, 0xba, 0xc8, 0x1a, 0xa9, 0xd9, + 0x3a, 0xe2, 0x43, 0x1c, 0xad, 0xa9, 0xd7, 0x9e, 0x24, 0x2f, 0x65, 0x17, 0x7e, 0xf9, 0xce, 0xd9, 0x32, 0xa2, 0x8e, 0xcd, 0x03, + 0xba, 0xaf, 0x6a, 0x8f, 0xca, 0x18, 0x4a, 0x1a, 0x50, 0x35, 0x42, 0x96, 0x0d, 0x45, 0x3f, 0x30, 0x3f, 0x1f, 0x19, 0x42, 0x1d, + 0x75, 0x1e, 0x8f, 0x8f, 0x1a, 0x9a, 0x9b, 0x75, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, + 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, + 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x6a, 0xfd, 0x22, 0x77, + 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x6a, 0xfd, 0x22, 0x77, 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, + 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, + 0x00, 0x30, 0x44, 0x02, 0x20, 0x50, 0xaa, 0x80, 0x02, 0xf4, 0xd9, 0x32, 0xa9, 0xa0, 0x05, 0x38, 0xf6, 0x53, 0x68, 0xad, 0x0f, + 0xff, 0xc8, 0xef, 0xbb, 0xc9, 0xbe, 0xb7, 0xda, 0x56, 0x98, 0x35, 0xcf, 0x9a, 0xa7, 0x51, 0x0e, 0x02, 0x20, 0x23, 0xba, 0xc8, + 0xfe, 0x0f, 0x23, 0xe7, 0x54, 0x45, 0xb6, 0x53, 0x39, 0x08, 0x1a, 0x47, 0x99, 0x49, 0x29, 0xc7, 0x2a, 0xaf, 0x0a, 0x15, 0x48, + 0xd4, 0x0d, 0x03, 0x4d, 0x51, 0x4b, 0x25, 0xde, +}; + +// These are used directly by the CryptoPAL test, so need to be declared extern +extern constexpr ByteSpan sTestCert_PAA_FFF1_Cert = ByteSpan(sTestCert_PAA_FFF1_Cert_Array); + +// ${chip_root}/credentials/test/attestation/Chip-Test-PAA-NoVID-Cert.pem + +constexpr uint8_t sTestCert_PAA_NoVID_Cert_Array[] = { + 0x30, 0x82, 0x01, 0x91, 0x30, 0x82, 0x01, 0x37, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x07, 0x0b, 0x8f, 0xba, 0xa8, 0xdd, 0x86, + 0xee, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, + 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, 0x30, + 0x20, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, + 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, 0x30, 0x59, + 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x03, 0x42, 0x00, 0x04, 0x10, 0xef, 0x02, 0xa8, 0x1a, 0x87, 0xb6, 0x81, 0x21, 0xfb, 0xa8, 0xd3, 0x19, 0x78, 0xf8, 0x07, 0xa3, + 0x17, 0xe5, 0x0a, 0xa8, 0xa8, 0x28, 0x44, 0x68, 0x28, 0x91, 0x4b, 0x93, 0x3d, 0xe8, 0xed, 0xd4, 0xa5, 0xc3, 0x9c, 0x9f, 0xf7, + 0x1a, 0x4c, 0xe3, 0x64, 0x7f, 0xd7, 0xf6, 0x26, 0x53, 0xb7, 0xd2, 0x49, 0x5f, 0xcb, 0xa4, 0xc0, 0xf4, 0x7f, 0x87, 0x68, 0x80, + 0x03, 0x9e, 0x07, 0x20, 0x4a, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, + 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, + 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, + 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, 0xea, 0x69, 0x68, 0x82, 0xd5, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, + 0x18, 0x30, 0x16, 0x80, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, 0xea, + 0x69, 0x68, 0x82, 0xd5, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, + 0x02, 0x21, 0x00, 0xb9, 0xef, 0xdb, 0x3e, 0xa0, 0x6a, 0x52, 0xec, 0x0b, 0xf0, 0x1e, 0x61, 0xda, 0xed, 0x2c, 0x2d, 0x15, 0x6d, + 0xdb, 0x6c, 0xf0, 0x14, 0x10, 0x1d, 0xab, 0x79, 0x8f, 0xac, 0x05, 0xfa, 0x47, 0xe5, 0x02, 0x20, 0x60, 0x06, 0x1d, 0x3e, 0x35, + 0xd6, 0x0d, 0x9d, 0x4b, 0x0d, 0x44, 0x8d, 0xad, 0x76, 0x12, 0xf7, 0xe8, 0x5c, 0x58, 0x2e, 0x3f, 0xc3, 0x12, 0xdc, 0x18, 0x79, + 0x4d, 0xd3, 0x73, 0x71, 0x5e, 0x5d, +}; + +// These are used directly by the CryptoPAL test, so need to be declared extern +extern constexpr ByteSpan sTestCert_PAA_NoVID_Cert = ByteSpan(sTestCert_PAA_NoVID_Cert_Array); + +const Span kTestAttestationTrustStoreRoots((const ByteSpan[]){ + sTestCert_PAA_FFF1_Cert, + sTestCert_PAA_NoVID_Cert, +}); + +const Span & GetTestPaaRootStore() +{ + return kTestAttestationTrustStoreRoots; +} + +} // namespace TestCerts +} // namespace chip diff --git a/src/credentials/attestation_verifier/TestPAAStore.h b/src/credentials/attestation_verifier/TestPAAStore.h new file mode 100644 index 00000000000000..c690ae68acd832 --- /dev/null +++ b/src/credentials/attestation_verifier/TestPAAStore.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2021-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Storage for test attestation PAA certificates. Contains the certs for + * the 0xFFF1 vid PAA cert and the test PAA cert with no VID. + * + * These certs are used by the device attestation and crypto tests + * and by the DefaultDeviceAttestationVerifier. + */ + +#pragma once + +#include + +namespace chip { +namespace TestCerts { + +extern const ByteSpan sTestCert_PAA_FFF1_Cert; +extern const ByteSpan sTestCert_PAA_NoVID_Cert; + +const Span & GetTestPaaRootStore(); + +} // namespace TestCerts +} // namespace chip diff --git a/src/credentials/tests/BUILD.gn b/src/credentials/tests/BUILD.gn index fd24132e4cab1b..05b58b9f3f0441 100644 --- a/src/credentials/tests/BUILD.gn +++ b/src/credentials/tests/BUILD.gn @@ -36,7 +36,10 @@ static_library("cert_test_vectors") { cflags = [ "-Wconversion" ] - public_deps = [ "${chip_root}/src/credentials" ] + public_deps = [ + "${chip_root}/src/credentials", + "${chip_root}/src/credentials:test_paa_store", + ] } chip_test_suite("tests") { diff --git a/src/credentials/tests/CHIPAttCert_test_vectors.cpp b/src/credentials/tests/CHIPAttCert_test_vectors.cpp index 84d35f4f194f01..06e09b17580da4 100644 --- a/src/credentials/tests/CHIPAttCert_test_vectors.cpp +++ b/src/credentials/tests/CHIPAttCert_test_vectors.cpp @@ -3347,35 +3347,6 @@ constexpr uint8_t sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_PrivateKey_Array[] extern const ByteSpan sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_PrivateKey = ByteSpan(sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_PrivateKey_Array); -// ${chip_root}/credentials/test/attestation/Chip-Test-PAA-FFF1-Cert.pem - -constexpr uint8_t sTestCert_PAA_FFF1_Cert_Array[] = { - 0x30, 0x82, 0x01, 0xbd, 0x30, 0x82, 0x01, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4e, 0xa8, 0xe8, 0x31, 0x82, 0xd4, - 0x1c, 0x1c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, - 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, - 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, - 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, - 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, - 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, - 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, - 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, - 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xb6, 0xcb, 0x63, 0x72, 0x88, 0x7f, 0x29, 0x28, 0xf5, 0xba, 0xc8, 0x1a, 0xa9, 0xd9, - 0x3a, 0xe2, 0x43, 0x1c, 0xad, 0xa9, 0xd7, 0x9e, 0x24, 0x2f, 0x65, 0x17, 0x7e, 0xf9, 0xce, 0xd9, 0x32, 0xa2, 0x8e, 0xcd, 0x03, - 0xba, 0xaf, 0x6a, 0x8f, 0xca, 0x18, 0x4a, 0x1a, 0x50, 0x35, 0x42, 0x96, 0x0d, 0x45, 0x3f, 0x30, 0x3f, 0x1f, 0x19, 0x42, 0x1d, - 0x75, 0x1e, 0x8f, 0x8f, 0x1a, 0x9a, 0x9b, 0x75, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, - 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, - 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x6a, 0xfd, 0x22, 0x77, - 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x1f, 0x06, 0x03, 0x55, - 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x6a, 0xfd, 0x22, 0x77, 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, - 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, - 0x00, 0x30, 0x44, 0x02, 0x20, 0x50, 0xaa, 0x80, 0x02, 0xf4, 0xd9, 0x32, 0xa9, 0xa0, 0x05, 0x38, 0xf6, 0x53, 0x68, 0xad, 0x0f, - 0xff, 0xc8, 0xef, 0xbb, 0xc9, 0xbe, 0xb7, 0xda, 0x56, 0x98, 0x35, 0xcf, 0x9a, 0xa7, 0x51, 0x0e, 0x02, 0x20, 0x23, 0xba, 0xc8, - 0xfe, 0x0f, 0x23, 0xe7, 0x54, 0x45, 0xb6, 0x53, 0x39, 0x08, 0x1a, 0x47, 0x99, 0x49, 0x29, 0xc7, 0x2a, 0xaf, 0x0a, 0x15, 0x48, - 0xd4, 0x0d, 0x03, 0x4d, 0x51, 0x4b, 0x25, 0xde, -}; - -extern const ByteSpan sTestCert_PAA_FFF1_Cert = ByteSpan(sTestCert_PAA_FFF1_Cert_Array); - constexpr uint8_t sTestCert_PAA_FFF1_SKID_Array[] = { 0x6A, 0xFD, 0x22, 0x77, 0x1F, 0x51, 0x1F, 0xEC, 0xBF, 0x16, 0x41, 0x97, 0x67, 0x10, 0xDC, 0xDC, 0x31, 0xA1, 0x71, 0x7E, }; @@ -3506,33 +3477,6 @@ constexpr uint8_t sTestCert_PAA_FFF2_ValInPast_PrivateKey_Array[] = { extern const ByteSpan sTestCert_PAA_FFF2_ValInPast_PrivateKey = ByteSpan(sTestCert_PAA_FFF2_ValInPast_PrivateKey_Array); -// ${chip_root}/credentials/test/attestation/Chip-Test-PAA-NoVID-Cert.pem - -constexpr uint8_t sTestCert_PAA_NoVID_Cert_Array[] = { - 0x30, 0x82, 0x01, 0x91, 0x30, 0x82, 0x01, 0x37, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x07, 0x0b, 0x8f, 0xba, 0xa8, 0xdd, 0x86, - 0xee, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, 0x30, - 0x20, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, - 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, - 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, 0x30, 0x59, - 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, - 0x03, 0x42, 0x00, 0x04, 0x10, 0xef, 0x02, 0xa8, 0x1a, 0x87, 0xb6, 0x81, 0x21, 0xfb, 0xa8, 0xd3, 0x19, 0x78, 0xf8, 0x07, 0xa3, - 0x17, 0xe5, 0x0a, 0xa8, 0xa8, 0x28, 0x44, 0x68, 0x28, 0x91, 0x4b, 0x93, 0x3d, 0xe8, 0xed, 0xd4, 0xa5, 0xc3, 0x9c, 0x9f, 0xf7, - 0x1a, 0x4c, 0xe3, 0x64, 0x7f, 0xd7, 0xf6, 0x26, 0x53, 0xb7, 0xd2, 0x49, 0x5f, 0xcb, 0xa4, 0xc0, 0xf4, 0x7f, 0x87, 0x68, 0x80, - 0x03, 0x9e, 0x07, 0x20, 0x4a, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, - 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, - 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, - 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, 0xea, 0x69, 0x68, 0x82, 0xd5, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, - 0x18, 0x30, 0x16, 0x80, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, 0xea, - 0x69, 0x68, 0x82, 0xd5, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, - 0x02, 0x21, 0x00, 0xb9, 0xef, 0xdb, 0x3e, 0xa0, 0x6a, 0x52, 0xec, 0x0b, 0xf0, 0x1e, 0x61, 0xda, 0xed, 0x2c, 0x2d, 0x15, 0x6d, - 0xdb, 0x6c, 0xf0, 0x14, 0x10, 0x1d, 0xab, 0x79, 0x8f, 0xac, 0x05, 0xfa, 0x47, 0xe5, 0x02, 0x20, 0x60, 0x06, 0x1d, 0x3e, 0x35, - 0xd6, 0x0d, 0x9d, 0x4b, 0x0d, 0x44, 0x8d, 0xad, 0x76, 0x12, 0xf7, 0xe8, 0x5c, 0x58, 0x2e, 0x3f, 0xc3, 0x12, 0xdc, 0x18, 0x79, - 0x4d, 0xd3, 0x73, 0x71, 0x5e, 0x5d, -}; - -extern const ByteSpan sTestCert_PAA_NoVID_Cert = ByteSpan(sTestCert_PAA_NoVID_Cert_Array); - constexpr uint8_t sTestCert_PAA_NoVID_SKID_Array[] = { 0x78, 0x5C, 0xE7, 0x05, 0xB8, 0x6B, 0x8F, 0x4E, 0x6F, 0xC7, 0x93, 0xAA, 0x60, 0xCB, 0x43, 0xEA, 0x69, 0x68, 0x82, 0xD5, }; @@ -4289,10 +4233,5 @@ constexpr uint8_t sTestCert_PAI_FFF2_NoPID_Resigned_SKID_Array[] = { extern const ByteSpan sTestCert_PAI_FFF2_NoPID_Resigned_SKID = ByteSpan(sTestCert_PAI_FFF2_NoPID_Resigned_SKID_Array); -extern constexpr Span kTestAttestationTrustStoreRoots((const ByteSpan[]){ - sTestCert_PAA_FFF1_Cert, - sTestCert_PAA_NoVID_Cert, -}); - } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/CHIPAttCert_test_vectors.h b/src/credentials/tests/CHIPAttCert_test_vectors.h index 8be73c4a38f09d..00f013bf6b7b2e 100644 --- a/src/credentials/tests/CHIPAttCert_test_vectors.h +++ b/src/credentials/tests/CHIPAttCert_test_vectors.h @@ -23,9 +23,6 @@ namespace chip { namespace TestCerts { -// Root CA certs for chip::Credentials::GetTestAttestationTrustStore() -extern const Span kTestAttestationTrustStoreRoots; - extern const ByteSpan sTestCert_DAC_FFF1_8000_0000_2CDPs_Cert; extern const ByteSpan sTestCert_DAC_FFF1_8000_0000_2CDPs_SKID; extern const ByteSpan sTestCert_DAC_FFF1_8000_0000_2CDPs_PublicKey; @@ -316,7 +313,7 @@ extern const ByteSpan sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_SKID; extern const ByteSpan sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_PublicKey; extern const ByteSpan sTestCert_DAC_FFF2_8006_0035_Val1SecBefore_PrivateKey; -extern const ByteSpan sTestCert_PAA_FFF1_Cert; +// Cert is provided in the PAA store file as it is used in the default verifier. extern const ByteSpan sTestCert_PAA_FFF1_SKID; extern const ByteSpan sTestCert_PAA_FFF1_PublicKey; extern const ByteSpan sTestCert_PAA_FFF1_PrivateKey; @@ -331,7 +328,7 @@ extern const ByteSpan sTestCert_PAA_FFF2_ValInPast_SKID; extern const ByteSpan sTestCert_PAA_FFF2_ValInPast_PublicKey; extern const ByteSpan sTestCert_PAA_FFF2_ValInPast_PrivateKey; -extern const ByteSpan sTestCert_PAA_NoVID_Cert; +// Cert is provided in the PAA store file as it is used in the default verifier. extern const ByteSpan sTestCert_PAA_NoVID_SKID; extern const ByteSpan sTestCert_PAA_NoVID_PublicKey; extern const ByteSpan sTestCert_PAA_NoVID_PrivateKey; diff --git a/src/credentials/tests/TestDeviceAttestationCredentials.cpp b/src/credentials/tests/TestDeviceAttestationCredentials.cpp index c24b0468d90f5e..4707caa3bc6669 100644 --- a/src/credentials/tests/TestDeviceAttestationCredentials.cpp +++ b/src/credentials/tests/TestDeviceAttestationCredentials.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/crypto/tests/BUILD.gn b/src/crypto/tests/BUILD.gn index 0f2fde50996481..cc08520c6dfbbf 100644 --- a/src/crypto/tests/BUILD.gn +++ b/src/crypto/tests/BUILD.gn @@ -64,6 +64,7 @@ chip_test_suite("tests") { cflags = [ "-Wconversion" ] public_deps = [ + "${chip_root}/src/credentials:test_paa_store", "${chip_root}/src/credentials/tests:cert_test_vectors", "${chip_root}/src/crypto", "${chip_root}/src/lib/core", diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index fd2c79b06c5b10..14e5ec9c052ead 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -57,6 +57,7 @@ #endif #include +#include #include #include diff --git a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm index ad6900a001f41e..ece651a21238de 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm +++ b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm @@ -47,7 +47,7 @@ @interface MTRAsyncCallbackQueueWorkItem () @property (nonatomic, strong) MTRAsyncCallbackWorkQueue * workQueue; @property (nonatomic, readonly) BOOL enqueued; // Called by the queue -- (void)markedEnqueued; +- (void)markEnqueued; - (void)callReadyHandlerWithContext:(id)context; - (void)cancel; @end @@ -85,7 +85,7 @@ - (void)enqueueWorkItem:(MTRAsyncCallbackQueueWorkItem *)item return; } - [item markedEnqueued]; + [item markEnqueued]; os_unfair_lock_lock(&_lock); item.workQueue = self; @@ -204,7 +204,7 @@ - (void)invalidate os_unfair_lock_unlock(&_lock); } -- (void)markedEnqueued +- (void)markEnqueued { os_unfair_lock_lock(&_lock); _enqueued = YES; diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h index 259bf1dbc78a25..5bc302c6e39714 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h @@ -19,66 +19,187 @@ NS_ASSUME_NONNULL_BEGIN -@class MTRAsyncWorkItem; - -typedef void (^MTRAsyncWorkReadyHandler)(id context, NSUInteger retryCount); - -// MTRAsyncWorkQueue high level description -// The MTRAsyncWorkQueue was made to call one readyHandler -// block at a time asynchronously, and the readyHandler is -// expected to start/schedule a task. When the task finishes -// asynchronously in the future (at any time, from any queue -// or thread), it is expected to ask the workItem object to -// either endWork or retryWork. - -// Sequence of steps when queuing a work item: -// - Create MTRAsyncWorkItem object -// - Create ready handler block (MTRAsyncWorkReadyHandler) -// - block is called when it's the WorkItem's turn to do work -// - its body is to perform a task that is expected to end asynchronously in the future -// - at the end of work, call on the work item object: -// - endWork for success or failure -// - retryWork for temporary failures -// - Set the readyHandler block on the WorkItem object -// - Call enqueueWorkItem on a MTRAsyncWorkQueue - -// A serial one-at-a-time queue for performing work items +typedef NS_ENUM(NSInteger, MTRAsyncWorkOutcome) { + MTRAsyncWorkComplete, + MTRAsyncWorkNeedsRetry, +}; + +/// The type of completion handler passed to `MTRAsyncWorkItem`. +/// Return YES if the completion call was valid, or NO if the +/// work item was already completed previously (e.g. due to +/// being cancelled). +typedef BOOL (^MTRAsyncWorkCompletionBlock)(MTRAsyncWorkOutcome outcome); + +/// An optional handler that controls batching of MTRAsyncWorkItem. +/// +/// When a work item is dequeued to run, if it is of a type that can be +/// combined with similar work items in a batch, this facility provides an +/// opportunity to coalesce and merge work items. +/// +/// The batching handler is called by the work queue when all of the following +/// are true: +/// 1) A work item that is batchable is about to be executed for the first time +/// 2) The next work item in the queue is also batchable +/// 3) The two work items have identical batching ids +/// +/// The handler will be passed the opaque data of the two work items: +/// `opaqueDataCurrent` is the data of the item about to be executed and +/// `opaqueDataNext` is the data for the next item. The `fullyMerged` parameter +/// will be initialized to NO by the caller. +/// +/// The handler is expected to mutate the data as needed to achieve batching. +/// +/// If after the data mutations opaqueDataNext no longer requires any work, the +/// handler should set `fullyMerged` to YES to indicate that the next item can +/// be dropped from the queue. In this case, the handler may be called again to +/// possibly also batch the work item after the one that was dropped. +/// +/// @see MTRAsyncWorkItem +typedef void (^MTRAsyncWorkBatchingHandler)(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged); + +/// An optional handler than enables duplicate checking for MTRAsyncWorkItem. +/// +/// The duplicate check handler is called when the client wishes to check +/// whether a new candidate work item is a duplicate of an existing queued +/// item, so that the client may decide to not enqueue the duplicate work. +/// Duplicate checking is performed in reverse queue order, i.e. more +/// recently enqueued items will be checked first. +/// +/// The handler will be passed the opaque data of the candidate work item. The +/// `stop` and `isDuplicate` parameters will be initialized to NO by the caller. +/// +/// If the handler determines the data is indeed duplicate work, it should +/// set `stop` to YES, and set `isDuplicate` to YES. +/// +/// If the handler determines the data is not duplicate work, it should set +/// `stop` to YES, and set `isDuplicate` to NO. +/// +/// If the handler is unable to determine if the data is duplicate work, it +/// should set `stop` to NO; the value of `isDuplicate` will be ignored. +/// +/// @see MTRAsyncWorkItem +typedef void (^MTRAsyncWorkDuplicateCheckHandler)(id opaqueItemData, BOOL * isDuplicate, BOOL * stop); + +/// A unit of work that can be run on a `MTRAsyncWorkQueue`. +/// +/// A work item can be configured with a number of hander blocks called by the +/// async work queue in various situations. Generally work items will have at +/// least a `readyHandler` (though it is technically optional). +/// +/// This class is not thread-safe, and once a work item has been submitted to +/// the queue via `enqueueWorkItem` ownership of the work item passes to the +/// queue. No further modifications may be made to it after that point. +/// +/// @see -[MTRAsyncWorkQueue enqueueWorkItem:] MTR_TESTABLE -@interface MTRAsyncWorkQueue : NSObject +@interface MTRAsyncWorkItem<__contravariant ContextType> : NSObject + - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; -// The context object is only held and passed back as a reference and is opaque to the work queue -- (instancetype)initWithContext:(id _Nullable)context queue:(dispatch_queue_t)queue; +/// Creates a work item that will run on the specified dispatch queue. +- (instancetype)initWithQueue:(dispatch_queue_t)queue; -// Called by the work queue owner to clean up and cancel work items -- (void)invalidate; +/// Called by the work queue to start this work item. +/// +/// Will be called on the dispatch queue associated with this item. +/// +/// This handler block must, synchronously or asynchronously from any thread, +/// call the provided completion block exactly once. Passing an outcome of +/// MTRAsyncWorkComplete removes it from the queue and allows the queue to move +/// on to the next work item (if any). +/// +/// Passing an outcome of MTRAsyncWorkNeedsRetry causes the queue to start the +/// work item again with an incremented retryCount. The retryCount is 0 when a +/// work item is executed for the first time. +@property (nonatomic, strong, nullable) void (^readyHandler) + (ContextType context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion); + +/// Called by the work queue to cancel the work item. +/// +/// Will be called on the dispatch queue associated with this item. +/// The work item may or may not have been started already. +@property (nonatomic, strong, nullable) void (^cancelHandler)(void); + +@property (nonatomic, readonly) NSUInteger batchingID; +@property (nonatomic, readonly, nullable) id batchableData; +@property (nonatomic, readonly, nullable) MTRAsyncWorkBatchingHandler batchingHandler; + +/// Sets the batching handler and associated data for this work item. +/// +/// Note: This handler is NOT called on the dispatch queue associated with +/// this work item. Thread-safety is managed by the work queue internally. +/// +/// If no `batchingHandler` is set using this method, the work item will not +/// participate in batching, and the `batchingID` and `batchableData` +/// properties are meaningless. +/// +/// @see MTRAsyncWorkBatchingHandler +- (void)setBatchingID:(NSUInteger)opaqueBatchingID + data:(id)opaqueBatchableData + handler:(MTRAsyncWorkBatchingHandler)batchingHandler; + +@property (nonatomic, readonly) NSUInteger duplicateTypeID; +@property (nonatomic, readonly, nullable) MTRAsyncWorkDuplicateCheckHandler duplicateCheckHandler; + +/// Sets the duplicate check type and handler for this work item. +/// +/// Note: This handler is NOT called on the dispatch queue associated with +/// this work item. Thread-safety is managed by the work queue internally. +/// +/// If no `duplicateCheckHandler` is set using this method, the work item +/// will not participate in duplicate checking, and the `duplicateTypeID` +/// property is meaningless. +/// +/// @see MTRAsyncWorkDuplicateCheckHandler +- (void)setDuplicateTypeID:(NSUInteger)opaqueDuplicateTypeID + handler:(MTRAsyncWorkDuplicateCheckHandler)duplicateCheckHandler; -// Work items may be enqueued from any queue or thread -// Note: Once a work item is enqueued, its handlers cannot be modified -- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item; @end -// An item in the work queue +/// A serial one-at-a-time queue for performing asynchronous work items. +/// +/// Units of work are represented by MTRAsyncWorkItem objects that are +/// configured with one or more handler blocks before being passed to +/// `enqueueWorkItem:`. +/// +/// MTRAsyncWorkQueue is thread-safe. MTR_TESTABLE -@interface MTRAsyncWorkItem : NSObject +@interface MTRAsyncWorkQueue : NSObject + - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; -// Both readyHandler and cancelHander will be called on the queue given to initWithQueue -- (instancetype)initWithQueue:(dispatch_queue_t)queue; -@property (nonatomic, strong) MTRAsyncWorkReadyHandler readyHandler; -@property (nonatomic, strong) dispatch_block_t cancelHandler; - -// Called by the creater of the work item when async work is done and should -// be removed from the queue. The work queue will run the next work item. -// Note: This must only be called from within the readyHandler -- (void)endWork; - -// Called by the creater of the work item when async work should be retried. -// The work queue will call this workItem's readyHandler again. -// Note: This must only be called from within the readyHandler -- (void)retryWork; +/// Creates a work queue with the given context object. +/// +/// The context object is weakly held and passed to the readyHandler of work +/// items. This avoids work item blocks accidentally creating a retain cycle +/// by strongly closing over the context object themselves (since the context +/// object will generally be holding a strong reference to the work queue +/// itself). The owner of the queue is responsible for keeping the context +/// object alive; no further work items will be executed if the context object +/// is lost. +- (instancetype)initWithContext:(ContextType)context; + +/// Enqueues the specified work item, making it eligible for execution. +/// +/// Once a work item is enqueued, ownership of it passes to the queue and +/// no further modifications may be made to it. Work item objects cannot be +/// re-used. +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item; + +/// Checks whether the queue already contains a work item matching the provided +/// details. A client may call this method to avoid enqueueing duplicate work. +/// +/// This method will call the duplicate check handler for all work items +/// matching the duplicate type ID, starting from the last item in the queue +/// +/// @see MTRAsyncWorkDuplicateCheckHandler +- (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID + workItemData:(id)opaqueWorkItemData; + +/// Cancels and removes all work items. +- (void)invalidate; @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm index 98291126a31728..4de523ec0cd889 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm @@ -15,325 +15,303 @@ * limitations under the License. */ -#import -#import - -#import "MTRAsyncWorkQueue_Internal.h" +#import "MTRAsyncWorkQueue.h" +#import "MTRDefines_Internal.h" #import "MTRLogging_Internal.h" -#pragma mark - Class extensions - -@interface MTRAsyncWorkQueue () -// The lock protects the internal state of the work queue so that these may be called from any queue or thread: -// -enqueueWorkItem: -// -invalidate -// -endWork: -// -retryWork: -@property (nonatomic, readonly) os_unfair_lock lock; -@property (nonatomic, strong, readonly) id context; -@property (nonatomic, strong, readonly) dispatch_queue_t queue; -@property (nonatomic, strong, readonly) NSMutableArray * items; -@property (nonatomic, readwrite) NSUInteger runningWorkItemCount; - -// For WorkItem's use only - the parameter is for sanity check -- (void)endWork:(MTRAsyncWorkItem *)workItem; -- (void)retryWork:(MTRAsyncWorkItem *)workItem; -@end +#import -@interface MTRAsyncWorkItem () -@property (nonatomic, readonly) os_unfair_lock lock; -@property (nonatomic, strong, readonly) dispatch_queue_t queue; -@property (nonatomic, readwrite) NSUInteger retryCount; -@property (nonatomic, strong) MTRAsyncWorkQueue * workQueue; -@property (nonatomic, readonly) BOOL enqueued; -// Called by the queue -- (void)markedEnqueued; -- (void)callReadyHandlerWithContext:(id)context; -- (void)cancel; -@end +typedef NS_ENUM(NSInteger, MTRAsyncWorkItemState) { + MTRAsyncWorkItemMutable, + MTRAsyncWorkItemComplete, + MTRAsyncWorkItemEnqueued, + MTRAsyncWorkItemRunning, + MTRAsyncWorkItemRetryCountBase = MTRAsyncWorkItemRunning, // values >= MTRAsyncWorkItemRunning encode retryCount +}; + +MTR_DIRECT_MEMBERS +@implementation MTRAsyncWorkItem { + dispatch_queue_t _queue; + MTRAsyncWorkItemState _state; // protected by queue lock once enqueued +} -#pragma mark - Class implementations +#pragma mark Configuration by the client -@implementation MTRAsyncWorkQueue -- (instancetype)initWithContext:(id)context queue:(dispatch_queue_t)queue +- (instancetype)initWithQueue:(dispatch_queue_t)queue { + NSParameterAssert(queue); if (self = [super init]) { - _lock = OS_UNFAIR_LOCK_INIT; - _context = context; _queue = queue; - _items = [NSMutableArray array]; - MTR_LOG_INFO("MTRAsyncCallbackWorkQueue init for context %@", context); + _state = MTRAsyncWorkItemMutable; } return self; } -- (NSString *)description +- (void)setReadyHandler:(void (^)(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion))readyHandler { - os_unfair_lock_lock(&_lock); - - auto * desc = [NSString - stringWithFormat:@"MTRAsyncCallbackWorkQueue context: %@ items count: %lu", self.context, (unsigned long) self.items.count]; - - os_unfair_lock_unlock(&_lock); - - return desc; + [self assertMutable]; + _readyHandler = readyHandler; } -- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item +- (void)setCancelHandler:(void (^)(void))cancelHandler { - if (item.enqueued) { - MTR_LOG_ERROR("MTRAsyncCallbackWorkQueue enqueueWorkItem: item cannot be enqueued twice"); - return; - } - - [item markedEnqueued]; - - os_unfair_lock_lock(&_lock); - item.workQueue = self; - [self.items addObject:item]; - - [self _callNextReadyWorkItem]; - os_unfair_lock_unlock(&_lock); + [self assertMutable]; + _cancelHandler = cancelHandler; } -- (void)invalidate +- (void)setBatchingID:(NSUInteger)opaqueBatchingID data:(id)opaqueBatchableData handler:(MTRAsyncWorkBatchingHandler)batchingHandler { - os_unfair_lock_lock(&_lock); - NSMutableArray * invalidateItems = _items; - _items = nil; - os_unfair_lock_unlock(&_lock); - - MTR_LOG_INFO( - "MTRAsyncCallbackWorkQueue invalidate for context %@ items count: %lu", _context, (unsigned long) invalidateItems.count); - for (MTRAsyncWorkItem * item in invalidateItems) { - [item cancel]; - } - [invalidateItems removeAllObjects]; + NSParameterAssert(batchingHandler); + [self assertMutable]; + _batchingID = opaqueBatchingID; + _batchableData = opaqueBatchableData; + _batchingHandler = batchingHandler; } -// called after executing a work item -- (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem retry:(BOOL)retry +- (void)setDuplicateTypeID:(NSUInteger)opaqueDuplicateTypeID handler:(MTRAsyncWorkDuplicateCheckHandler)duplicateCheckHandler { - os_unfair_lock_lock(&_lock); - // sanity check if running - if (!self.runningWorkItemCount) { - // something is wrong with state - nothing is currently running - os_unfair_lock_unlock(&_lock); - MTR_LOG_ERROR("MTRAsyncCallbackWorkQueue endWork: no work is running on work queue"); - return; - } - - // sanity check the same work item is running - // when "concurrency width" is implemented need to check first N items - MTRAsyncWorkItem * firstWorkItem = self.items.firstObject; - if (firstWorkItem != workItem) { - // something is wrong with this work item - should not be currently running - os_unfair_lock_unlock(&_lock); - MTR_LOG_ERROR("MTRAsyncCallbackWorkQueue endWork: work item is not first on work queue"); - return; - } - - // if work item is done (no need to retry), remove from queue and call ready on the next item - if (!retry) { - [self.items removeObjectAtIndex:0]; - } + NSParameterAssert(duplicateCheckHandler); + [self assertMutable]; + _duplicateTypeID = opaqueDuplicateTypeID; + _duplicateCheckHandler = duplicateCheckHandler; +} - // when "concurrency width" is implemented this will be decremented instead - self.runningWorkItemCount = 0; - [self _callNextReadyWorkItem]; - os_unfair_lock_unlock(&_lock); +- (void)assertMutable +{ + NSAssert(_state == MTRAsyncWorkItemMutable, @"work item is not mutable (%ld)", (long) _state); } -- (void)endWork:(MTRAsyncWorkItem *)workItem +#pragma mark Management by the work queue (queue lock held) + +- (void)markEnqueued { - [self _postProcessWorkItem:workItem retry:NO]; + [self assertMutable]; + _state = MTRAsyncWorkItemEnqueued; } -- (void)retryWork:(MTRAsyncWorkItem *)workItem +- (NSInteger)retryCount { - [self _postProcessWorkItem:workItem retry:YES]; + switch (_state) { + case MTRAsyncWorkItemMutable: + case MTRAsyncWorkItemComplete: + case MTRAsyncWorkItemEnqueued: + return 0; + default: + return ((NSInteger) _state) - MTRAsyncWorkItemRetryCountBase; + } } -// assume lock is held while calling this -- (void)_callNextReadyWorkItem +- (void)callReadyHandlerWithContext:(id)context completion:(MTRAsyncWorkCompletionBlock)completion { - // when "concurrency width" is implemented this will be checked against the width - if (self.runningWorkItemCount) { - // can't run next work item until the current one is done - return; + // + NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item is not enqueued (%ld)", (long) _state); + NSInteger retryCount = 0; + if (_state == MTRAsyncWorkItemEnqueued) { + _state = MTRAsyncWorkItemRunning; + } else if (_state >= MTRAsyncWorkItemRunning) { + retryCount = (_state - MTRAsyncWorkItemRetryCountBase) + 1; // increment retryCount + _state = (MTRAsyncWorkItemState) (MTRAsyncWorkItemRetryCountBase + retryCount); + } else { + return; // asserted above } - // only proceed to mark queue as running if there are items to run - if (self.items.count) { - // when "concurrency width" is implemented this will be incremented instead - self.runningWorkItemCount = 1; - - MTRAsyncWorkItem * workItem = self.items.firstObject; - - // Check if batching is possible or needed. Only ask work item to batch once for simplicity - if (workItem.batchable && workItem.batchingHandler && (workItem.retryCount == 0)) { - while (self.items.count >= 2) { - MTRAsyncWorkItem * nextWorkItem = self.items[1]; - if (!nextWorkItem.batchable || (nextWorkItem.batchingID != workItem.batchingID)) { - // next item is not eligible to merge with this one - break; - } - - BOOL fullyMerged = NO; - workItem.batchingHandler(workItem.batchableData, nextWorkItem.batchableData, &fullyMerged); - if (!fullyMerged) { - // We can't remove the next work item, so we can't merge anything else into this one. - break; - } - - [self.items removeObjectAtIndex:1]; - } + // Always dispatch even if there is no readyHandler as this avoids synchronously + // re-entering the MTRAsyncWorkQueueCode, simplifying the implementation. + auto readyHandler = _readyHandler; + dispatch_async(_queue, ^{ + if (readyHandler) { + readyHandler(context, retryCount, completion); + } else { + completion(MTRAsyncWorkComplete); } - - [workItem callReadyHandlerWithContext:self.context]; - } + }); } -- (BOOL)isDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id)opaqueWorkItemData +- (void)cancel { - os_unfair_lock_lock(&_lock); - // Start from the last item - for (NSUInteger i = self.items.count; i > 0; i--) { - MTRAsyncWorkItem * item = self.items[i - 1]; - BOOL isDuplicate = NO; - BOOL stop = NO; - if (item.supportsDuplicateCheck && (item.duplicateTypeID == opaqueDuplicateTypeID) && item.duplicateCheckHandler) { - item.duplicateCheckHandler(opaqueWorkItemData, &isDuplicate, &stop); - if (stop) { - os_unfair_lock_unlock(&_lock); - return isDuplicate; - } + if (_state != MTRAsyncWorkItemComplete) { + auto cancelHandler = _cancelHandler; + [self markComplete]; + if (cancelHandler) { + // Note that if the work item was running it may call the work + // completion handler before the cancel handler actually runs, + // however in this case the work completion handler will return + // NO, giving the work code the ability to deal with this race if + // necessary. + dispatch_async(_queue, cancelHandler); } } - os_unfair_lock_unlock(&_lock); - return NO; } -@end -@implementation MTRAsyncWorkItem - -- (instancetype)initWithQueue:(dispatch_queue_t)queue +- (BOOL)isComplete { - if (self = [super init]) { - _lock = OS_UNFAIR_LOCK_INIT; - _queue = queue; - } - return self; + return _state == MTRAsyncWorkItemComplete; } -// assume lock is held -- (void)_invalidate +- (void)markComplete { - // Make sure we don't leak via handlers that close over us, as ours must. - // This is a bit odd, since these are supposed to be non-nullable - // properties, but it's the best we can do given our API surface, unless we - // assume that all consumers consistently use __weak refs to us inside their - // handlers. - // - // Setting the attributes to nil will not compile; set the ivars directly. + NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item was not enqueued (%ld)", (long) _state); + _state = MTRAsyncWorkItemComplete; + + // Clear all handlers in case any of them captured this object. _readyHandler = nil; _cancelHandler = nil; + _batchingHandler = nil; + _duplicateCheckHandler = nil; } -- (void)invalidate +@end + +MTR_DIRECT_MEMBERS +@implementation MTRAsyncWorkQueue { + os_unfair_lock _lock; + __weak id _context; + NSMutableArray * _items; + NSInteger _runningWorkItemCount; +} + +- (instancetype)initWithContext:(id)context { - os_unfair_lock_lock(&_lock); - [self _invalidate]; - os_unfair_lock_unlock(&_lock); + NSParameterAssert(context); + if (self = [super init]) { + _context = context; + _items = [NSMutableArray array]; + } + return self; } -- (void)markedEnqueued +- (NSString *)description { os_unfair_lock_lock(&_lock); - _enqueued = YES; + auto * result = [NSString stringWithFormat:@"<%@ context: %@ items count: %tu>", self.class, _context, _items.count]; os_unfair_lock_unlock(&_lock); + return result; } -- (void)setReadyHandler:(MTRAsyncWorkReadyHandler)readyHandler +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item { + NSParameterAssert(item); + NSAssert(_context, @"context has been lost"); + os_unfair_lock_lock(&_lock); - if (!_enqueued) { - _readyHandler = readyHandler; - } + [item markEnqueued]; + [_items addObject:item]; + [self _callNextReadyWorkItem]; os_unfair_lock_unlock(&_lock); } -- (void)setCancelHandler:(dispatch_block_t)cancelHandler +- (void)invalidate { + NSString * contextDescription = [_context description]; // outside of lock os_unfair_lock_lock(&_lock); - if (!_enqueued) { - _cancelHandler = cancelHandler; + MTR_LOG_INFO("MTRAsyncWorkQueue<%@> invalidate %tu items", contextDescription, _items.count); + for (MTRAsyncWorkItem * item in _items) { + [item cancel]; } + [_items removeAllObjects]; os_unfair_lock_unlock(&_lock); } -- (void)endWork +- (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem retry:(BOOL)retry { - [self.workQueue endWork:self]; - [self invalidate]; -} + os_unfair_lock_assert_owner(&_lock); -- (void)retryWork -{ - [self.workQueue retryWork:self]; -} + MTRAsyncWorkItem * runningWorkItem = (_runningWorkItemCount) ? _items.firstObject : nil; + if (workItem != runningWorkItem) { + NSAssert(NO, @"work item to post-process is not running"); + return; + } -// Called by the work queue -- (void)callReadyHandlerWithContext:(id)context -{ - dispatch_async(self.queue, ^{ - os_unfair_lock_lock(&self->_lock); - MTRAsyncWorkReadyHandler readyHandler = self->_readyHandler; - NSUInteger retryCount = self->_retryCount; - if (readyHandler) { - self->_retryCount++; - } - os_unfair_lock_unlock(&self->_lock); + // if work item is done (no need to retry), remove from queue and call ready on the next item + if (!retry) { + [workItem markComplete]; + [_items removeObjectAtIndex:0]; + } - if (readyHandler == nil) { - // Nothing to do here. - [self endWork]; - } else { - readyHandler(context, retryCount); - } - }); + // when "concurrency width" is implemented this will be decremented instead + _runningWorkItemCount = 0; + [self _callNextReadyWorkItem]; } -// Called by the work queue -- (void)cancel +- (void)_callNextReadyWorkItem { - os_unfair_lock_lock(&self->_lock); - dispatch_block_t cancelHandler = self->_cancelHandler; - [self _invalidate]; - os_unfair_lock_unlock(&self->_lock); - - if (cancelHandler) { - dispatch_async(self.queue, ^{ - cancelHandler(); - }); + os_unfair_lock_assert_owner(&_lock); + + // when "concurrency width" is implemented this will be checked against the width + if (_runningWorkItemCount) { + return; // can't run next work item until the current one is done } -} -- (void)setBatchingID:(NSUInteger)opaqueBatchingID data:(id)opaqueBatchableData handler:(MTRAsyncWorkBatchingHandler)batchingHandler -{ - os_unfair_lock_lock(&self->_lock); - _batchable = YES; - _batchingID = opaqueBatchingID; - _batchableData = opaqueBatchableData; - _batchingHandler = batchingHandler; - os_unfair_lock_unlock(&self->_lock); + if (!_items.count) { + return; // nothing to run + } + + id context = _context; + if (!context) { + MTR_LOG_ERROR("MTRAsyncWorkQueue context has been lost, dropping queued work items"); + [_items removeAllObjects]; + return; + } + + // when "concurrency width" is implemented this will be incremented instead + _runningWorkItemCount = 1; + + MTRAsyncWorkItem * workItem = _items.firstObject; + + // Check if batching is possible or needed. Only ask work item to batch once for simplicity + auto batchingHandler = workItem.batchingHandler; + if (batchingHandler && workItem.retryCount == 0) { + while (_items.count >= 2) { + MTRAsyncWorkItem * nextWorkItem = _items[1]; + if (!nextWorkItem.batchingHandler || nextWorkItem.batchingID != workItem.batchingID) { + break; // next item is not eligible to merge with this one + } + + BOOL fullyMerged = NO; + batchingHandler(workItem.batchableData, nextWorkItem.batchableData, &fullyMerged); + if (!fullyMerged) { + break; // not removing the next item, so we can't merge anything else + } + + [_items removeObjectAtIndex:1]; + } + } + + mtr_weakify(self); + [workItem callReadyHandlerWithContext:context completion:^(MTRAsyncWorkOutcome outcome) { + mtr_strongify(self); + BOOL handled = NO; + if (self) { + os_unfair_lock_lock(&self->_lock); + if (!workItem.isComplete) { + [self _postProcessWorkItem:workItem retry:(outcome == MTRAsyncWorkNeedsRetry)]; + handled = YES; + } + os_unfair_lock_unlock(&self->_lock); + } + return handled; + }]; } -- (void)setDuplicateTypeID:(NSUInteger)opaqueDuplicateTypeID handler:(MTRAsyncWorkDuplicateCheckHandler)duplicateCheckHandler +- (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id)opaqueWorkItemData { - _supportsDuplicateCheck = YES; - _duplicateTypeID = opaqueDuplicateTypeID; - _duplicateCheckHandler = duplicateCheckHandler; + BOOL hasDuplicate = NO; + os_unfair_lock_lock(&_lock); + // Start from the last item + for (MTRAsyncWorkItem * item in [_items reverseObjectEnumerator]) { + auto duplicateCheckHandler = item.duplicateCheckHandler; + if (duplicateCheckHandler && item.duplicateTypeID == opaqueDuplicateTypeID) { + BOOL stop = NO; + BOOL isDuplicate = NO; + duplicateCheckHandler(opaqueWorkItemData, &isDuplicate, &stop); + if (stop) { + hasDuplicate = isDuplicate; + break; + } + } + } + os_unfair_lock_unlock(&_lock); + return hasDuplicate; } @end diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue_Internal.h b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue_Internal.h deleted file mode 100644 index 54995effd8a8c7..00000000000000 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue_Internal.h +++ /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. - */ - -#import - -#import "MTRAsyncWorkQueue.h" - -NS_ASSUME_NONNULL_BEGIN - -@class MTRDevice; - -// Optional feature: Work Item Batching -// When a work item is dequeued to run, if it is of a type that can be combined with similar work items in a batch, this facility -// gives the client of this API an opportunity to coalesce and merge work items. -// - The "batching ID" is used for grouping mergeable work items with unique merging strategies. The ID value is opaque to this -// API, and the API client is responsible for assigning them. -// - Each work item will only be asked to batch before it's first dequeued to run readyHandler. -// See the MTRAsyncWorkBatchingHandler definition for more details. - -// The batching handler is called by the work queue when all of the following are true: -// -// 1) A work item that is batchable is about to be dequeued and executed for the first time. -// 2) The next work item in the queue is also batchable. -// 3) The two work items have matching batching ids. -// -// The handler will be passed the opaque data of the two work items: opaqueDataCurrent is the data of the -// item about to be executed and opaqueDataNext is the data for the next item. -// -// The handler is expected to mutate the data as needed to achieve batching. -// -// If after the data mutations opaqueDataNext no longer requires any work, the handler should set *fullyMerged to YES to indicate -// that the next item can be dropped from the queue. Otherwise the handler should set *fullyMerged to NO. -// -// If *fullyMerged is set to YES, this handler may be called again to possibly also batch the work item -// after the one that was dropped. -typedef void (^MTRAsyncWorkBatchingHandler)(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged); - -// Optional feature: Duplicate Filtering -// This is a facility that enables the API client to check if a potential work item has already been enqueued. By providing a -// handler that can answer if a work item's relevant data is a duplicate, it can avoid redundant queuing of requests. -// - The "duplicate type ID" is used for grouping different types of work items for duplicate checking. The ID value is opaque -// to this API, and the API client is responsible for assigning them. -// See the MTRAsyncWorkDuplicateCheckHandler definition and the WorkQueue's -isDuplicateForTypeID:workItemData: method -// descriptions for more details. - -// The duplicate check handler is called by the work queue when the client wishes to check whether a work item is a duplicate of an -// existing one, so that the client may decide to not enqueue a duplicate work item. -// -// The handler will be passed the opaque data of a potential duplicate work item. -// -// If the handler determines the data is indeed duplicate work, it should set *stop to YES, and set *isDuplicate to YES. -// -// If the handler determines the data is not duplicate work, it should set *stop to YES, and set *isDuplicate to NO. -// -// If the handler is unable to determine if the data is duplicate work, it should set *stop to NO. -// In this case, the value of *isDuplicate is not examined. -typedef void (^MTRAsyncWorkDuplicateCheckHandler)(id opaqueItemData, BOOL * isDuplicate, BOOL * stop); - -@interface MTRAsyncWorkQueue () -// The MTRDevice object is only held and passed back as a reference and is opaque to the queue -- (instancetype)initWithContext:(id _Nullable)context queue:(dispatch_queue_t)queue; - -// Before creating a work item, a client may call this method to check with existing work items that the new potential work item -// data is not a duplicate request. -// - This method will call the duplicate check handler for all work items matching the duplicate type ID, starting from the last -// item in the queue, and if a handler sets *stop to YES, this method will return the value the handler sets for *isDuplicate -// - If no duplicate check handlers set *stop to YES, this method will return NO. -- (BOOL)isDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id)opaqueWorkItemData; -@end - -@interface MTRAsyncWorkItem () -// Batching -@property (nonatomic, readonly) BOOL batchable; -@property (nonatomic, readonly) NSUInteger batchingID; -@property (nonatomic, readonly) id batchableData; -@property (nonatomic, readonly) MTRAsyncWorkBatchingHandler batchingHandler; -- (void)setBatchingID:(NSUInteger)opaqueBatchingID - data:(id)opaqueBatchableData - handler:(MTRAsyncWorkBatchingHandler)batchingHandler; - -// Duplicate check -@property (nonatomic, readonly) BOOL supportsDuplicateCheck; -@property (nonatomic, readonly) NSUInteger duplicateTypeID; -@property (nonatomic, readonly) MTRAsyncWorkDuplicateCheckHandler duplicateCheckHandler; -- (void)setDuplicateTypeID:(NSUInteger)opaqueDuplicateTypeID handler:(MTRAsyncWorkDuplicateCheckHandler)duplicateCheckHandler; -@end - -NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm index 4b313d75c9e6b6..e498a1682d52aa 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm @@ -35,6 +35,12 @@ // Reports attribute and event data if any exists void MTRBaseSubscriptionCallback::ReportData() { + // At data reporting time, nil out scheduled or currently running interimReportBlock + if (mInterimReportBlock) { + dispatch_block_cancel(mInterimReportBlock); // no-op when running from mInterimReportBlock + mInterimReportBlock = nil; + } + __block NSArray * attributeReports = mAttributeReports; mAttributeReports = nil; auto attributeCallback = mAttributeReportCallback; @@ -59,7 +65,6 @@ } mInterimReportBlock = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, ^{ - mInterimReportBlock = nil; ReportData(); // Allocate reports arrays to continue accumulation mAttributeReports = [NSMutableArray new]; @@ -71,10 +76,6 @@ void MTRBaseSubscriptionCallback::OnReportEnd() { - if (mInterimReportBlock) { - dispatch_block_cancel(mInterimReportBlock); - mInterimReportBlock = nil; - } ReportData(); if (mReportEndHandler) { mReportEndHandler(); diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 674d52f60fdb2c..d5d7040a927681 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -33,3 +33,17 @@ #else #define MTR_TESTABLE MTR_HIDDEN #endif + +// clang-format off +/// Creates a weak shadow copy of the variable `local` +#define mtr_weakify(local) \ + __weak typeof(local) _mtr_weak_##local = local + +/// Copies the weak shadow copy of `local` created by `mtr_weakify` +/// back into a strong variable of the same name. +#define mtr_strongify(local) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wshadow\"") \ + __strong typeof(local) _Nullable local = _mtr_weak_##local \ + _Pragma("clang diagnostic pop") +// clang-format on diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index ea5d9e800de8e5..2ed4a67c4e6bd7 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -18,7 +18,7 @@ #import #import -#import "MTRAsyncWorkQueue_Internal.h" +#import "MTRAsyncWorkQueue.h" #import "MTRAttributeSpecifiedCheck.h" #import "MTRBaseDevice_Internal.h" #import "MTRBaseSubscriptionCallback.h" @@ -207,7 +207,7 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); _readCache = [NSMutableDictionary dictionary]; _expectedValueCache = [NSMutableDictionary dictionary]; - _asyncCallbackWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self queue:_queue]; + _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; _state = MTRDeviceStateUnknown; MTR_LOG_INFO("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue); } @@ -246,6 +246,9 @@ - (void)setDelegate:(id)delegate queue:(dispatch_queue_t)queu - (void)invalidate { MTR_LOG_INFO("%@ invalidate", self); + + [_asyncWorkQueue invalidate]; + os_unfair_lock_lock(&self->_lock); _weakDelegate = nil; @@ -381,7 +384,7 @@ - (void)_handleSubscriptionReset } MTR_LOG_DEFAULT("%@ scheduling to reattempt subscription in %u seconds", self, _lastSubscriptionAttemptWait); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_lastSubscriptionAttemptWait * NSEC_PER_SEC)), self.queue, ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (_lastSubscriptionAttemptWait * NSEC_PER_SEC)), self.queue, ^{ os_unfair_lock_lock(&self->_lock); [self _reattemptSubscriptionNowIfNeeded]; os_unfair_lock_unlock(&self->_lock); @@ -882,7 +885,7 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) NSArray * readRequestData = @[ readRequestPath, params ?: [NSNull null] ]; // But first, check if a duplicate read request is already queued and return - if ([_asyncCallbackWorkQueue isDuplicateForTypeID:MTRDeviceWorkItemDuplicateReadTypeID workItemData:readRequestData]) { + if ([_asyncWorkQueue hasDuplicateForTypeID:MTRDeviceWorkItemDuplicateReadTypeID workItemData:readRequestData]) { return attributeValueToReturn; } @@ -890,12 +893,10 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // Create work item, set ready handler to perform task, then enqueue the work MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - MTRAsyncWorkBatchingHandler batchingHandler = ^(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged) { + [workItem setBatchingID:MTRDeviceWorkItemBatchingReadID data:readRequests handler:^(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged) { NSMutableArray * readRequestsCurrent = opaqueDataCurrent; NSMutableArray * readRequestsNext = opaqueDataNext; - *fullyMerged = NO; - // Can only read up to 9 paths at a time, per spec if (readRequestsCurrent.count >= 9) { MTR_LOG_DEFAULT("%@ batching cannot add more", logPrefix); @@ -927,8 +928,8 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) MTR_LOG_DEFAULT("%@ batching - fully merged next item", logPrefix); *fullyMerged = YES; } - }; - MTRAsyncWorkDuplicateCheckHandler duplicateCheckHandler = ^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { + }]; + [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { for (NSArray * readItem in readRequests) { if ([readItem isEqual:opaqueItemData]) { MTR_LOG_DEFAULT("%@ duplicate check found %@ - report duplicate", logPrefix, readItem); @@ -938,14 +939,14 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) } } *stop = NO; - }; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncCallbackWorkQueue); + }]; + [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); // Sanity check if (readRequests.count == 0) { MTR_LOG_ERROR("%@ dequeueWorkItem no read requests", logPrefix); - [workItem endWork]; + completion(MTRAsyncWorkComplete); return; } @@ -955,7 +956,7 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // Sanity check if (readItem.count < 2) { MTR_LOG_ERROR("%@ dequeueWorkItem read item missing info %@", logPrefix, readItem); - [workItem endWork]; + completion(MTRAsyncWorkComplete); return; } [attributePaths addObject:readItem[MTRDeviceReadRequestFieldPathIndex]]; @@ -981,18 +982,15 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // TODO: better retry logic if (error && (retryCount < 2)) { MTR_LOG_ERROR("%@ completion error %@ retryWork %lu", logPrefix, error, (unsigned long) retryCount); - [workItem retryWork]; + completion(MTRAsyncWorkNeedsRetry); } else { MTR_LOG_DEFAULT("%@ completion error %@ endWork", logPrefix, error); - [workItem endWork]; + completion(MTRAsyncWorkComplete); } }]; - }; - workItem.readyHandler = readyHandler; - [workItem setBatchingID:MTRDeviceWorkItemBatchingReadID data:readRequests handler:batchingHandler]; - [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:duplicateCheckHandler]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncCallbackWorkQueue); - [_asyncCallbackWorkQueue enqueueWorkItem:workItem]; + }]; + MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); + [_asyncWorkQueue enqueueWorkItem:workItem]; } return attributeValueToReturn; @@ -1023,12 +1021,12 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; // The write operation will install a duplicate check handler, to return NO for "isDuplicate". Since a write operation may // change values, only read requests after this should be considered for duplicate requests. - MTRAsyncWorkDuplicateCheckHandler duplicateCheckHandler = ^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { + [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { *isDuplicate = NO; *stop = YES; - }; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncCallbackWorkQueue); + }]; + [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); MTRBaseDevice * baseDevice = [self newBaseDevice]; [baseDevice writeAttributeWithEndpointID:endpointID @@ -1039,16 +1037,14 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID queue:self.queue completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { MTR_LOG_DEFAULT("%@ completion error %@ endWork", logPrefix, error); - [workItem endWork]; if (error) { [self removeExpectedValueForAttributePath:attributePath expectedValueID:expectedValueID]; } + completion(MTRAsyncWorkComplete); }]; - }; - workItem.readyHandler = readyHandler; - [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:duplicateCheckHandler]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncCallbackWorkQueue); - [_asyncCallbackWorkQueue enqueueWorkItem:workItem]; + }]; + MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); + [_asyncWorkQueue enqueueWorkItem:workItem]; } - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID @@ -1083,12 +1079,12 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; // The command operation will install a duplicate check handler, to return NO for "isDuplicate". Since a command operation may // change values, only read requests after this should be considered for duplicate requests. - MTRAsyncWorkDuplicateCheckHandler duplicateCheckHandler = ^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { + [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { *isDuplicate = NO; *stop = YES; - }; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncCallbackWorkQueue); + }]; + [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); MTRBaseDevice * baseDevice = [self newBaseDevice]; [baseDevice invokeCommandWithEndpointID:endpointID @@ -1101,20 +1097,18 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID // Log the data at the INFO level (not usually persisted permanently), // but make sure we log the work completion at the DEFAULT level. MTR_LOG_INFO("%@ received response: %@ error: %@", logPrefix, values, error); - MTR_LOG_DEFAULT("%@ endWork", logPrefix); dispatch_async(queue, ^{ completion(values, error); }); - [workItem endWork]; if (error && expectedValues) { [self removeExpectedValuesForAttributePaths:attributePaths expectedValueID:expectedValueID]; } + MTR_LOG_DEFAULT("%@ endWork", logPrefix); + workCompletion(MTRAsyncWorkComplete); }]; - }; - workItem.readyHandler = readyHandler; - [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:duplicateCheckHandler]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncCallbackWorkQueue); - [_asyncCallbackWorkQueue enqueueWorkItem:workItem]; + }]; + MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); + [_asyncWorkQueue enqueueWorkItem:workItem]; } - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode @@ -1198,7 +1192,7 @@ - (void)_checkExpiredExpectedValues waitTime = MTR_DEVICE_EXPIRATION_CHECK_TIMER_MINIMUM_WAIT_TIME; } MTRWeakReference * weakSelf = [MTRWeakReference weakReferenceWithObject:self]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(waitTime * NSEC_PER_SEC)), self.queue, ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (waitTime * NSEC_PER_SEC)), self.queue, ^{ MTRDevice * strongSelf = weakSelf.strongObject; [strongSelf _performScheduledExpirationCheck]; }); diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 7815fe2e5d44c2..cd94bfbb673d52 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -19,6 +19,8 @@ #import #import +#import "MTRAsyncWorkQueue.h" + #include NS_ASSUME_NONNULL_BEGIN @@ -44,11 +46,9 @@ typedef void (^MTRDevicePerformAsyncBlock)(MTRBaseDevice * baseDevice); @property (nonatomic, readonly) MTRDeviceController * deviceController; @property (nonatomic, readonly, copy) NSNumber * nodeID; -// Queue used for various internal bookkeeping work. In general endWork calls -// on work items should happen on this queue, so we don't block progress of the -// asyncCallbackWorkQueue on any client code. +// Queue used for various internal bookkeeping work. @property (nonatomic) dispatch_queue_t queue; -@property (nonatomic, readonly) MTRAsyncWorkQueue * asyncCallbackWorkQueue; +@property (nonatomic, readonly) MTRAsyncWorkQueue * asyncWorkQueue; @end diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index a4afcd5c8bace0..d33c75124c462a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -114,8 +114,8 @@ completionHandler // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[{{> baseCluster}} alloc] initWithDevice:baseDevice endpointID:@(self.endpoint) queue:self.device.queue]; [cluster {{asLowerCamelCase name}}WithParams:params {{> completionName}}: @@ -127,7 +127,7 @@ completionHandler not great from a type-safety perspective, of course. }} completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); } {{else}} ^(NSError * _Nullable error) { @@ -138,14 +138,13 @@ completionHandler type-safety perspective, of course. }} completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); } {{/if}} ]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index b0274760046165..7fdbe9367c7ece 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -82,8 +82,8 @@ - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params expectedVa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:baseDevice @@ -95,12 +95,11 @@ - (void)identifyWithParams:(MTRIdentifyClusterIdentifyParams *)params expectedVa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -118,8 +117,8 @@ - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:baseDevice @@ -131,12 +130,11 @@ - (void)triggerEffectWithParams:(MTRIdentifyClusterTriggerEffectParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -240,8 +238,8 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params expectedValu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -253,12 +251,11 @@ - (void)addGroupWithParams:(MTRGroupsClusterAddGroupParams *)params expectedValu dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -276,8 +273,8 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params expectedVa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -289,12 +286,11 @@ - (void)viewGroupWithParams:(MTRGroupsClusterViewGroupParams *)params expectedVa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -312,8 +308,8 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -325,12 +321,11 @@ - (void)getGroupMembershipWithParams:(MTRGroupsClusterGetGroupMembershipParams * dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -348,8 +343,8 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params expect // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -361,12 +356,11 @@ - (void)removeGroupWithParams:(MTRGroupsClusterRemoveGroupParams *)params expect dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -388,8 +382,8 @@ - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Null // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -401,12 +395,11 @@ - (void)removeAllGroupsWithParams:(MTRGroupsClusterRemoveAllGroupsParams * _Null dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -424,8 +417,8 @@ - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingPa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:baseDevice @@ -437,12 +430,11 @@ - (void)addGroupIfIdentifyingWithParams:(MTRGroupsClusterAddGroupIfIdentifyingPa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -566,8 +558,8 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params expectedValu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -579,12 +571,11 @@ - (void)addSceneWithParams:(MTRScenesClusterAddSceneParams *)params expectedValu dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -602,8 +593,8 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params expectedVa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -615,12 +606,11 @@ - (void)viewSceneWithParams:(MTRScenesClusterViewSceneParams *)params expectedVa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -638,8 +628,8 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params expect // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -651,12 +641,11 @@ - (void)removeSceneWithParams:(MTRScenesClusterRemoveSceneParams *)params expect dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -674,8 +663,8 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -687,12 +676,11 @@ - (void)removeAllScenesWithParams:(MTRScenesClusterRemoveAllScenesParams *)param dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -710,8 +698,8 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params expected // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -723,12 +711,11 @@ - (void)storeSceneWithParams:(MTRScenesClusterStoreSceneParams *)params expected dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -746,8 +733,8 @@ - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params expect // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -759,12 +746,11 @@ - (void)recallSceneWithParams:(MTRScenesClusterRecallSceneParams *)params expect dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -782,8 +768,8 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -795,12 +781,11 @@ - (void)getSceneMembershipWithParams:(MTRScenesClusterGetSceneMembershipParams * dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -818,8 +803,8 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -831,12 +816,11 @@ - (void)enhancedAddSceneWithParams:(MTRScenesClusterEnhancedAddSceneParams *)par dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -854,8 +838,8 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -867,12 +851,11 @@ - (void)enhancedViewSceneWithParams:(MTRScenesClusterEnhancedViewSceneParams *)p dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -890,8 +873,8 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params expectedVa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:baseDevice @@ -903,12 +886,11 @@ - (void)copySceneWithParams:(MTRScenesClusterCopySceneParams *)params expectedVa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1102,8 +1084,8 @@ - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params expectedValue // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1115,12 +1097,11 @@ - (void)offWithParams:(MTROnOffClusterOffParams * _Nullable)params expectedValue dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1142,8 +1123,8 @@ - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params expectedValues: // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1155,12 +1136,11 @@ - (void)onWithParams:(MTROnOffClusterOnParams * _Nullable)params expectedValues: dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1182,8 +1162,8 @@ - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params expecte // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1195,12 +1175,11 @@ - (void)toggleWithParams:(MTROnOffClusterToggleParams * _Nullable)params expecte dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1218,8 +1197,8 @@ - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1231,12 +1210,11 @@ - (void)offWithEffectWithParams:(MTROnOffClusterOffWithEffectParams *)params exp dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1258,8 +1236,8 @@ - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalScen // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1271,12 +1249,11 @@ - (void)onWithRecallGlobalSceneWithParams:(MTROnOffClusterOnWithRecallGlobalScen dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1294,8 +1271,8 @@ - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:baseDevice @@ -1307,12 +1284,11 @@ - (void)onWithTimedOffWithParams:(MTROnOffClusterOnWithTimedOffParams *)params e dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1565,8 +1541,8 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1578,12 +1554,11 @@ - (void)moveToLevelWithParams:(MTRLevelControlClusterMoveToLevelParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1601,8 +1576,8 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params expectedValues // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1614,12 +1589,11 @@ - (void)moveWithParams:(MTRLevelControlClusterMoveParams *)params expectedValues dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1637,8 +1611,8 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params expectedValues // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1650,12 +1624,11 @@ - (void)stepWithParams:(MTRLevelControlClusterStepParams *)params expectedValues dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1673,8 +1646,8 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params expectedValues // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1686,12 +1659,11 @@ - (void)stopWithParams:(MTRLevelControlClusterStopParams *)params expectedValues dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1709,8 +1681,8 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1722,12 +1694,11 @@ - (void)moveToLevelWithOnOffWithParams:(MTRLevelControlClusterMoveToLevelWithOnO dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1745,8 +1716,8 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1758,12 +1729,11 @@ - (void)moveWithOnOffWithParams:(MTRLevelControlClusterMoveWithOnOffParams *)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1781,8 +1751,8 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1794,12 +1764,11 @@ - (void)stepWithOnOffWithParams:(MTRLevelControlClusterStepWithOnOffParams *)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1817,8 +1786,8 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1830,12 +1799,11 @@ - (void)stopWithOnOffWithParams:(MTRLevelControlClusterStopWithOnOffParams *)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -1853,8 +1821,8 @@ - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFre // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:baseDevice @@ -1866,12 +1834,11 @@ - (void)moveToClosestFrequencyWithParams:(MTRLevelControlClusterMoveToClosestFre dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2617,8 +2584,8 @@ - (void)instantActionWithParams:(MTRActionsClusterInstantActionParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2630,12 +2597,11 @@ - (void)instantActionWithParams:(MTRActionsClusterInstantActionParams *)params e dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2653,8 +2619,8 @@ - (void)instantActionWithTransitionWithParams:(MTRActionsClusterInstantActionWit // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2666,12 +2632,11 @@ - (void)instantActionWithTransitionWithParams:(MTRActionsClusterInstantActionWit dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2689,8 +2654,8 @@ - (void)startActionWithParams:(MTRActionsClusterStartActionParams *)params expec // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2702,12 +2667,11 @@ - (void)startActionWithParams:(MTRActionsClusterStartActionParams *)params expec dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2725,8 +2689,8 @@ - (void)startActionWithDurationWithParams:(MTRActionsClusterStartActionWithDurat // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2738,12 +2702,11 @@ - (void)startActionWithDurationWithParams:(MTRActionsClusterStartActionWithDurat dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2761,8 +2724,8 @@ - (void)stopActionWithParams:(MTRActionsClusterStopActionParams *)params expecte // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2774,12 +2737,11 @@ - (void)stopActionWithParams:(MTRActionsClusterStopActionParams *)params expecte dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2797,8 +2759,8 @@ - (void)pauseActionWithParams:(MTRActionsClusterPauseActionParams *)params expec // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2810,12 +2772,11 @@ - (void)pauseActionWithParams:(MTRActionsClusterPauseActionParams *)params expec dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2833,8 +2794,8 @@ - (void)pauseActionWithDurationWithParams:(MTRActionsClusterPauseActionWithDurat // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2846,12 +2807,11 @@ - (void)pauseActionWithDurationWithParams:(MTRActionsClusterPauseActionWithDurat dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2869,8 +2829,8 @@ - (void)resumeActionWithParams:(MTRActionsClusterResumeActionParams *)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2882,12 +2842,11 @@ - (void)resumeActionWithParams:(MTRActionsClusterResumeActionParams *)params exp dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2905,8 +2864,8 @@ - (void)enableActionWithParams:(MTRActionsClusterEnableActionParams *)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2918,12 +2877,11 @@ - (void)enableActionWithParams:(MTRActionsClusterEnableActionParams *)params exp dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2941,8 +2899,8 @@ - (void)enableActionWithDurationWithParams:(MTRActionsClusterEnableActionWithDur // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2954,12 +2912,11 @@ - (void)enableActionWithDurationWithParams:(MTRActionsClusterEnableActionWithDur dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -2977,8 +2934,8 @@ - (void)disableActionWithParams:(MTRActionsClusterDisableActionParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -2990,12 +2947,11 @@ - (void)disableActionWithParams:(MTRActionsClusterDisableActionParams *)params e dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3013,8 +2969,8 @@ - (void)disableActionWithDurationWithParams:(MTRActionsClusterDisableActionWithD // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActions alloc] initWithDevice:baseDevice @@ -3026,12 +2982,11 @@ - (void)disableActionWithDurationWithParams:(MTRActionsClusterDisableActionWithD dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3183,8 +3138,8 @@ - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nulla // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:baseDevice @@ -3196,12 +3151,11 @@ - (void)mfgSpecificPingWithParams:(MTRBasicClusterMfgSpecificPingParams * _Nulla dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3423,8 +3377,8 @@ - (void)queryImageWithParams:(MTROTASoftwareUpdateProviderClusterQueryImageParam // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOTASoftwareUpdateProvider alloc] initWithDevice:baseDevice @@ -3436,12 +3390,11 @@ - (void)queryImageWithParams:(MTROTASoftwareUpdateProviderClusterQueryImageParam dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3459,8 +3412,8 @@ - (void)applyUpdateRequestWithParams:(MTROTASoftwareUpdateProviderClusterApplyUp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOTASoftwareUpdateProvider alloc] initWithDevice:baseDevice @@ -3472,12 +3425,11 @@ - (void)applyUpdateRequestWithParams:(MTROTASoftwareUpdateProviderClusterApplyUp dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3495,8 +3447,8 @@ - (void)notifyUpdateAppliedWithParams:(MTROTASoftwareUpdateProviderClusterNotify // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOTASoftwareUpdateProvider alloc] initWithDevice:baseDevice @@ -3508,12 +3460,11 @@ - (void)notifyUpdateAppliedWithParams:(MTROTASoftwareUpdateProviderClusterNotify dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -3609,8 +3560,8 @@ - (void)announceOTAProviderWithParams:(MTROTASoftwareUpdateRequestorClusterAnnou // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOTASoftwareUpdateRequestor alloc] initWithDevice:baseDevice @@ -3622,12 +3573,11 @@ - (void)announceOTAProviderWithParams:(MTROTASoftwareUpdateRequestorClusterAnnou dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4264,8 +4214,8 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:baseDevice @@ -4277,12 +4227,11 @@ - (void)armFailSafeWithParams:(MTRGeneralCommissioningClusterArmFailSafeParams * dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4300,8 +4249,8 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:baseDevice @@ -4313,12 +4262,11 @@ - (void)setRegulatoryConfigWithParams:(MTRGeneralCommissioningClusterSetRegulato dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4340,8 +4288,8 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:baseDevice @@ -4353,12 +4301,11 @@ - (void)commissioningCompleteWithParams:(MTRGeneralCommissioningClusterCommissio dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4495,8 +4442,8 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4508,12 +4455,11 @@ - (void)scanNetworksWithParams:(MTRNetworkCommissioningClusterScanNetworksParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4531,8 +4477,8 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4544,12 +4490,11 @@ - (void)addOrUpdateWiFiNetworkWithParams:(MTRNetworkCommissioningClusterAddOrUpd dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4567,8 +4512,8 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4580,12 +4525,11 @@ - (void)addOrUpdateThreadNetworkWithParams:(MTRNetworkCommissioningClusterAddOrU dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4603,8 +4547,8 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4616,12 +4560,11 @@ - (void)removeNetworkWithParams:(MTRNetworkCommissioningClusterRemoveNetworkPara dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4639,8 +4582,8 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4652,12 +4595,11 @@ - (void)connectNetworkWithParams:(MTRNetworkCommissioningClusterConnectNetworkPa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4675,8 +4617,8 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:baseDevice @@ -4688,12 +4630,11 @@ - (void)reorderNetworkWithParams:(MTRNetworkCommissioningClusterReorderNetworkPa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4865,8 +4806,8 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDiagnosticLogs alloc] initWithDevice:baseDevice @@ -4878,12 +4819,11 @@ - (void)retrieveLogsRequestWithParams:(MTRDiagnosticLogsClusterRetrieveLogsReque dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -4964,8 +4904,8 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:baseDevice @@ -4977,12 +4917,11 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -5118,8 +5057,8 @@ - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksP // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterSoftwareDiagnostics alloc] initWithDevice:baseDevice @@ -5131,12 +5070,11 @@ - (void)resetWatermarksWithParams:(MTRSoftwareDiagnosticsClusterResetWatermarksP dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -5242,8 +5180,8 @@ - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsPara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterThreadNetworkDiagnostics alloc] initWithDevice:baseDevice @@ -5255,12 +5193,11 @@ - (void)resetCountsWithParams:(MTRThreadNetworkDiagnosticsClusterResetCountsPara dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -5669,8 +5606,8 @@ - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWiFiNetworkDiagnostics alloc] initWithDevice:baseDevice @@ -5682,12 +5619,11 @@ - (void)resetCountsWithParams:(MTRWiFiNetworkDiagnosticsClusterResetCountsParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -5846,8 +5782,8 @@ - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsPa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:baseDevice @@ -5859,12 +5795,11 @@ - (void)resetCountsWithParams:(MTREthernetNetworkDiagnosticsClusterResetCountsPa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -5991,8 +5926,8 @@ - (void)setUTCTimeWithParams:(MTRTimeSynchronizationClusterSetUTCTimeParams *)pa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTimeSynchronization alloc] initWithDevice:baseDevice @@ -6004,12 +5939,11 @@ - (void)setUTCTimeWithParams:(MTRTimeSynchronizationClusterSetUTCTimeParams *)pa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6027,8 +5961,8 @@ - (void)setTrustedTimeSourceWithParams:(MTRTimeSynchronizationClusterSetTrustedT // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTimeSynchronization alloc] initWithDevice:baseDevice @@ -6040,12 +5974,11 @@ - (void)setTrustedTimeSourceWithParams:(MTRTimeSynchronizationClusterSetTrustedT dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6063,8 +5996,8 @@ - (void)setTimeZoneWithParams:(MTRTimeSynchronizationClusterSetTimeZoneParams *) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTimeSynchronization alloc] initWithDevice:baseDevice @@ -6076,12 +6009,11 @@ - (void)setTimeZoneWithParams:(MTRTimeSynchronizationClusterSetTimeZoneParams *) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6099,8 +6031,8 @@ - (void)setDSTOffsetWithParams:(MTRTimeSynchronizationClusterSetDSTOffsetParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTimeSynchronization alloc] initWithDevice:baseDevice @@ -6112,12 +6044,11 @@ - (void)setDSTOffsetWithParams:(MTRTimeSynchronizationClusterSetDSTOffsetParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6135,8 +6066,8 @@ - (void)setDefaultNTPWithParams:(MTRTimeSynchronizationClusterSetDefaultNTPParam // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTimeSynchronization alloc] initWithDevice:baseDevice @@ -6148,12 +6079,11 @@ - (void)setDefaultNTPWithParams:(MTRTimeSynchronizationClusterSetDefaultNTPParam dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6500,8 +6430,8 @@ - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterO // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:baseDevice @@ -6513,12 +6443,11 @@ - (void)openCommissioningWindowWithParams:(MTRAdministratorCommissioningClusterO dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6536,8 +6465,8 @@ - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:baseDevice @@ -6549,12 +6478,11 @@ - (void)openBasicCommissioningWindowWithParams:(MTRAdministratorCommissioningClu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6576,8 +6504,8 @@ - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevok // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:baseDevice @@ -6589,12 +6517,11 @@ - (void)revokeCommissioningWithParams:(MTRAdministratorCommissioningClusterRevok dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6701,8 +6628,8 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6714,12 +6641,11 @@ - (void)attestationRequestWithParams:(MTROperationalCredentialsClusterAttestatio dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6737,8 +6663,8 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6750,12 +6676,11 @@ - (void)certificateChainRequestWithParams:(MTROperationalCredentialsClusterCerti dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6773,8 +6698,8 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6786,12 +6711,11 @@ - (void)CSRRequestWithParams:(MTROperationalCredentialsClusterCSRRequestParams * dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6809,8 +6733,8 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6822,12 +6746,11 @@ - (void)addNOCWithParams:(MTROperationalCredentialsClusterAddNOCParams *)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6845,8 +6768,8 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6858,12 +6781,11 @@ - (void)updateNOCWithParams:(MTROperationalCredentialsClusterUpdateNOCParams *)p dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6881,8 +6803,8 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6894,12 +6816,11 @@ - (void)updateFabricLabelWithParams:(MTROperationalCredentialsClusterUpdateFabri dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6917,8 +6838,8 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6930,12 +6851,11 @@ - (void)removeFabricWithParams:(MTROperationalCredentialsClusterRemoveFabricPara dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -6953,8 +6873,8 @@ - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAdd // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:baseDevice @@ -6966,12 +6886,11 @@ - (void)addTrustedRootCertificateWithParams:(MTROperationalCredentialsClusterAdd dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7135,8 +7054,8 @@ - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:baseDevice @@ -7148,12 +7067,11 @@ - (void)keySetWriteWithParams:(MTRGroupKeyManagementClusterKeySetWriteParams *)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7171,8 +7089,8 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:baseDevice @@ -7184,12 +7102,11 @@ - (void)keySetReadWithParams:(MTRGroupKeyManagementClusterKeySetReadParams *)par dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7207,8 +7124,8 @@ - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:baseDevice @@ -7220,12 +7137,11 @@ - (void)keySetRemoveWithParams:(MTRGroupKeyManagementClusterKeySetRemoveParams * dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7247,8 +7163,8 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:baseDevice @@ -7260,12 +7176,11 @@ - (void)keySetReadAllIndicesWithParams:(MTRGroupKeyManagementClusterKeySetReadAl dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7586,8 +7501,8 @@ - (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:baseDevice @@ -7599,12 +7514,11 @@ - (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7622,8 +7536,8 @@ - (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParam // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:baseDevice @@ -7635,12 +7549,11 @@ - (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParam dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7662,8 +7575,8 @@ - (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestPar // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:baseDevice @@ -7675,12 +7588,11 @@ - (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestPar dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7774,8 +7686,8 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:baseDevice @@ -7787,12 +7699,11 @@ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -7922,8 +7833,8 @@ - (void)changeToModeWithParams:(MTRLaundryWasherModeClusterChangeToModeParams *) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLaundryWasherMode alloc] initWithDevice:baseDevice @@ -7935,12 +7846,11 @@ - (void)changeToModeWithParams:(MTRLaundryWasherModeClusterChangeToModeParams *) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8046,8 +7956,8 @@ - (void)changeToModeWithParams:(MTRRefrigeratorAndTemperatureControlledCabinetMo // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode alloc] initWithDevice:baseDevice @@ -8059,12 +7969,11 @@ - (void)changeToModeWithParams:(MTRRefrigeratorAndTemperatureControlledCabinetMo dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8258,8 +8167,8 @@ - (void)changeToModeWithParams:(MTRRVCRunModeClusterChangeToModeParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCRunMode alloc] initWithDevice:baseDevice @@ -8271,12 +8180,11 @@ - (void)changeToModeWithParams:(MTRRVCRunModeClusterChangeToModeParams *)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8382,8 +8290,8 @@ - (void)changeToModeWithParams:(MTRRVCCleanModeClusterChangeToModeParams *)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:baseDevice @@ -8395,12 +8303,11 @@ - (void)changeToModeWithParams:(MTRRVCCleanModeClusterChangeToModeParams *)param dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8506,8 +8413,8 @@ - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperaturePara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:baseDevice @@ -8519,12 +8426,11 @@ - (void)setTemperatureWithParams:(MTRTemperatureControlClusterSetTemperaturePara dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8679,8 +8585,8 @@ - (void)changeToModeWithParams:(MTRDishwasherModeClusterChangeToModeParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDishwasherMode alloc] initWithDevice:baseDevice @@ -8692,12 +8598,11 @@ - (void)changeToModeWithParams:(MTRDishwasherModeClusterChangeToModeParams *)par dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -8858,8 +8763,8 @@ - (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterSmokeCOAlarm alloc] initWithDevice:baseDevice @@ -8871,12 +8776,11 @@ - (void)selfTestRequestWithParams:(MTRSmokeCOAlarmClusterSelfTestRequestParams * dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9016,8 +8920,8 @@ - (void)resetWithParams:(MTRDishwasherAlarmClusterResetParams *)params expectedV // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDishwasherAlarm alloc] initWithDevice:baseDevice @@ -9029,12 +8933,11 @@ - (void)resetWithParams:(MTRDishwasherAlarmClusterResetParams *)params expectedV dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9052,8 +8955,8 @@ - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAla // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDishwasherAlarm alloc] initWithDevice:baseDevice @@ -9065,12 +8968,11 @@ - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAla dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9158,8 +9060,8 @@ - (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:baseDevice @@ -9171,12 +9073,11 @@ - (void)pauseWithParams:(MTROperationalStateClusterPauseParams * _Nullable)param dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9198,8 +9099,8 @@ - (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:baseDevice @@ -9211,12 +9112,11 @@ - (void)stopWithParams:(MTROperationalStateClusterStopParams * _Nullable)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9238,8 +9138,8 @@ - (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:baseDevice @@ -9251,12 +9151,11 @@ - (void)startWithParams:(MTROperationalStateClusterStartParams * _Nullable)param dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9278,8 +9177,8 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:baseDevice @@ -9291,12 +9190,11 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9394,8 +9292,8 @@ - (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)pa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:baseDevice @@ -9407,12 +9305,11 @@ - (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)pa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9434,8 +9331,8 @@ - (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)para // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:baseDevice @@ -9447,12 +9344,11 @@ - (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)para dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9474,8 +9370,8 @@ - (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)pa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:baseDevice @@ -9487,12 +9383,11 @@ - (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)pa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9514,8 +9409,8 @@ - (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:baseDevice @@ -9527,12 +9422,11 @@ - (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9630,8 +9524,8 @@ - (void)resetConditionWithParams:(MTRHEPAFilterMonitoringClusterResetConditionPa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:baseDevice @@ -9643,12 +9537,11 @@ - (void)resetConditionWithParams:(MTRHEPAFilterMonitoringClusterResetConditionPa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9757,8 +9650,8 @@ - (void)resetConditionWithParams:(MTRActivatedCarbonFilterMonitoringClusterReset // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:baseDevice @@ -9770,12 +9663,11 @@ - (void)resetConditionWithParams:(MTRActivatedCarbonFilterMonitoringClusterReset dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9880,8 +9772,8 @@ - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -9893,12 +9785,11 @@ - (void)lockDoorWithParams:(MTRDoorLockClusterLockDoorParams * _Nullable)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9916,8 +9807,8 @@ - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -9929,12 +9820,11 @@ - (void)unlockDoorWithParams:(MTRDoorLockClusterUnlockDoorParams * _Nullable)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9952,8 +9842,8 @@ - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -9965,12 +9855,11 @@ - (void)unlockWithTimeoutWithParams:(MTRDoorLockClusterUnlockWithTimeoutParams * dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -9988,8 +9877,8 @@ - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10001,12 +9890,11 @@ - (void)setWeekDayScheduleWithParams:(MTRDoorLockClusterSetWeekDayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10024,8 +9912,8 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10037,12 +9925,11 @@ - (void)getWeekDayScheduleWithParams:(MTRDoorLockClusterGetWeekDayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10060,8 +9947,8 @@ - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDaySchedulePa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10073,12 +9960,11 @@ - (void)clearWeekDayScheduleWithParams:(MTRDoorLockClusterClearWeekDaySchedulePa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10096,8 +9982,8 @@ - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10109,12 +9995,11 @@ - (void)setYearDayScheduleWithParams:(MTRDoorLockClusterSetYearDayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10132,8 +10017,8 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10145,12 +10030,11 @@ - (void)getYearDayScheduleWithParams:(MTRDoorLockClusterGetYearDayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10168,8 +10052,8 @@ - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDaySchedulePa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10181,12 +10065,11 @@ - (void)clearYearDayScheduleWithParams:(MTRDoorLockClusterClearYearDaySchedulePa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10204,8 +10087,8 @@ - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10217,12 +10100,11 @@ - (void)setHolidayScheduleWithParams:(MTRDoorLockClusterSetHolidayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10240,8 +10122,8 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10253,12 +10135,11 @@ - (void)getHolidayScheduleWithParams:(MTRDoorLockClusterGetHolidayScheduleParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10276,8 +10157,8 @@ - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidaySchedulePa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10289,12 +10170,11 @@ - (void)clearHolidayScheduleWithParams:(MTRDoorLockClusterClearHolidaySchedulePa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10312,8 +10192,8 @@ - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params expectedValu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10325,12 +10205,11 @@ - (void)setUserWithParams:(MTRDoorLockClusterSetUserParams *)params expectedValu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10348,8 +10227,8 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params expectedValu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10361,12 +10240,11 @@ - (void)getUserWithParams:(MTRDoorLockClusterGetUserParams *)params expectedValu dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10384,8 +10262,8 @@ - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params expected // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10397,12 +10275,11 @@ - (void)clearUserWithParams:(MTRDoorLockClusterClearUserParams *)params expected dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10420,8 +10297,8 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10433,12 +10310,11 @@ - (void)setCredentialWithParams:(MTRDoorLockClusterSetCredentialParams *)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10456,8 +10332,8 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10469,12 +10345,11 @@ - (void)getCredentialStatusWithParams:(MTRDoorLockClusterGetCredentialStatusPara dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10492,8 +10367,8 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10505,12 +10380,11 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -10528,8 +10402,8 @@ - (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)par // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:baseDevice @@ -10541,12 +10415,11 @@ - (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)par dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11109,8 +10982,8 @@ - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11122,12 +10995,11 @@ - (void)upOrOpenWithParams:(MTRWindowCoveringClusterUpOrOpenParams * _Nullable)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11149,8 +11021,8 @@ - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Null // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11162,12 +11034,11 @@ - (void)downOrCloseWithParams:(MTRWindowCoveringClusterDownOrCloseParams * _Null dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11189,8 +11060,8 @@ - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullab // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11202,12 +11073,11 @@ - (void)stopMotionWithParams:(MTRWindowCoveringClusterStopMotionParams * _Nullab dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11225,8 +11095,8 @@ - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11238,12 +11108,11 @@ - (void)goToLiftValueWithParams:(MTRWindowCoveringClusterGoToLiftValueParams *)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11261,8 +11130,8 @@ - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentage // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11274,12 +11143,11 @@ - (void)goToLiftPercentageWithParams:(MTRWindowCoveringClusterGoToLiftPercentage dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11297,8 +11165,8 @@ - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11310,12 +11178,11 @@ - (void)goToTiltValueWithParams:(MTRWindowCoveringClusterGoToTiltValueParams *)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11333,8 +11200,8 @@ - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentage // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:baseDevice @@ -11346,12 +11213,11 @@ - (void)goToTiltPercentageWithParams:(MTRWindowCoveringClusterGoToTiltPercentage dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11592,8 +11458,8 @@ - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierCont // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterBarrierControl alloc] initWithDevice:baseDevice @@ -11605,12 +11471,11 @@ - (void)barrierControlGoToPercentWithParams:(MTRBarrierControlClusterBarrierCont dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -11632,8 +11497,8 @@ - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStop // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterBarrierControl alloc] initWithDevice:baseDevice @@ -11645,12 +11510,11 @@ - (void)barrierControlStopWithParams:(MTRBarrierControlClusterBarrierControlStop dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -12067,8 +11931,8 @@ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerPara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:baseDevice @@ -12080,12 +11944,11 @@ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerPara dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -12103,8 +11966,8 @@ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:baseDevice @@ -12116,12 +11979,11 @@ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -12139,8 +12001,8 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:baseDevice @@ -12152,12 +12014,11 @@ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -12179,8 +12040,8 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:baseDevice @@ -12192,12 +12053,11 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -12839,8 +12699,8 @@ - (void)stepWithParams:(MTRFanControlClusterStepParams *)params expectedValues:( // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterFanControl alloc] initWithDevice:baseDevice @@ -12852,12 +12712,11 @@ - (void)stepWithParams:(MTRFanControlClusterStepParams *)params expectedValues:( dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13170,8 +13029,8 @@ - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params expe // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13183,12 +13042,11 @@ - (void)moveToHueWithParams:(MTRColorControlClusterMoveToHueParams *)params expe dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13206,8 +13064,8 @@ - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params expected // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13219,12 +13077,11 @@ - (void)moveHueWithParams:(MTRColorControlClusterMoveHueParams *)params expected dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13242,8 +13099,8 @@ - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params expected // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13255,12 +13112,11 @@ - (void)stepHueWithParams:(MTRColorControlClusterStepHueParams *)params expected dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13278,8 +13134,8 @@ - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13291,12 +13147,11 @@ - (void)moveToSaturationWithParams:(MTRColorControlClusterMoveToSaturationParams dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13314,8 +13169,8 @@ - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13327,12 +13182,11 @@ - (void)moveSaturationWithParams:(MTRColorControlClusterMoveSaturationParams *)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13350,8 +13204,8 @@ - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)p // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13363,12 +13217,11 @@ - (void)stepSaturationWithParams:(MTRColorControlClusterStepSaturationParams *)p dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13386,8 +13239,8 @@ - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSatu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13399,12 +13252,11 @@ - (void)moveToHueAndSaturationWithParams:(MTRColorControlClusterMoveToHueAndSatu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13422,8 +13274,8 @@ - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13435,12 +13287,11 @@ - (void)moveToColorWithParams:(MTRColorControlClusterMoveToColorParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13458,8 +13309,8 @@ - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params expe // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13471,12 +13322,11 @@ - (void)moveColorWithParams:(MTRColorControlClusterMoveColorParams *)params expe dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13494,8 +13344,8 @@ - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params expe // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13507,12 +13357,11 @@ - (void)stepColorWithParams:(MTRColorControlClusterStepColorParams *)params expe dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13530,8 +13379,8 @@ - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTempe // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13543,12 +13392,11 @@ - (void)moveToColorTemperatureWithParams:(MTRColorControlClusterMoveToColorTempe dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13566,8 +13414,8 @@ - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHuePara // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13579,12 +13427,11 @@ - (void)enhancedMoveToHueWithParams:(MTRColorControlClusterEnhancedMoveToHuePara dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13602,8 +13449,8 @@ - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13615,12 +13462,11 @@ - (void)enhancedMoveHueWithParams:(MTRColorControlClusterEnhancedMoveHueParams * dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13638,8 +13484,8 @@ - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams * // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13651,12 +13497,11 @@ - (void)enhancedStepHueWithParams:(MTRColorControlClusterEnhancedStepHueParams * dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13674,8 +13519,8 @@ - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhanced // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13687,12 +13532,11 @@ - (void)enhancedMoveToHueAndSaturationWithParams:(MTRColorControlClusterEnhanced dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13710,8 +13554,8 @@ - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13723,12 +13567,11 @@ - (void)colorLoopSetWithParams:(MTRColorControlClusterColorLoopSetParams *)param dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13746,8 +13589,8 @@ - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)param // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13759,12 +13602,11 @@ - (void)stopMoveStepWithParams:(MTRColorControlClusterStopMoveStepParams *)param dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13782,8 +13624,8 @@ - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13795,12 +13637,11 @@ - (void)moveColorTemperatureWithParams:(MTRColorControlClusterMoveColorTemperatu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -13818,8 +13659,8 @@ - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:baseDevice @@ -13831,12 +13672,11 @@ - (void)stepColorTemperatureWithParams:(MTRColorControlClusterStepColorTemperatu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16381,8 +16221,8 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:baseDevice @@ -16394,12 +16234,11 @@ - (void)changeChannelWithParams:(MTRChannelClusterChangeChannelParams *)params e dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16417,8 +16256,8 @@ - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberP // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:baseDevice @@ -16430,12 +16269,11 @@ - (void)changeChannelByNumberWithParams:(MTRChannelClusterChangeChannelByNumberP dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16453,8 +16291,8 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params expec // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:baseDevice @@ -16466,12 +16304,11 @@ - (void)skipChannelWithParams:(MTRChannelClusterSkipChannelParams *)params expec dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16577,8 +16414,8 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterTargetNavigator alloc] initWithDevice:baseDevice @@ -16590,12 +16427,11 @@ - (void)navigateTargetWithParams:(MTRTargetNavigatorClusterNavigateTargetParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16690,8 +16526,8 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16703,12 +16539,11 @@ - (void)playWithParams:(MTRMediaPlaybackClusterPlayParams * _Nullable)params exp dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16730,8 +16565,8 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16743,12 +16578,11 @@ - (void)pauseWithParams:(MTRMediaPlaybackClusterPauseParams * _Nullable)params e dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16770,8 +16604,8 @@ - (void)stopWithParams:(MTRMediaPlaybackClusterStopParams * _Nullable)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16783,12 +16617,11 @@ - (void)stopWithParams:(MTRMediaPlaybackClusterStopParams * _Nullable)params exp dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16810,8 +16643,8 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16823,12 +16656,11 @@ - (void)startOverWithParams:(MTRMediaPlaybackClusterStartOverParams * _Nullable) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16850,8 +16682,8 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16863,12 +16695,11 @@ - (void)previousWithParams:(MTRMediaPlaybackClusterPreviousParams * _Nullable)pa dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16890,8 +16721,8 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params exp // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16903,12 +16734,11 @@ - (void)nextWithParams:(MTRMediaPlaybackClusterNextParams * _Nullable)params exp dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16930,8 +16760,8 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16943,12 +16773,11 @@ - (void)rewindWithParams:(MTRMediaPlaybackClusterRewindParams * _Nullable)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -16970,8 +16799,8 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -16983,12 +16812,11 @@ - (void)fastForwardWithParams:(MTRMediaPlaybackClusterFastForwardParams * _Nulla dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17006,8 +16834,8 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -17019,12 +16847,11 @@ - (void)skipForwardWithParams:(MTRMediaPlaybackClusterSkipForwardParams *)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17042,8 +16869,8 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -17055,12 +16882,11 @@ - (void)skipBackwardWithParams:(MTRMediaPlaybackClusterSkipBackwardParams *)para dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17078,8 +16904,8 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValue // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:baseDevice @@ -17091,12 +16917,11 @@ - (void)seekWithParams:(MTRMediaPlaybackClusterSeekParams *)params expectedValue dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17324,8 +17149,8 @@ - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params ex // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:baseDevice @@ -17337,12 +17162,11 @@ - (void)selectInputWithParams:(MTRMediaInputClusterSelectInputParams *)params ex dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17364,8 +17188,8 @@ - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _ // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:baseDevice @@ -17377,12 +17201,11 @@ - (void)showInputStatusWithParams:(MTRMediaInputClusterShowInputStatusParams * _ dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17404,8 +17227,8 @@ - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _ // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:baseDevice @@ -17417,12 +17240,11 @@ - (void)hideInputStatusWithParams:(MTRMediaInputClusterHideInputStatusParams * _ dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17440,8 +17262,8 @@ - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params ex // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:baseDevice @@ -17453,12 +17275,11 @@ - (void)renameInputWithParams:(MTRMediaInputClusterRenameInputParams *)params ex dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17573,8 +17394,8 @@ - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params expect // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:baseDevice @@ -17586,12 +17407,11 @@ - (void)sleepWithParams:(MTRLowPowerClusterSleepParams * _Nullable)params expect dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17673,8 +17493,8 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params expectedV // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterKeypadInput alloc] initWithDevice:baseDevice @@ -17686,12 +17506,11 @@ - (void)sendKeyWithParams:(MTRKeypadInputClusterSendKeyParams *)params expectedV dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17772,8 +17591,8 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:baseDevice @@ -17785,12 +17604,11 @@ - (void)launchContentWithParams:(MTRContentLauncherClusterLaunchContentParams *) dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17808,8 +17626,8 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:baseDevice @@ -17821,12 +17639,11 @@ - (void)launchURLWithParams:(MTRContentLauncherClusterLaunchURLParams *)params e dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17936,8 +17753,8 @@ - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:baseDevice @@ -17949,12 +17766,11 @@ - (void)selectOutputWithParams:(MTRAudioOutputClusterSelectOutputParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -17972,8 +17788,8 @@ - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAudioOutput alloc] initWithDevice:baseDevice @@ -17985,12 +17801,11 @@ - (void)renameOutputWithParams:(MTRAudioOutputClusterRenameOutputParams *)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18083,8 +17898,8 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nul // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:baseDevice @@ -18096,12 +17911,11 @@ - (void)launchAppWithParams:(MTRApplicationLauncherClusterLaunchAppParams * _Nul dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18119,8 +17933,8 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullabl // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:baseDevice @@ -18132,12 +17946,11 @@ - (void)stopAppWithParams:(MTRApplicationLauncherClusterStopAppParams * _Nullabl dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18155,8 +17968,8 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullabl // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:baseDevice @@ -18168,12 +17981,11 @@ - (void)hideAppWithParams:(MTRApplicationLauncherClusterHideAppParams * _Nullabl dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18386,8 +18198,8 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:baseDevice @@ -18399,12 +18211,11 @@ - (void)getSetupPINWithParams:(MTRAccountLoginClusterGetSetupPINParams *)params dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18422,8 +18233,8 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:baseDevice @@ -18435,12 +18246,11 @@ - (void)loginWithParams:(MTRAccountLoginClusterLoginParams *)params expectedValu dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18462,8 +18272,8 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:baseDevice @@ -18475,12 +18285,11 @@ - (void)logoutWithParams:(MTRAccountLoginClusterLogoutParams * _Nullable)params dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18579,8 +18388,8 @@ - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfi // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterElectricalMeasurement alloc] initWithDevice:baseDevice @@ -18592,12 +18401,11 @@ - (void)getProfileInfoCommandWithParams:(MTRElectricalMeasurementClusterGetProfi dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -18615,8 +18423,8 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterElectricalMeasurement alloc] initWithDevice:baseDevice @@ -18628,12 +18436,11 @@ - (void)getMeasurementProfileCommandWithParams:(MTRElectricalMeasurementClusterG dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19452,8 +19259,8 @@ - (void)testWithParams:(MTRUnitTestingClusterTestParams * _Nullable)params expec // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19465,12 +19272,11 @@ - (void)testWithParams:(MTRUnitTestingClusterTestParams * _Nullable)params expec dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19492,8 +19298,8 @@ - (void)testNotHandledWithParams:(MTRUnitTestingClusterTestNotHandledParams * _N // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19505,12 +19311,11 @@ - (void)testNotHandledWithParams:(MTRUnitTestingClusterTestNotHandledParams * _N dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19532,8 +19337,8 @@ - (void)testSpecificWithParams:(MTRUnitTestingClusterTestSpecificParams * _Nulla // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19545,12 +19350,11 @@ - (void)testSpecificWithParams:(MTRUnitTestingClusterTestSpecificParams * _Nulla dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19572,8 +19376,8 @@ - (void)testUnknownCommandWithParams:(MTRUnitTestingClusterTestUnknownCommandPar // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19585,12 +19389,11 @@ - (void)testUnknownCommandWithParams:(MTRUnitTestingClusterTestUnknownCommandPar dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19608,8 +19411,8 @@ - (void)testAddArgumentsWithParams:(MTRUnitTestingClusterTestAddArgumentsParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19621,12 +19424,11 @@ - (void)testAddArgumentsWithParams:(MTRUnitTestingClusterTestAddArgumentsParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19644,8 +19446,8 @@ - (void)testSimpleArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleArgu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19657,12 +19459,11 @@ - (void)testSimpleArgumentRequestWithParams:(MTRUnitTestingClusterTestSimpleArgu dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19680,8 +19481,8 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRUnitTestingClusterTestStruc // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19693,12 +19494,11 @@ - (void)testStructArrayArgumentRequestWithParams:(MTRUnitTestingClusterTestStruc dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19716,8 +19516,8 @@ - (void)testStructArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArgu // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19729,12 +19529,11 @@ - (void)testStructArgumentRequestWithParams:(MTRUnitTestingClusterTestStructArgu dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19752,8 +19551,8 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRUnitTestingClusterTestNest // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19765,12 +19564,11 @@ - (void)testNestedStructArgumentRequestWithParams:(MTRUnitTestingClusterTestNest dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19788,8 +19586,8 @@ - (void)testListStructArgumentRequestWithParams:(MTRUnitTestingClusterTestListSt // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19801,12 +19599,11 @@ - (void)testListStructArgumentRequestWithParams:(MTRUnitTestingClusterTestListSt dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19824,8 +19621,8 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRUnitTestingClusterTestListInt // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19837,12 +19634,11 @@ - (void)testListInt8UArgumentRequestWithParams:(MTRUnitTestingClusterTestListInt dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19860,8 +19656,8 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTest // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19873,12 +19669,11 @@ - (void)testNestedStructListArgumentRequestWithParams:(MTRUnitTestingClusterTest dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19896,8 +19691,8 @@ - (void)testListNestedStructListArgumentRequestWithParams:(MTRUnitTestingCluster // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19909,12 +19704,11 @@ - (void)testListNestedStructListArgumentRequestWithParams:(MTRUnitTestingCluster dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19932,8 +19726,8 @@ - (void)testListInt8UReverseRequestWithParams:(MTRUnitTestingClusterTestListInt8 // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19945,12 +19739,11 @@ - (void)testListInt8UReverseRequestWithParams:(MTRUnitTestingClusterTestListInt8 dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -19968,8 +19761,8 @@ - (void)testEnumsRequestWithParams:(MTRUnitTestingClusterTestEnumsRequestParams // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -19981,12 +19774,11 @@ - (void)testEnumsRequestWithParams:(MTRUnitTestingClusterTestEnumsRequestParams dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20004,8 +19796,8 @@ - (void)testNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestNullable // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20017,12 +19809,11 @@ - (void)testNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestNullable dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20040,8 +19831,8 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestC // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20053,12 +19844,11 @@ - (void)testComplexNullableOptionalRequestWithParams:(MTRUnitTestingClusterTestC dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20076,8 +19866,8 @@ - (void)simpleStructEchoRequestWithParams:(MTRUnitTestingClusterSimpleStructEcho // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20089,12 +19879,11 @@ - (void)simpleStructEchoRequestWithParams:(MTRUnitTestingClusterSimpleStructEcho dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20116,8 +19905,8 @@ - (void)timedInvokeRequestWithParams:(MTRUnitTestingClusterTimedInvokeRequestPar // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20129,12 +19918,11 @@ - (void)timedInvokeRequestWithParams:(MTRUnitTestingClusterTimedInvokeRequestPar dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20152,8 +19940,8 @@ - (void)testSimpleOptionalArgumentRequestWithParams:(MTRUnitTestingClusterTestSi // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20165,12 +19953,11 @@ - (void)testSimpleOptionalArgumentRequestWithParams:(MTRUnitTestingClusterTestSi dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20188,8 +19975,8 @@ - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEve // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20201,12 +19988,11 @@ - (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEve dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -20224,8 +20010,8 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTes // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:baseDevice @@ -20237,12 +20023,11 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTes dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -21814,8 +21599,8 @@ - (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params expecte // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:baseDevice @@ -21827,12 +21612,11 @@ - (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params expecte dispatch_async(self.callbackQueue, ^{ completion(error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; @@ -21850,8 +21634,8 @@ - (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params e // Make a copy of params before we go async. params = [params copy]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + workItem.readyHandler = ^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { + MTRClustersLogDequeue(logPrefix, self.device.asyncWorkQueue); auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; auto * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:baseDevice @@ -21863,12 +21647,11 @@ - (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params e dispatch_async(self.callbackQueue, ^{ completion(value, error); }); - [workItem endWork]; + workCompletion(MTRAsyncWorkComplete); }]; }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + MTRClustersLogEnqueue(logPrefix, self.device.asyncWorkQueue); + [self.device.asyncWorkQueue enqueueWorkItem:workItem]; if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; diff --git a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m index 4fbb1c44468652..d7154afe996d77 100644 --- a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m +++ b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m @@ -15,33 +15,40 @@ */ #import - -// system dependencies #import -#import "MTRAsyncWorkQueue_Internal.h" +#import "MTRAsyncWorkQueue.h" @interface MTRAsyncWorkQueueTests : XCTestCase - @end -@implementation MTRAsyncWorkQueueTests +@implementation MTRAsyncWorkQueueTests { + dispatch_queue_t _backgroundQueue; +} + +- (dispatch_queue_t)backgroundQueue +{ + if (!_backgroundQueue) { + _backgroundQueue = dispatch_queue_create("background queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + } + return _backgroundQueue; +} - (void)testRunItem { XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + id context = [[NSObject alloc] init]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:context]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; __block int counter = 0; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem1.readyHandler = ^(id handlerContext, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + XCTAssertIdentical(handlerContext, context); + XCTAssertEqual(retryCount, 0); + XCTAssertTrue(completion(MTRAsyncWorkComplete)); counter++; [expectation fulfill]; - [workItem1 endWork]; - }; - workItem1.readyHandler = readyHandler; - workItem1.cancelHandler = ^{ }; [workQueue enqueueWorkItem:workItem1]; @@ -51,7 +58,7 @@ - (void)testRunItem XCTAssertNil(weakItem); }]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:1 handler:nil]; // see that it only ran once XCTAssertEqual(counter, 1); @@ -61,34 +68,28 @@ - (void)testRunItemsSerialized { XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called in order"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; __block int counter = 0; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem1.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { sleep(1); counter++; - [workItem1 endWork]; - }; - workItem1.readyHandler = readyHandler1; - workItem1.cancelHandler = ^{ + completion(MTRAsyncWorkComplete); }; [workQueue enqueueWorkItem:workItem1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // expect this to have waited until workItem1's sleep(1) finished and incremented counter if (counter == 1) { [expectation fulfill]; } - [workItem2 endWork]; - }; - workItem2.readyHandler = readyHandler2; - workItem2.cancelHandler = ^{ + completion(MTRAsyncWorkComplete); }; [workQueue enqueueWorkItem:workItem2]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:2 handler:nil]; // see that workItem1 only ran once XCTAssertEqual(counter, 1); @@ -98,40 +99,34 @@ - (void)testRunItemsRetry { XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called in order"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; __block int counter = 0; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem1.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { sleep(1); counter++; if (retryCount) { // only end after retried once - [workItem1 endWork]; + completion(MTRAsyncWorkComplete); } else { - [workItem1 retryWork]; + completion(MTRAsyncWorkNeedsRetry); } }; - workItem1.readyHandler = readyHandler1; - workItem1.cancelHandler = ^{ - }; [workQueue enqueueWorkItem:workItem1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // expect this to have waited until workItem1's sleep(1) finished and incremented counter twice if (counter == 2) { [expectation fulfill]; } - [workItem2 endWork]; - }; - workItem2.readyHandler = readyHandler2; - workItem2.cancelHandler = ^{ + completion(MTRAsyncWorkComplete); }; [workQueue enqueueWorkItem:workItem2]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:3 handler:nil]; // see that workItem1 ran twice after the retry XCTAssertEqual(counter, 2); @@ -142,57 +137,48 @@ - (void)testRunItemsAfterDrain XCTestExpectation * expectation1 = [self expectationWithDescription:@"First work item caled"]; XCTestExpectation * expectation2 = [self expectationWithDescription:@"Second work item called after drain"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem1 endWork]; + workItem1.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); [expectation1 fulfill]; }; - workItem1.readyHandler = readyHandler1; - workItem1.cancelHandler = ^{ - }; [workQueue enqueueWorkItem:workItem1]; - [self waitForExpectations:@[ expectation1 ] timeout:5]; + [self waitForExpectations:@[ expectation1 ] timeout:2]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { [expectation2 fulfill]; - [workItem2 endWork]; - }; - workItem2.readyHandler = readyHandler2; - workItem2.cancelHandler = ^{ + completion(MTRAsyncWorkComplete); }; [workQueue enqueueWorkItem:workItem2]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:2 handler:nil]; } - (void)testRunItemNoHandlers { XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; __block int counter = 0; - MTRAsyncWorkReadyHandler readyHandler = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { counter++; - [workItem2 endWork]; + completion(MTRAsyncWorkComplete); [expectation fulfill]; }; - workItem2.readyHandler = readyHandler; - workItem2.cancelHandler = ^{ - }; // Check that trying to run workItem1 does not crash. [workQueue enqueueWorkItem:workItem1]; [workQueue enqueueWorkItem:workItem2]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectationsWithTimeout:2 handler:nil]; // see that it only ran once XCTAssertEqual(counter, 1); @@ -203,45 +189,39 @@ - (void)testInvalidation XCTestExpectation * expectation = [self expectationWithDescription:@"Work item called"]; XCTestExpectation * cancelExpectation = [self expectationWithDescription:@"Work item canceled"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem1.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // Give the code enqueing the other items a chance to run, so they can // actually get canceled. sleep(1); [workQueue invalidate]; - [workItem1 endWork]; + XCTAssertFalse(completion(MTRAsyncWorkComplete)); [expectation fulfill]; }; - workItem1.readyHandler = readyHandler1; // No cancel handler on purpose. [workQueue enqueueWorkItem:workItem1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - // This should never get called. - XCTAssertFalse(YES); - [workItem2 endWork]; + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + XCTFail("Should not have been called"); + completion(MTRAsyncWorkComplete); }; - workItem2.readyHandler = readyHandler2; - // No cancel handler on purpose. + workItem2.cancelHandler = nil; [workQueue enqueueWorkItem:workItem2]; MTRAsyncWorkItem * workItem3 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler3 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - // This should never get called. - XCTAssertFalse(YES); - [workItem3 endWork]; + workItem3.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + XCTFail("Should not have been called"); + completion(MTRAsyncWorkComplete); }; - dispatch_block_t cancelHandler3 = ^() { + workItem3.cancelHandler = ^{ [cancelExpectation fulfill]; }; - workItem3.readyHandler = readyHandler3; - workItem3.cancelHandler = cancelHandler3; [workQueue enqueueWorkItem:workItem3]; - [self waitForExpectations:@[ expectation, cancelExpectation ] timeout:5]; + [self waitForExpectations:@[ expectation, cancelExpectation ] timeout:2]; } - (void)testBatching @@ -251,18 +231,16 @@ - (void)testBatching __block BOOL workItem2ReadyCalled = NO; XCTestExpectation * workItem3ReadyExpectation = [self expectationWithDescription:@"Work item 3 called"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:@42]; - // Have a work item sleep so the testing items can queue MTRAsyncWorkItem * workItem0 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler0 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem0.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // While processing item 0, enqueue additional items to test batching MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + [workItem1 setReadyHandler:^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { [workItem1ReadyExpectation fulfill]; - [workItem1 endWork]; - }; - workItem1.readyHandler = readyHandler1; + completion(MTRAsyncWorkComplete); + }]; [workItem1 setBatchingID:1 data:@(1) handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond, BOOL * _Nonnull fullyMerged) { @@ -270,38 +248,32 @@ - (void)testBatching XCTAssertEqualObjects(opaqueDataSecond, @(2)); *fullyMerged = YES; }]; - // No cancel handler on purpose. [workQueue enqueueWorkItem:workItem1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + [workItem2 setReadyHandler:^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { workItem2ReadyCalled = YES; - [workItem2 endWork]; - }; - workItem2.readyHandler = readyHandler2; + completion(MTRAsyncWorkComplete); + }]; [workItem2 setBatchingID:1 data:@(2) handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond, BOOL * _Nonnull fullyMerged) { workItem2BatchingCalled = YES; }]; - // No cancel handler on purpose. [workQueue enqueueWorkItem:workItem2]; MTRAsyncWorkItem * workItem3 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler3 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + [workItem3 setReadyHandler:^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { [workItem3ReadyExpectation fulfill]; - [workItem3 endWork]; - }; - workItem3.readyHandler = readyHandler3; + completion(MTRAsyncWorkComplete); + }]; [workQueue enqueueWorkItem:workItem3]; - [workItem0 endWork]; + completion(MTRAsyncWorkComplete); }; - workItem0.readyHandler = readyHandler0; - // No cancel handler on purpose. [workQueue enqueueWorkItem:workItem0]; - [self waitForExpectations:@[ workItem1ReadyExpectation, workItem3ReadyExpectation ] timeout:5]; + [self waitForExpectations:@[ workItem1ReadyExpectation, workItem3ReadyExpectation ] timeout:3]; XCTAssertFalse(workItem2BatchingCalled); XCTAssertFalse(workItem2ReadyCalled); @@ -312,17 +284,15 @@ - (void)testDuplicate XCTestExpectation * workItem0ReadyExpectation = [self expectationWithDescription:@"Work item 0 called"]; XCTestExpectation * workItem6ReadyExpectation = [self expectationWithDescription:@"Work item 6 called"]; - MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:nil queue:dispatch_get_main_queue()]; + MTRAsyncWorkQueue * workQueue = [[MTRAsyncWorkQueue alloc] initWithContext:NSNull.null]; - // Have a work item sleep so the testing items can queue MTRAsyncWorkItem * workItem0 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler0 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { + workItem0.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // While processing item 0, enqueue additional items to test duplicate checking MTRAsyncWorkItem * workItem1 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler1 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem1 endWork]; + workItem1.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); }; - workItem1.readyHandler = readyHandler1; [workItem1 setDuplicateTypeID:1 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(1)]) { @@ -335,10 +305,9 @@ - (void)testDuplicate [workQueue enqueueWorkItem:workItem1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler2 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem2 endWork]; + workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); }; - workItem2.readyHandler = readyHandler2; [workItem2 setDuplicateTypeID:1 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(2)]) { @@ -351,10 +320,9 @@ - (void)testDuplicate [workQueue enqueueWorkItem:workItem2]; MTRAsyncWorkItem * workItem3 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler3 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem3 endWork]; + workItem3.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); }; - workItem3.readyHandler = readyHandler3; [workItem3 setDuplicateTypeID:2 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(1)]) { @@ -367,24 +335,23 @@ - (void)testDuplicate [workQueue enqueueWorkItem:workItem3]; // At this point we should have duplicate type 1 with data @(1) and @(2), and type 2 with data @(1). - XCTAssertTrue([workQueue isDuplicateForTypeID:1 workItemData:@(1)]); - XCTAssertTrue([workQueue isDuplicateForTypeID:1 workItemData:@(2)]); - XCTAssertTrue([workQueue isDuplicateForTypeID:2 workItemData:@(1)]); + XCTAssertTrue([workQueue hasDuplicateForTypeID:1 workItemData:@(1)]); + XCTAssertTrue([workQueue hasDuplicateForTypeID:1 workItemData:@(2)]); + XCTAssertTrue([workQueue hasDuplicateForTypeID:2 workItemData:@(1)]); - XCTAssertFalse([workQueue isDuplicateForTypeID:0 workItemData:@(1)]); - XCTAssertFalse([workQueue isDuplicateForTypeID:0 workItemData:@(2)]); - XCTAssertFalse([workQueue isDuplicateForTypeID:1 workItemData:@(0)]); - XCTAssertFalse([workQueue isDuplicateForTypeID:1 workItemData:@(3)]); - XCTAssertFalse([workQueue isDuplicateForTypeID:2 workItemData:@(2)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:0 workItemData:@(1)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:0 workItemData:@(2)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:1 workItemData:@(0)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:1 workItemData:@(3)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:2 workItemData:@(2)]); // Test returning *isDuplicate=NO and queuing one extra duplicate item, and that the extra item runs // First have a regular item with ID/data == 3/1 MTRAsyncWorkItem * workItem4 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler4 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem4 endWork]; + workItem4.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); }; - workItem4.readyHandler = readyHandler4; [workItem4 setDuplicateTypeID:3 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(1)]) { @@ -396,14 +363,13 @@ - (void)testDuplicate }]; [workQueue enqueueWorkItem:workItem4]; - XCTAssertTrue([workQueue isDuplicateForTypeID:3 workItemData:@(1)]); + XCTAssertTrue([workQueue hasDuplicateForTypeID:3 workItemData:@(1)]); // Have a barrier item with ID/data == 3/1 that returns *isDuplicate=NO MTRAsyncWorkItem * workItem5 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler5 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem5 endWork]; + workItem5.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); }; - workItem5.readyHandler = readyHandler5; [workItem5 setDuplicateTypeID:3 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(1)]) { @@ -416,15 +382,14 @@ - (void)testDuplicate [workQueue enqueueWorkItem:workItem5]; // After the above, the same ID/data should no longer be considered duplicate - XCTAssertFalse([workQueue isDuplicateForTypeID:3 workItemData:@(1)]); + XCTAssertFalse([workQueue hasDuplicateForTypeID:3 workItemData:@(1)]); // Now add regular regular item with ID/data == 3/1 MTRAsyncWorkItem * workItem6 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; - MTRAsyncWorkReadyHandler readyHandler6 = ^(MTRDevice * _Nonnull device, NSUInteger retryCount) { - [workItem6 endWork]; + workItem6.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + completion(MTRAsyncWorkComplete); [workItem6ReadyExpectation fulfill]; }; - workItem6.readyHandler = readyHandler6; [workItem6 setDuplicateTypeID:3 handler:^(id _Nonnull opaqueItemData, BOOL * _Nonnull isDuplicate, BOOL * stop) { if ([opaqueItemData isEqual:@(1)]) { @@ -437,15 +402,92 @@ - (void)testDuplicate [workQueue enqueueWorkItem:workItem6]; // After the above, the same ID/data should no longer be considered duplicate - XCTAssertTrue([workQueue isDuplicateForTypeID:3 workItemData:@(1)]); + XCTAssertTrue([workQueue hasDuplicateForTypeID:3 workItemData:@(1)]); - [workItem0 endWork]; + completion(MTRAsyncWorkComplete); [workItem0ReadyExpectation fulfill]; }; - workItem0.readyHandler = readyHandler0; [workQueue enqueueWorkItem:workItem0]; [self waitForExpectations:@[ workItem0ReadyExpectation, workItem6ReadyExpectation ] timeout:5]; } +- (void)testNoRetainCycles +{ + NSPointerArray * objects = [NSPointerArray weakObjectsPointerArray]; + @autoreleasepool { + __block MTRAsyncWorkCompletionBlock workCompletion; + @autoreleasepool { + MTRAsyncWorkQueue * queue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; + [objects addPointer:(__bridge void *) queue]; + MTRAsyncWorkItem * work = [[MTRAsyncWorkItem alloc] initWithQueue:self.backgroundQueue]; + dispatch_semaphore_t workReady = dispatch_semaphore_create(0); + dispatch_semaphore_t readyHandlerDone = dispatch_semaphore_create(0); + work.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + dispatch_semaphore_wait(workReady, DISPATCH_TIME_FOREVER); + workCompletion = completion; // retain outside inner ARP, simulating ongoing work + dispatch_async(self.backgroundQueue, ^{ + dispatch_semaphore_signal(readyHandlerDone); + }); + }; + [objects addPointer:(__bridge void *) work]; + [queue enqueueWorkItem:work]; + XCTAssertEqual(objects.allObjects.count, 2); + + dispatch_semaphore_signal(workReady); + dispatch_semaphore_wait(readyHandlerDone, DISPATCH_TIME_FOREVER); + // Not calling [queue invalidate] + } + + // We've dropped the work queue but the work item may + // still be retained by the work completion block. + XCTAssertNotNil(workCompletion); + NSArray * retained = objects.allObjects; + if (retained.count > 0) { + XCTAssertEqual(retained.count, 1); + XCTAssert([retained.firstObject isKindOfClass:MTRAsyncWorkItem.class]); + } + workCompletion = nil; + } + + // Everything should be gone now + XCTAssertEqualObjects(objects.allObjects, @[]); +} + +- (void)testContextLoss +{ + // Use a CFTypeRef so we can explicitly control the reference count + CFTypeRef testContext = CFBridgingRetain([[NSObject alloc] init]); + XCTAssertEqual(CFGetRetainCount(testContext), 1, @"internal test error"); + MTRAsyncWorkQueue * queue = [[MTRAsyncWorkQueue alloc] initWithContext:(__bridge id) testContext]; + + dispatch_semaphore_t ready = dispatch_semaphore_create(0); + dispatch_semaphore_t proceed = dispatch_semaphore_create(0); + MTRAsyncWorkItem * setup = [[MTRAsyncWorkItem alloc] initWithQueue:self.backgroundQueue]; + setup.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + // dispatch again because `context` is retained by the caller + dispatch_async(self.backgroundQueue, ^{ + dispatch_semaphore_signal(ready); + dispatch_semaphore_wait(proceed, DISPATCH_TIME_FOREVER); + completion(MTRAsyncWorkComplete); + }); + }; + [queue enqueueWorkItem:setup]; + + // Enqueue work item. It should not run because we will drop the context first. + XCTestExpectation * workRun = [self expectationWithDescription:@"work ready handler run"]; + workRun.inverted = YES; + MTRAsyncWorkItem * work = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; + work.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { + [workRun fulfill]; + }; + [queue enqueueWorkItem:work]; + + dispatch_semaphore_wait(ready, DISPATCH_TIME_FOREVER); + XCTAssertEqual(CFGetRetainCount(testContext), 1, @"internal test error"); + CFRelease(testContext); + dispatch_semaphore_signal(proceed); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + @end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index b5a63a11efa6df..5c68dd1d2cba9f 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -122,7 +122,6 @@ 3D843717294979230070D20A /* MTRClusters_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843715294979230070D20A /* MTRClusters_Internal.h */; }; 3D843756294AD25A0070D20A /* MTRCertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843754294AD25A0070D20A /* MTRCertificateInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D843757294AD25A0070D20A /* MTRCertificateInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D843755294AD25A0070D20A /* MTRCertificateInfo.mm */; }; - 3DA1A3542ABAB3B4004F0BB9 /* MTRAsyncWorkQueue_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DA1A3512ABAB3B4004F0BB9 /* MTRAsyncWorkQueue_Internal.h */; }; 3DA1A3552ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DA1A3522ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.h */; }; 3DA1A3562ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3DA1A3532ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.mm */; }; 3DA1A3582ABABF6A004F0BB9 /* MTRAsyncWorkQueueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DA1A3572ABABF69004F0BB9 /* MTRAsyncWorkQueueTests.m */; }; @@ -476,7 +475,6 @@ 3D84372F294984AF0070D20A /* command_completion_type.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = command_completion_type.zapt; sourceTree = ""; }; 3D843754294AD25A0070D20A /* MTRCertificateInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCertificateInfo.h; sourceTree = ""; }; 3D843755294AD25A0070D20A /* MTRCertificateInfo.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCertificateInfo.mm; sourceTree = ""; }; - 3DA1A3512ABAB3B4004F0BB9 /* MTRAsyncWorkQueue_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRAsyncWorkQueue_Internal.h; sourceTree = ""; }; 3DA1A3522ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRAsyncWorkQueue.h; sourceTree = ""; }; 3DA1A3532ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRAsyncWorkQueue.mm; sourceTree = ""; }; 3DA1A3572ABABF69004F0BB9 /* MTRAsyncWorkQueueTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRAsyncWorkQueueTests.m; sourceTree = ""; }; @@ -1100,7 +1098,6 @@ 7596A84628762783004DAE0E /* MTRAsyncCallbackWorkQueue.h */, 7596A84728762783004DAE0E /* MTRAsyncCallbackWorkQueue.mm */, 3DA1A3522ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.h */, - 3DA1A3512ABAB3B4004F0BB9 /* MTRAsyncWorkQueue_Internal.h */, 3DA1A3532ABAB3B4004F0BB9 /* MTRAsyncWorkQueue.mm */, 3CF134AA289D8DF70017A19E /* MTRDeviceAttestationInfo.h */, 3CF134AC289D8E570017A19E /* MTRDeviceAttestationInfo.mm */, @@ -1459,7 +1456,6 @@ 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */, 3D843713294977000070D20A /* NSDataSpanConversion.h in Headers */, 991DC08B247704DC00C13860 /* MTRLogging_Internal.h in Headers */, - 3DA1A3542ABAB3B4004F0BB9 /* MTRAsyncWorkQueue_Internal.h in Headers */, 1E4D655029C208DD00BC3478 /* MTRCommissionableBrowserDelegate.h in Headers */, 7596A84828762783004DAE0E /* MTRAsyncCallbackWorkQueue.h in Headers */, 5A7947E527C0129F00434CF2 /* MTRDeviceController+XPC.h in Headers */, diff --git a/src/platform/GLibTypeDeleter.h b/src/platform/GLibTypeDeleter.h index bd93be76203cd2..1e187aa275adb3 100644 --- a/src/platform/GLibTypeDeleter.h +++ b/src/platform/GLibTypeDeleter.h @@ -104,6 +104,12 @@ struct GAutoPtrDeleter using deleter = GErrorDeleter; }; +template <> +struct GAutoPtrDeleter +{ + using deleter = GObjectDeleter; +}; + template <> struct GAutoPtrDeleter { diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 6483920d410ac9..f4426cde2119de 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -187,21 +188,19 @@ void BLEManagerImpl::ReadValueRequestedCb(const char * remoteAddress, int reques { int ret, len = 0; bt_gatt_type_e type; - char * uuid = nullptr; - char * value = nullptr; + GAutoPtr uuid; + GAutoPtr value; - VerifyOrReturn(__GetAttInfo(gattHandle, &uuid, &type) == BT_ERROR_NONE, + VerifyOrReturn(__GetAttInfo(gattHandle, &MakeUniquePointerReceiver(uuid).Get(), &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from GATT handle")); - ChipLogProgress(DeviceLayer, "Gatt read requested on %s: uuid=%s", __ConvertAttTypeToStr(type), StringOrNullMarker(uuid)); - g_free(uuid); + ChipLogProgress(DeviceLayer, "Gatt read requested on %s: uuid=%s", __ConvertAttTypeToStr(type), StringOrNullMarker(uuid.get())); - ret = bt_gatt_get_value(gattHandle, &value, &len); + ret = bt_gatt_get_value(gattHandle, &MakeUniquePointerReceiver(value).Get(), &len); VerifyOrReturn(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_get_value() failed. ret: %d", ret)); - ChipLogByteSpan(DeviceLayer, ByteSpan(Uint8::from_const_char(value), len)); + ChipLogByteSpan(DeviceLayer, ByteSpan(Uint8::from_const_char(value.get()), len)); - ret = bt_gatt_server_send_response(requestId, BT_GATT_REQUEST_TYPE_READ, offset, 0x00, value, len); - g_free(value); + ret = bt_gatt_server_send_response(requestId, BT_GATT_REQUEST_TYPE_READ, offset, 0x00, value.get(), len); VerifyOrReturn(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_server_send_response() failed. ret: %d", ret)); } @@ -209,19 +208,18 @@ void BLEManagerImpl::WriteValueRequestedCb(const char * remoteAddress, int reque bool responseNeeded, int offset, const char * value, int len, void * userData) { int ret; - char * uuid = nullptr; + GAutoPtr uuid; BLEConnection * conn = nullptr; bt_gatt_type_e type; conn = static_cast(g_hash_table_lookup(sInstance.mConnectionMap, remoteAddress)); VerifyOrReturn(conn != nullptr, ChipLogError(DeviceLayer, "Failed to find connection info")); - VerifyOrReturn(__GetAttInfo(gattHandle, &uuid, &type) == BT_ERROR_NONE, + VerifyOrReturn(__GetAttInfo(gattHandle, &MakeUniquePointerReceiver(uuid).Get(), &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from GATT handle")); ChipLogProgress(DeviceLayer, "Gatt write requested on %s: uuid=%s len=%d", __ConvertAttTypeToStr(type), - StringOrNullMarker(uuid), len); + StringOrNullMarker(uuid.get()), len); ChipLogByteSpan(DeviceLayer, ByteSpan(Uint8::from_const_char(value), len)); - g_free(uuid); ret = bt_gatt_set_value(gattHandle, value, len); VerifyOrReturn(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_set_value() failed. ret: %d", ret)); @@ -234,7 +232,7 @@ void BLEManagerImpl::WriteValueRequestedCb(const char * remoteAddress, int reque void BLEManagerImpl::NotificationStateChangedCb(bool notify, bt_gatt_server_h server, bt_gatt_h gattHandle, void * userData) { - char * uuid = nullptr; + GAutoPtr uuid; BLEConnection * conn = nullptr; bt_gatt_type_e type; GHashTableIter iter; @@ -250,12 +248,11 @@ void BLEManagerImpl::NotificationStateChangedCb(bool notify, bt_gatt_server_h se } VerifyOrReturn(conn != nullptr, ChipLogError(DeviceLayer, "Failed to find connection info")); - VerifyOrReturn(__GetAttInfo(gattHandle, &uuid, &type) == BT_ERROR_NONE, + VerifyOrReturn(__GetAttInfo(gattHandle, &MakeUniquePointerReceiver(uuid).Get(), &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from GATT handle")); ChipLogProgress(DeviceLayer, "Notification State Changed %d on %s: %s", notify, __ConvertAttTypeToStr(type), - StringOrNullMarker(uuid)); - g_free(uuid); + StringOrNullMarker(uuid.get())); sInstance.NotifyBLESubscribed(notify ? true : false, conn); } @@ -728,23 +725,22 @@ int BLEManagerImpl::StopBLEAdvertising() static bool __GattClientForeachCharCb(int total, int index, bt_gatt_h charHandle, void * data) { bt_gatt_type_e type; - char * uuid = nullptr; - auto conn = static_cast(data); + GAutoPtr uuid; + auto conn = static_cast(data); - VerifyOrExit(__GetAttInfo(charHandle, &uuid, &type) == BT_ERROR_NONE, + VerifyOrExit(__GetAttInfo(charHandle, &MakeUniquePointerReceiver(uuid).Get(), &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from CHAR handle")); - if (strcasecmp(uuid, chip_ble_char_c1_tx_uuid) == 0) + if (strcasecmp(uuid.get(), chip_ble_char_c1_tx_uuid) == 0) { - ChipLogProgress(DeviceLayer, "CHIP Char C1 TX Found [%s]", StringOrNullMarker(uuid)); + ChipLogProgress(DeviceLayer, "CHIP Char C1 TX Found [%s]", StringOrNullMarker(uuid.get())); conn->gattCharC1Handle = charHandle; } - else if (strcasecmp(uuid, chip_ble_char_c2_rx_uuid) == 0) + else if (strcasecmp(uuid.get(), chip_ble_char_c2_rx_uuid) == 0) { - ChipLogProgress(DeviceLayer, "CHIP Char C2 RX Found [%s]", StringOrNullMarker(uuid)); + ChipLogProgress(DeviceLayer, "CHIP Char C2 RX Found [%s]", StringOrNullMarker(uuid.get())); conn->gattCharC2Handle = charHandle; } - g_free(uuid); exit: /* Try next Char UUID */ @@ -754,25 +750,23 @@ static bool __GattClientForeachCharCb(int total, int index, bt_gatt_h charHandle static bool __GattClientForeachServiceCb(int total, int index, bt_gatt_h svcHandle, void * data) { bt_gatt_type_e type; - char * uuid = nullptr; - auto conn = static_cast(data); + GAutoPtr uuid; + auto conn = static_cast(data); ChipLogProgress(DeviceLayer, "__GattClientForeachServiceCb"); - VerifyOrExit(__GetAttInfo(svcHandle, &uuid, &type) == BT_ERROR_NONE, + VerifyOrExit(__GetAttInfo(svcHandle, &MakeUniquePointerReceiver(uuid).Get(), &type) == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from SVC handle")); - if (strcasecmp(uuid, chip_ble_service_uuid) == 0) + if (strcasecmp(uuid.get(), chip_ble_service_uuid) == 0) { - ChipLogProgress(DeviceLayer, "CHIP Service UUID Found [%s]", StringOrNullMarker(uuid)); + ChipLogProgress(DeviceLayer, "CHIP Service UUID Found [%s]", StringOrNullMarker(uuid.get())); if (bt_gatt_service_foreach_characteristics(svcHandle, __GattClientForeachCharCb, conn) == BT_ERROR_NONE) conn->isChipDevice = true; /* Got CHIP Device, no need to process further service */ - g_free(uuid); return false; } - g_free(uuid); exit: /* Try next Service UUID */ diff --git a/src/platform/Tizen/ChipDeviceScanner.cpp b/src/platform/Tizen/ChipDeviceScanner.cpp index 5dcf154f13b984..d69db7bf24263a 100644 --- a/src/platform/Tizen/ChipDeviceScanner.cpp +++ b/src/platform/Tizen/ChipDeviceScanner.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include namespace chip { @@ -145,25 +146,22 @@ gboolean ChipDeviceScanner::TimerExpiredCb(gpointer userData) CHIP_ERROR ChipDeviceScanner::TriggerScan(ChipDeviceScanner * self) { - CHIP_ERROR err = CHIP_NO_ERROR; - GSource * idleSource; + GAutoPtr idleSource; int ret; // Trigger LE Scan ret = bt_adapter_le_start_scan(LeScanResultCb, self); - VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_adapter_le_start_scan() failed: %s", get_error_message(ret)); - err = CHIP_ERROR_INTERNAL); + VerifyOrReturnValue(ret == BT_ERROR_NONE, CHIP_ERROR_INTERNAL, + ChipLogError(DeviceLayer, "bt_adapter_le_start_scan() failed: %s", get_error_message(ret))); self->mIsScanning = true; // Setup timer for scan timeout - idleSource = g_timeout_source_new(self->mScanTimeoutMs); - g_source_set_callback(idleSource, TimerExpiredCb, self, nullptr); - g_source_set_priority(idleSource, G_PRIORITY_HIGH_IDLE); - g_source_attach(idleSource, g_main_context_get_thread_default()); - g_source_unref(idleSource); + idleSource = GAutoPtr(g_timeout_source_new(self->mScanTimeoutMs)); + g_source_set_callback(idleSource.get(), TimerExpiredCb, self, nullptr); + g_source_set_priority(idleSource.get(), G_PRIORITY_HIGH_IDLE); + g_source_attach(idleSource.get(), g_main_context_get_thread_default()); -exit: - return err; + return CHIP_NO_ERROR; } static bool __IsScanFilterSupported() diff --git a/src/platform/Tizen/DnssdImpl.cpp b/src/platform/Tizen/DnssdImpl.cpp index 0c68bd67694a03..646d40af5a8f53 100644 --- a/src/platform/Tizen/DnssdImpl.cpp +++ b/src/platform/Tizen/DnssdImpl.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #if CHIP_DEVICE_CONFIG_ENABLE_THREAD @@ -186,31 +187,31 @@ void OnBrowse(dnssd_service_state_e state, dnssd_service_h service, void * data) g_source_attach(source, g_main_context_get_thread_default()); bCtx->mTimeoutSource = source; - char * type = nullptr; - char * name = nullptr; - char * ifaceName = nullptr; + chip::GAutoPtr type; + chip::GAutoPtr name; + chip::GAutoPtr ifaceName; uint32_t interfaceId = 0; - ret = dnssd_service_get_type(service, &type); + ret = dnssd_service_get_type(service, &MakeUniquePointerReceiver(type).Get()); VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_type() failed. ret: %d", ret)); - ret = dnssd_service_get_name(service, &name); + ret = dnssd_service_get_name(service, &MakeUniquePointerReceiver(name).Get()); VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_name() failed. ret: %d", ret)); - ret = dnssd_service_get_interface(service, &ifaceName); + ret = dnssd_service_get_interface(service, &MakeUniquePointerReceiver(ifaceName).Get()); VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_interface() failed. ret: %d", ret)); - interfaceId = if_nametoindex(ifaceName); + interfaceId = if_nametoindex(ifaceName.get()); VerifyOrExit(interfaceId > 0, ChipLogError(DeviceLayer, "if_nametoindex() failed. errno: %d", errno); ret = DNSSD_ERROR_OPERATION_FAILED); if (state == DNSSD_SERVICE_STATE_AVAILABLE) { - OnBrowseAdd(bCtx, type, name, interfaceId); + OnBrowseAdd(bCtx, type.get(), name.get(), interfaceId); } else { - OnBrowseRemove(bCtx, type, name, interfaceId); + OnBrowseRemove(bCtx, type.get(), name.get(), interfaceId); } exit: @@ -223,10 +224,6 @@ void OnBrowse(dnssd_service_state_e state, dnssd_service_h service, void * data) // After this point the context might be no longer valid bCtx->mInstance->RemoveContext(bCtx); } - - g_free(type); - g_free(name); - g_free(ifaceName); } CHIP_ERROR BrowseAsync(chip::Dnssd::BrowseContext * bCtx) @@ -310,46 +307,42 @@ void OnResolve(dnssd_error_e result, dnssd_service_h service, void * userData) ChipLogDetail(DeviceLayer, "DNSsd %s", __func__); auto rCtx = reinterpret_cast(userData); - char * name = nullptr; - char * ipv4 = nullptr; - char * ipv6 = nullptr; + chip::GAutoPtr name; + chip::GAutoPtr ipv4; + chip::GAutoPtr ipv6; int port = 0; char * interface = nullptr; chip::Inet::IPAddress ipAddr; CHIP_ERROR err = CHIP_NO_ERROR; - int ret = dnssd_service_get_name(service, &name); + int ret = dnssd_service_get_name(service, &MakeUniquePointerReceiver(name).Get()); VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_name() failed. ret: %d", ret)); - chip::Platform::CopyString(rCtx->mResult.mName, name); - g_free(name); + chip::Platform::CopyString(rCtx->mResult.mName, name.get()); - ret = dnssd_service_get_ip(service, &ipv4, &ipv6); + ret = dnssd_service_get_ip(service, &MakeUniquePointerReceiver(ipv4).Get(), &MakeUniquePointerReceiver(ipv6).Get()); VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_service_get_ip() failed. ret: %d", ret)); // If both IPv4 and IPv6 are set, IPv6 address has higher priority. - if (ipv6 != nullptr && strcmp(ipv6, kEmptyAddressIpv6) != 0) + if (ipv6.get() != nullptr && strcmp(ipv6.get(), kEmptyAddressIpv6) != 0) { - if (!chip::Inet::IPAddress::FromString(ipv6, ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv6) + if (!chip::Inet::IPAddress::FromString(ipv6.get(), ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv6) { ret = DNSSD_ERROR_OPERATION_FAILED; } } #if INET_CONFIG_ENABLE_IPV4 - else if (ipv4 != nullptr) + else if (ipv4.get() != nullptr) { - if (!chip::Inet::IPAddress::FromString(ipv4, ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv4) + if (!chip::Inet::IPAddress::FromString(ipv4.get(), ipAddr) || ipAddr.Type() != chip::Inet::IPAddressType::kIPv4) { ret = DNSSD_ERROR_OPERATION_FAILED; } } #endif - ChipLogDetail(DeviceLayer, "DNSsd %s: IPv4: %s, IPv6: %s, ret: %d", __func__, StringOrNullMarker(ipv4), - StringOrNullMarker(ipv6), ret); - - g_free(ipv4); - g_free(ipv6); + ChipLogDetail(DeviceLayer, "DNSsd %s: IPv4: %s, IPv6: %s, ret: %d", __func__, StringOrNullMarker(ipv4.get()), + StringOrNullMarker(ipv6.get()), ret); VerifyOrExit(ret == DNSSD_ERROR_NONE, ); @@ -378,10 +371,9 @@ void OnResolve(dnssd_error_e result, dnssd_service_h service, void * userData) // with the NSD internal mutex locked, which is also locked by the // dnssd_create_remote_service() function called in the Resolve(), and // the Resolve() itself is called with the stack mutex locked. - auto * sourceIdle = g_idle_source_new(); - g_source_set_callback(sourceIdle, OnResolveFinalize, rCtx, NULL); - g_source_attach(sourceIdle, g_main_context_get_thread_default()); - g_source_unref(sourceIdle); + chip::GAutoPtr sourceIdle(g_idle_source_new()); + g_source_set_callback(sourceIdle.get(), OnResolveFinalize, rCtx, NULL); + g_source_attach(sourceIdle.get(), g_main_context_get_thread_default()); } return; diff --git a/src/platform/Tizen/PlatformManagerImpl.cpp b/src/platform/Tizen/PlatformManagerImpl.cpp index 27174a6c4c74ee..58e1e014f41e28 100644 --- a/src/platform/Tizen/PlatformManagerImpl.cpp +++ b/src/platform/Tizen/PlatformManagerImpl.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "PosixConfig.h" @@ -92,9 +93,9 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() GLibMatterContextInvokeData invokeData{}; - auto * idleSource = g_idle_source_new(); + GAutoPtr idleSource(g_idle_source_new()); g_source_set_callback( - idleSource, + idleSource.get(), [](void * userData_) { auto * data = reinterpret_cast(userData_); std::unique_lock lock(data->mDoneMutex); @@ -103,8 +104,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() return G_SOURCE_REMOVE; }, &invokeData, nullptr); - g_source_attach(idleSource, g_main_loop_get_context(mGLibMainLoop)); - g_source_unref(idleSource); + g_source_attach(idleSource.get(), g_main_loop_get_context(mGLibMainLoop)); std::unique_lock lock(invokeData.mDoneMutex); invokeData.mDoneCond.wait(lock, [&invokeData]() { return invokeData.mDone; }); diff --git a/src/platform/Tizen/WiFiManager.cpp b/src/platform/Tizen/WiFiManager.cpp index cc0369120b11b0..bd0907f5531ab2 100644 --- a/src/platform/Tizen/WiFiManager.cpp +++ b/src/platform/Tizen/WiFiManager.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -384,12 +385,12 @@ void WiFiManager::_FullScanFinishedCb(wifi_manager_error_e wifiErr, void * userD bool WiFiManager::_FoundAPOnScanCb(wifi_manager_ap_h ap, void * userData) { - bool cbRet = true; - int wifiErr = WIFI_MANAGER_ERROR_NONE; - char * essid = nullptr; - char * bssid = nullptr; - int rssi = 0; - int freq = 0; + bool cbRet = true; + int wifiErr = WIFI_MANAGER_ERROR_NONE; + GAutoPtr essid; + GAutoPtr bssid; + int rssi = 0; + int freq = 0; auto networkScanned = static_cast *>(userData); std::pair bandInfo; @@ -397,17 +398,17 @@ bool WiFiManager::_FoundAPOnScanCb(wifi_manager_ap_h ap, void * userData) wifi_manager_security_type_e type; WiFiScanResponse scannedAP; - wifiErr = wifi_manager_ap_get_essid(ap, &essid); + wifiErr = wifi_manager_ap_get_essid(ap, &MakeUniquePointerReceiver(essid).Get()); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, ChipLogError(DeviceLayer, "FAIL: get AP essid [%s]", get_error_message(wifiErr))); - ChipLogProgress(DeviceLayer, "Essid Found: %s\n", essid); - scannedAP.ssidLen = static_cast(std::min(strlen(essid), sizeof(scannedAP.ssid))); - memcpy(scannedAP.ssid, essid, scannedAP.ssidLen); + ChipLogProgress(DeviceLayer, "Essid Found: %s\n", essid.get()); + scannedAP.ssidLen = static_cast(std::min(strlen(essid.get()), sizeof(scannedAP.ssid))); + memcpy(scannedAP.ssid, essid.get(), scannedAP.ssidLen); - wifiErr = wifi_manager_ap_get_bssid(ap, &bssid); + wifiErr = wifi_manager_ap_get_bssid(ap, &MakeUniquePointerReceiver(bssid).Get()); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, ChipLogError(DeviceLayer, "Fail: get AP bssid [%s]", get_error_message(wifiErr))); - memcpy(scannedAP.bssid, bssid, std::min(strlen(bssid), sizeof(scannedAP.bssid))); + memcpy(scannedAP.bssid, bssid.get(), std::min(strlen(bssid.get()), sizeof(scannedAP.bssid))); wifiErr = wifi_manager_ap_get_rssi(ap, &rssi); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, @@ -428,26 +429,23 @@ bool WiFiManager::_FoundAPOnScanCb(wifi_manager_ap_h ap, void * userData) networkScanned->push_back(scannedAP); -exit : { - g_free(essid); - g_free(bssid); -} +exit: return cbRet; } bool WiFiManager::_FoundAPCb(wifi_manager_ap_h ap, void * userData) { - bool cbRet = true; - int wifiErr = WIFI_MANAGER_ERROR_NONE; - char * essid = nullptr; + bool cbRet = true; + int wifiErr = WIFI_MANAGER_ERROR_NONE; + GAutoPtr essid; bool isPassphraseRequired = false; auto clonedAp = reinterpret_cast(userData); - wifiErr = wifi_manager_ap_get_essid(ap, &essid); + wifiErr = wifi_manager_ap_get_essid(ap, &MakeUniquePointerReceiver(essid).Get()); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, ChipLogError(DeviceLayer, "FAIL: get AP essid [%s]", get_error_message(wifiErr))); - VerifyOrExit(strcmp(sInstance.mWiFiSSID, essid) == 0, ); + VerifyOrExit(strcmp(sInstance.mWiFiSSID, essid.get()) == 0, ); wifiErr = wifi_manager_ap_is_passphrase_required(ap, &isPassphraseRequired); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, @@ -468,7 +466,6 @@ bool WiFiManager::_FoundAPCb(wifi_manager_ap_h ap, void * userData) cbRet = false; exit: - g_free(essid); return cbRet; } @@ -500,24 +497,23 @@ void WiFiManager::_ConnectedCb(wifi_manager_error_e wifiErr, void * userData) bool WiFiManager::_ConfigListCb(const wifi_manager_config_h config, void * userData) { - int wifiErr = WIFI_MANAGER_ERROR_NONE; - char * name = nullptr; + int wifiErr = WIFI_MANAGER_ERROR_NONE; + GAutoPtr name; wifi_manager_security_type_e securityType = WIFI_MANAGER_SECURITY_TYPE_NONE; - wifi_manager_config_get_name(config, &name); + wifi_manager_config_get_name(config, &MakeUniquePointerReceiver(name).Get()); wifi_manager_config_get_security_type(config, &securityType); wifiErr = wifi_manager_config_remove(sInstance.mWiFiManagerHandle, config); if (wifiErr == WIFI_MANAGER_ERROR_NONE) { - ChipLogProgress(DeviceLayer, "Remove config [%s:%s]", name, __WiFiSecurityTypeToStr(securityType)); + ChipLogProgress(DeviceLayer, "Remove config [%s:%s]", name.get(), __WiFiSecurityTypeToStr(securityType)); } else { ChipLogError(DeviceLayer, "FAIL: remove config [%s]", get_error_message(wifiErr)); } - g_free(name); return true; } @@ -1156,13 +1152,12 @@ CHIP_ERROR WiFiManager::GetConfiguredNetwork(NetworkCommissioning::Network & net { return CHIP_ERROR_INCORRECT_STATE; } - char * essid = nullptr; - int wifiErr = wifi_manager_ap_get_essid(connectedAp, &essid); + GAutoPtr essid; + int wifiErr = wifi_manager_ap_get_essid(connectedAp, &MakeUniquePointerReceiver(essid).Get()); VerifyOrReturnError(wifiErr == WIFI_MANAGER_ERROR_NONE, CHIP_ERROR_INTERNAL, ChipLogError(DeviceLayer, "FAIL: get essid [%s]", get_error_message(wifiErr))); - network.networkIDLen = static_cast(std::min(strlen(essid), sizeof(network.networkID))); - memcpy(network.networkID, essid, network.networkIDLen); - g_free(essid); + network.networkIDLen = static_cast(std::min(strlen(essid.get()), sizeof(network.networkID))); + memcpy(network.networkID, essid.get(), network.networkIDLen); return CHIP_NO_ERROR; } diff --git a/third_party/asr/asr582x/BUILD.gn b/third_party/asr/asr582x/BUILD.gn index 9f4cc9fd6c468e..69b730218b87fa 100755 --- a/third_party/asr/asr582x/BUILD.gn +++ b/third_party/asr/asr582x/BUILD.gn @@ -19,6 +19,9 @@ import("${chip_root}/src/platform/ASR/args.gni") declare_args() { # Build target to use for asr SDK. Use this to set global SDK defines. asr_target_project = "" + + # Must be "4M" or "2M". For matter, ASR582X use 4M flash default. + asr_flash_max_size = "4M" } assert(asr_target_project != "", "asr_target_project must be specified") @@ -121,7 +124,6 @@ config("asr_sdk_config") { "CONFIG_IEEE80211W", "WFA_CERTIFICATE_N", "CFG_DUET_5822S", - "CFG_DUET_5822T", "MBEDTLS_HW", "MBEDTLS_HW_RSA", "MBEDTLS_HW_ECC", @@ -133,6 +135,12 @@ config("asr_sdk_config") { "CFG_EASY_LOG_MODULE_EN=1", ] + if (asr_flash_max_size == "2M") { + defines += [ "_OTA_CMP_VENDOR_" ] + } else { + defines += [ "CFG_DUET_5822T" ] + } + cflags_c = [ "-mcpu=cortex-m4", "-Os", diff --git a/third_party/asr/asr582x/asr_sdk b/third_party/asr/asr582x/asr_sdk index 667c66a2f69eb6..d8cec59dc2a2ca 160000 --- a/third_party/asr/asr582x/asr_sdk +++ b/third_party/asr/asr582x/asr_sdk @@ -1 +1 @@ -Subproject commit 667c66a2f69eb6f4adf2e9bede0b6b88cd4378ce +Subproject commit d8cec59dc2a2ca04e44e575d8963ce31d542b2ba diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 86364eaf8b3ff3..07b07acb67d4c3 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -96,7 +96,6 @@ class TestList : public Command { printf("Test_TC_DGETH_2_1\n"); printf("Test_TC_DGETH_2_2\n"); printf("Test_TC_FLW_1_1\n"); - printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLABEL_1_1\n"); printf("Test_TC_FAN_1_1\n"); printf("Test_TC_FAN_2_1\n"); @@ -197,7 +196,6 @@ class TestList : public Command { printf("Test_TC_PCC_2_4\n"); printf("Test_TC_REFALM_1_1\n"); printf("Test_TC_RH_1_1\n"); - printf("Test_TC_RH_2_1\n"); printf("Test_TC_RVCCLEANM_1_1\n"); printf("Test_TC_RVCRUNM_1_1\n"); printf("Test_TC_RVCOPSTATE_1_1\n"); @@ -46024,239 +46022,6 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { } }; -class Test_TC_FLW_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_FLW_2_1() - : TestCommandBridge("Test_TC_FLW_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_FLW_2_1() - { - } - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Read the mandatory attribute: MinMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0001")) { - NextTest(); - return; - } - err = TestStep2ReadTheMandatoryAttributeMinMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: Read the mandatory attribute: MaxMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0002")) { - NextTest(); - return; - } - err = TestStep3ReadTheMandatoryAttributeMaxMeasuredValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("FLW.S.A0000")) { - NextTest(); - return; - } - err = TestStep4ReadTheMandatoryAttributeMeasuredValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 5: TH reads from the DUT the Tolerance attribute\n"); - if (ShouldSkip("FLW.S.A0003")) { - NextTest(); - return; - } - err = TestStep5ThReadsFromTheDutTheToleranceAttribute_4(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - NSNumber * _Nullable MinMeasuredVariable; - - CHIP_ERROR TestStep2ReadTheMandatoryAttributeMinMeasuredValue_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: Read the mandatory attribute: MinMeasuredValue Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); - } - { - MinMeasuredVariable = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nullable MaxMeasuredVariable; - - CHIP_ERROR TestStep3ReadTheMandatoryAttributeMaxMeasuredValue_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Read the mandatory attribute: MaxMeasuredValue Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], MinMeasuredVariable)); - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); - } - { - MaxMeasuredVariable = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4ReadTheMandatoryAttributeMeasuredValue_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: Read the mandatory attribute: MeasuredValue Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], MinMeasuredVariable)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], MaxMeasuredVariable)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5ThReadsFromTheDutTheToleranceAttribute_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: TH reads from the DUT the Tolerance attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_FLABEL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -62342,7 +62107,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: TH writes 0 (Fahrenheit) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Fahrenheit")) { NextTest(); return; } @@ -62350,7 +62115,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Fahrenheit")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Fahrenheit")) { NextTest(); return; } @@ -62358,7 +62123,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH writes 1 (Celsius) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Celsius")) { NextTest(); return; } @@ -62366,7 +62131,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Celsius")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Celsius")) { NextTest(); return; } @@ -62374,7 +62139,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH writes 2 (Kelvin) to TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Kelvin")) { NextTest(); return; } @@ -62382,7 +62147,7 @@ class Test_TC_LUNIT_3_1 : public TestCommandBridge { break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads TemperatureUnit attribute\n"); - if (ShouldSkip("LUNIT.S.A0000 && LUNIT.TempUnit.Kelvin")) { + if (ShouldSkip("LUNIT.S.A0000 && LUNIT.S.M.Kelvin")) { NextTest(); return; } @@ -88982,239 +88747,6 @@ class Test_TC_RH_1_1 : public TestCommandBridge { } }; -class Test_TC_RH_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_RH_2_1() - : TestCommandBridge("Test_TC_RH_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_RH_2_1() - { - } - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); - err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the MinMeasuredValue attribute from the DUT\n"); - if (ShouldSkip("RH.S.A0001")) { - NextTest(); - return; - } - err = TestStep2ThReadsTheMinMeasuredValueAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads the MaxMeasuredValue attribute from the DUT\n"); - if (ShouldSkip("RH.S.A0002")) { - NextTest(); - return; - } - err = TestStep3ThReadsTheMaxMeasuredValueAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads the MeasuredValue attribute from the DUT\n"); - if (ShouldSkip("RH.S.A0000")) { - NextTest(); - return; - } - err = TestStep4ThReadsTheMeasuredValueAttributeFromTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 5: TH reads the Tolerance attribute from the DUT\n"); - if (ShouldSkip("RH.S.A0003")) { - NextTest(); - return; - } - err = TestStep5ThReadsTheToleranceAttributeFromTheDut_4(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - NSNumber * _Nullable CurrentMinMeasured; - - CHIP_ERROR TestStep2ThReadsTheMinMeasuredValueAttributeFromTheDut_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRelativeHumidityMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the MinMeasuredValue attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); - } - { - CurrentMinMeasured = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nullable CurrentMaxMeasured; - - CHIP_ERROR TestStep3ThReadsTheMaxMeasuredValueAttributeFromTheDut_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRelativeHumidityMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the MaxMeasuredValue attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], CurrentMinMeasured)); - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 10000U)); - } - { - CurrentMaxMeasured = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4ThReadsTheMeasuredValueAttributeFromTheDut_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRelativeHumidityMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads the MeasuredValue attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], CurrentMinMeasured)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], CurrentMaxMeasured)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5ThReadsTheToleranceAttributeFromTheDut_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRelativeHumidityMeasurement alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: TH reads the Tolerance attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_RVCCLEANM_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -92634,8 +92166,6 @@ class Test_TC_TCCM_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -92807,7 +92337,7 @@ class Test_TC_TCTL_1_1 : public TestCommandBridge { break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Step 3d: TH reads from the DUT the FeatureMap attribute. bit 2: SHALL be 1 if and only if TCTL.S.F02(A_STEP) & TCTL.S.F00(TN)\n"); - if (ShouldSkip("TCTL.S.F02 && !TCTL.S.F00")) { + if (ShouldSkip("TCTL.S.F02 && TCTL.S.F00")) { NextTest(); return; } @@ -94595,47 +94125,51 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { err = TestStep4rReadTheFeatureDependentTSTATSF05AUTOOptionalAttributeInAttributeList_52(); break; case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Step 5a: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList\n"); + ChipLogProgress(chipTool, " ***** Test Step 53 : Step 5a: Read the mandatory commands in AcceptedCommandList\n"); + err = TestStep5aReadTheMandatoryCommandsInAcceptedCommandList_53(); + break; + case 54: + ChipLogProgress(chipTool, " ***** Test Step 54 : Step 5b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList\n"); if (ShouldSkip("TSTAT.S.F03")) { NextTest(); return; } - err = TestStep5aReadFeatureDependentTSTATSF03SCHCommandsInAcceptedCommandList_53(); + err = TestStep5bReadFeatureDependentTSTATSF03SCHCommandsInAcceptedCommandList_54(); break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Step 5b: Read the optional attribute: AcceptedCommandList\n"); + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Step 5c: Read the optional (GetRelayStatusLog) command in AcceptedCommandList\n"); if (ShouldSkip("TSTAT.S.C04.Rsp")) { NextTest(); return; } - err = TestStep5bReadTheOptionalAttributeAcceptedCommandList_54(); + err = TestStep5cReadTheOptionalGetRelayStatusLogCommandInAcceptedCommandList_55(); break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Step 6a: Read the global attribute: GeneratedCommandList\n"); + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Step 6a: Read the global attribute: GeneratedCommandList\n"); if (ShouldSkip(" !TSTAT.S.C04.Rsp && !TSTAT.S.C02.Rsp ")) { NextTest(); return; } - err = TestStep6aReadTheGlobalAttributeGeneratedCommandList_55(); + err = TestStep6aReadTheGlobalAttributeGeneratedCommandList_56(); break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Step 6b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in GeneratedCommandList\n"); + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : Step 6b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in GeneratedCommandList\n"); if (ShouldSkip("TSTAT.S.F03")) { NextTest(); return; } - err = TestStep6bReadFeatureDependentTSTATSF03SCHCommandsInGeneratedCommandList_56(); + err = TestStep6bReadFeatureDependentTSTATSF03SCHCommandsInGeneratedCommandList_57(); break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Step 6c: Read optional command (GetRelayStatusLogResponse) in GeneratedCommandList\n"); + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : Step 6c: Read optional command (GetRelayStatusLogResponse) in GeneratedCommandList\n"); if (ShouldSkip("TSTAT.S.C04.Rsp")) { NextTest(); return; } - err = TestStep6cReadOptionalCommandGetRelayStatusLogResponseInGeneratedCommandList_57(); + err = TestStep6cReadOptionalCommandGetRelayStatusLogResponseInGeneratedCommandList_58(); break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Step 7: Read EventList attribute from the DUT.\n"); + case 59: + ChipLogProgress(chipTool, " ***** Test Step 59 : Step 7: Read EventList attribute from the DUT.\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; @@ -94830,6 +94364,9 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { case 58: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -94840,7 +94377,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 59; + const uint16_t mTestCount = 60; chip::Optional mNodeId; chip::Optional mCluster; @@ -95962,7 +95499,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5aReadFeatureDependentTSTATSF03SCHCommandsInAcceptedCommandList_53() + CHIP_ERROR TestStep5aReadTheMandatoryCommandsInAcceptedCommandList_53() { MTRBaseDevice * device = GetDevice("alpha"); @@ -95970,12 +95507,32 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5a: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList Error: %@", err); + NSLog(@"Step 5a: Read the mandatory commands in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5bReadFeatureDependentTSTATSF03SCHCommandsInAcceptedCommandList_54() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5b: Read Feature dependent(TSTAT.S.F03(SCH)) commands in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); @@ -95986,7 +95543,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5bReadTheOptionalAttributeAcceptedCommandList_54() + CHIP_ERROR TestStep5cReadTheOptionalGetRelayStatusLogCommandInAcceptedCommandList_55() { MTRBaseDevice * device = GetDevice("alpha"); @@ -95994,7 +95551,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5b: Read the optional attribute: AcceptedCommandList Error: %@", err); + NSLog(@"Step 5c: Read the optional (GetRelayStatusLog) command in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -96007,7 +95564,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aReadTheGlobalAttributeGeneratedCommandList_55() + CHIP_ERROR TestStep6aReadTheGlobalAttributeGeneratedCommandList_56() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96031,7 +95588,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bReadFeatureDependentTSTATSF03SCHCommandsInGeneratedCommandList_56() + CHIP_ERROR TestStep6bReadFeatureDependentTSTATSF03SCHCommandsInGeneratedCommandList_57() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96052,7 +95609,7 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6cReadOptionalCommandGetRelayStatusLogResponseInGeneratedCommandList_57() + CHIP_ERROR TestStep6cReadOptionalCommandGetRelayStatusLogResponseInGeneratedCommandList_58() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96119,39 +95676,47 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH read ClusterRevision attribute from the DUT\n"); - err = TestStep2ThReadClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute.\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: Read FeatureMap attribute from the DUT\n"); - err = TestStep3ReadFeatureMapAttributeFromTheDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute.\n"); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: Read the global attribute: AttributeList\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep4ReadTheGlobalAttributeAttributeList_3(); + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: Read the global attribute: AttributeList\n"); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } - err = TestStep4ReadTheGlobalAttributeAttributeList_4(); + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: Read the global attribute: AcceptedCommandList\n"); - err = TestStep5ReadTheGlobalAttributeAcceptedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: TH reads optional attribute(ScheduleProgrammingVisibility) in AttributeList\n"); + if (ShouldSkip("TSUIC.S.A0002")) { + NextTest(); + return; + } + err = TestStep4bThReadsOptionalAttributeScheduleProgrammingVisibilityInAttributeList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: Read the global attribute: GeneratedCommandList\n"); - err = TestStep6ReadTheGlobalAttributeGeneratedCommandList_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep5ThReadsFromTheDutTheAcceptedCommandListAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH reads from the DUT the EventList attribute.\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: TH reads from the DUT the GeneratedCommandList attribute.\n"); + err = TestStep6ThReadsFromTheDutTheGeneratedCommandListAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 7: TH reads from the DUT the EventList attribute.\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; @@ -96193,6 +95758,9 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -96203,7 +95771,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -96218,7 +95786,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep2ThReadClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96226,7 +95794,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH read ClusterRevision attribute from the DUT Error: %@", err); + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -96242,7 +95810,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ReadFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96250,7 +95818,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Read FeatureMap attribute from the DUT Error: %@", err); + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -96266,7 +95834,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96274,14 +95842,13 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: Read the global attribute: AttributeList Error: %@", err); + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); @@ -96295,7 +95862,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96303,14 +95870,13 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: Read the global attribute: AttributeList Error: %@", err); + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -96323,7 +95889,28 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestStep4bThReadsOptionalAttributeScheduleProgrammingVisibilityInAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads optional attribute(ScheduleProgrammingVisibility) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5ThReadsFromTheDutTheAcceptedCommandListAttribute_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96331,7 +95918,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: Read the global attribute: AcceptedCommandList Error: %@", err); + NSLog(@"Step 5: TH reads from the DUT the AcceptedCommandList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -96347,7 +95934,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6ReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestStep6ThReadsFromTheDutTheGeneratedCommandListAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -96355,7 +95942,7 @@ class Test_TC_TSUIC_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: Read the global attribute: GeneratedCommandList Error: %@", err); + NSLog(@"Step 6: TH reads from the DUT the GeneratedCommandList attribute. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -107492,7 +107079,7 @@ class Test_TC_WNCV_3_4 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000UL; + value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 5000UL; return WaitForMs("alpha", value); } @@ -107844,7 +107431,7 @@ class Test_TC_WNCV_3_5 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 3000UL; + value.ms = mFastMotionDuration.HasValue() ? mFastMotionDuration.Value() : 5000UL; return WaitForMs("alpha", value); } @@ -165417,18 +165004,34 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00")) { + NextTest(); + return; + } err = TestCreateNewUser_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00")) { + NextTest(); + return; + } err = TestReadTheUserBackAndVerifyItsFields_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Create new PIN credential and lock/unlock user\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00")) { + NextTest(); + return; + } err = TestCreateNewPinCredentialAndLockUnlockUser_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Verify created PIN credential\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00")) { + NextTest(); + return; + } err = TestVerifyCreatedPinCredential_4(); break; case 5: @@ -165473,47 +165076,59 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: TH sends the Unlock with Timeout argument value as 60 seconds\n"); - if (ShouldSkip("DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP")) { + if (ShouldSkip(" DRLK.S.F08 && DRLK.S.F00 && DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP ")) { NextTest(); return; } err = TestStep2bThSendsTheUnlockWithTimeoutArgumentValueAs60Seconds_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Wait for AutoRelockTime Expires\n"); - if (ShouldSkip("DRLK.S.C03.Rsp && PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2b: TH sends the Unlock with Timeout argument value as 60 seconds\n"); + if (ShouldSkip(" (!DRLK.S.F08 || !DRLK.S.F00) && DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP ")) { NextTest(); return; } - err = TestWaitForAutoRelockTimeExpires_11(); + err = TestStep2bThSendsTheUnlockWithTimeoutArgumentValueAs60Seconds_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for AutoRelockTime Expires\n"); - if (ShouldSkip("DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP")) { + if (ShouldSkip("DRLK.S.C03.Rsp && PICS_SDK_CI_ONLY")) { NextTest(); return; } err = TestWaitForAutoRelockTimeExpires_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 2c: TH reads LockState attribute\n"); - if (ShouldSkip("DRLK.S.A0000 && DRLK.S.C03.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait for AutoRelockTime Expires\n"); + if (ShouldSkip("DRLK.S.C03.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep2cThReadsLockStateAttribute_13(); + err = TestWaitForAutoRelockTimeExpires_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Cleanup the created user\n"); - err = TestCleanupTheCreatedUser_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 2c: TH reads LockState attribute\n"); + if (ShouldSkip("DRLK.S.A0000 && DRLK.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestStep2cThReadsLockStateAttribute_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Clean the created credential\n"); - if (ShouldSkip("DRLK.S.C26.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Cleanup the created user\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00")) { NextTest(); return; } - err = TestCleanTheCreatedCredential_15(); + err = TestCleanupTheCreatedUser_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Clean the created credential\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.F00 && DRLK.S.C26.Rsp")) { + NextTest(); + return; + } + err = TestCleanTheCreatedCredential_16(); break; } @@ -165574,6 +165189,9 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -165584,7 +165202,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mCluster; @@ -165946,7 +165564,29 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForAutoRelockTimeExpires_11() + CHIP_ERROR TestStep2bThSendsTheUnlockWithTimeoutArgumentValueAs60Seconds_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockWithTimeoutParams alloc] init]; + params.timeout = + [NSNumber numberWithUnsignedShort:60U]; + [cluster unlockWithTimeoutWithParams:params completion: + ^(NSError * _Nullable err) { + NSLog(@"Step 2b: TH sends the Unlock with Timeout argument value as 60 seconds Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForAutoRelockTimeExpires_12() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -165954,7 +165594,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestWaitForAutoRelockTimeExpires_12() + CHIP_ERROR TestWaitForAutoRelockTimeExpires_13() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -165962,7 +165602,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep2cThReadsLockStateAttribute_13() + CHIP_ERROR TestStep2cThReadsLockStateAttribute_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -165986,7 +165626,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanupTheCreatedUser_14() + CHIP_ERROR TestCleanupTheCreatedUser_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -166008,7 +165648,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_15() + CHIP_ERROR TestCleanTheCreatedCredential_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -173781,7 +173421,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), @@ -173882,7 +173521,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h index 85b6ca3fc694ae..2c689ce70fe83b 100644 --- a/zzz_generated/placeholder/app1/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app1/zap-generated/test/Commands.h @@ -321,7 +321,7 @@ class Test_TC_DGWIFI_3_2_SimulatedSuite : public TestCommand { case 0: { LogStep(0, "DUT sends ResetCounts command to TH"); - VerifyOrDo(!ShouldSkip("DGTHREAD.C.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGWIFI.S.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return WaitCommand(GetEndpoint(0), WiFiNetworkDiagnostics::Id, WiFiNetworkDiagnostics::Commands::ResetCounts::Id); } } @@ -1634,188 +1634,6 @@ class Test_TC_DGTHREAD_3_4_SimulatedSuite : public TestCommand } }; -class Test_TC_LVL_2_3_SimulatedSuite : public TestCommand -{ -public: - Test_TC_LVL_2_3_SimulatedSuite() : TestCommand("Test_TC_LVL_2_3_Simulated", 24) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_LVL_2_3_SimulatedSuite() {} - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Read mandatory attribute CurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id); - } - case 1: { - LogStep(1, "Read mandatory attribute OnLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id); - } - case 2: { - LogStep(2, "Read mandatory attribute Options"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id); - } - case 3: { - LogStep(3, "Read optional attribute RemainingTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::RemainingTime::Id); - } - case 4: { - LogStep(4, "Read optional attribute StartUpCurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::StartUpCurrentLevel::Id); - } - case 5: { - LogStep(5, "Read optional attribute CurrentFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id); - } - case 6: { - LogStep(6, "Read optional attribute MinFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinFrequency::Id); - } - case 7: { - LogStep(7, "Read optional attribute MaxFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxFrequency::Id); - } - case 8: { - LogStep(8, "Read optional attribute MinLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id); - } - case 9: { - LogStep(9, "Read optional attribute MaxLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id); - } - case 10: { - LogStep(10, "Read optional attribute OnOffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnOffTransitionTime::Id); - } - case 11: { - LogStep(11, "Read optional attribute OnTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id); - } - case 12: { - LogStep(12, "Read optional attribute OffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id); - } - case 13: { - LogStep(13, "Read optional attribute DefaultMoveRate"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id); - } - case 14: { - LogStep(14, "Write mandatory attribute OnLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id); - } - case 15: { - LogStep(15, "Write mandatory attribute Options"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id); - } - case 16: { - LogStep(16, "Write optional attribute OnOffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnOffTransitionTime::Id); - } - case 17: { - LogStep(17, "Write optional attribute OnTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id); - } - case 18: { - LogStep(18, "Write optional attribute OffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id); - } - case 19: { - LogStep(19, "Write optional attribute DefaultMoveRate"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id); - } - case 20: { - LogStep(20, "Write optional attribute StartUpCurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::StartUpCurrentLevel::Id); - } - case 21: { - LogStep(21, - "Configure TH such that it implements mandatory and none of the optional attributes of the server-side of the " - "cluster, and that it also reflects this in global attributes such as FeatureMap and AttributeList.Commission " - "DUT to TH again"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 22: { - LogStep(22, "DUT reads all supported optional attributes from TH one at a time in a manufacturer specific order"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 23: { - LogStep(23, - "DUT writes a suitable value to all supported optional attributes on the TH one at a time in a manufacturer " - "specific order"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_OO_3_2_SimulatedSuite : public TestCommand { public: @@ -1955,10 +1773,6 @@ std::unique_ptr GetTestCommand(std::string testName) { return std::unique_ptr(new Test_TC_DGTHREAD_3_4_SimulatedSuite()); } - if (testName == "Test_TC_LVL_2_3_Simulated") - { - return std::unique_ptr(new Test_TC_LVL_2_3_SimulatedSuite()); - } if (testName == "Test_TC_OO_3_2_Simulated") { return std::unique_ptr(new Test_TC_OO_3_2_SimulatedSuite()); @@ -1984,6 +1798,5 @@ void PrintTestCommands() ChipLogError(chipTool, "\t* Test_TC_CC_7_5_Simulated"); ChipLogError(chipTool, "\t* Test_TC_CC_9_4_Simulated"); ChipLogError(chipTool, "\t* Test_TC_DGTHREAD_3_4_Simulated"); - ChipLogError(chipTool, "\t* Test_TC_LVL_2_3_Simulated"); ChipLogError(chipTool, "\t* Test_TC_OO_3_2_Simulated"); } diff --git a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h index 85b6ca3fc694ae..2c689ce70fe83b 100644 --- a/zzz_generated/placeholder/app2/zap-generated/test/Commands.h +++ b/zzz_generated/placeholder/app2/zap-generated/test/Commands.h @@ -321,7 +321,7 @@ class Test_TC_DGWIFI_3_2_SimulatedSuite : public TestCommand { case 0: { LogStep(0, "DUT sends ResetCounts command to TH"); - VerifyOrDo(!ShouldSkip("DGTHREAD.C.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGWIFI.S.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return WaitCommand(GetEndpoint(0), WiFiNetworkDiagnostics::Id, WiFiNetworkDiagnostics::Commands::ResetCounts::Id); } } @@ -1634,188 +1634,6 @@ class Test_TC_DGTHREAD_3_4_SimulatedSuite : public TestCommand } }; -class Test_TC_LVL_2_3_SimulatedSuite : public TestCommand -{ -public: - Test_TC_LVL_2_3_SimulatedSuite() : TestCommand("Test_TC_LVL_2_3_Simulated", 24) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_LVL_2_3_SimulatedSuite() {} - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Read mandatory attribute CurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id); - } - case 1: { - LogStep(1, "Read mandatory attribute OnLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id); - } - case 2: { - LogStep(2, "Read mandatory attribute Options"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id); - } - case 3: { - LogStep(3, "Read optional attribute RemainingTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::RemainingTime::Id); - } - case 4: { - LogStep(4, "Read optional attribute StartUpCurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::StartUpCurrentLevel::Id); - } - case 5: { - LogStep(5, "Read optional attribute CurrentFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id); - } - case 6: { - LogStep(6, "Read optional attribute MinFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinFrequency::Id); - } - case 7: { - LogStep(7, "Read optional attribute MaxFrequency"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxFrequency::Id); - } - case 8: { - LogStep(8, "Read optional attribute MinLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id); - } - case 9: { - LogStep(9, "Read optional attribute MaxLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id); - } - case 10: { - LogStep(10, "Read optional attribute OnOffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnOffTransitionTime::Id); - } - case 11: { - LogStep(11, "Read optional attribute OnTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id); - } - case 12: { - LogStep(12, "Read optional attribute OffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id); - } - case 13: { - LogStep(13, "Read optional attribute DefaultMoveRate"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id); - } - case 14: { - LogStep(14, "Write mandatory attribute OnLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id); - } - case 15: { - LogStep(15, "Write mandatory attribute Options"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id); - } - case 16: { - LogStep(16, "Write optional attribute OnOffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnOffTransitionTime::Id); - } - case 17: { - LogStep(17, "Write optional attribute OnTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnTransitionTime::Id); - } - case 18: { - LogStep(18, "Write optional attribute OffTransitionTime"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OffTransitionTime::Id); - } - case 19: { - LogStep(19, "Write optional attribute DefaultMoveRate"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::DefaultMoveRate::Id); - } - case 20: { - LogStep(20, "Write optional attribute StartUpCurrentLevel"); - return WaitAttribute(GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::StartUpCurrentLevel::Id); - } - case 21: { - LogStep(21, - "Configure TH such that it implements mandatory and none of the optional attributes of the server-side of the " - "cluster, and that it also reflects this in global attributes such as FeatureMap and AttributeList.Commission " - "DUT to TH again"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 22: { - LogStep(22, "DUT reads all supported optional attributes from TH one at a time in a manufacturer specific order"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 23: { - LogStep(23, - "DUT writes a suitable value to all supported optional attributes on the TH one at a time in a manufacturer " - "specific order"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_OO_3_2_SimulatedSuite : public TestCommand { public: @@ -1955,10 +1773,6 @@ std::unique_ptr GetTestCommand(std::string testName) { return std::unique_ptr(new Test_TC_DGTHREAD_3_4_SimulatedSuite()); } - if (testName == "Test_TC_LVL_2_3_Simulated") - { - return std::unique_ptr(new Test_TC_LVL_2_3_SimulatedSuite()); - } if (testName == "Test_TC_OO_3_2_Simulated") { return std::unique_ptr(new Test_TC_OO_3_2_SimulatedSuite()); @@ -1984,6 +1798,5 @@ void PrintTestCommands() ChipLogError(chipTool, "\t* Test_TC_CC_7_5_Simulated"); ChipLogError(chipTool, "\t* Test_TC_CC_9_4_Simulated"); ChipLogError(chipTool, "\t* Test_TC_DGTHREAD_3_4_Simulated"); - ChipLogError(chipTool, "\t* Test_TC_LVL_2_3_Simulated"); ChipLogError(chipTool, "\t* Test_TC_OO_3_2_Simulated"); }