diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index f468341b0b84b1..7ef7120da6ad04 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -73,7 +73,7 @@ jobs: /tmp/bloat_reports/ - name: "Test: shell example" - if: steps.build_shell.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_shell.outcome == 'success' run: | scripts/run_in_python_env.sh out/venv \ 'scripts/examples/openiotsdk_example.sh --no-activate -C test shell' @@ -103,7 +103,7 @@ jobs: /tmp/bloat_reports/ - name: "Test: tv-app example" - if: steps.build_tv_app.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_tv_app.outcome == 'success' timeout-minutes: 10 run: | scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up @@ -125,7 +125,7 @@ jobs: /tmp/bloat_reports/ - name: "Test: all-clusters-app example" - if: steps.build_all_clusters_app.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_all_clusters_app.outcome == 'success' timeout-minutes: 5 run: | scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up @@ -161,7 +161,7 @@ jobs: scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out/ota-provider chip_config_network_layer_ble=false - name: "Test: lock-app example (mbedtls)" - if: steps.build_lock_app_mbedtls.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_mbedtls.outcome == 'success' run: | scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up scripts/run_in_python_env.sh out/venv \ @@ -169,7 +169,7 @@ jobs: scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - name: "Test: ota-requestor-app example" - if: steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_ota_requestor_app.outcome == 'success' && steps.build_ota_provider_app.outcome == 'success' timeout-minutes: 30 run: | mkdir out/binaries @@ -182,7 +182,7 @@ jobs: scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - name: "Test: unit-tests (mbedtls)" - if: steps.build_unit_tests_mbedtls.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_mbedtls.outcome == 'success' run: | scripts/run_in_python_env.sh out/venv \ 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' @@ -199,7 +199,7 @@ jobs: /tmp/bloat_reports/ - name: "Test: lock-app example (psa)" - if: steps.build_lock_app_psa.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_lock_app_psa.outcome == 'success' run: | scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up scripts/run_in_python_env.sh out/venv \ @@ -212,7 +212,7 @@ jobs: scripts/examples/openiotsdk_example.sh -b psa unit-tests - name: "Test: unit-tests (psa)" - if: steps.build_unit_tests_psa.outcome == 'success' + if: github.event_name == 'workflow_dispatch' && steps.build_unit_tests_psa.outcome == 'success' run: | scripts/run_in_python_env.sh out/venv \ 'scripts/examples/openiotsdk_example.sh --no-activate -C test unit-tests' diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 8e798c058525c6..f9f4b933cccf5d 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -95,6 +95,7 @@ matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_ matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) +matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) matter_add_gn_arg_bool ("chip_enable_bootloader_mcuboot" CONFIG_BOOTLOADER_MCUBOOT) matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index 93ebc31a0f426e..1148af804eee0b 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -31,6 +31,19 @@ config CHIP_APP_LOG_LEVEL option only within the application. To set the logging level for the Matter stack, use the MATTER_LOG_LEVEL configuration option. +config CHIP_NFC_COMMISSIONING + bool "Share onboarding payload in NFC tag" + default n + imply I2C + imply ST25DVXXKC + imply NFC + imply NFC_NDEF + imply NFC_NDEF_MSG + imply NFC_NDEF_RECORD + imply NFC_NDEF_URI_REC + imply NFC_NDEF_URI_MSG + help + Enables sharing the onboarding payload in the NFC tag. # See config/zephyr/Kconfig for full definition config CHIP_OTA_REQUESTOR diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index 54137bc281562b..c4ccd625b9cda7 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -209,6 +209,10 @@ config NVS_LOOKUP_CACHE_SIZE config SETTINGS_NVS_SECTOR_SIZE_MULT default 1 +# Set sector counter of NVS +config SETTINGS_NVS_SECTOR_COUNT + default 10 + # Enable OpenThread config NET_L2_OPENTHREAD diff --git a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt index 5e80ef13daddb5..1b66fa5886f7f4 100644 --- a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt +++ b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt @@ -37,21 +37,13 @@ class PairOnNetworkLongImInvokeCommand( DiscoveryFilterType.LONG_DISCRIMINATOR ) { override fun runCommand() { - currentCommissioner() - .pairDevice( - getNodeId(), - getRemoteAddr().address.hostAddress, - MATTER_PORT, - getDiscriminator(), - getSetupPINCode(), - ) - currentCommissioner().setCompletionListener(this) - waitCompleteMs(getTimeoutMillis()) - runBlocking { try { val identifyTime: UShort = 1u val identifyCluster = IdentifyCluster(controller = currentCommissioner(), endpointId = 0u) + + // By running command identify, we are implicitly requesting CASE to be established if it's + // not already present. identifyCluster.identify(identifyTime) logger.log(Level.INFO, "Invoke command succeeded") } catch (ex: Exception) { diff --git a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt index ba4ae1ac938f2b..d1f2c37f318c35 100644 --- a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt +++ b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImReadCommand.kt @@ -17,22 +17,14 @@ class PairOnNetworkLongImReadCommand(controller: MatterController, credsIssue: C DiscoveryFilterType.LONG_DISCRIMINATOR ) { override fun runCommand() { - currentCommissioner() - .pairDevice( - getNodeId(), - getRemoteAddr().address.hostAddress, - MATTER_PORT, - getDiscriminator(), - getSetupPINCode(), - ) - currentCommissioner().setCompletionListener(this) - waitCompleteMs(getTimeoutMillis()) - runBlocking { try { val basicInformationCluster = BasicInformationCluster(controller = currentCommissioner(), endpointId = DEFAULT_ENDPOINT) val vendorName = basicInformationCluster.readVendorNameAttribute() + + // By running command readVendorIDAttribute, we are implicitly requesting CASE to be + // established if it's not already present. val vendorId = basicInformationCluster.readVendorIDAttribute() logger.log(Level.INFO, "Read command succeeded, Verdor Name:${vendorName} (ID:${vendorId})") } catch (ex: Exception) { diff --git a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.kt b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.kt index f87d827a0bc32a..161c8d3133f26f 100644 --- a/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.kt +++ b/examples/kotlin-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.kt @@ -37,21 +37,13 @@ class PairOnNetworkLongImWriteCommand( DiscoveryFilterType.LONG_DISCRIMINATOR ) { override fun runCommand() { - currentCommissioner() - .pairDevice( - getNodeId(), - getRemoteAddr().address.hostAddress, - MATTER_PORT, - getDiscriminator(), - getSetupPINCode(), - ) - currentCommissioner().setCompletionListener(this) - waitCompleteMs(getTimeoutMillis()) - runBlocking { try { val basicInformationCluster = BasicInformationCluster(controller = currentCommissioner(), endpointId = DEFAULT_ENDPOINT) + + // By running command writeNodeLabelAttribute, we are implicitly requesting CASE to be + // established if it's not already present. basicInformationCluster.writeNodeLabelAttribute("Test Node Label") logger.log(Level.INFO, "Write command succeeded") diff --git a/examples/lighting-app/esp32/main/main.cpp b/examples/lighting-app/esp32/main/main.cpp index 5957a683589c26..adb2bafd84f577 100644 --- a/examples/lighting-app/esp32/main/main.cpp +++ b/examples/lighting-app/esp32/main/main.cpp @@ -41,7 +41,7 @@ #if CONFIG_ENABLE_ESP_INSIGHTS_SYSTEM_STATS #include -#define START_TIMEOUT_MS 600000 +#define START_TIMEOUT_MS 60000 #endif #if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 566c993ee92dca..4bd1798b99e560 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -42,6 +42,8 @@ CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y # Disable CHIP shell support CONFIG_CHIP_LIB_SHELL=n +CONFIG_CHIP_NFC_COMMISSIONING=n + # Disable factory data support CONFIG_CHIP_FACTORY_DATA=n CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 9b570517ab0835..ce33f98ec7a354 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -1740,8 +1740,8 @@ endpoint 0 { callback attribute registeredClients; callback attribute ICDCounter; callback attribute clientsSupportedPerFabric; - callback attribute userActiveModeTriggerHint; - callback attribute userActiveModeTriggerInstruction; + ram attribute userActiveModeTriggerHint default = 0x110D; + ram attribute userActiveModeTriggerInstruction default = "Restart the application"; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap index 52301cf0d9540e..294429afe14e7f 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap @@ -3494,10 +3494,10 @@ "side": "server", "type": "UserActiveModeTriggerBitmap", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0x110D", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3510,10 +3510,10 @@ "side": "server", "type": "char_string", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "Restart the application", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/lock-app/telink/include/LockSettingsStorage.h b/examples/lock-app/telink/include/LockSettingsStorage.h index 5cb1773eea4040..fd2c7939139327 100644 --- a/examples/lock-app/telink/include/LockSettingsStorage.h +++ b/examples/lock-app/telink/include/LockSettingsStorage.h @@ -18,6 +18,7 @@ #include <../Zephyr/ZephyrConfig.h> #include +#include #if LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE namespace chip { @@ -28,13 +29,13 @@ class LockSettingsStorage : ZephyrConfig { public: static const ZephyrConfig::Key kConfigKey_LockUser; - static const ZephyrConfig::Key kConfigKey_Credential; static const ZephyrConfig::Key kConfigKey_LockUserName; - static const ZephyrConfig::Key kConfigKey_CredentialData; static const ZephyrConfig::Key kConfigKey_UserCredentials; static const ZephyrConfig::Key kConfigKey_WeekDaySchedules; static const ZephyrConfig::Key kConfigKey_YearDaySchedules; static const ZephyrConfig::Key kConfigKey_HolidaySchedules; + static const char * kConfigKey_Credential[kNumCredentialTypes]; + static const char * kConfigKey_CredentialData[kNumCredentialTypes]; }; } // namespace Internal } // namespace DeviceLayer diff --git a/examples/lock-app/telink/src/LockManager.cpp b/examples/lock-app/telink/src/LockManager.cpp index 4a7ee03c1a6bb6..529e1aa557fa7c 100644 --- a/examples/lock-app/telink/src/LockManager.cpp +++ b/examples/lock-app/telink/src/LockManager.cpp @@ -120,6 +120,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Lock Action: Lock is already locked. No action performed"); } break; @@ -181,6 +182,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Unlock Action: Lock is already unlocked. no action performed"); } break; @@ -205,6 +207,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Unbolt Action: Lock is already in unbolt state. no action performed"); } break; @@ -244,6 +247,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Lock Action: Lock is already locked. No action performed"); } break; @@ -302,6 +306,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Unlock Action: Lock is already unlocked. no action performed"); } break; @@ -325,6 +330,7 @@ bool LockManager::LockAction(int32_t appSource, Action_t aAction, OperationSourc } else { + status = true; LOG_INF("Unbolt Action: Lock is already in unbolt state. no action performed"); } break; @@ -426,15 +432,9 @@ bool LockManager::ReadConfigValues() ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_LockUser, reinterpret_cast(&mLockUsers), sizeof(EmberAfPluginDoorLockUserInfo) * ArraySize(mLockUsers), outLen); - ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_Credential, reinterpret_cast(&mLockCredentials), - sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials * kNumCredentialTypes, outLen); - ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_LockUserName, reinterpret_cast(mUserNames), sizeof(mUserNames), outLen); - ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_CredentialData, reinterpret_cast(mCredentialData), - sizeof(mCredentialData), outLen); - ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_UserCredentials, reinterpret_cast(mCredentials), sizeof(CredentialStruct) * LockParams.numberOfUsers * LockParams.numberOfCredentialsPerUser, outLen); @@ -453,6 +453,17 @@ bool LockManager::ReadConfigValues() reinterpret_cast(&(mHolidaySchedule)), sizeof(EmberAfPluginDoorLockHolidaySchedule) * LockParams.numberOfHolidaySchedules, outLen); + for (uint8_t i = 0; i < kNumCredentialTypes; i++) + { + ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_Credential[i], + reinterpret_cast(&mLockCredentials[i]), + sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials, outLen); + + ZephyrConfig::ReadConfigValueBin(LockSettingsStorage::kConfigKey_CredentialData[i], + reinterpret_cast(mCredentialData[i]), kMaxCredentials * kMaxCredentialSize, + outLen); + } + return true; } #endif @@ -654,16 +665,19 @@ bool LockManager::SetCredential(chip::EndpointId endpointId, uint16_t credential chip::ByteSpan{ mCredentialData[to_underlying(credentialType)][credentialIndex], credentialData.size() }; #if LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE + CHIP_ERROR err; + // Save credential information in NVM flash - CHIP_ERROR err = ZephyrConfig::WriteConfigValueBin( - LockSettingsStorage::kConfigKey_Credential, reinterpret_cast(&mLockCredentials), - sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials * kNumCredentialTypes); + err = ZephyrConfig::WriteConfigValueBin(LockSettingsStorage::kConfigKey_Credential[to_underlying(credentialType)], + reinterpret_cast(&mLockCredentials[to_underlying(credentialType)]), + sizeof(EmberAfPluginDoorLockCredentialInfo) * kMaxCredentials); if (err != CHIP_NO_ERROR) ChipLogError( Zcl, "Failed to write kConfigKey_Credential. User data will be resetted during reboot. Not enough storage space \n"); - err = ZephyrConfig::WriteConfigValueBin(LockSettingsStorage::kConfigKey_CredentialData, - reinterpret_cast(&mCredentialData), sizeof(mCredentialData)); + err = ZephyrConfig::WriteConfigValueBin(LockSettingsStorage::kConfigKey_CredentialData[to_underlying(credentialType)], + reinterpret_cast(&mCredentialData[to_underlying(credentialType)]), + kMaxCredentials * kMaxCredentialSize); if (err != CHIP_NO_ERROR) ChipLogError( Zcl, diff --git a/examples/lock-app/telink/src/LockSettingsStorage.cpp b/examples/lock-app/telink/src/LockSettingsStorage.cpp index abe83ced65357e..73b88e2c593dea 100644 --- a/examples/lock-app/telink/src/LockSettingsStorage.cpp +++ b/examples/lock-app/telink/src/LockSettingsStorage.cpp @@ -33,16 +33,26 @@ namespace Internal { (key); \ static_assert(sizeof(key) <= SETTINGS_MAX_NAME_LEN, "Config key too long: " key) +#define CONFIG_KEY_CREDENTIAL(type) (NAMESPACE_CONFIG "credential-" type) +#define CONFIG_KEY_CREDENTIAL_DATA(type) (NAMESPACE_CONFIG "credential-" type "-data") + #define NAMESPACE_CONFIG CHIP_DEVICE_CONFIG_SETTINGS_KEY "/cfg/" -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_LockUser = CONFIG_KEY(NAMESPACE_CONFIG "lock-user"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_Credential = CONFIG_KEY(NAMESPACE_CONFIG "credential"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_LockUserName = CONFIG_KEY(NAMESPACE_CONFIG "lock-user-name"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_CredentialData = CONFIG_KEY(NAMESPACE_CONFIG "credential-data"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_UserCredentials = CONFIG_KEY(NAMESPACE_CONFIG "user-credentials"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_WeekDaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "week-day-schedules"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_YearDaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "year-day-schedules"); -const ZephyrConfig::Key LockSettingsStorage::kConfigKey_HolidaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "holiday-schedules"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_LockUser = CONFIG_KEY(NAMESPACE_CONFIG "lock-user"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_LockUserName = CONFIG_KEY(NAMESPACE_CONFIG "lock-user-name"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_UserCredentials = CONFIG_KEY(NAMESPACE_CONFIG "user-credentials"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_WeekDaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "week-day-schedules"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_YearDaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "year-day-schedules"); +const ZephyrConfig::Key LockSettingsStorage::kConfigKey_HolidaySchedules = CONFIG_KEY(NAMESPACE_CONFIG "holiday-schedules"); +const char * LockSettingsStorage::kConfigKey_Credential[kNumCredentialTypes] = { + CONFIG_KEY_CREDENTIAL("programming-pin"), CONFIG_KEY_CREDENTIAL("pin"), CONFIG_KEY_CREDENTIAL("rfid"), + CONFIG_KEY_CREDENTIAL("finger-print"), CONFIG_KEY_CREDENTIAL("finger-vein"), CONFIG_KEY_CREDENTIAL("face") +}; +const char * LockSettingsStorage::kConfigKey_CredentialData[kNumCredentialTypes] = { + CONFIG_KEY_CREDENTIAL_DATA("programming-pin"), CONFIG_KEY_CREDENTIAL_DATA("pin"), CONFIG_KEY_CREDENTIAL_DATA("rfid"), + CONFIG_KEY_CREDENTIAL_DATA("finger-print"), CONFIG_KEY_CREDENTIAL_DATA("finger-vein"), CONFIG_KEY_CREDENTIAL_DATA("face") +}; + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/examples/platform/linux/CommissionerMain.cpp b/examples/platform/linux/CommissionerMain.cpp index 64a7a47d2dffcb..2b3f98ba5868b2 100644 --- a/examples/platform/linux/CommissionerMain.cpp +++ b/examples/platform/linux/CommissionerMain.cpp @@ -181,7 +181,8 @@ CHIP_ERROR InitCommissioner(uint16_t commissionerPort, uint16_t udcListenPort, F params.controllerICAC = icacSpan; params.controllerNOC = nocSpan; - params.defaultCommissioner = &gAutoCommissioner; + params.defaultCommissioner = &gAutoCommissioner; + params.enableServerInteractions = true; // assign prefered feature settings CommissioningParameters commissioningParams = gAutoCommissioner.GetCommissioningParameters(); diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index cd3831caa40c1c..1ba800e5e1bcf0 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -680,6 +680,23 @@ void AppTaskCommon::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* sHaveBLEConnections = ConnectivityMgr().NumBLEConnections() != 0; #if CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED UpdateStatusLED(); +#endif +#ifdef CONFIG_CHIP_NFC_COMMISSIONING + if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Started) + { + if (NFCMgr().IsTagEmulationStarted()) + { + LOG_INF("NFC Tag emulation is already started"); + } + else + { + ShareQRCodeOverNFC(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); + } + } + else if (event->CHIPoBLEAdvertisingChange.Result == kActivity_Stopped) + { + NFCMgr().StopTagEmulation(); + } #endif break; case DeviceEventType::kThreadStateChange: diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index d7f41ac5b376c1..404c6d896bd118 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -38,8 +38,8 @@ Commissioner. In the context of the [Matter Video Player architecture](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/app_clusters/media/VideoPlayerArchitecture.adoc), a `CastingPlayer` would map to [Casting "Video" Player](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/app_clusters/media/VideoPlayerArchitecture.adoc#1-introduction). -The `CastingPlayer` is expected to be hosting one or more `Endpoints` (similar -to +The `CastingPlayer` is expected to be hosting one or more `Endpoints` (some of +which can represent [Content Apps](https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/app_clusters/media/VideoPlayerArchitecture.adoc#1-introduction) in the Matter Video Player architecture) that support one or more Matter Media `Clusters`. @@ -73,7 +73,10 @@ The Casting Client is expected to consume the Matter TV Casting library built for its respective platform which implements the APIs described in this document. Refer to the tv-casting-app READMEs for [Linux](linux/README.md), Android and [iOS](darwin/TvCasting/README.md) to understand how to build and -consume each platform's specific libraries. +consume each platform's specific libraries. The libraries MUST be built with the +client's specific values for `CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID` and +`CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID` updated in the +[CHIPProjectAppConfig.h](tv-casting-common/include/CHIPProjectAppConfig.h) file. ### Initialize the Casting Client @@ -474,11 +477,21 @@ to a `CastingPlayer`, once the Casting client has been commissioned by it. After that, the Casting client is able to skip the full UDC process by establishing CASE with the `CastingPlayer` directly. Once connected, the `CastingPlayer` object will contain the list of available Endpoints on that `CastingPlayer`. +Optionally, the following arguments may also be passed in. The optional +`commissioningWindowTimeoutSec` indicates how long to keep the commissioning +window open, if commissioning is required. And `DesiredEndpointFilter` specifies +the attributes, such as Vendor ID and Product ID of the `Endpoint`, the Casting +client desires to interact with after connecting. This forces the Matter TV +Casting library to go through the full UDC process in search of the desired +Endpoint, in cases where it is not available in the Casting client's cache. On Linux, the Casting Client can connect to a `CastingPlayer` by successfully calling `VerifyOrEstablishConnection` on it. ```c + +const uint16_t kDesiredEndpointVendorId = 65521; + void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * castingPlayer) { ChipLogProgress(AppServer, "ConnectionHandler called with %" CHIP_ERROR_FORMAT, err.Format()); @@ -486,7 +499,11 @@ void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * ca ... // targetCastingPlayer is a discovered CastingPlayer -targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler); +matter::casting::core::EndpointFilter desiredEndpointFilter; +desiredEndpointFilter.vendorId = kDesiredEndpointVendorId; +targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler, + matter::casting::core::kCommissioningWindowTimeoutSec, + desiredEndpointFilter); ... ``` diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp index dab134dfb7b57c..fe248c2a66d2a8 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.cpp +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -16,6 +16,8 @@ */ #include "simple-app-helper.h" +#include "clusters/ContentLauncherCluster.h" + #include "app/clusters/bindings/BindingManager.h" #include #include @@ -27,6 +29,9 @@ #include #include +// VendorId of the Endpoint on the CastingPlayer that the CastingApp desires to interact with after connection +const uint16_t kDesiredEndpointVendorId = 65521; + DiscoveryDelegateImpl * DiscoveryDelegateImpl::_discoveryDelegateImpl = nullptr; DiscoveryDelegateImpl * DiscoveryDelegateImpl::GetInstance() @@ -102,7 +107,11 @@ CHIP_ERROR CommandHandler(int argc, char ** argv) VerifyOrReturnValue(0 <= index && index < castingPlayers.size(), CHIP_ERROR_INVALID_ARGUMENT, ChipLogError(AppServer, "Invalid casting player index provided: %lu", index)); std::shared_ptr targetCastingPlayer = castingPlayers.at(index); - targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler); + + matter::casting::core::EndpointFilter desiredEndpointFilter; + desiredEndpointFilter.vendorId = kDesiredEndpointVendorId; + targetCastingPlayer->VerifyOrEstablishConnection(ConnectionHandler, matter::casting::core::kCommissioningWindowTimeoutSec, + desiredEndpointFilter); return CHIP_NO_ERROR; } if (strcmp(argv[0], "print-bindings") == 0) diff --git a/examples/tv-casting-app/linux/simple-app-helper.h b/examples/tv-casting-app/linux/simple-app-helper.h index d48b082e0faf30..9b114337d2fff1 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.h +++ b/examples/tv-casting-app/linux/simple-app-helper.h @@ -21,7 +21,6 @@ #include "core/CastingPlayer.h" #include "core/CastingPlayerDiscovery.h" #include "core/Types.h" - #include /** diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index c5ad03964cb0d9..697ae980e40c54 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -93,12 +93,18 @@ chip_data_model("tv-casting-common") { # Add simplified casting API files here sources += [ + "clusters/ContentLauncherCluster.h", + "clusters/MediaPlaybackCluster.h", + "clusters/TargetNavigatorCluster.h", + "core/Attribute.h", "core/CastingApp.cpp", "core/CastingApp.h", "core/CastingPlayer.cpp", "core/CastingPlayer.h", "core/CastingPlayerDiscovery.cpp", "core/CastingPlayerDiscovery.h", + "core/Cluster.h", + "core/Endpoint.h", "core/Types.h", "support/AppParameters.h", "support/CastingStore.cpp", @@ -106,6 +112,8 @@ chip_data_model("tv-casting-common") { "support/ChipDeviceEventHandler.cpp", "support/ChipDeviceEventHandler.h", "support/DataProvider.h", + "support/EndpointListLoader.cpp", + "support/EndpointListLoader.h", ] deps = [ diff --git a/examples/tv-casting-app/tv-casting-common/clusters/ContentLauncherCluster.h b/examples/tv-casting-app/tv-casting-common/clusters/ContentLauncherCluster.h new file mode 100644 index 00000000000000..a8d5ad847a003b --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/clusters/ContentLauncherCluster.h @@ -0,0 +1,44 @@ +/* + * + * 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. + */ + +#pragma once + +#include "core/Endpoint.h" +#include "core/Types.h" + +#include "lib/support/logging/CHIPLogging.h" + +namespace matter { +namespace casting { +namespace clusters { + +class ContentLauncherCluster : public core::BaseCluster +{ +private: +protected: +public: + ContentLauncherCluster(memory::Weak endpoint) : core::BaseCluster(endpoint) {} + + // TODO: + // LaunchURL(const char * contentUrl, const char * contentDisplayStr, + // chip::Optional brandingInformation); +}; + +}; // namespace clusters +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/clusters/MediaPlaybackCluster.h b/examples/tv-casting-app/tv-casting-common/clusters/MediaPlaybackCluster.h new file mode 100644 index 00000000000000..8fe196597f001e --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/clusters/MediaPlaybackCluster.h @@ -0,0 +1,42 @@ +/* + * + * 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. + */ + +#pragma once + +#include "core/Endpoint.h" +#include "core/Types.h" + +#include "lib/support/logging/CHIPLogging.h" + +namespace matter { +namespace casting { +namespace clusters { + +class MediaPlaybackCluster : public core::BaseCluster +{ +private: +protected: +public: + MediaPlaybackCluster(memory::Weak endpoint) : core::BaseCluster(endpoint) {} + + // TODO: add commands +}; + +}; // namespace clusters +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/clusters/TargetNavigatorCluster.h b/examples/tv-casting-app/tv-casting-common/clusters/TargetNavigatorCluster.h new file mode 100644 index 00000000000000..0f03e9296d73ca --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/clusters/TargetNavigatorCluster.h @@ -0,0 +1,42 @@ +/* + * + * 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. + */ + +#pragma once + +#include "core/Endpoint.h" +#include "core/Types.h" + +#include "lib/support/logging/CHIPLogging.h" + +namespace matter { +namespace casting { +namespace clusters { + +class TargetNavigatorCluster : public core::BaseCluster +{ +private: +protected: +public: + TargetNavigatorCluster(memory::Weak endpoint) : core::BaseCluster(endpoint) {} + + // TODO: add commands +}; + +}; // namespace clusters +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/core/Attribute.h b/examples/tv-casting-app/tv-casting-common/core/Attribute.h new file mode 100644 index 00000000000000..5c8716967bab86 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/core/Attribute.h @@ -0,0 +1,76 @@ +/* + * + * 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. + */ + +#pragma once + +#include "Cluster.h" +#include "Types.h" + +#include "lib/support/logging/CHIPLogging.h" + +namespace matter { +namespace casting { +namespace core { + +enum ReadAttributeError +{ + READ_ATTRIBUTE_NO_ERROR +}; + +enum WriteAttributeError +{ + WRITE_ATTRIBUTE_NO_ERROR +}; + +template +using ReadAttributeCallback = std::function before, ValueType after, ReadAttributeError)>; + +using WriteAttributeCallback = std::function; + +class BaseCluster; + +template +class Attribute +{ +private: + memory::Weak cluster; + ValueType value; + +public: + Attribute(memory::Weak cluster) { this->cluster = cluster; } + + ~Attribute() {} + + Attribute() = delete; + Attribute(Attribute & other) = delete; + void operator=(const Attribute &) = delete; + +protected: + memory::Strong GetCluster() const { return cluster.lock(); } + +public: + ValueType GetValue(); + void Read(ReadAttributeCallback onRead); + void Write(ValueType value, WriteAttributeCallback onWrite); + bool SubscribeAttribute(AttributeId attributeId, ReadAttributeCallback callback); + bool UnsubscribeAttribute(AttributeId attributeId, ReadAttributeCallback callback); +}; + +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp index 9cc11a774e1564..e0d2e22d7f1524 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp @@ -17,6 +17,8 @@ */ #include "CastingPlayer.h" +#include "Endpoint.h" + #include "support/CastingStore.h" #include @@ -27,7 +29,8 @@ namespace core { CastingPlayer * CastingPlayer::mTargetCastingPlayer = nullptr; -void CastingPlayer::VerifyOrEstablishConnection(ConnectCallback onCompleted, unsigned long long int commissioningWindowTimeoutSec) +void CastingPlayer::VerifyOrEstablishConnection(ConnectCallback onCompleted, unsigned long long int commissioningWindowTimeoutSec, + EndpointFilter desiredEndpointFilter) { ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection called"); @@ -46,40 +49,49 @@ void CastingPlayer::VerifyOrEstablishConnection(ConnectCallback onCompleted, uns mCommissioningWindowTimeoutSec = commissioningWindowTimeoutSec; mTargetCastingPlayer = this; - // If this CastingPlayer is the cache of CastingPlayers the app previously connected to (and has nodeId and fabricIndex of), - // simply Find or Re-establish the CASE session and return early + // If *this* CastingPlayer was previously connected to, its nodeId, fabricIndex and other attributes should be present + // in the CastingStore cache. If that is the case, AND, the cached data contains the endpoint desired by the client, if any, + // as per desiredEndpointFilter, simply Find or Re-establish the CASE session and return early if (cachedCastingPlayers.size() != 0) { it = std::find_if(cachedCastingPlayers.begin(), cachedCastingPlayers.end(), [this](const core::CastingPlayer & castingPlayerParam) { return castingPlayerParam == *this; }); + // found the CastingPlayer in cache if (it != cachedCastingPlayers.end()) { unsigned index = (unsigned int) std::distance(cachedCastingPlayers.begin(), it); - *this = cachedCastingPlayers[index]; - - FindOrEstablishSession( - nullptr, - [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { - ChipLogProgress(AppServer, "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer successful"); - CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_CONNECTED; - support::CastingStore::GetInstance()->AddOrUpdate(*CastingPlayer::GetTargetCastingPlayer()); - VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); - CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); - }, - [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { - ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer failed"); - CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_NOT_CONNECTED; - support::CastingStore::GetInstance()->Delete(*CastingPlayer::GetTargetCastingPlayer()); - VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); - CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(error, nullptr); - mTargetCastingPlayer = nullptr; - }); - return; // FindOrEstablishSession called. Return early. + if (ContainsDesiredEndpoint(&cachedCastingPlayers[index], desiredEndpointFilter)) + { + *this = cachedCastingPlayers[index]; + + FindOrEstablishSession( + nullptr, + [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { + ChipLogProgress(AppServer, + "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer successful"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_CONNECTED; + + // this async call will Load all the endpoints with their respective attributes into the TargetCastingPlayer + // persist the TargetCastingPlayer information into the CastingStore and call mOnCompleted() + support::EndpointListLoader::GetInstance()->Initialize(&exchangeMgr, &sessionHandle); + support::EndpointListLoader::GetInstance()->Load(); + }, + [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { + ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection Connection to CastingPlayer failed"); + CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_NOT_CONNECTED; + support::CastingStore::GetInstance()->Delete(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(error, nullptr); + mTargetCastingPlayer = nullptr; + }); + return; // FindOrEstablishSession called. Return early. + } } } - // this CastingPlayer is not in the list of cached CastingPlayers previously connected to. This VerifyOrEstablishConnection call + // this CastingPlayer is not in the list of cached CastingPlayers previously connected to or the cached data + // does not contain the endpoint the client desires to interact with. So, this VerifyOrEstablishConnection call // will require User Directed Commissioning. if (chip::Server::GetInstance().GetFailSafeContext().IsFailSafeArmed()) { @@ -101,13 +113,31 @@ void CastingPlayer::VerifyOrEstablishConnection(ConnectCallback onCompleted, uns exit: if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection failed with %" CHIP_ERROR_FORMAT, err.Format()); support::ChipDeviceEventHandler::SetUdcStatus(false); mConnectionState = CASTING_PLAYER_NOT_CONNECTED; mCommissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec; - mOnCompleted = nullptr; mTargetCastingPlayer = nullptr; - ChipLogError(AppServer, "CastingPlayer::VerifyOrEstablishConnection failed with %" CHIP_ERROR_FORMAT, err.Format()); mOnCompleted(err, nullptr); + mOnCompleted = nullptr; + } +} + +void CastingPlayer::RegisterEndpoint(const memory::Strong endpoint) +{ + auto it = std::find_if(mEndpoints.begin(), mEndpoints.end(), [endpoint](const memory::Strong & _endpoint) { + return _endpoint->GetId() == endpoint->GetId(); + }); + + // If existing endpoint, update mEndpoints. If new endpoint, add it to the vector mEndpoints + if (it != mEndpoints.end()) + { + unsigned index = (unsigned int) std::distance(mEndpoints.begin(), it); + mEndpoints[index] = endpoint; + } + else + { + mEndpoints.push_back(endpoint); } } @@ -165,6 +195,24 @@ void CastingPlayer::FindOrEstablishSession(void * clientContext, chip::OnDeviceC connectionContext->mOnConnectionFailureCallback); } +bool CastingPlayer::ContainsDesiredEndpoint(core::CastingPlayer * cachedCastingPlayer, EndpointFilter desiredEndpointFilter) +{ + std::vector> cachedEndpoints = cachedCastingPlayer->GetEndpoints(); + for (const auto & cachedEndpoint : cachedEndpoints) + { + bool match = true; + match = match && (desiredEndpointFilter.vendorId == 0 || cachedEndpoint->GetVendorId() == desiredEndpointFilter.vendorId); + match = + match && (desiredEndpointFilter.productId == 0 || cachedEndpoint->GetProductId() == desiredEndpointFilter.productId); + // TODO: check deviceTypeList + if (match) + { + return true; + } + } + return false; +} + void CastingPlayer::LogDetail() const { if (strlen(mAttributes.id) != 0) diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h index 17d722d6dc5210..60aba39b94c254 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h @@ -18,8 +18,10 @@ #pragma once +#include "Endpoint.h" #include "Types.h" #include "support/ChipDeviceEventHandler.h" +#include "support/EndpointListLoader.h" #include "lib/support/logging/CHIPLogging.h" #include @@ -36,6 +38,17 @@ const int kPortMaxLength = 5; // port is uint16_t const int kIdMaxLength = chip::Dnssd::kHostNameMaxLength + kPortMaxLength + 1; const unsigned long long int kCommissioningWindowTimeoutSec = 3 * 60; // 3 minutes +/** + * @brief Describes an Endpoint that the client wants to connect to + */ +struct EndpointFilter +{ + // value of 0 means unspecified + uint16_t vendorId = 0; + uint16_t productId = 0; + std::vector requiredDeviceTypes; +}; + class CastingPlayerAttributes { public: @@ -55,6 +68,8 @@ class CastingPlayerAttributes chip::FabricIndex fabricIndex = 0; }; +class Endpoint; + /** * @brief Represents CastingPlayer ConnectionState. * @@ -105,11 +120,24 @@ class CastingPlayer : public std::enable_shared_from_this * * @param onCompleted for success - called back with CHIP_NO_ERROR and CastingPlayer *. * For failure - called back with an error and nullptr. - * @param commissioningWindowTimeoutSec time (in sec) to keep the commissioning window open, if commissioning is required. - * Defaults to kCommissioningWindowTimeoutSec. + * @param commissioningWindowTimeoutSec (Optional) time (in sec) to keep the commissioning window open, if commissioning is + * required. Defaults to kCommissioningWindowTimeoutSec. + * @param desiredEndpointFilter (Optional) Attributes (such as VendorId) describing an Endpoint that the client wants to + * interact with after commissioning. If this value is passed in, the VerifyOrEstablishConnection will force User Directed + * Commissioning, in case the desired Endpoint is not found in the on device CastingStore. */ void VerifyOrEstablishConnection(ConnectCallback onCompleted, - unsigned long long int commissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec); + unsigned long long int commissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec, + EndpointFilter desiredEndpointFilter = EndpointFilter()); + + /** + * @brief Register an endpoint on this CastingPlayer. If the provided endpoint was already registered, its information will be + * updated in the registry. + */ + void RegisterEndpoint(const memory::Strong endpoint); + + const std::vector> GetEndpoints() const { return mEndpoints; } + void LogDetail() const; const char * GetId() const { return mAttributes.id; } @@ -140,12 +168,8 @@ class CastingPlayer : public std::enable_shared_from_this void SetFabricIndex(chip::FabricIndex fabricIndex) { mAttributes.fabricIndex = fabricIndex; } - // void RegisterEndpoint(const memory::Strong endpoint) { endpoints.push_back(endpoint); } - - // const std::vector> GetEndpoints() const { return endpoints; } - private: - // std::vector> endpoints; + std::vector> mEndpoints; ConnectionState mConnectionState = CASTING_PLAYER_NOT_CONNECTED; CastingPlayerAttributes mAttributes; static CastingPlayer * mTargetCastingPlayer; @@ -184,10 +208,20 @@ class CastingPlayer : public std::enable_shared_from_this void FindOrEstablishSession(void * clientContext, chip::OnDeviceConnected onDeviceConnected, chip::OnDeviceConnectionFailure onDeviceConnectionFailure); + /** + * @brief Checks if the cachedCastingPlayer contains an Endpoint that matches the description of the desiredEndpointFilter + * + * @return true - cachedCastingPlayer contains at least one endpoint that matches all the (non-default) values in + * desiredEndpointFilter, false otherwise + */ + bool ContainsDesiredEndpoint(core::CastingPlayer * cachedCastingPlayer, EndpointFilter desiredEndpointFilter); + // ChipDeviceEventHandler handles chip::DeviceLayer::ChipDeviceEvent events and helps the CastingPlayer class commission with // and connect to a CastingPlayer friend class support::ChipDeviceEventHandler; + friend class ConnectionContext; + friend class support::EndpointListLoader; }; class ConnectionContext diff --git a/examples/tv-casting-app/tv-casting-common/core/Cluster.h b/examples/tv-casting-app/tv-casting-common/core/Cluster.h new file mode 100644 index 00000000000000..678e55caf4237d --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/core/Cluster.h @@ -0,0 +1,54 @@ +/* + * + * 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. + */ + +#pragma once + +#include "Endpoint.h" +#include "Types.h" + +#include "lib/support/logging/CHIPLogging.h" + +namespace matter { +namespace casting { +namespace core { + +class Endpoint; + +// Base cluster class +class BaseCluster +{ +private: +protected: + memory::Weak mEndpoint; + +public: + BaseCluster(memory::Weak endpoint) { this->mEndpoint = endpoint; } + + virtual ~BaseCluster() {} + + BaseCluster() = delete; + BaseCluster(BaseCluster & other) = delete; + void operator=(const BaseCluster &) = delete; + +protected: + memory::Weak GetEndpoint() const { return mEndpoint.lock(); } +}; + +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h new file mode 100644 index 00000000000000..a481882b6de80e --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h @@ -0,0 +1,149 @@ +/* + * + * 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. + */ + +#pragma once + +#include "CastingPlayer.h" +#include "Cluster.h" +#include "Types.h" + +#include "lib/support/logging/CHIPLogging.h" +#include + +#include +#include +#include +#include +#include + +namespace matter { +namespace casting { +namespace core { + +class EndpointAttributes +{ +public: + // value of 0 means the attribute could not be read for the corresponding Endpoint + chip::EndpointId mId = 0; + uint16_t mVendorId = 0; + uint16_t mProductId = 0; + std::vector mDeviceTypeList; +}; + +class CastingPlayer; + +/** + * @brief An Endpoint on a CastingPlayer e.g. a Speaker or a Matter Content App + */ +class Endpoint : public std::enable_shared_from_this +{ + +private: + CastingPlayer * mCastingPlayer; + + EndpointAttributes mAttributes; + std::map> mClusters; + +protected: + CastingPlayer * GetCastingPlayer() const { return mCastingPlayer; } + +public: + Endpoint(CastingPlayer * castingPlayer, const EndpointAttributes & attributes) + { + this->mCastingPlayer = castingPlayer; + this->mAttributes = attributes; + } + + ~Endpoint() {} + + Endpoint() = delete; + Endpoint(Endpoint & other) = delete; + void operator=(const Endpoint &) = delete; + + /** + * @brief Compares based on the Id + */ + bool operator==(const Endpoint & other) const { return this->mAttributes.mId == other.mAttributes.mId; } + + chip::EndpointId GetId() const { return mAttributes.mId; } + + /** + * @return uint16_t - value 0 indicates no ProductId was returned for this Endpoint + */ + uint16_t GetProductId() const { return mAttributes.mProductId; } + + /** + * @return uint16_t - value 0 indicates no VendorId was returned for this Endpoint + */ + uint16_t GetVendorId() const { return mAttributes.mVendorId; } + + /** + * @return uint16_t - empty vector indicates no DeviceTypeList was returned for this Endpoint + */ + std::vector GetDeviceTypeList() const + { + return mAttributes.mDeviceTypeList; + } + + /** + * @return uint16_t - empty vector indicates no ServerList was returned for this Endpoint + */ + std::vector GetServerList() + { + std::vector serverList; + for (auto const & cluster : mClusters) + { + serverList.push_back(cluster.first); + } + return serverList; + } + + /** + * @brief Registers a cluster of type T against the passed in clusterId + * for this Endpoint + */ + template + void RegisterCluster(const chip::ClusterId clusterId) + { + static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); + auto cluster = std::make_shared(shared_from_this()); + mClusters[clusterId] = std::static_pointer_cast(cluster); + } + + /** + * @brief Returns a cluster of type T, if applicable. Returns nullptr otherwise + */ + template + memory::Strong GetCluster() + { + static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); + for (const auto & pair : mClusters) + { + auto cluster = std::dynamic_pointer_cast(pair.second); + if (cluster) + { + return cluster; + } + } + return nullptr; + } +}; + +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/core/Types.h b/examples/tv-casting-app/tv-casting-common/core/Types.h index 691fc3d2b36944..267b09642171b2 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Types.h +++ b/examples/tv-casting-app/tv-casting-common/core/Types.h @@ -49,6 +49,8 @@ class AppParameters; class ByteSpanDataProvider; class ServerInitParamsProvider; +class EndpointListLoader; + } // namespace support }; // namespace casting diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp index 1bfd75a93a47ca..b6ee4779d41d6e 100644 --- a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp @@ -125,6 +125,7 @@ std::vector CastingStore::ReadAll() ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); core::CastingPlayerAttributes attributes; + std::vector endpointAttributesList; while ((err = reader.Next()) == CHIP_NO_ERROR) { chip::TLV::Tag castingPlayerContainerTag = reader.GetTag(); @@ -196,13 +197,170 @@ std::vector CastingStore::ReadAll() continue; } + if (castingPlayerContainerTagNum == kCastingPlayerEndpointsContainerTag) + { + // Entering Endpoints container + chip::TLV::TLVType endpointsContainerType = chip::TLV::kTLVType_Array; + err = reader.EnterContainer(endpointsContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + core::EndpointAttributes endpointAttributes; + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + // Entering Endpoint container + chip::TLV::TLVType endpointContainerType = chip::TLV::kTLVType_Structure; + err = reader.EnterContainer(endpointContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + chip::TLV::Tag endpointContainerTag = reader.GetTag(); + VerifyOrReturnValue(chip::TLV::IsContextTag(endpointContainerTag), std::vector(), + ChipLogError(AppServer, "Unexpected non-context TLV tag")); + + uint8_t endpointContainerTagNum = static_cast(chip::TLV::TagNumFromTag(endpointContainerTag)); + if (endpointContainerTagNum == kCastingPlayerEndpointIdTag) + { + err = reader.Get(endpointAttributes.mId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (endpointContainerTagNum == kCastingPlayerEndpointVendorIdTag) + { + err = reader.Get(endpointAttributes.mVendorId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (endpointContainerTagNum == kCastingPlayerEndpointProductIdTag) + { + err = reader.Get(endpointAttributes.mProductId); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + std::vector deviceTypeList; + if (endpointContainerTagNum == kCastingPlayerEndpointDeviceTypeListContainerTag) + { + // Entering DeviceTypeList container + chip::TLV::TLVType deviceTypeListContainerType = chip::TLV::kTLVType_Array; + err = reader.EnterContainer(deviceTypeListContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + // Entering DeviceTypeStruct container + chip::TLV::TLVType deviceTypeStructContainerType = chip::TLV::kTLVType_Structure; + err = reader.EnterContainer(deviceTypeStructContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.EnterContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + chip::app::Clusters::Descriptor::Structs::DeviceTypeStruct::DecodableType deviceTypeStruct; + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + chip::TLV::Tag deviceTypeStructContainerTag = reader.GetTag(); + VerifyOrReturnValue(chip::TLV::IsContextTag(deviceTypeStructContainerTag), + std::vector(), + ChipLogError(AppServer, "Unexpected non-context TLV tag")); + + uint8_t deviceTypeStructContainerTagNum = + static_cast(chip::TLV::TagNumFromTag(deviceTypeStructContainerTag)); + if (deviceTypeStructContainerTagNum == kCastingPlayerEndpointDeviceTypeTag) + { + err = reader.Get(deviceTypeStruct.deviceType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + + if (deviceTypeStructContainerTagNum == kCastingPlayerEndpointDeviceTypeRevisionTag) + { + err = reader.Get(deviceTypeStruct.revision); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); + continue; + } + } + + if (err == CHIP_END_OF_TLV) + { + // Exiting DeviceTypeStruct container + err = reader.ExitContainer(deviceTypeStructContainerType); + VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, + "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, + err.Format())); + + deviceTypeList.push_back(deviceTypeStruct); + break; + } + } + if (err == CHIP_END_OF_TLV) + { + // Exiting DeviceTypeList container + err = reader.ExitContainer(deviceTypeListContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + endpointAttributes.mDeviceTypeList = deviceTypeList; + break; + } + continue; + } + } + + if (err == CHIP_END_OF_TLV) + { + // Exiting Endpoint container + err = reader.ExitContainer(endpointContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + endpointAttributesList.push_back(endpointAttributes); + break; + } + } + + if (err == CHIP_END_OF_TLV) + { + // Exiting Endpoints container + err = reader.ExitContainer(endpointsContainerType); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + break; + } + + continue; + } + if (err == CHIP_END_OF_TLV) { // Exiting CastingPlayer container err = reader.ExitContainer(castingPlayerContainerType); VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), ChipLogError(AppServer, "TLVReader.ExitContainer failed %" CHIP_ERROR_FORMAT, err.Format())); + + // create a castingPlayer with Endpoints and add it to the castingPlayers to be returned core::CastingPlayer castingPlayer(attributes); + for (auto & endpointAttributes : endpointAttributesList) + { + std::shared_ptr endpoint(new core::Endpoint(&castingPlayer, endpointAttributes)); + castingPlayer.RegisterEndpoint(endpoint); + } castingPlayers.push_back(castingPlayer); break; } @@ -321,6 +479,65 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer ReturnErrorOnFailure(tlvWriter.PutBytes(chip::TLV::ContextTag(kCastingPlayerHostNameTag), (const uint8_t *) castingPlayer.GetHostName(), static_cast(strlen(castingPlayer.GetHostName()) + 1))); + + // Endpoints container starts + chip::TLV::TLVType endpointsContainerType = chip::TLV::kTLVType_Array; + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointsContainerTag), + chip::TLV::kTLVType_Array, endpointsContainerType)); + std::vector> endpoints = core::CastingPlayer::GetTargetCastingPlayer()->GetEndpoints(); + for (auto & endpoint : endpoints) + { + chip::TLV::TLVType endpointContainerType = chip::TLV::kTLVType_Structure; + // Endpoint container starts + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointContainerTag), + chip::TLV::kTLVType_Structure, endpointContainerType)); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointIdTag), endpoint->GetId())); + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointVendorIdTag), endpoint->GetVendorId())); + ReturnErrorOnFailure( + tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointProductIdTag), endpoint->GetProductId())); + + // DeviceTypeList container starts + chip::TLV::TLVType deviceTypeListContainerType = chip::TLV::kTLVType_Array; + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointDeviceTypeListContainerTag), + chip::TLV::kTLVType_Array, deviceTypeListContainerType)); + std::vector deviceTypeList = + endpoint->GetDeviceTypeList(); + for (chip::app::Clusters::Descriptor::Structs::DeviceTypeStruct::DecodableType deviceTypeStruct : deviceTypeList) + { + chip::TLV::TLVType deviceTypeStructContainerType = chip::TLV::kTLVType_Structure; + // DeviceTypeStruct container starts + ReturnErrorOnFailure( + tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointDeviceTypeStructContainerTag), + chip::TLV::kTLVType_Structure, deviceTypeStructContainerType)); + ReturnErrorOnFailure( + tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointDeviceTypeTag), deviceTypeStruct.deviceType)); + ReturnErrorOnFailure( + tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointDeviceTypeRevisionTag), deviceTypeStruct.revision)); + + // DeviceTypeStruct container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(deviceTypeStructContainerType)); + } + // DeviceTypeList container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(deviceTypeListContainerType)); + + // ServerList container starts + chip::TLV::TLVType serverListContainerType = chip::TLV::kTLVType_Array; + ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointServerListContainerTag), + chip::TLV::kTLVType_Array, serverListContainerType)); + std::vector serverList = endpoint->GetServerList(); + for (chip::ClusterId clusterId : serverList) + { + ReturnErrorOnFailure(tlvWriter.Put(chip::TLV::ContextTag(kCastingPlayerEndpointServerClusterIdTag), clusterId)); + } + // ServerList container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(serverListContainerType)); + + // Endpoint container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(endpointContainerType)); + } + // Endpoints container ends + ReturnErrorOnFailure(tlvWriter.EndContainer(endpointsContainerType)); + // CastingPlayer container ends ReturnErrorOnFailure(tlvWriter.EndContainer(castingPlayerContainerType)); } diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.h b/examples/tv-casting-app/tv-casting-common/support/CastingStore.h index 3d8ec7f613511b..563410fb380e3a 100644 --- a/examples/tv-casting-app/tv-casting-common/support/CastingStore.h +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.h @@ -72,6 +72,7 @@ class CastingStore : public chip::FabricTable::Delegate enum CastingStoreTLVTag { kCastingStoreDataVersionTag = 1, + kCastingPlayersContainerTag, kCastingPlayerContainerTag, kCastingPlayerIdTag, @@ -83,6 +84,20 @@ class CastingStore : public chip::FabricTable::Delegate kCastingPlayerDeviceNameTag, kCastingPlayerHostNameTag, + kCastingPlayerEndpointsContainerTag, + kCastingPlayerEndpointContainerTag, + kCastingPlayerEndpointIdTag, + kCastingPlayerEndpointVendorIdTag, + kCastingPlayerEndpointProductIdTag, + + kCastingPlayerEndpointDeviceTypeListContainerTag, + kCastingPlayerEndpointDeviceTypeStructContainerTag, + kCastingPlayerEndpointDeviceTypeTag, + kCastingPlayerEndpointDeviceTypeRevisionTag, + + kCastingPlayerEndpointServerListContainerTag, + kCastingPlayerEndpointServerClusterIdTag, + kContextTagMaxNum = UINT8_MAX }; diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp index 704e4ef7295874..eaaf8dc44cc834 100644 --- a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp @@ -21,6 +21,7 @@ #include "core/CastingPlayer.h" #include "core/Types.h" #include "support/CastingStore.h" +#include "support/EndpointListLoader.h" #include "app/clusters/bindings/BindingManager.h" @@ -66,9 +67,11 @@ void ChipDeviceEventHandler::Handle(const chip::DeviceLayer::ChipDeviceEvent * e [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle: Connection to CastingPlayer successful"); CastingPlayer::GetTargetCastingPlayer()->mConnectionState = CASTING_PLAYER_CONNECTED; - support::CastingStore::GetInstance()->AddOrUpdate(*CastingPlayer::GetTargetCastingPlayer()); - VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); - CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); + + // this async call will Load all the endpoints with their respective attributes into the TargetCastingPlayer + // persist the TargetCastingPlayer information into the CastingStore and call mOnCompleted() + EndpointListLoader::GetInstance()->Initialize(&exchangeMgr, &sessionHandle); + EndpointListLoader::GetInstance()->Load(); }, [](void * context, const chip::ScopedNodeId & peerId, CHIP_ERROR error) { ChipLogError(AppServer, "ChipDeviceEventHandler::Handle: Connection to CastingPlayer failed"); diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h index 69142603ce40f0..e6759856be8caf 100644 --- a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.h @@ -27,7 +27,7 @@ namespace support { /** * @brief Handles chip::DeviceLayer::ChipDeviceEvent events (such as kFailSafeTimerExpired, kBindingsChangedViaCluster, * kCommissioningComplete) sent by the Matter DeviceLayer. - * ChipDeviceEventHandlerhelps the CastingPlayer class commission with and connect to a CastingPlayer + * ChipDeviceEventHandler helps the CastingPlayer class commission with and connect to a CastingPlayer */ class ChipDeviceEventHandler { diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp new file mode 100644 index 00000000000000..396a3229c23e2a --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp @@ -0,0 +1,259 @@ +/* + * + * 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 "EndpointListLoader.h" + +#include "clusters/ContentLauncherCluster.h" +#include "clusters/MediaPlaybackCluster.h" +#include "clusters/TargetNavigatorCluster.h" +#include "core/CastingPlayer.h" +#include "core/Types.h" +#include "support/CastingStore.h" + +#include "app/clusters/bindings/BindingManager.h" + +namespace matter { +namespace casting { +namespace support { + +using namespace matter::casting::core; + +EndpointListLoader * EndpointListLoader::_endpointListLoader = nullptr; + +EndpointListLoader::EndpointListLoader() {} + +EndpointListLoader * EndpointListLoader::GetInstance() +{ + if (_endpointListLoader == nullptr) + { + _endpointListLoader = new EndpointListLoader(); + } + return _endpointListLoader; +} + +void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeMgr, const chip::SessionHandle * sessionHandle) +{ + mExchangeMgr = exchangeMgr; + mSessionHandle = sessionHandle; + + for (const auto & binding : chip::BindingTable::GetInstance()) + { + if (binding.type == EMBER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + { + // check to see if we discovered a new endpoint in the bindings + chip::EndpointId endpointId = binding.remote; + std::vector> endpoints = CastingPlayer::GetTargetCastingPlayer()->GetEndpoints(); + if (std::find_if(endpoints.begin(), endpoints.end(), [&endpointId](const memory::Strong & endpoint) { + return endpoint->GetId() == endpointId; + }) == endpoints.end()) + { + mNewEndpointsToLoad++; + } + } + } + + mPendingAttributeReads = mNewEndpointsToLoad * kTotalDesiredAttributes; + mEndpointAttributesList = new EndpointAttributes[mNewEndpointsToLoad]; + mEndpointServerLists = new std::vector[mNewEndpointsToLoad]; +} + +CHIP_ERROR EndpointListLoader::Load() +{ + ChipLogProgress(AppServer, "EndpointListLoader::Load() called"); + + VerifyOrReturnError(CastingPlayer::GetTargetCastingPlayer() != nullptr, CHIP_ERROR_INCORRECT_STATE); + + int endpointIndex = -1; + for (const auto & binding : chip::BindingTable::GetInstance()) + { + ChipLogProgress(AppServer, + "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 + " groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI, + binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local, + binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0))); + if (binding.type == EMBER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + { + // if we discovered a new Endpoint from the bindings, read its EndpointAttributes + chip::EndpointId endpointId = binding.remote; + std::vector> endpoints = CastingPlayer::GetTargetCastingPlayer()->GetEndpoints(); + if (std::find_if(endpoints.begin(), endpoints.end(), [&endpointId](const memory::Strong & endpoint) { + return endpoint->GetId() == endpointId; + }) == endpoints.end()) + { + // Read attributes and mEndpointAttributesList for (endpointIndex + 1) + ChipLogProgress(AppServer, "EndpointListLoader::Load Reading attributes for endpointId %d", endpointId); + mEndpointAttributesList[++endpointIndex].mId = endpointId; + ReadVendorId(&mEndpointAttributesList[endpointIndex]); + ReadProductId(&mEndpointAttributesList[endpointIndex]); + ReadDeviceTypeList(&mEndpointAttributesList[endpointIndex]); + ReadServerList(&mEndpointServerLists[endpointIndex], endpointId); + } + } + } + + return CHIP_NO_ERROR; +} + +void EndpointListLoader::Complete() +{ + ChipLogProgress(AppServer, "EndpointListLoader::Complete called with mPendingAttributeReads %lu", mPendingAttributeReads); + mPendingAttributeReads--; + if (mPendingAttributeReads == 0) + { + ChipLogProgress(AppServer, "EndpointListLoader::Complete ready to complete Loading endpoints"); + for (unsigned long i = 0; i < mNewEndpointsToLoad; i++) + { + EndpointAttributes endpointAttributes = mEndpointAttributesList[i]; + std::shared_ptr endpoint = + std::make_shared(CastingPlayer::GetTargetCastingPlayer(), endpointAttributes); + for (chip::ClusterId clusterId : mEndpointServerLists[i]) + { + switch (clusterId) + { + case chip::app::Clusters::ContentLauncher::Id: + endpoint->RegisterCluster(clusterId); + break; + + case chip::app::Clusters::MediaPlayback::Id: + endpoint->RegisterCluster(clusterId); + break; + + case chip::app::Clusters::TargetNavigator::Id: + endpoint->RegisterCluster(clusterId); + break; + + default: + ChipLogProgress(AppServer, "Skipping registration of clusterId %d for endpointId %d", clusterId, + endpointAttributes.mId); + break; + } + } + CastingPlayer::GetTargetCastingPlayer()->RegisterEndpoint(endpoint); + } + + ChipLogProgress(AppServer, "EndpointListLoader::Complete finished Loading endpoints"); + + // TODO cleanup + // delete mEndpointAttributesList; + mEndpointAttributesList = nullptr; + // delete mEndpointServerLists; + mEndpointServerLists = nullptr; + mExchangeMgr = nullptr; + mSessionHandle = nullptr; + mNewEndpointsToLoad = 0; + + // done loading endpoints, callback client OnCompleted + support::CastingStore::GetInstance()->AddOrUpdate(*CastingPlayer::GetTargetCastingPlayer()); + VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted); + CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); + } +} + +CHIP_ERROR EndpointListLoader::ReadVendorId(EndpointAttributes * endpointAttributes) +{ + MediaClusterBase cluster(*mExchangeMgr, *mSessionHandle, endpointAttributes->mId); + + return cluster.template ReadAttribute( + endpointAttributes, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType decodableVendorId) { + EndpointAttributes * _endpointAttributes = static_cast(context); + _endpointAttributes->mVendorId = decodableVendorId; + EndpointListLoader::GetInstance()->Complete(); + }, + [](void * context, CHIP_ERROR err) { + EndpointAttributes * _endpointAttributes = static_cast(context); + ChipLogError(AppServer, "EndpointListLoader ReadAttribute(VendorID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + _endpointAttributes->mId, err.Format()); + EndpointListLoader::GetInstance()->Complete(); + }); +} + +CHIP_ERROR EndpointListLoader::ReadProductId(EndpointAttributes * endpointAttributes) +{ + MediaClusterBase cluster(*mExchangeMgr, *mSessionHandle, endpointAttributes->mId); + + return cluster.template ReadAttribute( + endpointAttributes, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType decodableProductId) { + EndpointAttributes * _endpointAttributes = static_cast(context); + _endpointAttributes->mProductId = decodableProductId; + EndpointListLoader::GetInstance()->Complete(); + }, + [](void * context, CHIP_ERROR err) { + EndpointAttributes * _endpointAttributes = static_cast(context); + ChipLogError(AppServer, + "EndpointListLoader ReadAttribute(ProductID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + _endpointAttributes->mId, err.Format()); + EndpointListLoader::GetInstance()->Complete(); + }); +} + +CHIP_ERROR EndpointListLoader::ReadDeviceTypeList(EndpointAttributes * endpointAttributes) +{ + MediaClusterBase cluster(*mExchangeMgr, *mSessionHandle, endpointAttributes->mId); + + return cluster.template ReadAttribute( + endpointAttributes, + [](void * context, + chip::app::Clusters::Descriptor::Attributes::DeviceTypeList::TypeInfo::DecodableArgType decodableDeviceTypeList) { + EndpointAttributes * _endpointAttributes = static_cast(context); + auto iter = decodableDeviceTypeList.begin(); + while (iter.Next()) + { + auto & deviceType = iter.GetValue(); + _endpointAttributes->mDeviceTypeList.push_back(deviceType); + } + EndpointListLoader::GetInstance()->Complete(); + }, + [](void * context, CHIP_ERROR err) { + EndpointAttributes * _endpointAttributes = static_cast(context); + ChipLogError(AppServer, + "EndpointListLoader ReadAttribute(DeviceTypeList) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + _endpointAttributes->mId, err.Format()); + EndpointListLoader::GetInstance()->Complete(); + }); +} + +CHIP_ERROR EndpointListLoader::ReadServerList(std::vector * endpointServerList, chip::EndpointId endpointId) +{ + MediaClusterBase cluster(*mExchangeMgr, *mSessionHandle, endpointId); + + return cluster.template ReadAttribute( + endpointServerList, + [](void * context, + chip::app::Clusters::Descriptor::Attributes::ServerList::TypeInfo::DecodableArgType decodableServerList) { + std::vector * _endpointServerList = static_cast *>(context); + auto iter = decodableServerList.begin(); + while (iter.Next()) + { + auto & clusterId = iter.GetValue(); + _endpointServerList->push_back(clusterId); + } + EndpointListLoader::GetInstance()->Complete(); + }, + [](void * context, CHIP_ERROR err) { + ChipLogError(AppServer, "EndpointListLoader ReadAttribute(ServerList) failed. Err: %" CHIP_ERROR_FORMAT, err.Format()); + EndpointListLoader::GetInstance()->Complete(); + }); +} + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.h b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.h new file mode 100644 index 00000000000000..4905e281e94fd6 --- /dev/null +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.h @@ -0,0 +1,119 @@ +/* + * + * 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. + */ + +#pragma once + +#include "core/Endpoint.h" +#include "core/Types.h" + +#include +#include +#include + +namespace matter { +namespace casting { +namespace support { + +/** + * @brief EndpointListLoader builds Endpoints corresponding to the CastingPlayer::GetTargetCastingPlayer by reading Bindings and + * fetching Endpoint attributes (like VendorID, ProductID, DeviceTypeList, ServerList, etc). It then loads all of these Endpoints + * into the CastingPlayer::GetTargetCastingPlayer. Finally, it calls mOnCompleted() on the CastingPlayer::GetTargetCastingPlayer to + * report the status of the Connection process to the client. + */ +class EndpointListLoader +{ +public: + static EndpointListLoader * GetInstance(); + + /** + * @brief Initializes EndpointListLoader with session info of the session the CastingApp just connected on. + */ + void Initialize(chip::Messaging::ExchangeManager * exchangeMgr, const chip::SessionHandle * sessionHandle); + + /** + * @brief Reads Bindings and fetches attributes (like VendorID, ProductID, DeviceTypeList, ServerList, etc) for each Endpoint + * discovered in them. + */ + CHIP_ERROR Load(); + +private: + EndpointListLoader(); + static EndpointListLoader * _endpointListLoader; + + /** + * @brief When all DesiredAttributes reads are completed, this function creates the list of Endpoints and loads/registers them + * on the CastingPlayer::GetTargetCastingPlayer + */ + void Complete(); + + /** + * @brief Fetches the VendorId for the endpoint with passed in endpointAttributes->mID + */ + CHIP_ERROR ReadVendorId(core::EndpointAttributes * endpointAttributes); + + /** + * @brief Fetches the ProductId for the endpoint with passed in endpointAttributes->mID + */ + CHIP_ERROR ReadProductId(core::EndpointAttributes * endpointAttributes); + + /** + * @brief Fetches the DeviceTypeList for the endpoint with passed in endpointAttributes->mID + */ + CHIP_ERROR ReadDeviceTypeList(core::EndpointAttributes * endpointAttributes); + + /** + * @brief Fetches the ServerList for the endpoint with passed in endpointAttributes->mID + */ + CHIP_ERROR ReadServerList(std::vector * endpointServerList, chip::EndpointId endpointId); + + chip::Messaging::ExchangeManager * mExchangeMgr = nullptr; + const chip::SessionHandle * mSessionHandle = nullptr; + unsigned long mNewEndpointsToLoad = 0; + unsigned long mPendingAttributeReads = 0; + core::EndpointAttributes * mEndpointAttributesList = nullptr; + std::vector * mEndpointServerLists = nullptr; +}; + +/** + * @brief Enumerated list of all Endpoint Attributes that need to be fetched + */ +enum DesiredAttributes +{ + kVendorId = 0, + kProductId, + kDeviceTypeList, + kServerList, + + kTotalDesiredAttributes +}; + +/** + * @brief MediaClusterBase is used by the EndpointListLoader to invoke controller/CHIPCluster.h#ReadAttribute() API calls + */ +class MediaClusterBase : public chip::Controller::ClusterBase +{ +public: + MediaClusterBase(chip::Messaging::ExchangeManager & exchangeManager, const chip::SessionHandle & session, + chip::EndpointId endpoint) : + ClusterBase(exchangeManager, session, endpoint) + {} +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py b/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py index 762f960364cc2d..26463550e6a28a 100644 --- a/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py +++ b/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py @@ -56,7 +56,7 @@ def toEnumEntryName(enumEntry, enumName): def toProtobufType(zapType: str) -> str: """ Convert zap type to protobuf type """ u32Types = [ - "uint32", "enum8", "enum16", "enum32", "bitmap8", + "uint32", "enum8", "enum16", "bitmap8", "bitmap16", "bitmap32", "cluster_id", "attrib_id", "event_id", "command_id", "endpoint_no", "group_id", "devtype_id", "fabric_idx", "vendor_id", "status_code", diff --git a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py index 5fa6f06482439c..2a909bbbfb4d23 100644 --- a/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/data_model_xml/handlers/handlers.py @@ -245,7 +245,7 @@ def EndProcessing(self): if not self._enum.entries: return - # try to find the best enum size that fits out of enum8, enum32 and enum32 + # try to find the best enum size that fits out of enum8 and enum16 # TODO: this is a pure heuristic. XML containing this would be better. # https://github.com/csa-data-model/projects/issues/345 acceptable = {8, 16} diff --git a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py index 98ac58a3a4ce37..caceed7866e9d4 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/java/__init__.py @@ -126,8 +126,6 @@ def FieldToGlobalName(field: Field, context: TypeLookupContext) -> Optional[str] # non-named enums 'enum8': 'uint8_t', 'enum16': 'uint16_t', - 'enum32': 'uint32_t', - 'enum64': 'uint64_t', } @@ -320,8 +318,6 @@ def _IsUsingGlobalCallback(field: Field, context: TypeLookupContext): "int64u", "enum8", "enum16", - "enum32", - "enum64", "bitmap8", "bitmap16", "bitmap32", diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja index c9802959d42d02..8b9a1a2a1193f7 100644 --- a/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/MatterClusters.jinja @@ -185,33 +185,19 @@ class {{cluster.name}}Cluster(private val controller: MatterController, private {% for command in cluster.commands | sort(attribute='code') -%} {%- set callbackName = command | javaCommandCallbackName() %} suspend fun {{command.name | lowfirst_except_acronym}}( -{%- if command.input_param -%} -{%- for field in (cluster.structs | named(command.input_param)).fields -%} - {{field.name | lowfirst_except_acronym}}: {{encode_value(cluster, field | asEncodable(typeLookup), 0)}} -{%- if not loop.last -%}, {% endif %} -{%- endfor -%} -{%- if command.is_timed_invoke -%} - , timedInvokeTimeoutMs: Int) -{%- else -%} - , timedInvokeTimeoutMs: Int? = null) -{%- endif -%} -{%- else -%} -{%- if command.is_timed_invoke -%} - timedInvokeTimeoutMs: Int) -{%- else -%} - timedInvokeTimeoutMs: Int? = null) -{%- endif -%} -{%- endif -%} + {%- if command.input_param -%} + {%- for field in (cluster.structs | named(command.input_param)).fields -%} + {{field.name | lowfirst_except_acronym}}: {{encode_value(cluster, field | asEncodable(typeLookup), 0)}} + , + {%- endfor -%} + {%- endif -%} + timedInvokeTimeout: Duration {%- if not command.is_timed_invoke -%}? = null {%- endif -%} + ) {%- if command | hasResponse -%} : {{callbackName}} { {%- else %} { {%- endif %} val commandId: UInt = {{command.code}}u -{% if command.is_timed_invoke -%} - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) -{%- else -%} - val timeoutMs: Duration = timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO -{%- endif %} val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -229,7 +215,7 @@ class {{cluster.name}}Cluster(private val controller: MatterController, private InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -271,7 +257,6 @@ class {{cluster.name}}Cluster(private val controller: MatterController, private {% endfor %} else { - // Skip unknown tags tlvReader.skipElement() } } @@ -351,18 +336,9 @@ class {{cluster.name}}Cluster(private val controller: MatterController, private {%- set attribute_id = "ATTRIBUTE_ID_" + attribute.definition.name | upper %} suspend fun write{{ attribute.definition.name | upfirst }}Attribute( value: {{ encode_value_without_optional_nullable(cluster, encodable, 0) }}, -{%- if attribute.requires_timed_write -%} - timedWriteTimeoutMs: Int -{%- else %} - timedWriteTimeoutMs: Int? = null -{%- endif %} + timedWriteTimeout: Duration {%- if not attribute.requires_timed_write -%}? = null {%- endif -%} ) { val ATTRIBUTE_ID: UInt = {{attribute.definition.code}}u -{% if attribute.requires_timed_write -%} - val timeoutMs: Duration = Duration.ofMillis(timedWriteTimeoutMs.toLong()) -{%- else -%} - val timeoutMs: Duration = timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO -{%- endif %} val tlvWriter = TlvWriter() {%- set encodable = attribute.definition | asEncodable(typeLookup) %} @@ -387,7 +363,7 @@ class {{cluster.name}}Cluster(private val controller: MatterController, private tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py index 680c865e5d73e2..b069319d7f586c 100644 --- a/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/kotlin/__init__.py @@ -126,8 +126,6 @@ def FieldToGlobalName(field: Field, context: TypeLookupContext) -> Optional[str] # non-named enums 'enum8': 'uint8_t', 'enum16': 'uint16_t', - 'enum32': 'uint32_t', - 'enum64': 'uint64_t', } diff --git a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py index b5243e4f9c7162..5f80f1e5ddf998 100644 --- a/scripts/py_matter_idl/matter_idl/generators/type_definitions.py +++ b/scripts/py_matter_idl/matter_idl/generators/type_definitions.py @@ -164,13 +164,10 @@ def is_struct(self) -> bool: # Data types, held by ZAP in chip-types.xml and generally by the spec. __CHIP_SIZED_TYPES__ = { "bitmap16": BasicInteger(idl_name="bitmap16", byte_count=2, is_signed=False), - "bitmap24": BasicInteger(idl_name="bitmap24", byte_count=3, is_signed=False), "bitmap32": BasicInteger(idl_name="bitmap32", byte_count=4, is_signed=False), "bitmap64": BasicInteger(idl_name="bitmap64", byte_count=8, is_signed=False), "bitmap8": BasicInteger(idl_name="bitmap8", byte_count=1, is_signed=False), "enum16": BasicInteger(idl_name="enum16", byte_count=2, is_signed=False), - "enum24": BasicInteger(idl_name="enum24", byte_count=3, is_signed=False), - "enum32": BasicInteger(idl_name="enum32", byte_count=4, is_signed=False), "enum8": BasicInteger(idl_name="enum8", byte_count=1, is_signed=False), "int16s": BasicInteger(idl_name="int16s", byte_count=2, is_signed=True), "int16u": BasicInteger(idl_name="int16u", byte_count=2, is_signed=False), @@ -336,7 +333,7 @@ def is_enum_type(self, name: str): Handles both standard names (like enum8) as well as enumerations defined within the current lookup context. """ - if name.lower() in ["enum8", "enum16", "enum24", "enum32"]: + if name.lower() in ["enum8", "enum16"]: return True return any(map(lambda e: e.name == name, self.all_enums)) @@ -348,7 +345,7 @@ def is_struct_type(self, name: str): def is_untyped_bitmap_type(self, name: str): """Determine if the given type is a untyped bitmap (just an interger size).""" - return name.lower() in {"bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64"} + return name.lower() in {"bitmap8", "bitmap16", "bitmap32", "bitmap64"} def is_bitmap_type(self, name: str): """ @@ -386,9 +383,9 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic return BasicString(idl_name=lowercase_name, is_binary=False, max_length=data_type.max_length) elif lowercase_name in ['octet_string', 'long_octet_string']: return BasicString(idl_name=lowercase_name, is_binary=True, max_length=data_type.max_length) - elif lowercase_name in ['enum8', 'enum16', 'enum24', 'enum32']: + elif lowercase_name in ['enum8', 'enum16']: return IdlEnumType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name]) - elif lowercase_name in ['bitmap8', 'bitmap16', 'bitmap24', 'bitmap32', 'bitmap64']: + elif lowercase_name in ['bitmap8', 'bitmap16', 'bitmap32', 'bitmap64']: return IdlBitmapType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name]) int_type = __CHIP_SIZED_TYPES__.get(lowercase_name, None) diff --git a/scripts/py_matter_idl/matter_idl/test_supported_types.py b/scripts/py_matter_idl/matter_idl/test_supported_types.py index 62f7d4c59956c5..f6eec7cf844342 100755 --- a/scripts/py_matter_idl/matter_idl/test_supported_types.py +++ b/scripts/py_matter_idl/matter_idl/test_supported_types.py @@ -72,9 +72,9 @@ def testAllTypesSupported(self): # handled as a non-integer type "boolean", "single", "double", # handled as specific bitmaps - "bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64", - # handled as specific enums - "enum8", "enum16", "enum24", "enum32", + "bitmap8", "bitmap16", "bitmap32", "bitmap64", + # handled as specific enums. Note that spec defines enumerations only for 8 and 16 + "enum8", "enum16", # TODO: these may be bugs to fix "unknown" diff --git a/scripts/setup/constraints.txt b/scripts/setup/constraints.txt index b0e9aed4ae60e7..ad80df20c4ab24 100644 --- a/scripts/setup/constraints.txt +++ b/scripts/setup/constraints.txt @@ -163,7 +163,7 @@ portpicker==1.5.2 # via # -r requirements.all.txt # mobly -prompt-toolkit==3.0.38 +prompt-toolkit==3.0.43 # via ipython protobuf==4.24.4 # via diff --git a/src/app/tests/suites/README.md b/src/app/tests/suites/README.md index de391a64cebfc0..39236e3b1517d6 100644 --- a/src/app/tests/suites/README.md +++ b/src/app/tests/suites/README.md @@ -314,7 +314,6 @@ src/app/tests/suites/examples/gen_readme_example.sh | boolean | 1 | BOOLEAN | 0x10 | Boolean | uint8_t | | bitmap8 | 1 | BITMAP8 | 0x18 | 8-bit bitmap | uint8_t | | bitmap16 | 2 | BITMAP16 | 0x19 | 16-bit bitmap | uint16_t | -| bitmap24 | 3 | BITMAP24 | 0x1A | 24-bit bitmap | uint32_t | | bitmap32 | 4 | BITMAP32 | 0x1B | 32-bit bitmap | uint32_t | | bitmap64 | 8 | BITMAP64 | 0x1F | 64-bit bitmap | uint8_t \* | | int8u | 1 | INT8U | 0x20 | Unsigned 8-bit integer | uint8_t | diff --git a/src/app/tests/suites/TestIcdManagementCluster.yaml b/src/app/tests/suites/TestIcdManagementCluster.yaml index 4f4cbf00a4dd27..eb611f27db24b9 100644 --- a/src/app/tests/suites/TestIcdManagementCluster.yaml +++ b/src/app/tests/suites/TestIcdManagementCluster.yaml @@ -69,6 +69,23 @@ tests: minValue: 0x0 maxValue: 0xFFFFFFFF + - label: "Read UserActiveModeTriggerHint" + command: "readAttribute" + attribute: "UserActiveModeTriggerHint" + response: + constraints: + type: bitmap32 + value: 0x110D + + - label: "Read UserActiveModeTriggerInstruction" + command: "readAttribute" + attribute: "UserActiveModeTriggerInstruction" + response: + constraints: + type: char_string + minLength: 1 + maxLength: 128 + - label: "Read ClientsSupportedPerFabric" command: "readAttribute" attribute: "ClientsSupportedPerFabric" diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index a9466ff6d79ffc..ffbf74cb78804c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -27,7 +27,6 @@ limitations under the License. - diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 1bab6d709d05df..54c13da92ca35b 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -217,9 +217,7 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric", - "UserActiveModeTriggerHint", - "UserActiveModeTriggerInstruction" + "ClientsSupportedPerFabric" ], "Operational Credentials": [ "SupportedFabrics", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 257222de56ad40..1e1e06e7b15c35 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -215,9 +215,7 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric", - "UserActiveModeTriggerHint", - "UserActiveModeTriggerInstruction" + "ClientsSupportedPerFabric" ], "Operational Credentials": [ "SupportedFabrics", diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index 82286e32619f31..1b286a400bccdb 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -725,6 +725,15 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio switch (report.stageCompleted) { case CommissioningStage::kReadCommissioningInfo: + break; + case CommissioningStage::kReadCommissioningInfo2: { + if (!report.Is()) + { + ChipLogError(Controller, + "[BUG] Should read commissioning info, but report is not ReadCommissioningInfo. THIS IS A BUG."); + } + ReadCommissioningInfo commissioningInfo = report.Get(); + mDeviceCommissioningInfo = report.Get(); if (!mParams.GetFailsafeTimerSeconds().HasValue() && mDeviceCommissioningInfo.general.recommendedFailsafe > 0) { @@ -736,22 +745,12 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio .SetLocationCapability(mDeviceCommissioningInfo.general.locationCapability); // Don't send DST unless the device says it needs it mNeedsDST = false; - break; - case CommissioningStage::kReadCommissioningInfo2: { - - if (!report.Is()) - { - ChipLogError( - Controller, - "[BUG] Should read commissioning info (part 2), but report is not ReadCommissioningInfo2. THIS IS A BUG."); - } - ReadCommissioningInfo2 commissioningInfo = report.Get(); mParams.SetSupportsConcurrentConnection(commissioningInfo.supportsConcurrentConnection); if (mParams.GetCheckForMatchingFabric()) { - chip::NodeId nodeId = commissioningInfo.nodeId; + chip::NodeId nodeId = commissioningInfo.remoteNodeId; if (nodeId != kUndefinedNodeId) { mParams.SetRemoteNodeId(nodeId); @@ -760,7 +759,7 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio if (mParams.GetICDRegistrationStrategy() != ICDRegistrationStrategy::kIgnore) { - if (commissioningInfo.isIcd && commissioningInfo.checkInProtocolSupport) + if (commissioningInfo.isLIT && commissioningInfo.checkInProtocolSupport) { mNeedIcdRegistration = true; ChipLogDetail(Controller, "AutoCommissioner: ICD supports the check-in protocol."); diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 49591966bd247f..e69546161e661e 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1922,25 +1922,50 @@ void DeviceCommissioner::OnDeviceConnectionRetryFn(void * context, const ScopedN // ClusterStateCache::Callback impl void DeviceCommissioner::OnDone(app::ReadClient *) { + mReadClient = nullptr; switch (mCommissioningStage) { case CommissioningStage::kReadCommissioningInfo: - ParseCommissioningInfo(); + // Silently complete the stage, data will be saved in attribute cache and + // will be parsed after all ReadCommissioningInfo stages are completed. + CommissioningStageComplete(CHIP_NO_ERROR); break; case CommissioningStage::kReadCommissioningInfo2: - ParseCommissioningInfo2(); + // Note: Only parse commissioning info in the last ReadCommissioningInfo stage. + ParseCommissioningInfo(); break; default: - // We're not trying to read anything here, just exit break; } } void DeviceCommissioner::ParseCommissioningInfo() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ReadCommissioningInfo info; + + err = ParseCommissioningInfo1(info); + if (err == CHIP_NO_ERROR) + { + err = ParseCommissioningInfo2(info); + } + + mAttributeCache = nullptr; + + if (mPairingDelegate != nullptr) + { + mPairingDelegate->OnReadCommissioningInfo(info); + } + + CommissioningDelegate::CommissioningReport report; + report.Set(info); + CommissioningStageComplete(err, report); +} + +CHIP_ERROR DeviceCommissioner::ParseCommissioningInfo1(ReadCommissioningInfo & info) { CHIP_ERROR err; CHIP_ERROR return_err = CHIP_NO_ERROR; - ReadCommissioningInfo info; // Try to parse as much as we can here before returning, even if attributes // are missing or cannot be decoded. @@ -2080,17 +2105,8 @@ void DeviceCommissioner::ParseCommissioningInfo() { ChipLogError(Controller, "Error parsing commissioning information"); } - mAttributeCache = nullptr; - mReadClient = nullptr; - - if (mPairingDelegate != nullptr) - { - mPairingDelegate->OnReadCommissioningInfo(info); - } - CommissioningDelegate::CommissioningReport report; - report.Set(info); - CommissioningStageComplete(return_err, report); + return return_err; } void DeviceCommissioner::ParseTimeSyncInfo(ReadCommissioningInfo & info) @@ -2153,34 +2169,31 @@ void DeviceCommissioner::ParseTimeSyncInfo(ReadCommissioningInfo & info) } } -void DeviceCommissioner::ParseCommissioningInfo2() +CHIP_ERROR DeviceCommissioner::ParseCommissioningInfo2(ReadCommissioningInfo & info) { - ReadCommissioningInfo2 info; - CHIP_ERROR return_err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; using namespace chip::app::Clusters::GeneralCommissioning::Attributes; - CHIP_ERROR err = - mAttributeCache->Get(kRootEndpointId, info.supportsConcurrentConnection); - if (err != CHIP_NO_ERROR) + + if (mAttributeCache->Get(kRootEndpointId, info.supportsConcurrentConnection) != + CHIP_NO_ERROR) { // May not be present so don't return the error code, non fatal, default concurrent ChipLogError(Controller, "Failed to read SupportsConcurrentConnection: %" CHIP_ERROR_FORMAT, err.Format()); info.supportsConcurrentConnection = true; } - return_err = ParseFabrics(info); + err = ParseFabrics(info); - if (return_err == CHIP_NO_ERROR) + if (err == CHIP_NO_ERROR) { - return_err = ParseICDInfo(info); + err = ParseICDInfo(info); } - CommissioningDelegate::CommissioningReport report; - report.Set(info); - CommissioningStageComplete(return_err, report); + return err; } -CHIP_ERROR DeviceCommissioner::ParseFabrics(ReadCommissioningInfo2 & info) +CHIP_ERROR DeviceCommissioner::ParseFabrics(ReadCommissioningInfo & info) { CHIP_ERROR err; CHIP_ERROR return_err = CHIP_NO_ERROR; @@ -2230,7 +2243,7 @@ CHIP_ERROR DeviceCommissioner::ParseFabrics(ReadCommissioningInfo2 & info) else if (commissionerRootPublicKey.Matches(deviceRootPublicKey)) { ChipLogProgress(Controller, "DeviceCommissioner::OnDone - fabric root keys match"); - info.nodeId = fabricDescriptor.nodeID; + info.remoteNodeId = fabricDescriptor.nodeID; } } } @@ -2244,13 +2257,13 @@ CHIP_ERROR DeviceCommissioner::ParseFabrics(ReadCommissioningInfo2 & info) if (mPairingDelegate != nullptr) { - mPairingDelegate->OnFabricCheck(info.nodeId); + mPairingDelegate->OnFabricCheck(info.remoteNodeId); } return return_err; } -CHIP_ERROR DeviceCommissioner::ParseICDInfo(ReadCommissioningInfo2 & info) +CHIP_ERROR DeviceCommissioner::ParseICDInfo(ReadCommissioningInfo & info) { CHIP_ERROR err; IcdManagement::Attributes::FeatureMap::TypeInfo::DecodableType featureMap; @@ -2258,14 +2271,14 @@ CHIP_ERROR DeviceCommissioner::ParseICDInfo(ReadCommissioningInfo2 & info) err = mAttributeCache->Get(kRootEndpointId, featureMap); if (err == CHIP_NO_ERROR) { - info.isIcd = true; + info.isLIT = true; info.checkInProtocolSupport = !!(featureMap & to_underlying(IcdManagement::Feature::kCheckInProtocolSupport)); } else if (err == CHIP_ERROR_KEY_NOT_FOUND) { // This key is optional so not an error err = CHIP_NO_ERROR; - info.isIcd = false; + info.isLIT = false; err = CHIP_NO_ERROR; } else if (err == CHIP_ERROR_IM_STATUS_CODE_RECEIVED) @@ -2277,7 +2290,7 @@ CHIP_ERROR DeviceCommissioner::ParseICDInfo(ReadCommissioningInfo2 & info) { if (statusIB.mStatus == Protocols::InteractionModel::Status::UnsupportedCluster) { - info.isIcd = false; + info.isLIT = false; } else { @@ -2458,7 +2471,8 @@ void DeviceCommissioner::SendCommissioningReadRequest(DeviceProxy * proxy, Optio readParams.mpAttributePathParamsList = readPaths; readParams.mAttributePathParamsListSize = readPathsSize; - auto attributeCache = Platform::MakeUnique(*this); + // Take ownership of the attribute cache, so it can be released when SendRequest fails. + auto attributeCache = std::move(mAttributeCache); auto readClient = chip::Platform::MakeUnique( engine, proxy->GetExchangeManager(), attributeCache->GetBufferedCallback(), app::ReadClient::InteractionType::Read); CHIP_ERROR err = readClient->SendRequest(readParams); @@ -2509,6 +2523,13 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio break; case CommissioningStage::kReadCommissioningInfo: { ChipLogProgress(Controller, "Sending read request for commissioning information"); + // Allocate a new ClusterStateCache when starting reading the first batch of attributes. + // The cache will be released in: + // - SendCommissioningReadRequest when failing to send a read request. + // - ParseCommissioningInfo when the last ReadCommissioningInfo stage is completed. + // Currently, we have two ReadCommissioningInfo* stages. + mAttributeCache = Platform::MakeUnique(*this); + // NOTE: this array cannot have more than 9 entries, since the spec mandates that server only needs to support 9 // See R1.1, 2.11.2 Interaction Model Limits app::AttributePathParams readPaths[9]; diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index e013b6a9da1590..2007d8424b2f88 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -952,12 +952,14 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, void SendCommissioningReadRequest(DeviceProxy * proxy, Optional timeout, app::AttributePathParams * readPaths, size_t readPathsSize); #if CHIP_CONFIG_ENABLE_READ_CLIENT - // Parsers for the two different read clients void ParseCommissioningInfo(); - void ParseCommissioningInfo2(); + // Parsing attributes read in kReadCommissioningInfo stage. + CHIP_ERROR ParseCommissioningInfo1(ReadCommissioningInfo & info); + // Parsing attributes read in kReadCommissioningInfo2 stage. + CHIP_ERROR ParseCommissioningInfo2(ReadCommissioningInfo & info); // Called by ParseCommissioningInfo2 - CHIP_ERROR ParseFabrics(ReadCommissioningInfo2 & info); - CHIP_ERROR ParseICDInfo(ReadCommissioningInfo2 & info); + CHIP_ERROR ParseFabrics(ReadCommissioningInfo & info); + CHIP_ERROR ParseICDInfo(ReadCommissioningInfo & info); // Called by ParseCommissioningInfo void ParseTimeSyncInfo(ReadCommissioningInfo & info); #endif // CHIP_CONFIG_ENABLE_READ_CLIENT diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 9a7b4ebe0970ea..67fe2e69878dfb 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -684,18 +684,14 @@ struct ReadCommissioningInfo NetworkClusters network; BasicClusterInfo basic; GeneralCommissioningInfo general; - bool requiresUTC = false; - bool requiresTimeZone = false; - bool requiresDefaultNTP = false; - bool requiresTrustedTimeSource = false; - uint8_t maxTimeZoneSize = 1; - uint8_t maxDSTSize = 1; -}; - -struct ReadCommissioningInfo2 -{ - NodeId nodeId = kUndefinedNodeId; - bool isIcd = false; + bool requiresUTC = false; + bool requiresTimeZone = false; + bool requiresDefaultNTP = false; + bool requiresTrustedTimeSource = false; + uint8_t maxTimeZoneSize = 1; + uint8_t maxDSTSize = 1; + NodeId remoteNodeId = kUndefinedNodeId; + bool isLIT = false; bool checkInProtocolSupport = false; bool supportsConcurrentConnection = true; }; @@ -730,8 +726,8 @@ class CommissioningDelegate public: virtual ~CommissioningDelegate(){}; /* CommissioningReport is returned after each commissioning step is completed. The reports for each step are: - * kReadCommissioningInfo: ReadCommissioningInfo - * kReadCommissioningInfo2: ReadCommissioningInfo2 + * kReadCommissioningInfo: Reported together with ReadCommissioningInfo2 + * kReadCommissioningInfo2: ReadCommissioningInfo * kArmFailsafe: CommissioningErrorInfo if there is an error * kConfigRegulatory: CommissioningErrorInfo if there is an error * kConfigureUTCTime: None @@ -755,9 +751,9 @@ class CommissioningDelegate * kSendComplete: CommissioningErrorInfo if there is an error * kCleanup: none */ - struct CommissioningReport : Variant + struct CommissioningReport + : Variant { CommissioningReport() : stageCompleted(CommissioningStage::kError) {} CommissioningStage stageCompleted; diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/AccessControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/AccessControlCluster.kt index fc11bce628093a..392cc9c9237e64 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/AccessControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/AccessControlCluster.kt @@ -88,11 +88,9 @@ class AccessControlCluster( suspend fun writeAclAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -111,7 +109,7 @@ class AccessControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -179,11 +177,9 @@ class AccessControlCluster( suspend fun writeExtensionAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -202,7 +198,7 @@ class AccessControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/AccountLoginCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/AccountLoginCluster.kt index f0116402eca67a..57c2a50d485a24 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/AccountLoginCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/AccountLoginCluster.kt @@ -49,10 +49,9 @@ class AccountLoginCluster( suspend fun getSetupPIN( tempAccountIdentifier: String, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ): GetSetupPINResponse { val commandId: UInt = 0u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -65,7 +64,7 @@ class AccountLoginCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -82,7 +81,6 @@ class AccountLoginCluster( if (tag == ContextSpecificTag(TAG_SETUP_P_I_N)) { setupPIN_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -100,10 +98,9 @@ class AccountLoginCluster( tempAccountIdentifier: String, setupPIN: String, node: ULong?, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 2u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -122,16 +119,15 @@ class AccountLoginCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun logout(node: ULong?, timedInvokeTimeoutMs: Int) { + suspend fun logout(node: ULong?, timedInvokeTimeout: Duration) { val commandId: UInt = 3u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -144,7 +140,7 @@ class AccountLoginCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ActionsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ActionsCluster.kt index 95bd3e795544a3..3dc76ced6e15de 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ActionsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ActionsCluster.kt @@ -46,10 +46,12 @@ class ActionsCluster(private val controller: MatterController, private val endpo class AttributeListAttribute(val value: List) - suspend fun instantAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun instantAction( + actionID: UShort, + invokeID: UInt?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -65,7 +67,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -76,11 +78,9 @@ class ActionsCluster(private val controller: MatterController, private val endpo actionID: UShort, invokeID: UInt?, transitionTime: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -99,17 +99,15 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun startAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun startAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -125,7 +123,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -136,11 +134,9 @@ class ActionsCluster(private val controller: MatterController, private val endpo actionID: UShort, invokeID: UInt?, duration: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -159,17 +155,15 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun stopAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun stopAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -185,17 +179,15 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun pauseAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun pauseAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -211,7 +203,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -222,11 +214,9 @@ class ActionsCluster(private val controller: MatterController, private val endpo actionID: UShort, invokeID: UInt?, duration: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -245,17 +235,19 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun resumeAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun resumeAction( + actionID: UShort, + invokeID: UInt?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -271,17 +263,19 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun enableAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun enableAction( + actionID: UShort, + invokeID: UInt?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -297,7 +291,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -308,11 +302,9 @@ class ActionsCluster(private val controller: MatterController, private val endpo actionID: UShort, invokeID: UInt?, duration: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -331,17 +323,19 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun disableAction(actionID: UShort, invokeID: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun disableAction( + actionID: UShort, + invokeID: UInt?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 10u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -357,7 +351,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -368,11 +362,9 @@ class ActionsCluster(private val controller: MatterController, private val endpo actionID: UShort, invokeID: UInt?, duration: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 11u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -391,7 +383,7 @@ class ActionsCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ActivatedCarbonFilterMonitoringCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ActivatedCarbonFilterMonitoringCluster.kt index a975d6d3c0672b..4e880bb6392c8d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ActivatedCarbonFilterMonitoringCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ActivatedCarbonFilterMonitoringCluster.kt @@ -53,10 +53,8 @@ class ActivatedCarbonFilterMonitoringCluster( class AttributeListAttribute(val value: List) - suspend fun resetCondition(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetCondition(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -66,7 +64,7 @@ class ActivatedCarbonFilterMonitoringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -253,10 +251,8 @@ class ActivatedCarbonFilterMonitoringCluster( return LastChangedTimeAttribute(decodedValue) } - suspend fun writeLastChangedTimeAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLastChangedTimeAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -271,7 +267,7 @@ class ActivatedCarbonFilterMonitoringCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/AdministratorCommissioningCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/AdministratorCommissioningCluster.kt index 0044a16f906070..ac9877a8c0ff60 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/AdministratorCommissioningCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/AdministratorCommissioningCluster.kt @@ -55,10 +55,9 @@ class AdministratorCommissioningCluster( discriminator: UShort, iterations: UInt, salt: ByteArray, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 0u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -83,7 +82,7 @@ class AdministratorCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -92,10 +91,9 @@ class AdministratorCommissioningCluster( suspend fun openBasicCommissioningWindow( commissioningTimeout: UShort, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 1u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -108,16 +106,15 @@ class AdministratorCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun revokeCommissioning(timedInvokeTimeoutMs: Int) { + suspend fun revokeCommissioning(timedInvokeTimeout: Duration) { val commandId: UInt = 2u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -127,7 +124,7 @@ class AdministratorCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ApplicationLauncherCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ApplicationLauncherCluster.kt index 73314cd4a1dd90..250fd3b0412dbe 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ApplicationLauncherCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ApplicationLauncherCluster.kt @@ -54,11 +54,9 @@ class ApplicationLauncherCluster( suspend fun launchApp( application: ApplicationLauncherClusterApplicationStruct?, data: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): LauncherResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class ApplicationLauncherCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -108,7 +106,6 @@ class ApplicationLauncherCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -124,11 +121,9 @@ class ApplicationLauncherCluster( suspend fun stopApp( application: ApplicationLauncherClusterApplicationStruct?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): LauncherResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -141,7 +136,7 @@ class ApplicationLauncherCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -175,7 +170,6 @@ class ApplicationLauncherCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -191,11 +185,9 @@ class ApplicationLauncherCluster( suspend fun hideApp( application: ApplicationLauncherClusterApplicationStruct?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): LauncherResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -208,7 +200,7 @@ class ApplicationLauncherCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -242,7 +234,6 @@ class ApplicationLauncherCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/AudioOutputCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/AudioOutputCluster.kt index ab200b7240d730..687f31b086db7c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/AudioOutputCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/AudioOutputCluster.kt @@ -44,10 +44,8 @@ class AudioOutputCluster(private val controller: MatterController, private val e class AttributeListAttribute(val value: List) - suspend fun selectOutput(index: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun selectOutput(index: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,17 +58,15 @@ class AudioOutputCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun renameOutput(index: UByte, name: String, timedInvokeTimeoutMs: Int? = null) { + suspend fun renameOutput(index: UByte, name: String, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -86,7 +82,7 @@ class AudioOutputCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BallastConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BallastConfigurationCluster.kt index 439e459f36a99f..cf2a3dc53cea40 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BallastConfigurationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BallastConfigurationCluster.kt @@ -183,10 +183,8 @@ class BallastConfigurationCluster( return decodedValue } - suspend fun writeMinLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMinLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -201,7 +199,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -256,10 +254,8 @@ class BallastConfigurationCluster( return decodedValue } - suspend fun writeMaxLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMaxLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 17u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -274,7 +270,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -339,10 +335,11 @@ class BallastConfigurationCluster( return IntrinsicBallastFactorAttribute(decodedValue) } - suspend fun writeIntrinsicBallastFactorAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeIntrinsicBallastFactorAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 20u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -357,7 +354,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -424,11 +421,9 @@ class BallastConfigurationCluster( suspend fun writeBallastFactorAdjustmentAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 21u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -443,7 +438,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -534,10 +529,8 @@ class BallastConfigurationCluster( return decodedValue } - suspend fun writeLampTypeAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampTypeAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 48u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -552,7 +545,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -612,10 +605,8 @@ class BallastConfigurationCluster( return decodedValue } - suspend fun writeLampManufacturerAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampManufacturerAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 49u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -630,7 +621,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -695,10 +686,8 @@ class BallastConfigurationCluster( return LampRatedHoursAttribute(decodedValue) } - suspend fun writeLampRatedHoursAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampRatedHoursAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 50u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -713,7 +702,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -778,10 +767,8 @@ class BallastConfigurationCluster( return LampBurnHoursAttribute(decodedValue) } - suspend fun writeLampBurnHoursAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampBurnHoursAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 51u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -796,7 +783,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -856,10 +843,8 @@ class BallastConfigurationCluster( return decodedValue } - suspend fun writeLampAlarmModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampAlarmModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 52u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -874,7 +859,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -939,10 +924,11 @@ class BallastConfigurationCluster( return LampBurnHoursTripPointAttribute(decodedValue) } - suspend fun writeLampBurnHoursTripPointAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLampBurnHoursTripPointAttribute( + value: UInt, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 53u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -957,7 +943,7 @@ class BallastConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt index e75a765a299b32..f66abbd74093ad 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt @@ -48,10 +48,8 @@ class BarrierControlCluster( class AttributeListAttribute(val value: List) - suspend fun barrierControlGoToPercent(percentOpen: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun barrierControlGoToPercent(percentOpen: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -64,17 +62,15 @@ class BarrierControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun barrierControlStop(timedInvokeTimeoutMs: Int? = null) { + suspend fun barrierControlStop(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -84,7 +80,7 @@ class BarrierControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -220,10 +216,8 @@ class BarrierControlCluster( return decodedValue } - suspend fun writeBarrierOpenEventsAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBarrierOpenEventsAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -238,7 +232,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -298,10 +292,8 @@ class BarrierControlCluster( return decodedValue } - suspend fun writeBarrierCloseEventsAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBarrierCloseEventsAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -316,7 +308,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -378,11 +370,9 @@ class BarrierControlCluster( suspend fun writeBarrierCommandOpenEventsAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 6u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -397,7 +387,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -459,11 +449,9 @@ class BarrierControlCluster( suspend fun writeBarrierCommandCloseEventsAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 7u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -478,7 +466,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -538,10 +526,8 @@ class BarrierControlCluster( return decodedValue } - suspend fun writeBarrierOpenPeriodAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBarrierOpenPeriodAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 8u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -556,7 +542,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -616,10 +602,8 @@ class BarrierControlCluster( return decodedValue } - suspend fun writeBarrierClosePeriodAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBarrierClosePeriodAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 9u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -634,7 +618,7 @@ class BarrierControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt index b7d485e630f295..d11d31f21cb09d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt @@ -51,10 +51,8 @@ class BasicInformationCluster( class AttributeListAttribute(val value: List) - suspend fun mfgSpecificPing(timedInvokeTimeoutMs: Int? = null) { + suspend fun mfgSpecificPing(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -64,7 +62,7 @@ class BasicInformationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -257,10 +255,8 @@ class BasicInformationCluster( return decodedValue } - suspend fun writeNodeLabelAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNodeLabelAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -275,7 +271,7 @@ class BasicInformationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -330,10 +326,8 @@ class BasicInformationCluster( return decodedValue } - suspend fun writeLocationAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLocationAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 6u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -348,7 +342,7 @@ class BasicInformationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -712,10 +706,11 @@ class BasicInformationCluster( return decodedValue } - suspend fun writeLocalConfigDisabledAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLocalConfigDisabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -730,7 +725,7 @@ class BasicInformationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt index 724313e69f9864..0493925c50e51e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt @@ -80,10 +80,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writeActiveTextAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeActiveTextAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -98,7 +96,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -158,10 +156,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writeDescriptionAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDescriptionAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 28u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -176,7 +172,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -236,10 +232,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writeInactiveTextAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInactiveTextAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 46u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -254,7 +248,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -309,10 +303,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writeOutOfServiceAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOutOfServiceAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 81u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -327,7 +319,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -418,10 +410,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writePresentValueAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writePresentValueAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 85u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -436,7 +426,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -496,10 +486,8 @@ class BinaryInputBasicCluster( return decodedValue } - suspend fun writeReliabilityAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeReliabilityAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 103u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -514,7 +502,7 @@ class BinaryInputBasicCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BindingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BindingCluster.kt index 0080e10783e5a0..fe716ecd52499b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BindingCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BindingCluster.kt @@ -83,11 +83,9 @@ class BindingCluster(private val controller: MatterController, private val endpo suspend fun writeBindingAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -106,7 +104,7 @@ class BindingCluster(private val controller: MatterController, private val endpo tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanSensorConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanSensorConfigurationCluster.kt index bee6e840c56b61..ca91dc5f0d62f3 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanSensorConfigurationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanSensorConfigurationCluster.kt @@ -48,10 +48,8 @@ class BooleanSensorConfigurationCluster( class AttributeListAttribute(val value: List) - suspend fun suppressRequest(alarmsToSuppress: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun suppressRequest(alarmsToSuppress: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -64,7 +62,7 @@ class BooleanSensorConfigurationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -107,10 +105,8 @@ class BooleanSensorConfigurationCluster( return decodedValue } - suspend fun writeSensitivityLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSensitivityLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -125,7 +121,7 @@ class BooleanSensorConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -257,10 +253,8 @@ class BooleanSensorConfigurationCluster( return decodedValue } - suspend fun writeAlarmsEnabledAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeAlarmsEnabledAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -275,7 +269,7 @@ class BooleanSensorConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt index e80a25e74f32c8..756682b508f4f4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt @@ -192,10 +192,8 @@ class BridgedDeviceBasicInformationCluster( return decodedValue } - suspend fun writeNodeLabelAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNodeLabelAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -210,7 +208,7 @@ class BridgedDeviceBasicInformationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt index d09b34301d14de..8de317d01f0f94 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt @@ -57,11 +57,9 @@ class ChannelCluster(private val controller: MatterController, private val endpo suspend fun changeChannel( match: String, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeChannelResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -108,7 +106,6 @@ class ChannelCluster(private val controller: MatterController, private val endpo } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -125,11 +122,9 @@ class ChannelCluster(private val controller: MatterController, private val endpo suspend fun changeChannelByNumber( majorNumber: UShort, minorNumber: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -145,17 +140,15 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun skipChannel(count: Short, timedInvokeTimeoutMs: Int? = null) { + suspend fun skipChannel(count: Short, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -168,7 +161,7 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -183,11 +176,9 @@ class ChannelCluster(private val controller: MatterController, private val endpo recordingFlag: UInt?, externalIDList: List?, data: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ProgramGuideResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -230,7 +221,7 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -261,7 +252,6 @@ class ChannelCluster(private val controller: MatterController, private val endpo tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -284,11 +274,9 @@ class ChannelCluster(private val controller: MatterController, private val endpo shouldRecordSeries: Boolean, externalIDList: List, data: ByteArray, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -314,7 +302,7 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -326,11 +314,9 @@ class ChannelCluster(private val controller: MatterController, private val endpo shouldRecordSeries: Boolean, externalIDList: List, data: ByteArray, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -356,7 +342,7 @@ class ChannelCluster(private val controller: MatterController, private val endpo InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt index 2491ef6cf88e71..73001c338d7a6d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt @@ -76,11 +76,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -105,7 +103,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -117,11 +115,9 @@ class ColorControlCluster( rate: UByte, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -143,7 +139,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -156,11 +152,9 @@ class ColorControlCluster( transitionTime: UByte, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -185,7 +179,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -197,11 +191,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -223,7 +215,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -235,11 +227,9 @@ class ColorControlCluster( rate: UByte, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -261,7 +251,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -274,11 +264,9 @@ class ColorControlCluster( transitionTime: UByte, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -303,7 +291,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -316,11 +304,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -345,7 +331,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -358,11 +344,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -387,7 +371,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -399,11 +383,9 @@ class ColorControlCluster( rateY: Short, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -425,7 +407,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -438,11 +420,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -467,7 +447,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -479,11 +459,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 10u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -505,7 +483,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -518,11 +496,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 64u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -547,7 +523,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -559,11 +535,9 @@ class ColorControlCluster( rate: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 65u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -585,7 +559,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -598,11 +572,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 66u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -627,7 +599,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -640,11 +612,9 @@ class ColorControlCluster( transitionTime: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 67u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -669,7 +639,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -684,11 +654,9 @@ class ColorControlCluster( startHue: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 68u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -719,7 +687,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -729,11 +697,9 @@ class ColorControlCluster( suspend fun stopMoveStep( optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 71u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -749,7 +715,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -763,11 +729,9 @@ class ColorControlCluster( colorTemperatureMaximumMireds: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 75u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -801,7 +765,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -816,11 +780,9 @@ class ColorControlCluster( colorTemperatureMaximumMireds: UShort, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 76u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -857,7 +819,7 @@ class ColorControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1214,10 +1176,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeOptionsAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOptionsAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 15u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1232,7 +1192,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2007,10 +1967,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeWhitePointXAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeWhitePointXAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 48u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2025,7 +1983,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2085,10 +2043,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeWhitePointYAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeWhitePointYAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 49u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2103,7 +2059,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2163,10 +2119,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointRXAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointRXAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 50u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2181,7 +2135,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2241,10 +2195,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointRYAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointRYAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 51u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2259,7 +2211,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2324,10 +2276,11 @@ class ColorControlCluster( return ColorPointRIntensityAttribute(decodedValue) } - suspend fun writeColorPointRIntensityAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointRIntensityAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 52u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2342,7 +2295,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2402,10 +2355,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointGXAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointGXAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 54u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2420,7 +2371,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2480,10 +2431,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointGYAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointGYAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 55u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2498,7 +2447,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2563,10 +2512,11 @@ class ColorControlCluster( return ColorPointGIntensityAttribute(decodedValue) } - suspend fun writeColorPointGIntensityAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointGIntensityAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 56u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2581,7 +2531,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2641,10 +2591,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointBXAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointBXAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 58u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2659,7 +2607,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2719,10 +2667,8 @@ class ColorControlCluster( return decodedValue } - suspend fun writeColorPointBYAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointBYAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 59u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2737,7 +2683,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2802,10 +2748,11 @@ class ColorControlCluster( return ColorPointBIntensityAttribute(decodedValue) } - suspend fun writeColorPointBIntensityAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeColorPointBIntensityAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 60u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2820,7 +2767,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3277,11 +3224,9 @@ class ColorControlCluster( suspend fun writeStartUpColorTemperatureMiredsAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16400u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3296,7 +3241,7 @@ class ColorControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt index a855e05d3931e6..645714bdf66e1b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt @@ -50,11 +50,9 @@ class ContentAppObserverCluster( suspend fun contentAppMessage( data: String?, encodingHint: String, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ContentAppMessageResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -70,7 +68,7 @@ class ContentAppObserverCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -111,7 +109,6 @@ class ContentAppObserverCluster( if (tag == ContextSpecificTag(TAG_ENCODING_HINT)) { encodingHint_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentControlCluster.kt index d2385635fa97ed..4fc07614a3915a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentControlCluster.kt @@ -51,10 +51,8 @@ class ContentControlCluster( class AttributeListAttribute(val value: List) - suspend fun updatePIN(oldPIN: String?, newPIN: String, timedInvokeTimeoutMs: Int? = null) { + suspend fun updatePIN(oldPIN: String?, newPIN: String, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -70,17 +68,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun resetPIN(timedInvokeTimeoutMs: Int? = null): ResetPINResponse { + suspend fun resetPIN(timedInvokeTimeout: Duration? = null): ResetPINResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -90,7 +86,7 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -107,7 +103,6 @@ class ContentControlCluster( if (tag == ContextSpecificTag(TAG_P_I_N_CODE)) { PINCode_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -121,10 +116,8 @@ class ContentControlCluster( return ResetPINResponse(PINCode_decoded) } - suspend fun enable(timedInvokeTimeoutMs: Int? = null) { + suspend fun enable(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -134,17 +127,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun disable(timedInvokeTimeoutMs: Int? = null) { + suspend fun disable(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -154,17 +145,19 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun addBonusTime(PINCode: String?, bonusTime: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun addBonusTime( + PINCode: String?, + bonusTime: UInt?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -180,17 +173,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun setScreenDailyTime(screenTime: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun setScreenDailyTime(screenTime: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -203,17 +194,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun blockUnratedContent(timedInvokeTimeoutMs: Int? = null) { + suspend fun blockUnratedContent(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -223,17 +212,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun unblockUnratedContent(timedInvokeTimeoutMs: Int? = null) { + suspend fun unblockUnratedContent(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -243,17 +230,15 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun setOnDemandRatingThreshold(rating: String, timedInvokeTimeoutMs: Int? = null) { + suspend fun setOnDemandRatingThreshold(rating: String, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -266,7 +251,7 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -275,11 +260,9 @@ class ContentControlCluster( suspend fun setScheduledContentRatingThreshold( rating: String, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 10u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -292,7 +275,7 @@ class ContentControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentLauncherCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentLauncherCluster.kt index cc570223e91c41..e3acd6cde3d2f9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentLauncherCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentLauncherCluster.kt @@ -55,11 +55,9 @@ class ContentLauncherCluster( data: String?, playbackPreferences: ContentLauncherClusterPlaybackPreferencesStruct?, useCurrentContext: Boolean?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): LauncherResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -88,7 +86,7 @@ class ContentLauncherCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -122,7 +120,6 @@ class ContentLauncherCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -140,11 +137,9 @@ class ContentLauncherCluster( contentURL: String, displayString: String?, brandingInformation: ContentLauncherClusterBrandingInformationStruct?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): LauncherResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -165,7 +160,7 @@ class ContentLauncherCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -199,7 +194,6 @@ class ContentLauncherCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DemandResponseLoadControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DemandResponseLoadControlCluster.kt index 0e1bd29d154949..0e26876329cb5f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DemandResponseLoadControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DemandResponseLoadControlCluster.kt @@ -60,11 +60,9 @@ class DemandResponseLoadControlCluster( suspend fun registerLoadControlProgramRequest( loadControlProgram: DemandResponseLoadControlClusterLoadControlProgramStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -77,7 +75,7 @@ class DemandResponseLoadControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -86,11 +84,9 @@ class DemandResponseLoadControlCluster( suspend fun unregisterLoadControlProgramRequest( loadControlProgramID: ByteArray, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -103,7 +99,7 @@ class DemandResponseLoadControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -112,11 +108,9 @@ class DemandResponseLoadControlCluster( suspend fun addLoadControlEventRequest( event: DemandResponseLoadControlClusterLoadControlEventStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -129,7 +123,7 @@ class DemandResponseLoadControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -139,11 +133,9 @@ class DemandResponseLoadControlCluster( suspend fun removeLoadControlEventRequest( eventID: ByteArray, cancelControl: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -159,17 +151,15 @@ class DemandResponseLoadControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun clearLoadControlEventsRequest(timedInvokeTimeoutMs: Int? = null) { + suspend fun clearLoadControlEventsRequest(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -179,7 +169,7 @@ class DemandResponseLoadControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -433,10 +423,8 @@ class DemandResponseLoadControlCluster( return decodedValue } - suspend fun writeDefaultRandomStartAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDefaultRandomStartAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 6u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -451,7 +439,7 @@ class DemandResponseLoadControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -506,10 +494,11 @@ class DemandResponseLoadControlCluster( return decodedValue } - suspend fun writeDefaultRandomDurationAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDefaultRandomDurationAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 7u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -524,7 +513,7 @@ class DemandResponseLoadControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt index 3adff50b051520..2456d29fe96c52 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt @@ -51,10 +51,12 @@ class DeviceEnergyManagementCluster( class AttributeListAttribute(val value: List) - suspend fun powerAdjustRequest(power: Long, duration: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun powerAdjustRequest( + power: Long, + duration: UInt, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -70,17 +72,15 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun cancelPowerAdjustRequest(timedInvokeTimeoutMs: Int? = null) { + suspend fun cancelPowerAdjustRequest(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -90,17 +90,18 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun startTimeAdjustRequest(requestedStartTime: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun startTimeAdjustRequest( + requestedStartTime: UInt, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -113,17 +114,15 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun pauseRequest(duration: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun pauseRequest(duration: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -136,17 +135,15 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun resumeRequest(timedInvokeTimeoutMs: Int? = null) { + suspend fun resumeRequest(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -156,7 +153,7 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -166,11 +163,9 @@ class DeviceEnergyManagementCluster( suspend fun modifyForecastRequest( forecastId: UInt, slotAdjustments: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -190,7 +185,7 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -199,11 +194,9 @@ class DeviceEnergyManagementCluster( suspend fun requestConstraintBasedForecast( constraints: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -220,7 +213,7 @@ class DeviceEnergyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DiagnosticLogsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DiagnosticLogsCluster.kt index a40ae5c48fbbed..44e346e7c46d35 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DiagnosticLogsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DiagnosticLogsCluster.kt @@ -56,11 +56,9 @@ class DiagnosticLogsCluster( intent: UByte, requestedProtocol: UByte, transferFileDesignator: String?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): RetrieveLogsResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -81,7 +79,7 @@ class DiagnosticLogsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -139,7 +137,6 @@ class DiagnosticLogsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherAlarmCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherAlarmCluster.kt index 5684b27e7555f2..0a72b49309b012 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherAlarmCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherAlarmCluster.kt @@ -45,10 +45,8 @@ class DishwasherAlarmCluster( class AttributeListAttribute(val value: List) - suspend fun reset(alarms: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun reset(alarms: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -61,17 +59,15 @@ class DishwasherAlarmCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun modifyEnabledAlarms(mask: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun modifyEnabledAlarms(mask: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -84,7 +80,7 @@ class DishwasherAlarmCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherModeCluster.kt index 8cda015004b3d4..be86c564699aa4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DishwasherModeCluster.kt @@ -58,11 +58,9 @@ class DishwasherModeCluster( suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -75,7 +73,7 @@ class DishwasherModeCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -109,7 +107,6 @@ class DishwasherModeCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -233,10 +230,8 @@ class DishwasherModeCluster( return StartUpModeAttribute(decodedValue) } - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -251,7 +246,7 @@ class DishwasherModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -316,10 +311,8 @@ class DishwasherModeCluster( return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -334,7 +327,7 @@ class DishwasherModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DoorLockCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DoorLockCluster.kt index e97463bc6a8eb5..aa365a093b48a5 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DoorLockCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DoorLockCluster.kt @@ -103,9 +103,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp class AttributeListAttribute(val value: List) - suspend fun lockDoor(PINCode: ByteArray?, timedInvokeTimeoutMs: Int) { + suspend fun lockDoor(PINCode: ByteArray?, timedInvokeTimeout: Duration) { val commandId: UInt = 0u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -118,16 +117,15 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun unlockDoor(PINCode: ByteArray?, timedInvokeTimeoutMs: Int) { + suspend fun unlockDoor(PINCode: ByteArray?, timedInvokeTimeout: Duration) { val commandId: UInt = 1u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -140,16 +138,19 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun unlockWithTimeout(timeout: UShort, PINCode: ByteArray?, timedInvokeTimeoutMs: Int) { + suspend fun unlockWithTimeout( + timeout: UShort, + PINCode: ByteArray?, + timedInvokeTimeout: Duration + ) { val commandId: UInt = 3u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -165,7 +166,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -180,11 +181,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp startMinute: UByte, endHour: UByte, endMinute: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 11u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -215,7 +214,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -225,11 +224,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun getWeekDaySchedule( weekDayIndex: UByte, userIndex: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetWeekDayScheduleResponse { val commandId: UInt = 12u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -245,7 +242,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -361,7 +358,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -395,11 +391,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun clearWeekDaySchedule( weekDayIndex: UByte, userIndex: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 13u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -415,7 +409,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -427,11 +421,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp userIndex: UShort, localStartTime: UInt, localEndTime: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 14u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -453,7 +445,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -463,11 +455,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun getYearDaySchedule( yearDayIndex: UByte, userIndex: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetYearDayScheduleResponse { val commandId: UInt = 15u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -483,7 +473,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -548,7 +538,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -579,11 +568,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun clearYearDaySchedule( yearDayIndex: UByte, userIndex: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 16u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -599,7 +586,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -611,11 +598,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp localStartTime: UInt, localEndTime: UInt, operatingMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 17u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -637,7 +622,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -646,11 +631,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun getHolidaySchedule( holidayIndex: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetHolidayScheduleResponse { val commandId: UInt = 18u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -663,7 +646,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -738,7 +721,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -762,10 +744,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp ) } - suspend fun clearHolidaySchedule(holidayIndex: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun clearHolidaySchedule(holidayIndex: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 19u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -778,7 +758,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -793,10 +773,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp userStatus: UByte?, userType: UByte?, credentialRule: UByte?, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 26u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -829,17 +808,15 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun getUser(userIndex: UShort, timedInvokeTimeoutMs: Int? = null): GetUserResponse { + suspend fun getUser(userIndex: UShort, timedInvokeTimeout: Duration? = null): GetUserResponse { val commandId: UInt = 27u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -852,7 +829,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1037,7 +1014,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1062,9 +1038,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp ) } - suspend fun clearUser(userIndex: UShort, timedInvokeTimeoutMs: Int) { + suspend fun clearUser(userIndex: UShort, timedInvokeTimeout: Duration) { val commandId: UInt = 29u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1077,7 +1052,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1091,10 +1066,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp userIndex: UShort?, userStatus: UByte?, userType: UByte?, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ): SetCredentialResponse { val commandId: UInt = 34u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1122,7 +1096,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1175,7 +1149,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1191,11 +1164,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun getCredentialStatus( credential: DoorLockClusterCredentialStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetCredentialStatusResponse { val commandId: UInt = 36u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1208,7 +1179,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1297,7 +1268,6 @@ class DoorLockCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1319,10 +1289,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun clearCredential( credential: DoorLockClusterCredentialStruct?, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 38u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1335,16 +1304,15 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun unboltDoor(PINCode: ByteArray?, timedInvokeTimeoutMs: Int) { + suspend fun unboltDoor(PINCode: ByteArray?, timedInvokeTimeout: Duration) { val commandId: UInt = 39u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1357,7 +1325,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1540,10 +1508,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeDoorOpenEventsAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDoorOpenEventsAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1558,7 +1524,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1618,10 +1584,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeDoorClosedEventsAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDoorClosedEventsAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1636,7 +1600,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1696,10 +1660,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeOpenPeriodAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOpenPeriodAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 6u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1714,7 +1676,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2214,10 +2176,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeLanguageAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLanguageAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 33u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2232,7 +2192,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2292,10 +2252,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeLEDSettingsAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLEDSettingsAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 34u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2310,7 +2268,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2365,10 +2323,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeAutoRelockTimeAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeAutoRelockTimeAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 35u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2383,7 +2339,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2443,10 +2399,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeSoundVolumeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSoundVolumeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 36u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2461,7 +2415,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2516,10 +2470,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeOperatingModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOperatingModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 37u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2534,7 +2486,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2663,11 +2615,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeEnableLocalProgrammingAttribute( value: Boolean, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 40u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2682,7 +2632,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2744,11 +2694,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeEnableOneTouchLockingAttribute( value: Boolean, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 41u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2763,7 +2711,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2825,11 +2773,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeEnableInsideStatusLEDAttribute( value: Boolean, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 42u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2844,7 +2790,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2906,11 +2852,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeEnablePrivacyModeButtonAttribute( value: Boolean, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 43u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2925,7 +2869,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2987,11 +2931,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeLocalProgrammingFeaturesAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 44u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3006,7 +2948,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3066,10 +3008,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeWrongCodeEntryLimitAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeWrongCodeEntryLimitAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 48u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3084,7 +3024,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3146,11 +3086,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeUserCodeTemporaryDisableTimeAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 49u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3165,7 +3103,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3225,10 +3163,8 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeSendPINOverTheAirAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSendPINOverTheAirAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 50u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3243,7 +3179,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3305,11 +3241,9 @@ class DoorLockCluster(private val controller: MatterController, private val endp suspend fun writeRequirePINforRemoteOperationAttribute( value: Boolean, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 51u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3324,7 +3258,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3384,10 +3318,11 @@ class DoorLockCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeExpiringUserTimeoutAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeExpiringUserTimeoutAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 53u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3402,7 +3337,7 @@ class DoorLockCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt index cff2c16d51397b..de282984d4c67d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt @@ -48,10 +48,8 @@ class ElectricalMeasurementCluster( class AttributeListAttribute(val value: List) - suspend fun getProfileInfoCommand(timedInvokeTimeoutMs: Int? = null) { + suspend fun getProfileInfoCommand(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -61,7 +59,7 @@ class ElectricalMeasurementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -72,11 +70,9 @@ class ElectricalMeasurementCluster( attributeId: UShort, startTime: UInt, numberOfIntervals: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -95,7 +91,7 @@ class ElectricalMeasurementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -2244,11 +2240,9 @@ class ElectricalMeasurementCluster( suspend fun writeAverageRmsVoltageMeasurementPeriodAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 1297u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2263,7 +2257,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2327,11 +2321,9 @@ class ElectricalMeasurementCluster( suspend fun writeAverageRmsUnderVoltageCounterAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 1299u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2346,7 +2338,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2408,11 +2400,9 @@ class ElectricalMeasurementCluster( suspend fun writeRmsExtremeOverVoltagePeriodAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 1300u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2427,7 +2417,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2489,11 +2479,9 @@ class ElectricalMeasurementCluster( suspend fun writeRmsExtremeUnderVoltagePeriodAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 1301u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2508,7 +2496,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2568,10 +2556,11 @@ class ElectricalMeasurementCluster( return decodedValue } - suspend fun writeRmsVoltageSagPeriodAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRmsVoltageSagPeriodAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 1302u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2586,7 +2575,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2646,10 +2635,11 @@ class ElectricalMeasurementCluster( return decodedValue } - suspend fun writeRmsVoltageSwellPeriodAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRmsVoltageSwellPeriodAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 1303u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2664,7 +2654,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2940,10 +2930,8 @@ class ElectricalMeasurementCluster( return decodedValue } - suspend fun writeOverloadAlarmsMaskAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOverloadAlarmsMaskAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1792u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2958,7 +2946,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3090,10 +3078,11 @@ class ElectricalMeasurementCluster( return decodedValue } - suspend fun writeAcOverloadAlarmsMaskAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeAcOverloadAlarmsMaskAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 2048u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3108,7 +3097,7 @@ class ElectricalMeasurementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt index 231bed8970f88a..93e1c213748fe1 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt @@ -74,9 +74,8 @@ class EnergyEvseCluster(private val controller: MatterController, private val en class AttributeListAttribute(val value: List) - suspend fun disable(timedInvokeTimeoutMs: Int) { + suspend fun disable(timedInvokeTimeout: Duration) { val commandId: UInt = 1u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -86,7 +85,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -97,10 +96,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en chargingEnabledUntil: UInt?, minimumChargeCurrent: Long, maximumChargeCurrent: Long, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 2u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -121,7 +119,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -131,10 +129,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en suspend fun enableDischarging( dischargingEnabledUntil: UInt?, maximumDischargeCurrent: Long, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 3u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -152,16 +149,15 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun startDiagnostics(timedInvokeTimeoutMs: Int) { + suspend fun startDiagnostics(timedInvokeTimeout: Duration) { val commandId: UInt = 4u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -171,7 +167,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -181,10 +177,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en suspend fun setTargets( dayOfWeekforSequence: UByte, chargingTargets: List, - timedInvokeTimeoutMs: Int + timedInvokeTimeout: Duration ) { val commandId: UInt = 5u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -204,16 +199,15 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun getTargets(daysToReturn: UByte, timedInvokeTimeoutMs: Int): GetTargetsResponse { + suspend fun getTargets(daysToReturn: UByte, timedInvokeTimeout: Duration): GetTargetsResponse { val commandId: UInt = 6u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -226,7 +220,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -257,7 +251,6 @@ class EnergyEvseCluster(private val controller: MatterController, private val en tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -275,9 +268,8 @@ class EnergyEvseCluster(private val controller: MatterController, private val en return GetTargetsResponse(dayOfWeekforSequence_decoded, chargingTargets_decoded) } - suspend fun clearTargets(timedInvokeTimeoutMs: Int) { + suspend fun clearTargets(timedInvokeTimeout: Duration) { val commandId: UInt = 7u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -287,7 +279,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -638,11 +630,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en suspend fun writeUserMaximumChargeCurrentAttribute( value: Long, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 9u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -657,7 +647,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -719,11 +709,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en suspend fun writeRandomizationDelayWindowAttribute( value: UInt, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 10u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -738,7 +726,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1041,11 +1029,9 @@ class EnergyEvseCluster(private val controller: MatterController, private val en suspend fun writeApproximateEVEfficiencyAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 39u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1060,7 +1046,7 @@ class EnergyEvseCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EthernetNetworkDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EthernetNetworkDiagnosticsCluster.kt index fcbff87fd95e32..36d51a163da90a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/EthernetNetworkDiagnosticsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EthernetNetworkDiagnosticsCluster.kt @@ -50,10 +50,8 @@ class EthernetNetworkDiagnosticsCluster( class AttributeListAttribute(val value: List) - suspend fun resetCounts(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetCounts(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -63,7 +61,7 @@ class EthernetNetworkDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/FanControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/FanControlCluster.kt index a2be5a8f645b37..9d82a42242442d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/FanControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/FanControlCluster.kt @@ -53,11 +53,9 @@ class FanControlCluster(private val controller: MatterController, private val en direction: UByte, wrap: Boolean?, lowestOff: Boolean?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -76,7 +74,7 @@ class FanControlCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -114,10 +112,8 @@ class FanControlCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeFanModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeFanModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -132,7 +128,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -224,10 +220,8 @@ class FanControlCluster(private val controller: MatterController, private val en return PercentSettingAttribute(decodedValue) } - suspend fun writePercentSettingAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writePercentSettingAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -242,7 +236,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -374,10 +368,8 @@ class FanControlCluster(private val controller: MatterController, private val en return SpeedSettingAttribute(decodedValue) } - suspend fun writeSpeedSettingAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSpeedSettingAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -392,7 +384,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -524,10 +516,8 @@ class FanControlCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeRockSettingAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRockSettingAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 8u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -542,7 +532,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -638,10 +628,8 @@ class FanControlCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeWindSettingAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeWindSettingAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 10u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -656,7 +644,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -716,10 +704,8 @@ class FanControlCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeAirflowDirectionAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeAirflowDirectionAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 11u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -734,7 +720,7 @@ class FanControlCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/FaultInjectionCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/FaultInjectionCluster.kt index e765024b458f3a..7d40a448831930 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/FaultInjectionCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/FaultInjectionCluster.kt @@ -51,11 +51,9 @@ class FaultInjectionCluster( numCallsToSkip: UInt, numCallsToFail: UInt, takeMutex: Boolean, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -80,7 +78,7 @@ class FaultInjectionCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -91,11 +89,9 @@ class FaultInjectionCluster( type: UByte, id: UInt, percentage: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -114,7 +110,7 @@ class FaultInjectionCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt index ea455c635b4075..64dacf9319ef2c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt @@ -61,11 +61,9 @@ class GeneralCommissioningCluster( suspend fun armFailSafe( expiryLengthSeconds: UShort, breadcrumb: ULong, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ArmFailSafeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -81,7 +79,7 @@ class GeneralCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -105,7 +103,6 @@ class GeneralCommissioningCluster( if (tag == ContextSpecificTag(TAG_DEBUG_TEXT)) { debugText_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -127,11 +124,9 @@ class GeneralCommissioningCluster( newRegulatoryConfig: UByte, countryCode: String, breadcrumb: ULong, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): SetRegulatoryConfigResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -150,7 +145,7 @@ class GeneralCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -174,7 +169,6 @@ class GeneralCommissioningCluster( if (tag == ContextSpecificTag(TAG_DEBUG_TEXT)) { debugText_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -193,11 +187,9 @@ class GeneralCommissioningCluster( } suspend fun commissioningComplete( - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): CommissioningCompleteResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -207,7 +199,7 @@ class GeneralCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -231,7 +223,6 @@ class GeneralCommissioningCluster( if (tag == ContextSpecificTag(TAG_DEBUG_TEXT)) { debugText_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -280,10 +271,8 @@ class GeneralCommissioningCluster( return decodedValue } - suspend fun writeBreadcrumbAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBreadcrumbAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -298,7 +287,7 @@ class GeneralCommissioningCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt index 247fd54f345036..3873ba445170e3 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralDiagnosticsCluster.kt @@ -58,11 +58,9 @@ class GeneralDiagnosticsCluster( suspend fun testEventTrigger( enableKey: ByteArray, eventTrigger: ULong, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -78,17 +76,15 @@ class GeneralDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun timeSnapshot(timedInvokeTimeoutMs: Int? = null): TimeSnapshotResponse { + suspend fun timeSnapshot(timedInvokeTimeout: Duration? = null): TimeSnapshotResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -98,7 +94,7 @@ class GeneralDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -133,7 +129,6 @@ class GeneralDiagnosticsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupKeyManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupKeyManagementCluster.kt index 00e415940a8d10..cc3475b002cc88 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupKeyManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupKeyManagementCluster.kt @@ -58,11 +58,9 @@ class GroupKeyManagementCluster( suspend fun keySetWrite( groupKeySet: GroupKeyManagementClusterGroupKeySetStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -75,7 +73,7 @@ class GroupKeyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -84,11 +82,9 @@ class GroupKeyManagementCluster( suspend fun keySetRead( groupKeySetID: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): KeySetReadResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -101,7 +97,7 @@ class GroupKeyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -118,7 +114,6 @@ class GroupKeyManagementCluster( if (tag == ContextSpecificTag(TAG_GROUP_KEY_SET)) { groupKeySet_decoded = GroupKeyManagementClusterGroupKeySetStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -132,10 +127,8 @@ class GroupKeyManagementCluster( return KeySetReadResponse(groupKeySet_decoded) } - suspend fun keySetRemove(groupKeySetID: UShort, timedInvokeTimeoutMs: Int? = null) { + suspend fun keySetRemove(groupKeySetID: UShort, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -148,7 +141,7 @@ class GroupKeyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -156,11 +149,9 @@ class GroupKeyManagementCluster( } suspend fun keySetReadAllIndices( - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): KeySetReadAllIndicesResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -170,7 +161,7 @@ class GroupKeyManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -194,7 +185,6 @@ class GroupKeyManagementCluster( tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -248,11 +238,9 @@ class GroupKeyManagementCluster( suspend fun writeGroupKeyMapAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -271,7 +259,7 @@ class GroupKeyManagementCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupsCluster.kt index a1c38ca8e8e0d2..d79567217cc8ba 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GroupsCluster.kt @@ -53,11 +53,9 @@ class GroupsCluster(private val controller: MatterController, private val endpoi suspend fun addGroup( groupID: UShort, groupName: String, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): AddGroupResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -73,7 +71,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -97,7 +95,6 @@ class GroupsCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_GROUP_I_D)) { groupID_decoded = tlvReader.getUShort(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -115,10 +112,8 @@ class GroupsCluster(private val controller: MatterController, private val endpoi return AddGroupResponse(status_decoded, groupID_decoded) } - suspend fun viewGroup(groupID: UShort, timedInvokeTimeoutMs: Int? = null): ViewGroupResponse { + suspend fun viewGroup(groupID: UShort, timedInvokeTimeout: Duration? = null): ViewGroupResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -131,7 +126,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -162,7 +157,6 @@ class GroupsCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_GROUP_NAME)) { groupName_decoded = tlvReader.getString(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -186,11 +180,9 @@ class GroupsCluster(private val controller: MatterController, private val endpoi suspend fun getGroupMembership( groupList: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetGroupMembershipResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -207,7 +199,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -249,7 +241,6 @@ class GroupsCluster(private val controller: MatterController, private val endpoi tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -263,10 +254,11 @@ class GroupsCluster(private val controller: MatterController, private val endpoi return GetGroupMembershipResponse(capacity_decoded, groupList_decoded) } - suspend fun removeGroup(groupID: UShort, timedInvokeTimeoutMs: Int? = null): RemoveGroupResponse { + suspend fun removeGroup( + groupID: UShort, + timedInvokeTimeout: Duration? = null + ): RemoveGroupResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -279,7 +271,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -303,7 +295,6 @@ class GroupsCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_GROUP_I_D)) { groupID_decoded = tlvReader.getUShort(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -321,10 +312,8 @@ class GroupsCluster(private val controller: MatterController, private val endpoi return RemoveGroupResponse(status_decoded, groupID_decoded) } - suspend fun removeAllGroups(timedInvokeTimeoutMs: Int? = null) { + suspend fun removeAllGroups(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -334,7 +323,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -344,11 +333,9 @@ class GroupsCluster(private val controller: MatterController, private val endpoi suspend fun addGroupIfIdentifying( groupID: UShort, groupName: String, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -364,7 +351,7 @@ class GroupsCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/HepaFilterMonitoringCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/HepaFilterMonitoringCluster.kt index 330aba9b6213c8..a4ba1749b006f4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/HepaFilterMonitoringCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/HepaFilterMonitoringCluster.kt @@ -53,10 +53,8 @@ class HepaFilterMonitoringCluster( class AttributeListAttribute(val value: List) - suspend fun resetCondition(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetCondition(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -66,7 +64,7 @@ class HepaFilterMonitoringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -253,10 +251,8 @@ class HepaFilterMonitoringCluster( return LastChangedTimeAttribute(decodedValue) } - suspend fun writeLastChangedTimeAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLastChangedTimeAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -271,7 +267,7 @@ class HepaFilterMonitoringCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/IcdManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/IcdManagementCluster.kt index 029dd194007c31..4490879d7fe247 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/IcdManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/IcdManagementCluster.kt @@ -58,11 +58,9 @@ class IcdManagementCluster( monitoredSubject: ULong, key: ByteArray, verificationKey: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): RegisterClientResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -86,7 +84,7 @@ class IcdManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -103,7 +101,6 @@ class IcdManagementCluster( if (tag == ContextSpecificTag(TAG_I_C_D_COUNTER)) { ICDCounter_decoded = tlvReader.getUInt(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -120,11 +117,9 @@ class IcdManagementCluster( suspend fun unregisterClient( checkInNodeID: ULong, verificationKey: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -142,17 +137,15 @@ class IcdManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun stayActiveRequest(timedInvokeTimeoutMs: Int? = null): StayActiveResponse { + suspend fun stayActiveRequest(timedInvokeTimeout: Duration? = null): StayActiveResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -162,7 +155,7 @@ class IcdManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -179,7 +172,6 @@ class IcdManagementCluster( if (tag == ContextSpecificTag(TAG_PROMISED_ACTIVE_DURATION)) { promisedActiveDuration_decoded = tlvReader.getUInt(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/IdentifyCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/IdentifyCluster.kt index 2cffe72cefd399..2221b5362e2620 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/IdentifyCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/IdentifyCluster.kt @@ -45,10 +45,8 @@ class IdentifyCluster(private val controller: MatterController, private val endp class AttributeListAttribute(val value: List) - suspend fun identify(identifyTime: UShort, timedInvokeTimeoutMs: Int? = null) { + suspend fun identify(identifyTime: UShort, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -61,7 +59,7 @@ class IdentifyCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -71,11 +69,9 @@ class IdentifyCluster(private val controller: MatterController, private val endp suspend fun triggerEffect( effectIdentifier: UByte, effectVariant: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 64u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -91,7 +87,7 @@ class IdentifyCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -129,10 +125,8 @@ class IdentifyCluster(private val controller: MatterController, private val endp return decodedValue } - suspend fun writeIdentifyTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeIdentifyTimeAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -147,7 +141,7 @@ class IdentifyCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/KeypadInputCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/KeypadInputCluster.kt index dc18411b24044b..edd6d8df5dc73a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/KeypadInputCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/KeypadInputCluster.kt @@ -44,10 +44,8 @@ class KeypadInputCluster(private val controller: MatterController, private val e class AttributeListAttribute(val value: List) - suspend fun sendKey(keyCode: UByte, timedInvokeTimeoutMs: Int? = null): SendKeyResponse { + suspend fun sendKey(keyCode: UByte, timedInvokeTimeout: Duration? = null): SendKeyResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,7 +58,7 @@ class KeypadInputCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -77,7 +75,6 @@ class KeypadInputCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_STATUS)) { status_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryDryerControlsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryDryerControlsCluster.kt index e840eaa128b766..af35edb3cfc343 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryDryerControlsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryDryerControlsCluster.kt @@ -123,10 +123,11 @@ class LaundryDryerControlsCluster( return SelectedDrynessLevelAttribute(decodedValue) } - suspend fun writeSelectedDrynessLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSelectedDrynessLevelAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -141,7 +142,7 @@ class LaundryDryerControlsCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherControlsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherControlsCluster.kt index 9540e0bcaa8d1b..95eefba0038d85 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherControlsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherControlsCluster.kt @@ -133,10 +133,8 @@ class LaundryWasherControlsCluster( return SpinSpeedCurrentAttribute(decodedValue) } - suspend fun writeSpinSpeedCurrentAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSpinSpeedCurrentAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -151,7 +149,7 @@ class LaundryWasherControlsCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -211,10 +209,8 @@ class LaundryWasherControlsCluster( return decodedValue } - suspend fun writeNumberOfRinsesAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNumberOfRinsesAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -229,7 +225,7 @@ class LaundryWasherControlsCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherModeCluster.kt index 4c32d50f224995..35b8147a67cbcf 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LaundryWasherModeCluster.kt @@ -58,11 +58,9 @@ class LaundryWasherModeCluster( suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -75,7 +73,7 @@ class LaundryWasherModeCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -109,7 +107,6 @@ class LaundryWasherModeCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -233,10 +230,8 @@ class LaundryWasherModeCluster( return StartUpModeAttribute(decodedValue) } - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -251,7 +246,7 @@ class LaundryWasherModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -316,10 +311,8 @@ class LaundryWasherModeCluster( return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -334,7 +327,7 @@ class LaundryWasherModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LevelControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LevelControlCluster.kt index 8718ed743ba3a3..df407d6f1fe71e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LevelControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LevelControlCluster.kt @@ -65,11 +65,9 @@ class LevelControlCluster( transitionTime: UShort?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -93,7 +91,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -105,11 +103,9 @@ class LevelControlCluster( rate: UByte?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -131,7 +127,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -144,11 +140,9 @@ class LevelControlCluster( transitionTime: UShort?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -175,17 +169,19 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun stop(optionsMask: UByte, optionsOverride: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun stop( + optionsMask: UByte, + optionsOverride: UByte, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -201,7 +197,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -213,11 +209,9 @@ class LevelControlCluster( transitionTime: UShort?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -241,7 +235,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -253,11 +247,9 @@ class LevelControlCluster( rate: UByte?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -279,7 +271,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -292,11 +284,9 @@ class LevelControlCluster( transitionTime: UShort?, optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -323,7 +313,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -333,11 +323,9 @@ class LevelControlCluster( suspend fun stopWithOnOff( optionsMask: UByte, optionsOverride: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -353,17 +341,15 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun moveToClosestFrequency(frequency: UShort, timedInvokeTimeoutMs: Int? = null) { + suspend fun moveToClosestFrequency(frequency: UShort, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -376,7 +362,7 @@ class LevelControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -667,10 +653,8 @@ class LevelControlCluster( return decodedValue } - suspend fun writeOptionsAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOptionsAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 15u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -685,7 +669,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -745,10 +729,11 @@ class LevelControlCluster( return decodedValue } - suspend fun writeOnOffTransitionTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnOffTransitionTimeAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -763,7 +748,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -824,10 +809,8 @@ class LevelControlCluster( return OnLevelAttribute(decodedValue) } - suspend fun writeOnLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 17u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -842,7 +825,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -907,10 +890,8 @@ class LevelControlCluster( return OnTransitionTimeAttribute(decodedValue) } - suspend fun writeOnTransitionTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnTransitionTimeAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 18u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -925,7 +906,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -990,10 +971,8 @@ class LevelControlCluster( return OffTransitionTimeAttribute(decodedValue) } - suspend fun writeOffTransitionTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOffTransitionTimeAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 19u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1008,7 +987,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1073,10 +1052,8 @@ class LevelControlCluster( return DefaultMoveRateAttribute(decodedValue) } - suspend fun writeDefaultMoveRateAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeDefaultMoveRateAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 20u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1091,7 +1068,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1156,10 +1133,8 @@ class LevelControlCluster( return StartUpCurrentLevelAttribute(decodedValue) } - suspend fun writeStartUpCurrentLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpCurrentLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16384u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1174,7 +1149,7 @@ class LevelControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LocalizationConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LocalizationConfigurationCluster.kt index 25259a5b6d033e..e5f61296f676f2 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LocalizationConfigurationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LocalizationConfigurationCluster.kt @@ -77,10 +77,8 @@ class LocalizationConfigurationCluster( return decodedValue } - suspend fun writeActiveLocaleAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeActiveLocaleAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -95,7 +93,7 @@ class LocalizationConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/LowPowerCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/LowPowerCluster.kt index 4cd658b6ecf7b2..b0ed37c7aaa582 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/LowPowerCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/LowPowerCluster.kt @@ -41,10 +41,8 @@ class LowPowerCluster(private val controller: MatterController, private val endp class AttributeListAttribute(val value: List) - suspend fun sleep(timedInvokeTimeoutMs: Int? = null) { + suspend fun sleep(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -54,7 +52,7 @@ class LowPowerCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt index 9294f209f59338..1dc12b37ae620b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaInputCluster.kt @@ -44,10 +44,8 @@ class MediaInputCluster(private val controller: MatterController, private val en class AttributeListAttribute(val value: List) - suspend fun selectInput(index: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun selectInput(index: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,17 +58,15 @@ class MediaInputCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun showInputStatus(timedInvokeTimeoutMs: Int? = null) { + suspend fun showInputStatus(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -80,17 +76,15 @@ class MediaInputCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun hideInputStatus(timedInvokeTimeoutMs: Int? = null) { + suspend fun hideInputStatus(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -100,17 +94,15 @@ class MediaInputCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun renameInput(index: UByte, name: String, timedInvokeTimeoutMs: Int? = null) { + suspend fun renameInput(index: UByte, name: String, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -126,7 +118,7 @@ class MediaInputCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt index 2185773712e036..ffe9e82a9c616a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MediaPlaybackCluster.kt @@ -65,10 +65,8 @@ class MediaPlaybackCluster( class AttributeListAttribute(val value: List) - suspend fun play(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun play(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -78,7 +76,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -112,7 +110,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -126,10 +123,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun pause(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun pause(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -139,7 +134,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -173,7 +168,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -187,10 +181,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun stop(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun stop(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -200,7 +192,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -234,7 +226,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -248,10 +239,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun startOver(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun startOver(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -261,7 +250,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -295,7 +284,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -309,10 +297,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun previous(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun previous(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -322,7 +308,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -356,7 +342,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -370,10 +355,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun next(timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun next(timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -383,7 +366,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -417,7 +400,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -433,11 +415,9 @@ class MediaPlaybackCluster( suspend fun rewind( audioAdvanceUnmuted: Boolean?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): PlaybackResponse { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -452,7 +432,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -486,7 +466,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -502,11 +481,9 @@ class MediaPlaybackCluster( suspend fun fastForward( audioAdvanceUnmuted: Boolean?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): PlaybackResponse { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -521,7 +498,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -555,7 +532,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -571,11 +547,9 @@ class MediaPlaybackCluster( suspend fun skipForward( deltaPositionMilliseconds: ULong, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): PlaybackResponse { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -591,7 +565,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -625,7 +599,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -641,11 +614,9 @@ class MediaPlaybackCluster( suspend fun skipBackward( deltaPositionMilliseconds: ULong, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): PlaybackResponse { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -661,7 +632,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -695,7 +666,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -709,10 +679,8 @@ class MediaPlaybackCluster( return PlaybackResponse(status_decoded, data_decoded) } - suspend fun seek(position: ULong, timedInvokeTimeoutMs: Int? = null): PlaybackResponse { + suspend fun seek(position: ULong, timedInvokeTimeout: Duration? = null): PlaybackResponse { val commandId: UInt = 11u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -725,7 +693,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -759,7 +727,6 @@ class MediaPlaybackCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -776,11 +743,9 @@ class MediaPlaybackCluster( suspend fun activateAudioTrack( trackID: String, audioOutputIndex: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 12u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -796,17 +761,15 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun activateTextTrack(trackID: String, timedInvokeTimeoutMs: Int? = null) { + suspend fun activateTextTrack(trackID: String, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 13u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -819,17 +782,15 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun deactivateTextTrack(timedInvokeTimeoutMs: Int? = null) { + suspend fun deactivateTextTrack(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 14u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -839,7 +800,7 @@ class MediaPlaybackCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt index 606bc9dc502b6e..cefaa3ed21eb54 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/MicrowaveOvenControlCluster.kt @@ -49,11 +49,9 @@ class MicrowaveOvenControlCluster( cookMode: UByte?, cookTime: UInt?, powerSetting: UByte?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -72,17 +70,15 @@ class MicrowaveOvenControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun addMoreTime(timeToAdd: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun addMoreTime(timeToAdd: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -95,7 +91,7 @@ class MicrowaveOvenControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt index 6231d0fda5f8b7..7c51d6eeb7a9f6 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ModeSelectCluster.kt @@ -53,10 +53,8 @@ class ModeSelectCluster(private val controller: MatterController, private val en class AttributeListAttribute(val value: List) - suspend fun changeToMode(newMode: UByte, timedInvokeTimeoutMs: Int? = null) { + suspend fun changeToMode(newMode: UByte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -69,7 +67,7 @@ class ModeSelectCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -254,10 +252,8 @@ class ModeSelectCluster(private val controller: MatterController, private val en return StartUpModeAttribute(decodedValue) } - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -272,7 +268,7 @@ class ModeSelectCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -337,10 +333,8 @@ class ModeSelectCluster(private val controller: MatterController, private val en return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -355,7 +349,7 @@ class ModeSelectCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/NetworkCommissioningCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/NetworkCommissioningCluster.kt index be084ccb9ff782..c5e13a8eb0c0c4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/NetworkCommissioningCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/NetworkCommissioningCluster.kt @@ -84,11 +84,9 @@ class NetworkCommissioningCluster( suspend fun scanNetworks( ssid: ByteArray?, breadcrumb: ULong?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ScanNetworksResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -104,7 +102,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -197,7 +195,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -223,11 +220,9 @@ class NetworkCommissioningCluster( networkIdentity: ByteArray?, clientIdentifier: ByteArray?, possessionNonce: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NetworkConfigResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -261,7 +256,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -346,7 +341,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -369,11 +363,9 @@ class NetworkCommissioningCluster( suspend fun addOrUpdateThreadNetwork( operationalDataset: ByteArray, breadcrumb: ULong?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NetworkConfigResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -389,7 +381,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -474,7 +466,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -497,11 +488,9 @@ class NetworkCommissioningCluster( suspend fun removeNetwork( networkID: ByteArray, breadcrumb: ULong?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NetworkConfigResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -517,7 +506,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -602,7 +591,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -625,11 +613,9 @@ class NetworkCommissioningCluster( suspend fun connectNetwork( networkID: ByteArray, breadcrumb: ULong?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ConnectNetworkResponse { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -645,7 +631,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -697,7 +683,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -715,11 +700,9 @@ class NetworkCommissioningCluster( networkID: ByteArray, networkIndex: UByte, breadcrumb: ULong?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NetworkConfigResponse { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -738,7 +721,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -823,7 +806,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -846,11 +828,9 @@ class NetworkCommissioningCluster( suspend fun queryIdentity( keyIdentifier: ByteArray, possessionNonce: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): QueryIdentityResponse { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -868,7 +848,7 @@ class NetworkCommissioningCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -902,7 +882,6 @@ class NetworkCommissioningCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1088,10 +1067,8 @@ class NetworkCommissioningCluster( return decodedValue } - suspend fun writeInterfaceEnabledAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInterfaceEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1106,7 +1083,7 @@ class NetworkCommissioningCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OccupancySensingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OccupancySensingCluster.kt index 8696b431542018..95b1f16986662b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OccupancySensingCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OccupancySensingCluster.kt @@ -175,11 +175,9 @@ class OccupancySensingCluster( suspend fun writePIROccupiedToUnoccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -194,7 +192,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -256,11 +254,9 @@ class OccupancySensingCluster( suspend fun writePIRUnoccupiedToOccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 17u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -275,7 +271,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -339,11 +335,9 @@ class OccupancySensingCluster( suspend fun writePIRUnoccupiedToOccupiedThresholdAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 18u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -358,7 +352,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -422,11 +416,9 @@ class OccupancySensingCluster( suspend fun writeUltrasonicOccupiedToUnoccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 32u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -441,7 +433,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -505,11 +497,9 @@ class OccupancySensingCluster( suspend fun writeUltrasonicUnoccupiedToOccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 33u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -524,7 +514,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -588,11 +578,9 @@ class OccupancySensingCluster( suspend fun writeUltrasonicUnoccupiedToOccupiedThresholdAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 34u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -607,7 +595,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -671,11 +659,9 @@ class OccupancySensingCluster( suspend fun writePhysicalContactOccupiedToUnoccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 48u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -690,7 +676,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -754,11 +740,9 @@ class OccupancySensingCluster( suspend fun writePhysicalContactUnoccupiedToOccupiedDelayAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 49u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -773,7 +757,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -837,11 +821,9 @@ class OccupancySensingCluster( suspend fun writePhysicalContactUnoccupiedToOccupiedThresholdAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 50u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -856,7 +838,7 @@ class OccupancySensingCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffCluster.kt index ff372b51cd8df1..7b3b700048da5e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffCluster.kt @@ -47,10 +47,8 @@ class OnOffCluster(private val controller: MatterController, private val endpoin class AttributeListAttribute(val value: List) - suspend fun off(timedInvokeTimeoutMs: Int? = null) { + suspend fun off(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,17 +58,15 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun on(timedInvokeTimeoutMs: Int? = null) { + suspend fun on(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -80,17 +76,15 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun toggle(timedInvokeTimeoutMs: Int? = null) { + suspend fun toggle(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -100,7 +94,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -110,11 +104,9 @@ class OnOffCluster(private val controller: MatterController, private val endpoin suspend fun offWithEffect( effectIdentifier: UByte, effectVariant: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 64u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -130,17 +122,15 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun onWithRecallGlobalScene(timedInvokeTimeoutMs: Int? = null) { + suspend fun onWithRecallGlobalScene(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 65u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -150,7 +140,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -161,11 +151,9 @@ class OnOffCluster(private val controller: MatterController, private val endpoin onOffControl: UByte, onTime: UShort, offWaitTime: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 66u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -184,7 +172,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -294,10 +282,8 @@ class OnOffCluster(private val controller: MatterController, private val endpoin return decodedValue } - suspend fun writeOnTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnTimeAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16385u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -312,7 +298,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -372,10 +358,8 @@ class OnOffCluster(private val controller: MatterController, private val endpoin return decodedValue } - suspend fun writeOffWaitTimeAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOffWaitTimeAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16386u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -390,7 +374,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -455,10 +439,8 @@ class OnOffCluster(private val controller: MatterController, private val endpoin return StartUpOnOffAttribute(decodedValue) } - suspend fun writeStartUpOnOffAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpOnOffAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16387u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -473,7 +455,7 @@ class OnOffCluster(private val controller: MatterController, private val endpoin tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt index ce7a5fcee8adb2..7448ff847c1d43 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt @@ -106,10 +106,8 @@ class OnOffSwitchConfigurationCluster( return decodedValue } - suspend fun writeSwitchActionsAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSwitchActionsAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -124,7 +122,7 @@ class OnOffSwitchConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalCredentialsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalCredentialsCluster.kt index 9cf448add35ed1..8f96cbccd13948 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalCredentialsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalCredentialsCluster.kt @@ -64,11 +64,9 @@ class OperationalCredentialsCluster( suspend fun attestationRequest( attestationNonce: ByteArray, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): AttestationResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -81,7 +79,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -105,7 +103,6 @@ class OperationalCredentialsCluster( if (tag == ContextSpecificTag(TAG_ATTESTATION_SIGNATURE)) { attestationSignature_decoded = tlvReader.getByteArray(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -125,11 +122,9 @@ class OperationalCredentialsCluster( suspend fun certificateChainRequest( certificateType: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): CertificateChainResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -142,7 +137,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -159,7 +154,6 @@ class OperationalCredentialsCluster( if (tag == ContextSpecificTag(TAG_CERTIFICATE)) { certificate_decoded = tlvReader.getByteArray(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -176,11 +170,9 @@ class OperationalCredentialsCluster( suspend fun CSRRequest( CSRNonce: ByteArray, isForUpdateNOC: Boolean?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): CSRResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -198,7 +190,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -222,7 +214,6 @@ class OperationalCredentialsCluster( if (tag == ContextSpecificTag(TAG_ATTESTATION_SIGNATURE)) { attestationSignature_decoded = tlvReader.getByteArray(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -246,11 +237,9 @@ class OperationalCredentialsCluster( IPKValue: ByteArray, caseAdminSubject: ULong, adminVendorId: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NOCResponse { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -275,7 +264,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -326,7 +315,6 @@ class OperationalCredentialsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -343,11 +331,9 @@ class OperationalCredentialsCluster( suspend fun updateNOC( NOCValue: ByteArray, ICACValue: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NOCResponse { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -363,7 +349,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -414,7 +400,6 @@ class OperationalCredentialsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -428,10 +413,8 @@ class OperationalCredentialsCluster( return NOCResponse(statusCode_decoded, fabricIndex_decoded, debugText_decoded) } - suspend fun updateFabricLabel(label: String, timedInvokeTimeoutMs: Int? = null): NOCResponse { + suspend fun updateFabricLabel(label: String, timedInvokeTimeout: Duration? = null): NOCResponse { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -444,7 +427,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -495,7 +478,6 @@ class OperationalCredentialsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -509,10 +491,8 @@ class OperationalCredentialsCluster( return NOCResponse(statusCode_decoded, fabricIndex_decoded, debugText_decoded) } - suspend fun removeFabric(fabricIndex: UByte, timedInvokeTimeoutMs: Int? = null): NOCResponse { + suspend fun removeFabric(fabricIndex: UByte, timedInvokeTimeout: Duration? = null): NOCResponse { val commandId: UInt = 10u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -525,7 +505,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -576,7 +556,6 @@ class OperationalCredentialsCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -592,11 +571,9 @@ class OperationalCredentialsCluster( suspend fun addTrustedRootCertificate( rootCACertificate: ByteArray, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 11u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -609,7 +586,7 @@ class OperationalCredentialsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalStateCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalStateCluster.kt index 1fa39c3ce846ee..82671e7f1c6083 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalStateCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalStateCluster.kt @@ -61,10 +61,8 @@ class OperationalStateCluster( class AttributeListAttribute(val value: List) - suspend fun pause(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun pause(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class OperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -92,7 +90,6 @@ class OperationalStateCluster( commandResponseState_decoded = OperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -106,10 +103,8 @@ class OperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun stop(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun stop(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -119,7 +114,7 @@ class OperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -137,7 +132,6 @@ class OperationalStateCluster( commandResponseState_decoded = OperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -151,10 +145,8 @@ class OperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun start(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun start(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -164,7 +156,7 @@ class OperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -182,7 +174,6 @@ class OperationalStateCluster( commandResponseState_decoded = OperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -196,10 +187,8 @@ class OperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun resume(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun resume(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -209,7 +198,7 @@ class OperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -227,7 +216,6 @@ class OperationalStateCluster( commandResponseState_decoded = OperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateProviderCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateProviderCluster.kt index 42062ad4b77498..83c5b1a11a375c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateProviderCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateProviderCluster.kt @@ -67,11 +67,9 @@ class OtaSoftwareUpdateProviderCluster( location: String?, requestorCanConsent: Boolean?, metadataForProvider: ByteArray?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): QueryImageResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -115,7 +113,7 @@ class OtaSoftwareUpdateProviderCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -251,7 +249,6 @@ class OtaSoftwareUpdateProviderCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -277,11 +274,9 @@ class OtaSoftwareUpdateProviderCluster( suspend fun applyUpdateRequest( updateToken: ByteArray, newVersion: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ApplyUpdateResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -297,7 +292,7 @@ class OtaSoftwareUpdateProviderCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -321,7 +316,6 @@ class OtaSoftwareUpdateProviderCluster( if (tag == ContextSpecificTag(TAG_DELAYED_ACTION_TIME)) { delayedActionTime_decoded = tlvReader.getUInt(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -342,11 +336,9 @@ class OtaSoftwareUpdateProviderCluster( suspend fun notifyUpdateApplied( updateToken: ByteArray, softwareVersion: UInt, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -362,7 +354,7 @@ class OtaSoftwareUpdateProviderCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateRequestorCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateRequestorCluster.kt index 66000d0ce29082..ff7f35ac10a4ee 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateRequestorCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateRequestorCluster.kt @@ -60,11 +60,9 @@ class OtaSoftwareUpdateRequestorCluster( announcementReason: UByte, metadataForNode: ByteArray?, endpoint: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -91,7 +89,7 @@ class OtaSoftwareUpdateRequestorCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -138,11 +136,9 @@ class OtaSoftwareUpdateRequestorCluster( suspend fun writeDefaultOTAProvidersAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -161,7 +157,7 @@ class OtaSoftwareUpdateRequestorCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenCavityOperationalStateCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenCavityOperationalStateCluster.kt index 5860562564f696..3a126cfd15c79d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenCavityOperationalStateCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenCavityOperationalStateCluster.kt @@ -61,10 +61,8 @@ class OvenCavityOperationalStateCluster( class AttributeListAttribute(val value: List) - suspend fun pause(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun pause(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class OvenCavityOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -92,7 +90,6 @@ class OvenCavityOperationalStateCluster( commandResponseState_decoded = OvenCavityOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -106,10 +103,8 @@ class OvenCavityOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun stop(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun stop(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -119,7 +114,7 @@ class OvenCavityOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -137,7 +132,6 @@ class OvenCavityOperationalStateCluster( commandResponseState_decoded = OvenCavityOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -151,10 +145,8 @@ class OvenCavityOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun start(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun start(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -164,7 +156,7 @@ class OvenCavityOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -182,7 +174,6 @@ class OvenCavityOperationalStateCluster( commandResponseState_decoded = OvenCavityOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -196,10 +187,8 @@ class OvenCavityOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun resume(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun resume(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -209,7 +198,7 @@ class OvenCavityOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -227,7 +216,6 @@ class OvenCavityOperationalStateCluster( commandResponseState_decoded = OvenCavityOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenModeCluster.kt index d9984fef2ed1ef..aa0be94f6d804b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/OvenModeCluster.kt @@ -55,11 +55,9 @@ class OvenModeCluster(private val controller: MatterController, private val endp suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -72,7 +70,7 @@ class OvenModeCluster(private val controller: MatterController, private val endp InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -106,7 +104,6 @@ class OvenModeCluster(private val controller: MatterController, private val endp } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -230,10 +227,8 @@ class OvenModeCluster(private val controller: MatterController, private val endp return StartUpModeAttribute(decodedValue) } - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -248,7 +243,7 @@ class OvenModeCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -313,10 +308,8 @@ class OvenModeCluster(private val controller: MatterController, private val endp return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -331,7 +324,7 @@ class OvenModeCluster(private val controller: MatterController, private val endp tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/PumpConfigurationAndControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/PumpConfigurationAndControlCluster.kt index 7d6d62984c3579..966aa570f2f950 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/PumpConfigurationAndControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/PumpConfigurationAndControlCluster.kt @@ -818,10 +818,8 @@ class PumpConfigurationAndControlCluster( return LifetimeRunningHoursAttribute(decodedValue) } - suspend fun writeLifetimeRunningHoursAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLifetimeRunningHoursAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 21u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -836,7 +834,7 @@ class PumpConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -942,10 +940,11 @@ class PumpConfigurationAndControlCluster( return LifetimeEnergyConsumedAttribute(decodedValue) } - suspend fun writeLifetimeEnergyConsumedAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLifetimeEnergyConsumedAttribute( + value: UInt, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 23u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -960,7 +959,7 @@ class PumpConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1015,10 +1014,8 @@ class PumpConfigurationAndControlCluster( return decodedValue } - suspend fun writeOperationModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOperationModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 32u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1033,7 +1030,7 @@ class PumpConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1093,10 +1090,8 @@ class PumpConfigurationAndControlCluster( return decodedValue } - suspend fun writeControlModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeControlModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 33u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1111,7 +1106,7 @@ class PumpConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAndTemperatureControlledCabinetModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAndTemperatureControlledCabinetModeCluster.kt index ae1b353d135399..eda1f4a74607e6 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAndTemperatureControlledCabinetModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/RefrigeratorAndTemperatureControlledCabinetModeCluster.kt @@ -60,11 +60,9 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -77,7 +75,7 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -111,7 +109,6 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -240,10 +237,8 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( return StartUpModeAttribute(decodedValue) } - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -258,7 +253,7 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -323,10 +318,8 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -341,7 +334,7 @@ class RefrigeratorAndTemperatureControlledCabinetModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcCleanModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcCleanModeCluster.kt index e0aec7f0b69d1b..a960aec6b98601 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcCleanModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcCleanModeCluster.kt @@ -56,11 +56,9 @@ class RvcCleanModeCluster( suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -73,7 +71,7 @@ class RvcCleanModeCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -107,7 +105,6 @@ class RvcCleanModeCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -231,10 +228,8 @@ class RvcCleanModeCluster( return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -249,7 +244,7 @@ class RvcCleanModeCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcOperationalStateCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcOperationalStateCluster.kt index fd6bdf869add7d..399b9209825a6d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcOperationalStateCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcOperationalStateCluster.kt @@ -61,10 +61,8 @@ class RvcOperationalStateCluster( class AttributeListAttribute(val value: List) - suspend fun pause(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun pause(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class RvcOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -92,7 +90,6 @@ class RvcOperationalStateCluster( commandResponseState_decoded = RvcOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -106,10 +103,8 @@ class RvcOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun stop(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun stop(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -119,7 +114,7 @@ class RvcOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -137,7 +132,6 @@ class RvcOperationalStateCluster( commandResponseState_decoded = RvcOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -151,10 +145,8 @@ class RvcOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun start(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun start(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -164,7 +156,7 @@ class RvcOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -182,7 +174,6 @@ class RvcOperationalStateCluster( commandResponseState_decoded = RvcOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -196,10 +187,8 @@ class RvcOperationalStateCluster( return OperationalCommandResponse(commandResponseState_decoded) } - suspend fun resume(timedInvokeTimeoutMs: Int? = null): OperationalCommandResponse { + suspend fun resume(timedInvokeTimeout: Duration? = null): OperationalCommandResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -209,7 +198,7 @@ class RvcOperationalStateCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -227,7 +216,6 @@ class RvcOperationalStateCluster( commandResponseState_decoded = RvcOperationalStateClusterErrorStateStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcRunModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcRunModeCluster.kt index a8007f66cec08c..46c2543f10edf9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcRunModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/RvcRunModeCluster.kt @@ -53,11 +53,9 @@ class RvcRunModeCluster(private val controller: MatterController, private val en suspend fun changeToMode( newMode: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ChangeToModeResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -70,7 +68,7 @@ class RvcRunModeCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -104,7 +102,6 @@ class RvcRunModeCluster(private val controller: MatterController, private val en } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -228,10 +225,8 @@ class RvcRunModeCluster(private val controller: MatterController, private val en return OnModeAttribute(decodedValue) } - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -246,7 +241,7 @@ class RvcRunModeCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/SampleMeiCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/SampleMeiCluster.kt index 3b8c7290bdf743..66f2110368163f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/SampleMeiCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/SampleMeiCluster.kt @@ -47,10 +47,8 @@ class SampleMeiCluster(private val controller: MatterController, private val end class AttributeListAttribute(val value: List) - suspend fun ping(timedInvokeTimeoutMs: Int? = null) { + suspend fun ping(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,7 +58,7 @@ class SampleMeiCluster(private val controller: MatterController, private val end InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -70,11 +68,9 @@ class SampleMeiCluster(private val controller: MatterController, private val end suspend fun addArguments( arg1: UByte, arg2: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): AddArgumentsResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -90,7 +86,7 @@ class SampleMeiCluster(private val controller: MatterController, private val end InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -107,7 +103,6 @@ class SampleMeiCluster(private val controller: MatterController, private val end if (tag == ContextSpecificTag(TAG_RETURN_VALUE)) { returnValue_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -152,10 +147,8 @@ class SampleMeiCluster(private val controller: MatterController, private val end return decodedValue } - suspend fun writeFlipFlopAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeFlipFlopAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -170,7 +163,7 @@ class SampleMeiCluster(private val controller: MatterController, private val end tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ScenesCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ScenesCluster.kt index e5c8a3894ea1d8..f5087794fe5179 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ScenesCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ScenesCluster.kt @@ -93,11 +93,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi transitionTime: UShort, sceneName: String, extensionFieldSets: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): AddSceneResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -126,7 +124,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -157,7 +155,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_SCENE_I_D)) { sceneID_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -182,11 +179,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun viewScene( groupID: UShort, sceneID: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): ViewSceneResponse { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -202,7 +197,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -290,7 +285,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -322,11 +316,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun removeScene( groupID: UShort, sceneID: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): RemoveSceneResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -342,7 +334,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -373,7 +365,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_SCENE_I_D)) { sceneID_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -397,11 +388,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun removeAllScenes( groupID: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): RemoveAllScenesResponse { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -414,7 +403,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -438,7 +427,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_GROUP_I_D)) { groupID_decoded = tlvReader.getUShort(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -459,11 +447,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun storeScene( groupID: UShort, sceneID: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): StoreSceneResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -479,7 +465,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -510,7 +496,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_SCENE_I_D)) { sceneID_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -536,11 +521,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi groupID: UShort, sceneID: UByte, transitionTime: UShort?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -561,7 +544,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -570,11 +553,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun getSceneMembership( groupID: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetSceneMembershipResponse { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -587,7 +568,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -652,7 +633,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -681,11 +661,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi transitionTime: UShort, sceneName: String, extensionFieldSets: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): EnhancedAddSceneResponse { val commandId: UInt = 64u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -714,7 +692,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -745,7 +723,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_SCENE_I_D)) { sceneID_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -770,11 +747,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi suspend fun enhancedViewScene( groupID: UShort, sceneID: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): EnhancedViewSceneResponse { val commandId: UInt = 65u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -790,7 +765,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -878,7 +853,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -913,11 +887,9 @@ class ScenesCluster(private val controller: MatterController, private val endpoi sceneIdentifierFrom: UByte, groupIdentifierTo: UShort, sceneIdentifierTo: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): CopySceneResponse { val commandId: UInt = 66u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -942,7 +914,7 @@ class ScenesCluster(private val controller: MatterController, private val endpoi InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -973,7 +945,6 @@ class ScenesCluster(private val controller: MatterController, private val endpoi if (tag == ContextSpecificTag(TAG_SCENE_IDENTIFIER_FROM)) { sceneIdentifierFrom_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/SmokeCoAlarmCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/SmokeCoAlarmCluster.kt index 5d0bbf0a702302..2b8b2e7944bf60 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/SmokeCoAlarmCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/SmokeCoAlarmCluster.kt @@ -47,10 +47,8 @@ class SmokeCoAlarmCluster( class AttributeListAttribute(val value: List) - suspend fun selfTestRequest(timedInvokeTimeoutMs: Int? = null) { + suspend fun selfTestRequest(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -60,7 +58,7 @@ class SmokeCoAlarmCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -474,10 +472,11 @@ class SmokeCoAlarmCluster( return decodedValue } - suspend fun writeSmokeSensitivityLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSmokeSensitivityLevelAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 11u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -492,7 +491,7 @@ class SmokeCoAlarmCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/SoftwareDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/SoftwareDiagnosticsCluster.kt index 7726983ed52b47..196be440046c32 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/SoftwareDiagnosticsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/SoftwareDiagnosticsCluster.kt @@ -46,10 +46,8 @@ class SoftwareDiagnosticsCluster( class AttributeListAttribute(val value: List) - suspend fun resetWatermarks(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetWatermarks(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -59,7 +57,7 @@ class SoftwareDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/TargetNavigatorCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/TargetNavigatorCluster.kt index b528993e51a7e6..8bcc7e0fa5c03e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/TargetNavigatorCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/TargetNavigatorCluster.kt @@ -52,11 +52,9 @@ class TargetNavigatorCluster( suspend fun navigateTarget( target: UByte, data: String?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): NavigateTargetResponse { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -72,7 +70,7 @@ class TargetNavigatorCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -106,7 +104,6 @@ class TargetNavigatorCluster( } } } else { - // Skip unknown tags tlvReader.skipElement() } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/TemperatureControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/TemperatureControlCluster.kt index f6663fee2f8e26..2bae8e12eae0b4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/TemperatureControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/TemperatureControlCluster.kt @@ -50,11 +50,9 @@ class TemperatureControlCluster( suspend fun setTemperature( targetTemperature: Short?, targetTemperatureLevel: UByte?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -74,7 +72,7 @@ class TemperatureControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt index 4ab15f65f59b01..b29d3540e22082 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt @@ -74,10 +74,8 @@ class ThermostatCluster(private val controller: MatterController, private val en class AttributeListAttribute(val value: List) - suspend fun setpointRaiseLower(mode: UByte, amount: Byte, timedInvokeTimeoutMs: Int? = null) { + suspend fun setpointRaiseLower(mode: UByte, amount: Byte, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -93,7 +91,7 @@ class ThermostatCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -105,11 +103,9 @@ class ThermostatCluster(private val controller: MatterController, private val en dayOfWeekForSequence: UByte, modeForSequence: UByte, transitions: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -138,7 +134,7 @@ class ThermostatCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -148,11 +144,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun getWeeklySchedule( daysToReturn: UByte, modeToReturn: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): GetWeeklyScheduleResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -168,7 +162,7 @@ class ThermostatCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -213,7 +207,6 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -244,10 +237,8 @@ class ThermostatCluster(private val controller: MatterController, private val en ) } - suspend fun clearWeeklySchedule(timedInvokeTimeoutMs: Int? = null) { + suspend fun clearWeeklySchedule(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -257,7 +248,7 @@ class ThermostatCluster(private val controller: MatterController, private val en InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -632,11 +623,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeHVACSystemTypeConfigurationAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 9u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -651,7 +640,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -713,11 +702,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeLocalTemperatureCalibrationAttribute( value: Byte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -732,7 +719,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -794,11 +781,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeOccupiedCoolingSetpointAttribute( value: Short, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 17u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -813,7 +798,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -875,11 +860,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeOccupiedHeatingSetpointAttribute( value: Short, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 18u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -894,7 +877,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -956,11 +939,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeUnoccupiedCoolingSetpointAttribute( value: Short, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 19u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -975,7 +956,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1037,11 +1018,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeUnoccupiedHeatingSetpointAttribute( value: Short, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 20u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1056,7 +1035,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1116,10 +1095,11 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeMinHeatSetpointLimitAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMinHeatSetpointLimitAttribute( + value: Short, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 21u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1134,7 +1114,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1194,10 +1174,11 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeMaxHeatSetpointLimitAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMaxHeatSetpointLimitAttribute( + value: Short, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 22u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1212,7 +1193,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1272,10 +1253,11 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeMinCoolSetpointLimitAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMinCoolSetpointLimitAttribute( + value: Short, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 23u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1290,7 +1272,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1350,10 +1332,11 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeMaxCoolSetpointLimitAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMaxCoolSetpointLimitAttribute( + value: Short, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 24u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1368,7 +1351,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1428,10 +1411,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeMinSetpointDeadBandAttribute(value: Byte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeMinSetpointDeadBandAttribute(value: Byte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 25u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1446,7 +1427,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1506,10 +1487,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeRemoteSensingAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRemoteSensingAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 26u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1524,7 +1503,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1581,11 +1560,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeControlSequenceOfOperationAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 27u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1600,7 +1577,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1655,10 +1632,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeSystemModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeSystemModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 28u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1673,7 +1648,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1879,11 +1854,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeTemperatureSetpointHoldAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 35u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1898,7 +1871,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1968,11 +1941,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeTemperatureSetpointHoldDurationAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 36u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1987,7 +1958,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2051,11 +2022,9 @@ class ThermostatCluster(private val controller: MatterController, private val en suspend fun writeThermostatProgrammingOperationModeAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 37u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2070,7 +2039,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2286,10 +2255,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return OccupiedSetbackAttribute(decodedValue) } - suspend fun writeOccupiedSetbackAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOccupiedSetbackAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 52u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2304,7 +2271,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2451,10 +2418,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return UnoccupiedSetbackAttribute(decodedValue) } - suspend fun writeUnoccupiedSetbackAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeUnoccupiedSetbackAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 55u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2469,7 +2434,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2611,10 +2576,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeEmergencyHeatDeltaAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEmergencyHeatDeltaAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 58u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2629,7 +2592,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2689,10 +2652,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACTypeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACTypeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 64u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2707,7 +2668,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2767,10 +2728,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACCapacityAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACCapacityAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 65u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2785,7 +2744,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2845,10 +2804,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACRefrigerantTypeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACRefrigerantTypeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 66u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2863,7 +2820,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2923,10 +2880,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACCompressorTypeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACCompressorTypeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 67u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2941,7 +2896,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3001,10 +2956,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACErrorCodeAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACErrorCodeAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 68u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3019,7 +2972,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3079,10 +3032,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACLouverPositionAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACLouverPositionAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 69u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3097,7 +3048,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3198,10 +3149,8 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACCapacityformatAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeACCapacityformatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 71u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3216,7 +3165,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatUserInterfaceConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatUserInterfaceConfigurationCluster.kt index a535c7912ace54..7f6112789198f1 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatUserInterfaceConfigurationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatUserInterfaceConfigurationCluster.kt @@ -75,10 +75,11 @@ class ThermostatUserInterfaceConfigurationCluster( return decodedValue } - suspend fun writeTemperatureDisplayModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeTemperatureDisplayModeAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -93,7 +94,7 @@ class ThermostatUserInterfaceConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -148,10 +149,8 @@ class ThermostatUserInterfaceConfigurationCluster( return decodedValue } - suspend fun writeKeypadLockoutAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeKeypadLockoutAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -166,7 +165,7 @@ class ThermostatUserInterfaceConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -230,11 +229,9 @@ class ThermostatUserInterfaceConfigurationCluster( suspend fun writeScheduleProgrammingVisibilityAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -249,7 +246,7 @@ class ThermostatUserInterfaceConfigurationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThreadNetworkDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThreadNetworkDiagnosticsCluster.kt index 0e75d1581d94a6..33fa378831a73d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThreadNetworkDiagnosticsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThreadNetworkDiagnosticsCluster.kt @@ -86,10 +86,8 @@ class ThreadNetworkDiagnosticsCluster( class AttributeListAttribute(val value: List) - suspend fun resetCounts(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetCounts(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -99,7 +97,7 @@ class ThreadNetworkDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeFormatLocalizationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeFormatLocalizationCluster.kt index a94ae87a98ae2e..41dc7099e7268b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeFormatLocalizationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeFormatLocalizationCluster.kt @@ -77,10 +77,8 @@ class TimeFormatLocalizationCluster( return decodedValue } - suspend fun writeHourFormatAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeHourFormatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -95,7 +93,7 @@ class TimeFormatLocalizationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -155,10 +153,8 @@ class TimeFormatLocalizationCluster( return decodedValue } - suspend fun writeActiveCalendarTypeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeActiveCalendarTypeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -173,7 +169,7 @@ class TimeFormatLocalizationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeSynchronizationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeSynchronizationCluster.kt index 8ad5b457803684..5989f79f117659 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeSynchronizationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimeSynchronizationCluster.kt @@ -63,11 +63,9 @@ class TimeSynchronizationCluster( UTCTime: ULong, granularity: UByte, timeSource: UByte?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -86,7 +84,7 @@ class TimeSynchronizationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -95,11 +93,9 @@ class TimeSynchronizationCluster( suspend fun setTrustedTimeSource( trustedTimeSource: TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -114,7 +110,7 @@ class TimeSynchronizationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -123,11 +119,9 @@ class TimeSynchronizationCluster( suspend fun setTimeZone( timeZone: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): SetTimeZoneResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -144,7 +138,7 @@ class TimeSynchronizationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -161,7 +155,6 @@ class TimeSynchronizationCluster( if (tag == ContextSpecificTag(TAG_D_S_T_OFFSET_REQUIRED)) { DSTOffsetRequired_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -177,11 +170,9 @@ class TimeSynchronizationCluster( suspend fun setDSTOffset( DSTOffset: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -198,17 +189,15 @@ class TimeSynchronizationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun setDefaultNTP(defaultNTP: String?, timedInvokeTimeoutMs: Int? = null) { + suspend fun setDefaultNTP(defaultNTP: String?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -221,7 +210,7 @@ class TimeSynchronizationCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimerCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimerCluster.kt index 9a200d28b3cb26..cbba2941c53728 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/TimerCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/TimerCluster.kt @@ -42,10 +42,8 @@ class TimerCluster(private val controller: MatterController, private val endpoin class AttributeListAttribute(val value: List) - suspend fun setTimer(newTime: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun setTimer(newTime: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -58,17 +56,15 @@ class TimerCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun resetTimer(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetTimer(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -78,17 +74,15 @@ class TimerCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun addTime(additionalTime: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun addTime(additionalTime: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -101,17 +95,15 @@ class TimerCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun reduceTime(timeReduction: UInt, timedInvokeTimeoutMs: Int? = null) { + suspend fun reduceTime(timeReduction: UInt, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -124,7 +116,7 @@ class TimerCluster(private val controller: MatterController, private val endpoin InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitLocalizationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitLocalizationCluster.kt index 75cd20f19e793a..2d18672a45c3a9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitLocalizationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitLocalizationCluster.kt @@ -80,10 +80,8 @@ class UnitLocalizationCluster( return decodedValue } - suspend fun writeTemperatureUnitAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeTemperatureUnitAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -98,7 +96,7 @@ class UnitLocalizationCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt index c0bd70eb10c1f0..e4961f84edc106 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt @@ -192,10 +192,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e class AttributeListAttribute(val value: List) - suspend fun test(timedInvokeTimeoutMs: Int? = null) { + suspend fun test(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -205,17 +203,15 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun testNotHandled(timedInvokeTimeoutMs: Int? = null) { + suspend fun testNotHandled(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -225,17 +221,15 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun testSpecific(timedInvokeTimeoutMs: Int? = null): TestSpecificResponse { + suspend fun testSpecific(timedInvokeTimeout: Duration? = null): TestSpecificResponse { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -245,7 +239,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -262,7 +256,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_RETURN_VALUE)) { returnValue_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -276,10 +269,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return TestSpecificResponse(returnValue_decoded) } - suspend fun testUnknownCommand(timedInvokeTimeoutMs: Int? = null) { + suspend fun testUnknownCommand(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 3u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -289,7 +280,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -299,11 +290,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testAddArguments( arg1: UByte, arg2: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestAddArgumentsResponse { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -319,7 +308,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -336,7 +325,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_RETURN_VALUE)) { returnValue_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -352,11 +340,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testSimpleArgumentRequest( arg1: Boolean, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestSimpleArgumentResponse { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -369,7 +355,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -386,7 +372,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_RETURN_VALUE)) { returnValue_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -407,11 +392,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e arg4: List, arg5: UByte, arg6: Boolean, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestStructArrayArgumentResponse { val commandId: UInt = 6u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -455,7 +438,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -535,7 +518,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_ARG6)) { arg6_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -578,11 +560,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testStructArgumentRequest( arg1: UnitTestingClusterSimpleStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -595,7 +575,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -612,7 +592,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -628,11 +607,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testNestedStructArgumentRequest( arg1: UnitTestingClusterNestedStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -645,7 +622,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -662,7 +639,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -678,11 +654,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testListStructArgumentRequest( arg1: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 9u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -699,7 +673,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -716,7 +690,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -732,11 +705,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testListInt8UArgumentRequest( arg1: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 10u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -753,7 +724,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -770,7 +741,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -786,11 +756,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testNestedStructListArgumentRequest( arg1: UnitTestingClusterNestedStructList, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 11u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -803,7 +771,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -820,7 +788,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -836,11 +803,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testListNestedStructListArgumentRequest( arg1: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): BooleanResponse { val commandId: UInt = 12u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -857,7 +822,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -874,7 +839,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getBoolean(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -890,11 +854,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testListInt8UReverseRequest( arg1: List, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestListInt8UReverseResponse { val commandId: UInt = 13u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -911,7 +873,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -935,7 +897,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvReader.exitContainer() } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -952,11 +913,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testEnumsRequest( arg1: UShort, arg2: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestEnumsResponse { val commandId: UInt = 14u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -972,7 +931,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -996,7 +955,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_ARG2)) { arg2_decoded = tlvReader.getUByte(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1016,11 +974,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testNullableOptionalRequest( arg1: UByte?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestNullableOptionalResponse { val commandId: UInt = 15u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1033,7 +989,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1106,7 +1062,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1138,11 +1093,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e nullableList: List?, optionalList: List?, nullableOptionalList: List?, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestComplexNullableOptionalResponse { val commandId: UInt = 16u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1220,7 +1173,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1604,7 +1557,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1693,11 +1645,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun simpleStructEchoRequest( arg1: UnitTestingClusterSimpleStruct, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): SimpleStructResponse { val commandId: UInt = 17u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1710,7 +1660,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1727,7 +1677,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_ARG1)) { arg1_decoded = UnitTestingClusterSimpleStruct.fromTlv(tag, tlvReader) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1741,9 +1690,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return SimpleStructResponse(arg1_decoded) } - suspend fun timedInvokeRequest(timedInvokeTimeoutMs: Int) { + suspend fun timedInvokeRequest(timedInvokeTimeout: Duration) { val commandId: UInt = 18u - val timeoutMs: Duration = Duration.ofMillis(timedInvokeTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1753,17 +1701,18 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun testSimpleOptionalArgumentRequest(arg1: Boolean?, timedInvokeTimeoutMs: Int? = null) { + suspend fun testSimpleOptionalArgumentRequest( + arg1: Boolean?, + timedInvokeTimeout: Duration? = null + ) { val commandId: UInt = 19u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1776,7 +1725,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1787,11 +1736,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e arg1: UByte, arg2: UByte, arg3: Boolean, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestEmitTestEventResponse { val commandId: UInt = 20u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1810,7 +1757,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1827,7 +1774,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getULong(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1843,11 +1789,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun testEmitTestFabricScopedEventRequest( arg1: UByte, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ): TestEmitTestFabricScopedEventResponse { val commandId: UInt = 21u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -1860,7 +1804,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1877,7 +1821,6 @@ class UnitTestingCluster(private val controller: MatterController, private val e if (tag == ContextSpecificTag(TAG_VALUE)) { value_decoded = tlvReader.getULong(tag) } else { - // Skip unknown tags tlvReader.skipElement() } } @@ -1922,10 +1865,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeBooleanAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBooleanAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1940,7 +1881,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -1995,10 +1936,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeBitmap8Attribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBitmap8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2013,7 +1952,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2068,10 +2007,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeBitmap16Attribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBitmap16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 2u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2086,7 +2023,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2141,10 +2078,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeBitmap32Attribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBitmap32Attribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 3u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2159,7 +2094,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2214,10 +2149,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeBitmap64Attribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeBitmap64Attribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 4u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2232,7 +2165,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2287,10 +2220,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt8uAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt8uAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2305,7 +2236,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2360,10 +2291,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt16uAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt16uAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 6u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2378,7 +2307,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2433,10 +2362,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt24uAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt24uAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 7u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2451,7 +2378,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2506,10 +2433,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt32uAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt32uAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 8u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2524,7 +2449,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2579,10 +2504,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt40uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt40uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 9u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2597,7 +2520,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2652,10 +2575,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt48uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt48uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 10u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2670,7 +2591,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2725,10 +2646,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt56uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt56uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 11u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2743,7 +2662,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2798,10 +2717,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt64uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt64uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 12u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2816,7 +2733,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2871,10 +2788,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt8sAttribute(value: Byte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt8sAttribute(value: Byte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 13u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2889,7 +2804,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -2944,10 +2859,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt16sAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt16sAttribute(value: Short, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 14u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -2962,7 +2875,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3017,10 +2930,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt24sAttribute(value: Int, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt24sAttribute(value: Int, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 15u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3035,7 +2946,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3090,10 +3001,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt32sAttribute(value: Int, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt32sAttribute(value: Int, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3108,7 +3017,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3163,10 +3072,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt40sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt40sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 17u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3181,7 +3088,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3236,10 +3143,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt48sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt48sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 18u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3254,7 +3159,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3309,10 +3214,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt56sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt56sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 19u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3327,7 +3230,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3382,10 +3285,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeInt64sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeInt64sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 20u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3400,7 +3301,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3455,10 +3356,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeEnum8Attribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEnum8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 21u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3473,7 +3372,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3528,10 +3427,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeEnum16Attribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEnum16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 22u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3546,7 +3443,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3601,10 +3498,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeFloatSingleAttribute(value: Float, timedWriteTimeoutMs: Int? = null) { + suspend fun writeFloatSingleAttribute(value: Float, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 23u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3619,7 +3514,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3674,10 +3569,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeFloatDoubleAttribute(value: Double, timedWriteTimeoutMs: Int? = null) { + suspend fun writeFloatDoubleAttribute(value: Double, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 24u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3692,7 +3585,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3747,10 +3640,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeOctetStringAttribute(value: ByteArray, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOctetStringAttribute(value: ByteArray, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 25u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -3765,7 +3656,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3827,10 +3718,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return ListInt8uAttribute(decodedValue) } - suspend fun writeListInt8uAttribute(value: List, timedWriteTimeoutMs: Int? = null) { + suspend fun writeListInt8uAttribute(value: List, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 26u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -3849,7 +3738,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -3913,11 +3802,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeListOctetStringAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 27u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -3936,7 +3823,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4000,11 +3887,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeListStructOctetStringAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 28u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -4023,7 +3908,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4078,10 +3963,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeLongOctetStringAttribute(value: ByteArray, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLongOctetStringAttribute(value: ByteArray, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 29u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4096,7 +3979,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4151,10 +4034,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeCharStringAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeCharStringAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 30u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4169,7 +4050,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4224,10 +4105,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeLongCharStringAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeLongCharStringAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 31u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4242,7 +4121,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4297,10 +4176,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeEpochUsAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEpochUsAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 32u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4315,7 +4192,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4370,10 +4247,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeEpochSAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEpochSAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 33u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4388,7 +4263,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4443,10 +4318,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeVendorIdAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeVendorIdAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 34u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4461,7 +4334,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4528,11 +4401,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeListNullablesAndOptionalsStructAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 35u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -4551,7 +4422,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4606,10 +4477,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeEnumAttrAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeEnumAttrAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 36u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4624,7 +4493,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4682,11 +4551,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeStructAttrAttribute( value: UnitTestingClusterSimpleStruct, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 37u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() value.toTlv(AnonymousTag, tlvWriter) @@ -4701,7 +4568,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4756,10 +4623,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeRangeRestrictedInt8uAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRangeRestrictedInt8uAttribute( + value: UByte, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 38u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4774,7 +4642,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4829,10 +4697,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeRangeRestrictedInt8sAttribute(value: Byte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRangeRestrictedInt8sAttribute(value: Byte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 39u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4847,7 +4713,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4902,10 +4768,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeRangeRestrictedInt16uAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRangeRestrictedInt16uAttribute( + value: UShort, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 40u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4920,7 +4787,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -4975,10 +4842,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeRangeRestrictedInt16sAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeRangeRestrictedInt16sAttribute( + value: Short, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 41u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -4993,7 +4861,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5057,11 +4925,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeListLongOctetStringAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 42u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -5080,7 +4946,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5144,11 +5010,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeListFabricScopedAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 43u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -5167,7 +5031,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5222,9 +5086,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeTimedWriteBooleanAttribute(value: Boolean, timedWriteTimeoutMs: Int) { + suspend fun writeTimedWriteBooleanAttribute(value: Boolean, timedWriteTimeout: Duration) { val ATTRIBUTE_ID: UInt = 48u - val timeoutMs: Duration = Duration.ofMillis(timedWriteTimeoutMs.toLong()) val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5239,7 +5102,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5294,10 +5157,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeGeneralErrorBooleanAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeGeneralErrorBooleanAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 49u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5312,7 +5176,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5367,10 +5231,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeClusterErrorBooleanAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeClusterErrorBooleanAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 50u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5385,7 +5250,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5445,10 +5310,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeUnsupportedAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeUnsupportedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 255u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5463,7 +5326,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5524,10 +5387,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableBooleanAttribute(decodedValue) } - suspend fun writeNullableBooleanAttribute(value: Boolean, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableBooleanAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16384u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5542,7 +5403,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5603,10 +5464,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableBitmap8Attribute(decodedValue) } - suspend fun writeNullableBitmap8Attribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableBitmap8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16385u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5621,7 +5480,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5682,10 +5541,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableBitmap16Attribute(decodedValue) } - suspend fun writeNullableBitmap16Attribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableBitmap16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16386u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5700,7 +5557,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5761,10 +5618,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableBitmap32Attribute(decodedValue) } - suspend fun writeNullableBitmap32Attribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableBitmap32Attribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16387u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5779,7 +5634,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5840,10 +5695,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableBitmap64Attribute(decodedValue) } - suspend fun writeNullableBitmap64Attribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableBitmap64Attribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16388u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5858,7 +5711,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5919,10 +5772,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt8uAttribute(decodedValue) } - suspend fun writeNullableInt8uAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt8uAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16389u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -5937,7 +5788,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -5998,10 +5849,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt16uAttribute(decodedValue) } - suspend fun writeNullableInt16uAttribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt16uAttribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16390u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6016,7 +5865,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6077,10 +5926,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt24uAttribute(decodedValue) } - suspend fun writeNullableInt24uAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt24uAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16391u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6095,7 +5942,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6156,10 +6003,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt32uAttribute(decodedValue) } - suspend fun writeNullableInt32uAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt32uAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16392u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6174,7 +6019,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6235,10 +6080,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt40uAttribute(decodedValue) } - suspend fun writeNullableInt40uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt40uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16393u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6253,7 +6096,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6314,10 +6157,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt48uAttribute(decodedValue) } - suspend fun writeNullableInt48uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt48uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16394u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6332,7 +6173,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6393,10 +6234,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt56uAttribute(decodedValue) } - suspend fun writeNullableInt56uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt56uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16395u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6411,7 +6250,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6472,10 +6311,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt64uAttribute(decodedValue) } - suspend fun writeNullableInt64uAttribute(value: ULong, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt64uAttribute(value: ULong, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16396u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6490,7 +6327,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6551,10 +6388,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt8sAttribute(decodedValue) } - suspend fun writeNullableInt8sAttribute(value: Byte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt8sAttribute(value: Byte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16397u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6569,7 +6404,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6630,10 +6465,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt16sAttribute(decodedValue) } - suspend fun writeNullableInt16sAttribute(value: Short, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt16sAttribute(value: Short, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16398u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6648,7 +6481,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6709,10 +6542,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt24sAttribute(decodedValue) } - suspend fun writeNullableInt24sAttribute(value: Int, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt24sAttribute(value: Int, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16399u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6727,7 +6558,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6788,10 +6619,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt32sAttribute(decodedValue) } - suspend fun writeNullableInt32sAttribute(value: Int, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt32sAttribute(value: Int, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16400u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6806,7 +6635,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6867,10 +6696,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt40sAttribute(decodedValue) } - suspend fun writeNullableInt40sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt40sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16401u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6885,7 +6712,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -6946,10 +6773,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt48sAttribute(decodedValue) } - suspend fun writeNullableInt48sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt48sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16402u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -6964,7 +6789,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7025,10 +6850,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt56sAttribute(decodedValue) } - suspend fun writeNullableInt56sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt56sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16403u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7043,7 +6866,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7104,10 +6927,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableInt64sAttribute(decodedValue) } - suspend fun writeNullableInt64sAttribute(value: Long, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableInt64sAttribute(value: Long, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16404u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7122,7 +6943,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7183,10 +7004,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableEnum8Attribute(decodedValue) } - suspend fun writeNullableEnum8Attribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableEnum8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16405u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7201,7 +7020,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7262,10 +7081,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableEnum16Attribute(decodedValue) } - suspend fun writeNullableEnum16Attribute(value: UShort, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableEnum16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16406u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7280,7 +7097,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7341,10 +7158,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableFloatSingleAttribute(decodedValue) } - suspend fun writeNullableFloatSingleAttribute(value: Float, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableFloatSingleAttribute(value: Float, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16407u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7359,7 +7174,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7420,10 +7235,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableFloatDoubleAttribute(decodedValue) } - suspend fun writeNullableFloatDoubleAttribute(value: Double, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableFloatDoubleAttribute( + value: Double, + timedWriteTimeout: Duration? = null + ) { val ATTRIBUTE_ID: UInt = 16408u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7438,7 +7254,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7501,11 +7317,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableOctetStringAttribute( value: ByteArray, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16409u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7520,7 +7334,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7581,10 +7395,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableCharStringAttribute(decodedValue) } - suspend fun writeNullableCharStringAttribute(value: String, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableCharStringAttribute(value: String, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16414u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7599,7 +7411,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7660,10 +7472,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return NullableEnumAttrAttribute(decodedValue) } - suspend fun writeNullableEnumAttrAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeNullableEnumAttrAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16420u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7678,7 +7488,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7741,11 +7551,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableStructAttribute( value: UnitTestingClusterSimpleStruct, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16421u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() value.toTlv(AnonymousTag, tlvWriter) @@ -7760,7 +7568,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7823,11 +7631,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableRangeRestrictedInt8uAttribute( value: UByte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16422u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7842,7 +7648,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7905,11 +7711,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableRangeRestrictedInt8sAttribute( value: Byte, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16423u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -7924,7 +7728,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -7989,11 +7793,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableRangeRestrictedInt16uAttribute( value: UShort, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16424u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8008,7 +7810,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -8073,11 +7875,9 @@ class UnitTestingCluster(private val controller: MatterController, private val e suspend fun writeNullableRangeRestrictedInt16sAttribute( value: Short, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 16425u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8092,7 +7892,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -8152,10 +7952,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e return decodedValue } - suspend fun writeWriteOnlyInt8uAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeWriteOnlyInt8uAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 16426u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8170,7 +7968,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UserLabelCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UserLabelCluster.kt index 808ccdf68d8d94..949d2b8dd1670f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UserLabelCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UserLabelCluster.kt @@ -83,11 +83,9 @@ class UserLabelCluster(private val controller: MatterController, private val end suspend fun writeLabelListAttribute( value: List, - timedWriteTimeoutMs: Int? = null + timedWriteTimeout: Duration? = null ) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startArray(AnonymousTag) @@ -106,7 +104,7 @@ class UserLabelCluster(private val controller: MatterController, private val end tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt index f0062adfb0851e..b3d2e536513087 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt @@ -64,10 +64,8 @@ class ValveConfigurationAndControlCluster( class AttributeListAttribute(val value: List) - suspend fun open(openDuration: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun open(openDuration: UInt?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -80,17 +78,15 @@ class ValveConfigurationAndControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun close(timedInvokeTimeoutMs: Int? = null) { + suspend fun close(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -100,17 +96,15 @@ class ValveConfigurationAndControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun setLevel(level: UByte, openDuration: UInt?, timedInvokeTimeoutMs: Int? = null) { + suspend fun setLevel(level: UByte, openDuration: UInt?, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -126,7 +120,7 @@ class ValveConfigurationAndControlCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -170,10 +164,8 @@ class ValveConfigurationAndControlCluster( return OpenDurationAttribute(decodedValue) } - suspend fun writeOpenDurationAttribute(value: UInt, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOpenDurationAttribute(value: UInt, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 0u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -188,7 +180,7 @@ class ValveConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -404,10 +396,8 @@ class ValveConfigurationAndControlCluster( return decodedValue } - suspend fun writeStartUpStateAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeStartUpStateAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 5u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -422,7 +412,7 @@ class ValveConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) @@ -569,10 +559,8 @@ class ValveConfigurationAndControlCluster( return OpenLevelAttribute(decodedValue) } - suspend fun writeOpenLevelAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeOpenLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 8u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -587,7 +575,7 @@ class ValveConfigurationAndControlCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt index 79619f4ede4c05..57eacac49efc59 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt @@ -70,10 +70,8 @@ class WiFiNetworkDiagnosticsCluster( class AttributeListAttribute(val value: List) - suspend fun resetCounts(timedInvokeTimeoutMs: Int? = null) { + suspend fun resetCounts(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -83,7 +81,7 @@ class WiFiNetworkDiagnosticsCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt index f521fa0e72e514..ecb5a8ad407210 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt @@ -64,10 +64,8 @@ class WindowCoveringCluster( class AttributeListAttribute(val value: List) - suspend fun upOrOpen(timedInvokeTimeoutMs: Int? = null) { + suspend fun upOrOpen(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 0u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -77,17 +75,15 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun downOrClose(timedInvokeTimeoutMs: Int? = null) { + suspend fun downOrClose(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 1u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -97,17 +93,15 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun stopMotion(timedInvokeTimeoutMs: Int? = null) { + suspend fun stopMotion(timedInvokeTimeout: Duration? = null) { val commandId: UInt = 2u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -117,17 +111,15 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun goToLiftValue(liftValue: UShort, timedInvokeTimeoutMs: Int? = null) { + suspend fun goToLiftValue(liftValue: UShort, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 4u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -140,7 +132,7 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -149,11 +141,9 @@ class WindowCoveringCluster( suspend fun goToLiftPercentage( liftPercent100thsValue: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 5u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -166,17 +156,15 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun goToTiltValue(tiltValue: UShort, timedInvokeTimeoutMs: Int? = null) { + suspend fun goToTiltValue(tiltValue: UShort, timedInvokeTimeout: Duration? = null) { val commandId: UInt = 7u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -189,7 +177,7 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -198,11 +186,9 @@ class WindowCoveringCluster( suspend fun goToTiltPercentage( tiltPercent100thsValue: UShort, - timedInvokeTimeoutMs: Int? = null + timedInvokeTimeout: Duration? = null ) { val commandId: UInt = 8u - val timeoutMs: Duration = - timedInvokeTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) @@ -215,7 +201,7 @@ class WindowCoveringCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timeoutMs + timedRequest = timedInvokeTimeout ) val response: InvokeResponse = controller.invoke(request) @@ -1009,10 +995,8 @@ class WindowCoveringCluster( return decodedValue } - suspend fun writeModeAttribute(value: UByte, timedWriteTimeoutMs: Int? = null) { + suspend fun writeModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 23u - val timeoutMs: Duration = - timedWriteTimeoutMs?.let { Duration.ofMillis(it.toLong()) } ?: Duration.ZERO val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -1027,7 +1011,7 @@ class WindowCoveringCluster( tlvPayload = tlvWriter.getEncoded() ) ), - timedRequest = timeoutMs + timedRequest = timedWriteTimeout ) val response: WriteResponse = controller.write(writeRequests) diff --git a/src/controller/python/ChipDeviceController-ScriptBinding.cpp b/src/controller/python/ChipDeviceController-ScriptBinding.cpp index 2d6857d17a4fe6..4979da8acdbe35 100644 --- a/src/controller/python/ChipDeviceController-ScriptBinding.cpp +++ b/src/controller/python/ChipDeviceController-ScriptBinding.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -88,7 +89,7 @@ using namespace chip::DeviceLayer; extern "C" { typedef void (*ConstructBytesArrayFunct)(const uint8_t * dataBuf, uint32_t dataLen); typedef void (*LogMessageFunct)(uint64_t time, uint64_t timeUS, const char * moduleName, uint8_t category, const char * msg); -typedef void (*DeviceAvailableFunc)(DeviceProxy * device, PyChipError err); +typedef void (*DeviceAvailableFunc)(chip::Controller::Python::PyObject * context, DeviceProxy * device, PyChipError err); typedef void (*ChipThreadTaskRunnerFunct)(intptr_t context); typedef void (*DeviceUnpairingCompleteFunct)(uint64_t nodeId, PyChipError error); } @@ -136,7 +137,7 @@ PyChipError pychip_DeviceController_ConnectBLE(chip::Controller::DeviceCommissio PyChipError pychip_DeviceController_ConnectIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, chip::NodeId nodeid); PyChipError pychip_DeviceController_ConnectWithCode(chip::Controller::DeviceCommissioner * devCtrl, const char * onboardingPayload, - chip::NodeId nodeid); + chip::NodeId nodeid, bool networkOnly); PyChipError pychip_DeviceController_UnpairDevice(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId remoteDeviceId, DeviceUnpairingCompleteFunct callback); PyChipError pychip_DeviceController_SetThreadOperationalDataset(const char * threadOperationalDataset, uint32_t size); @@ -207,7 +208,7 @@ const char * pychip_Stack_StatusReportToString(uint32_t profileId, uint16_t stat void pychip_Stack_SetLogFunct(LogMessageFunct logFunct); PyChipError pychip_GetConnectedDeviceByNodeId(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeId, - DeviceAvailableFunc callback); + chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback); PyChipError pychip_FreeOperationalDeviceProxy(chip::OperationalDeviceProxy * deviceProxy); PyChipError pychip_GetLocalSessionId(chip::OperationalDeviceProxy * deviceProxy, uint16_t * localSessionId); PyChipError pychip_GetNumSessionsToPeer(chip::OperationalDeviceProxy * deviceProxy, uint32_t * numSessions); @@ -398,10 +399,13 @@ PyChipError pychip_DeviceController_ConnectIP(chip::Controller::DeviceCommission } PyChipError pychip_DeviceController_ConnectWithCode(chip::Controller::DeviceCommissioner * devCtrl, const char * onboardingPayload, - chip::NodeId nodeid) + chip::NodeId nodeid, bool networkOnly) { + chip::Controller::DiscoveryType discoveryType = chip::Controller::DiscoveryType::kAll; sPairingDelegate.SetExpectingPairingComplete(true); - return ToPyChipError(devCtrl->PairDevice(nodeid, onboardingPayload, sCommissioningParameters)); + if (networkOnly) + discoveryType = chip::Controller::DiscoveryType::kDiscoveryNetworkOnly; + return ToPyChipError(devCtrl->PairDevice(nodeid, onboardingPayload, sCommissioningParameters, discoveryType)); } namespace { @@ -737,36 +741,37 @@ namespace { struct GetDeviceCallbacks { - GetDeviceCallbacks(DeviceAvailableFunc callback) : - mOnSuccess(OnDeviceConnectedFn, this), mOnFailure(OnConnectionFailureFn, this), mCallback(callback) + GetDeviceCallbacks(chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback) : + mOnSuccess(OnDeviceConnectedFn, this), mOnFailure(OnConnectionFailureFn, this), mContext(context), mCallback(callback) {} static void OnDeviceConnectedFn(void * context, Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle) { auto * self = static_cast(context); auto * operationalDeviceProxy = new OperationalDeviceProxy(&exchangeMgr, sessionHandle); - self->mCallback(operationalDeviceProxy, ToPyChipError(CHIP_NO_ERROR)); + self->mCallback(self->mContext, operationalDeviceProxy, ToPyChipError(CHIP_NO_ERROR)); delete self; } static void OnConnectionFailureFn(void * context, const ScopedNodeId & peerId, CHIP_ERROR error) { auto * self = static_cast(context); - self->mCallback(nullptr, ToPyChipError(error)); + self->mCallback(self->mContext, nullptr, ToPyChipError(error)); delete self; } Callback::Callback mOnSuccess; Callback::Callback mOnFailure; + chip::Controller::Python::PyObject * const mContext; DeviceAvailableFunc mCallback; }; } // anonymous namespace PyChipError pychip_GetConnectedDeviceByNodeId(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeId, - DeviceAvailableFunc callback) + chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback) { VerifyOrReturnError(devCtrl != nullptr, ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT)); - auto * callbacks = new GetDeviceCallbacks(callback); + auto * callbacks = new GetDeviceCallbacks(context, callback); return ToPyChipError(devCtrl->GetConnectedDevice(nodeId, &callbacks->mOnSuccess, &callbacks->mOnFailure)); } diff --git a/src/controller/python/OpCredsBinding.cpp b/src/controller/python/OpCredsBinding.cpp index 03f4ca0606975f..79995d133b45e0 100644 --- a/src/controller/python/OpCredsBinding.cpp +++ b/src/controller/python/OpCredsBinding.cpp @@ -160,7 +160,7 @@ class TestCommissioner : public chip::Controller::AutoCommissioner mCompletionError = err; } } - if (report.stageCompleted == chip::Controller::CommissioningStage::kReadCommissioningInfo) + if (report.stageCompleted == chip::Controller::CommissioningStage::kReadCommissioningInfo2) { mReadCommissioningInfo = report.Get(); } diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 0eb22d5f81bf47..72a1f7aaa681fd 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -76,7 +76,7 @@ # # CHIP_ERROR is actually signed, so using c_uint32 is weird, but everything # else seems to do it. -_DeviceAvailableFunct = CFUNCTYPE(None, c_void_p, PyChipError) +_DeviceAvailableCallbackFunct = CFUNCTYPE(None, py_object, c_void_p, PyChipError) _IssueNOCChainCallbackPythonCallbackFunct = CFUNCTYPE( None, py_object, PyChipError, c_void_p, c_size_t, c_void_p, c_size_t, c_void_p, c_size_t, c_void_p, c_size_t, c_uint64) @@ -100,6 +100,11 @@ class NOCChain: adminSubject: int +@_DeviceAvailableCallbackFunct +def _DeviceAvailableCallback(closure, device, err): + closure.deviceAvailable(device, err) + + @_IssueNOCChainCallbackPythonCallbackFunct def _IssueNOCChainCallbackPythonCallback(devCtrl, status: PyChipError, noc: c_void_p, nocLen: int, icac: c_void_p, icacLen: int, rcac: c_void_p, rcacLen: int, ipk: c_void_p, ipkLen: int, adminSubject: int): @@ -759,16 +764,6 @@ def GetConnectedDeviceSync(self, nodeid, allowPASE=True, timeoutMs: int = None): returnErr = None deviceAvailableCV = threading.Condition() - @_DeviceAvailableFunct - def DeviceAvailableCallback(device, err): - nonlocal returnDevice - nonlocal returnErr - nonlocal deviceAvailableCV - with deviceAvailableCV: - returnDevice = c_void_p(device) - returnErr = err - deviceAvailableCV.notify_all() - if allowPASE: res = self._ChipStack.Call(lambda: self._dmLib.pychip_GetDeviceBeingCommissioned( self.devCtrl, nodeid, byref(returnDevice)), timeoutMs) @@ -776,8 +771,22 @@ def DeviceAvailableCallback(device, err): print('Using PASE connection') return DeviceProxyWrapper(returnDevice) + class DeviceAvailableClosure(): + def deviceAvailable(self, device, err): + nonlocal returnDevice + nonlocal returnErr + nonlocal deviceAvailableCV + with deviceAvailableCV: + returnDevice = c_void_p(device) + returnErr = err + deviceAvailableCV.notify_all() + ctypes.pythonapi.Py_DecRef(ctypes.py_object(self)) + + closure = DeviceAvailableClosure() + ctypes.pythonapi.Py_IncRef(ctypes.py_object(closure)) self._ChipStack.Call(lambda: self._dmLib.pychip_GetConnectedDeviceByNodeId( - self.devCtrl, nodeid, DeviceAvailableCallback), timeoutMs).raise_on_error() + self.devCtrl, nodeid, ctypes.py_object(closure), _DeviceAvailableCallback), + timeoutMs).raise_on_error() # The callback might have been received synchronously (during self._ChipStack.Call()). # Check if the device is already set before waiting for the callback. @@ -892,6 +901,45 @@ async def SendCommand(self, nodeid: int, endpoint: int, payload: ClusterObjects. interactionTimeoutMs=interactionTimeoutMs, busyWaitMs=busyWaitMs, suppressResponse=suppressResponse).raise_on_error() return await future + async def SendBatchCommands(self, nodeid: int, commands: typing.List[ClusterCommand.InvokeRequestInfo], + timedRequestTimeoutMs: typing.Optional[int] = None, + interactionTimeoutMs: typing.Optional[int] = None, busyWaitMs: typing.Optional[int] = None, + suppressResponse: typing.Optional[bool] = None): + ''' + Send a batch of cluster-object encapsulated commands to a node and get returned a future that can be awaited upon to receive + the responses. If a valid responseType is passed in, that will be used to deserialize the object. If not, + the type will be automatically deduced from the metadata received over the wire. + + nodeId: Target's Node ID + commands: A list of InvokeRequestInfo containing the commands to invoke. + timedWriteTimeoutMs: Timeout for a timed invoke request. Omit or set to 'None' to indicate a non-timed request. + interactionTimeoutMs: Overall timeout for the interaction. Omit or set to 'None' to have the SDK automatically compute the + right timeout value based on transport characteristics as well as the responsiveness of the target. + busyWaitMs: How long to wait in ms after sending command to device before performing any other operations. + suppressResponse: Do not send a response to this action + + Returns: + - List of command responses in the same order as what was given in `commands`. The type of the response is defined by the command. + - A value of `None` indicates success. + - If only a single command fails, for example with `UNSUPPORTED_COMMAND`, the corresponding index associated with the command will, + contain `interaction_model.Status.UnsupportedCommand`. + - If a command is not responded to by server, command will contain `interaction_model.Status.Failure` + Raises: + - InteractionModelError if error with sending of InvokeRequestMessage fails as a whole. + ''' + self.CheckIsActive() + + eventLoop = asyncio.get_running_loop() + future = eventLoop.create_future() + + device = self.GetConnectedDeviceSync(nodeid, timeoutMs=interactionTimeoutMs) + + ClusterCommand.SendBatchCommands( + future, eventLoop, device.deviceProxy, commands, + timedRequestTimeoutMs=timedRequestTimeoutMs, + interactionTimeoutMs=interactionTimeoutMs, busyWaitMs=busyWaitMs, suppressResponse=suppressResponse).raise_on_error() + return await future + def SendGroupCommand(self, groupid: int, payload: ClusterObjects.ClusterCommand, busyWaitMs: typing.Union[None, int] = None): ''' Send a group cluster-object encapsulated command to a group_id and get returned a future @@ -1532,7 +1580,7 @@ def _InitLib(self): self._dmLib.pychip_DeviceController_ConnectIP.restype = PyChipError self._dmLib.pychip_DeviceController_ConnectWithCode.argtypes = [ - c_void_p, c_char_p, c_uint64] + c_void_p, c_char_p, c_uint64, c_bool] self._dmLib.pychip_DeviceController_ConnectWithCode.restype = PyChipError self._dmLib.pychip_DeviceController_UnpairDevice.argtypes = [ @@ -1568,7 +1616,7 @@ def _InitLib(self): self._dmLib.pychip_ScriptDevicePairingDelegate_SetFabricCheckCallback.restype = PyChipError self._dmLib.pychip_GetConnectedDeviceByNodeId.argtypes = [ - c_void_p, c_uint64, _DeviceAvailableFunct] + c_void_p, c_uint64, py_object, _DeviceAvailableCallbackFunct] self._dmLib.pychip_GetConnectedDeviceByNodeId.restype = PyChipError self._dmLib.pychip_FreeOperationalDeviceProxy.argtypes = [ @@ -1845,7 +1893,7 @@ def CommissionOnNetwork(self, nodeId: int, setupPinCode: int, return PyChipError(CHIP_ERROR_TIMEOUT) return self._ChipStack.commissioningEventRes - def CommissionWithCode(self, setupPayload: str, nodeid: int) -> PyChipError: + def CommissionWithCode(self, setupPayload: str, nodeid: int, networkOnly: bool = False) -> PyChipError: ''' Commission with the given nodeid from the setupPayload. setupPayload may be a QR or manual code. ''' @@ -1861,7 +1909,7 @@ def CommissionWithCode(self, setupPayload: str, nodeid: int) -> PyChipError: self._ChipStack.CallAsync( lambda: self._dmLib.pychip_DeviceController_ConnectWithCode( - self.devCtrl, setupPayload, nodeid) + self.devCtrl, setupPayload, nodeid, networkOnly) ) if not self._ChipStack.commissioningCompleteEvent.isSet(): # Error 50 is a timeout diff --git a/src/controller/python/chip/clusters/Command.py b/src/controller/python/chip/clusters/Command.py index af1336541b2e3e..eabbc2337d129a 100644 --- a/src/controller/python/chip/clusters/Command.py +++ b/src/controller/python/chip/clusters/Command.py @@ -23,7 +23,7 @@ from asyncio.futures import Future from ctypes import CFUNCTYPE, c_bool, c_char_p, c_size_t, c_uint8, c_uint16, c_uint32, c_void_p, py_object from dataclasses import dataclass -from typing import Type, Union +from typing import List, Optional, Type, Union import chip.exceptions import chip.interaction_model @@ -42,6 +42,13 @@ class CommandPath: CommandId: int +@dataclass +class InvokeRequestInfo: + EndpointId: int + Command: ClusterCommand + ResponseType: Optional[Type] = None + + @dataclass class Status: IMStatus: int @@ -94,7 +101,11 @@ def _handleResponse(self, path: CommandPath, status: Status, response: bytes): else: self._future.set_result(None) - def handleResponse(self, path: CommandPath, status: Status, response: bytes): + def handleResponse(self, path: CommandPath, index: int, status: Status, response: bytes): + # For AsyncCommandTransaction we only expect to ever get one response so we don't bother + # checking `index`. We just share a callback API with batch commands. If we ever get a + # second call to `handleResponse` we will see a different error on trying to set future + # that has already been set. self._event_loop.call_soon_threadsafe( self._handleResponse, path, status, response) @@ -105,9 +116,79 @@ def _handleError(self, imError: Status, chipError: PyChipError, exception: Excep self._future.set_exception(chipError.to_exception()) else: try: + # If you got an exception from this call other than AttributeError please + # add it to the except block below. We changed Exception->AttributeError as + # that is what we thought we are trying to catch here. + self._future.set_exception( + chip.interaction_model.InteractionModelError(chip.interaction_model.Status(imError.IMStatus), imError.ClusterStatus)) + except AttributeError: + logger.exception("Failed to map interaction model status received: %s. Remapping to Failure." % imError) + self._future.set_exception(chip.interaction_model.InteractionModelError( + chip.interaction_model.Status.Failure, imError.ClusterStatus)) + + def handleError(self, status: Status, chipError: PyChipError): + self._event_loop.call_soon_threadsafe( + self._handleError, status, chipError, None + ) + + def handleDone(self): + ctypes.pythonapi.Py_DecRef(ctypes.py_object(self)) + + +class AsyncBatchCommandsTransaction: + def __init__(self, future: Future, eventLoop, expectTypes: List[Type]): + self._event_loop = eventLoop + self._future = future + self._expect_types = expectTypes + default_im_failure = chip.interaction_model.InteractionModelError( + chip.interaction_model.Status.NoCommandResponse) + self._responses = [default_im_failure] * len(expectTypes) + + def _handleResponse(self, path: CommandPath, index: int, status: Status, response: bytes): + if index > len(self._responses): + self._handleError(status, 0, IndexError(f"CommandSenderCallback has given us an unexpected index value {index}")) + return + + if (len(response) == 0): + self._responses[index] = None + else: + # If a type hasn't been assigned, let's auto-deduce it. + if (self._expect_types[index] is None): + self._expect_types[index] = FindCommandClusterObject(False, path) + + if self._expect_types[index]: + try: + # If you got an exception from this call other than AttributeError please + # add it to the except block below. We changed Exception->AttributeError as + # that is what we thought we are trying to catch here. + self._responses[index] = self._expect_types[index].FromTLV(response) + except AttributeError as ex: + self._handleError(status, 0, ex) + else: + self._responses[index] = None + + def handleResponse(self, path: CommandPath, index: int, status: Status, response: bytes): + self._event_loop.call_soon_threadsafe( + self._handleResponse, path, index, status, response) + + def _handleError(self, imError: Status, chipError: PyChipError, exception: Exception): + if self._future.done(): + # TODO Right now this even callback happens if there was a real IM Status error on one command. + # We need to update OnError to allow providing a CommandRef that we can try associating with it. + logger.exception(f"Recieved another error, but we have sent error. imError:{imError}, chipError {chipError}") + return + if exception: + self._future.set_exception(exception) + elif chipError != 0: + self._future.set_exception(chipError.to_exception()) + else: + try: + # If you got an exception from this call other than AttributeError please + # add it to the except block below. We changed Exception->AttributeError as + # that is what we thought we are trying to catch here. self._future.set_exception( chip.interaction_model.InteractionModelError(chip.interaction_model.Status(imError.IMStatus), imError.ClusterStatus)) - except Exception: + except AttributeError: logger.exception("Failed to map interaction model status received: %s. Remapping to Failure." % imError) self._future.set_exception(chip.interaction_model.InteractionModelError( chip.interaction_model.Status.Failure, imError.ClusterStatus)) @@ -117,9 +198,18 @@ def handleError(self, status: Status, chipError: PyChipError): self._handleError, status, chipError, None ) + def _handleDone(self): + self._future.set_result(self._responses) + ctypes.pythonapi.Py_DecRef(ctypes.py_object(self)) + + def handleDone(self): + self._event_loop.call_soon_threadsafe( + self._handleDone + ) + _OnCommandSenderResponseCallbackFunct = CFUNCTYPE( - None, py_object, c_uint16, c_uint32, c_uint32, c_uint16, c_uint8, c_void_p, c_uint32) + None, py_object, c_uint16, c_uint32, c_uint32, c_size_t, c_uint16, c_uint8, c_void_p, c_uint32) _OnCommandSenderErrorCallbackFunct = CFUNCTYPE( None, py_object, c_uint16, c_uint8, PyChipError) _OnCommandSenderDoneCallbackFunct = CFUNCTYPE( @@ -127,10 +217,10 @@ def handleError(self, status: Status, chipError: PyChipError): @_OnCommandSenderResponseCallbackFunct -def _OnCommandSenderResponseCallback(closure, endpoint: int, cluster: int, command: int, +def _OnCommandSenderResponseCallback(closure, endpoint: int, cluster: int, command: int, index: int, imStatus: int, clusterStatus: int, payload, size): data = ctypes.string_at(payload, size) - closure.handleResponse(CommandPath(endpoint, cluster, command), Status( + closure.handleResponse(CommandPath(endpoint, cluster, command), index, Status( imStatus, clusterStatus), data[:]) @@ -141,7 +231,7 @@ def _OnCommandSenderErrorCallback(closure, imStatus: int, clusterStatus: int, ch @_OnCommandSenderDoneCallbackFunct def _OnCommandSenderDoneCallback(closure): - ctypes.pythonapi.Py_DecRef(ctypes.py_object(closure)) + closure.handleDone() def TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke(future: Future, eventLoop, responseType, device, commandPath, payload): @@ -201,6 +291,59 @@ def SendCommand(future: Future, eventLoop, responseType: Type, device, commandPa )) +def SendBatchCommands(future: Future, eventLoop, device, commands: List[InvokeRequestInfo], + timedRequestTimeoutMs: Optional[int] = None, interactionTimeoutMs: Optional[int] = None, busyWaitMs: Optional[int] = None, + suppressResponse: Optional[bool] = None) -> PyChipError: + ''' Send a cluster-object encapsulated command to a device and does the following: + - On receipt of a successful data response, returns the cluster-object equivalent through the provided future. + - None (on a successful response containing no data) + - Raises an exception if any errors are encountered. + + If no response type is provided above, the type will be automatically deduced. + + If a valid timedRequestTimeoutMs is provided, a timed interaction will be initiated instead. + If a valid interactionTimeoutMs is provided, the interaction will terminate with a CHIP_ERROR_TIMEOUT if a response + has not been received within that timeout. If it isn't provided, a sensible value will be automatically computed that + accounts for the underlying characteristics of both the transport and the responsiveness of the receiver. + ''' + handle = chip.native.GetLibraryHandle() + + responseTypes = [] + commandargs = [] + for command in commands: + clusterCommand = command.Command + responseType = command.ResponseType + if (responseType is not None) and (not issubclass(responseType, ClusterCommand)): + raise ValueError("responseType must be a ClusterCommand or None") + if clusterCommand.must_use_timed_invoke and timedRequestTimeoutMs is None or timedRequestTimeoutMs == 0: + raise chip.interaction_model.InteractionModelError(chip.interaction_model.Status.NeedsTimedInteraction) + + commandPath = chip.interaction_model.CommandPathIBStruct.build({ + "EndpointId": command.EndpointId, + "ClusterId": clusterCommand.cluster_id, + "CommandId": clusterCommand.command_id}) + payloadTLV = clusterCommand.ToTLV() + + commandargs.append(c_char_p(commandPath)) + commandargs.append(c_char_p(bytes(payloadTLV))) + commandargs.append(c_size_t(len(payloadTLV))) + + responseTypes.append(responseType) + + transaction = AsyncBatchCommandsTransaction(future, eventLoop, responseTypes) + ctypes.pythonapi.Py_IncRef(ctypes.py_object(transaction)) + + return builtins.chipStack.Call( + lambda: handle.pychip_CommandSender_SendBatchCommands( + py_object(transaction), device, + c_uint16(0 if timedRequestTimeoutMs is None else timedRequestTimeoutMs), + c_uint16(0 if interactionTimeoutMs is None else interactionTimeoutMs), + c_uint16(0 if busyWaitMs is None else busyWaitMs), + c_bool(False if suppressResponse is None else suppressResponse), + c_size_t(len(commands)), *commandargs) + ) + + def SendGroupCommand(groupId: int, devCtrl: c_void_p, payload: ClusterCommand, busyWaitMs: Union[None, int] = None) -> PyChipError: ''' Send a cluster-object encapsulated group command to a device and does the following: - None (on a successful response containing no data) @@ -227,6 +370,8 @@ def Init(): setter.Set('pychip_CommandSender_SendCommand', PyChipError, [py_object, c_void_p, c_uint16, c_uint32, c_uint32, c_char_p, c_size_t, c_uint16, c_bool]) + setter.Set('pychip_CommandSender_SendBatchCommands', + PyChipError, [py_object, c_void_p, c_uint16, c_uint16, c_uint16, c_bool, c_size_t]) setter.Set('pychip_CommandSender_TestOnlySendCommandTimedRequestNoTimedInvoke', PyChipError, [py_object, c_void_p, c_uint32, c_uint32, c_char_p, c_size_t, c_uint16, c_bool]) setter.Set('pychip_CommandSender_SendGroupCommand', diff --git a/src/controller/python/chip/clusters/command.cpp b/src/controller/python/chip/clusters/command.cpp index c824c251995932..168a3cf818eb5b 100644 --- a/src/controller/python/chip/clusters/command.cpp +++ b/src/controller/python/chip/clusters/command.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -38,6 +39,10 @@ PyChipError pychip_CommandSender_SendCommand(void * appContext, DeviceProxy * de const uint8_t * payload, size_t length, uint16_t interactionTimeoutMs, uint16_t busyWaitMs, bool suppressResponse); +PyChipError pychip_CommandSender_SendBatchCommands(void * appContext, DeviceProxy * device, uint16_t timedRequestTimeoutMs, + uint16_t interactionTimeoutMs, uint16_t busyWaitMs, bool suppressResponse, + size_t n, ...); + PyChipError pychip_CommandSender_TestOnlySendCommandTimedRequestNoTimedInvoke( void * appContext, DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId, chip::CommandId commandId, const uint8_t * payload, size_t length, uint16_t interactionTimeoutMs, uint16_t busyWaitMs, bool suppressResponse); @@ -51,7 +56,7 @@ namespace chip { namespace python { using OnCommandSenderResponseCallback = void (*)(PyObject appContext, chip::EndpointId endpointId, chip::ClusterId clusterId, - chip::CommandId commandId, + chip::CommandId commandId, size_t index, std::underlying_type_t status, chip::ClusterStatus clusterStatus, const uint8_t * payload, uint32_t length); using OnCommandSenderErrorCallback = void (*)(PyObject appContext, @@ -63,14 +68,25 @@ OnCommandSenderResponseCallback gOnCommandSenderResponseCallback = nullptr; OnCommandSenderErrorCallback gOnCommandSenderErrorCallback = nullptr; OnCommandSenderDoneCallback gOnCommandSenderDoneCallback = nullptr; +struct __attribute__((packed)) CommandPath +{ + chip::EndpointId endpointId; + chip::ClusterId clusterId; + chip::CommandId commandId; +}; + class CommandSenderCallback : public CommandSender::Callback { public: - CommandSenderCallback(PyObject appContext) : mAppContext(appContext) {} + CommandSenderCallback(PyObject appContext, bool isBatchedCommands) : + mAppContext(appContext), mIsBatchedCommands(isBatchedCommands) + {} - void OnResponse(CommandSender * apCommandSender, const ConcreteCommandPath & aPath, const app::StatusIB & aStatus, - TLV::TLVReader * aData) override + void OnResponseWithAdditionalData(CommandSender * apCommandSender, const ConcreteCommandPath & aPath, + const app::StatusIB & aStatus, TLV::TLVReader * aData, + const CommandSender::AdditionalResponseData & aAdditionalResponseData) override { + CHIP_ERROR err = CHIP_NO_ERROR; uint8_t buffer[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; uint32_t size = 0; // When the apData is nullptr, means we did not receive a valid attribute data from server, status will be some error @@ -80,7 +96,7 @@ class CommandSenderCallback : public CommandSender::Callback // Python need to read from full TLV data the TLVReader may contain some unclean states. TLV::TLVWriter writer; writer.Init(buffer); - CHIP_ERROR err = writer.CopyContainer(TLV::AnonymousTag(), *aData); + err = writer.CopyContainer(TLV::AnonymousTag(), *aData); if (err != CHIP_NO_ERROR) { this->OnError(apCommandSender, err); @@ -89,8 +105,23 @@ class CommandSenderCallback : public CommandSender::Callback size = writer.GetLengthWritten(); } + if (err != CHIP_NO_ERROR) + { + this->OnError(apCommandSender, err); + return; + } + + chip::CommandRef commandRef = aAdditionalResponseData.mCommandRef.ValueOr(0); + size_t index = 0; + err = GetIndexFromCommandRef(commandRef, index); + if (err != CHIP_NO_ERROR && mIsBatchedCommands) + { + this->OnError(apCommandSender, err); + return; + } + gOnCommandSenderResponseCallback( - mAppContext, aPath.mEndpointId, aPath.mClusterId, aPath.mCommandId, to_underlying(aStatus.mStatus), + mAppContext, aPath.mEndpointId, aPath.mClusterId, aPath.mCommandId, index, to_underlying(aStatus.mStatus), aStatus.mClusterStatus.HasValue() ? aStatus.mClusterStatus.Value() : chip::python::kUndefinedClusterStatus, buffer, size); } @@ -114,8 +145,32 @@ class CommandSenderCallback : public CommandSender::Callback delete this; }; + CHIP_ERROR GetIndexFromCommandRef(uint16_t aCommandRef, size_t & aIndex) + { + auto search = mCommandRefToIndex.find(aCommandRef); + if (search == mCommandRefToIndex.end()) + { + return CHIP_ERROR_KEY_NOT_FOUND; + } + aIndex = mCommandRefToIndex[aCommandRef]; + return CHIP_NO_ERROR; + } + + CHIP_ERROR AddCommandRefToIndexLookup(uint16_t aCommandRef, size_t aIndex) + { + auto search = mCommandRefToIndex.find(aCommandRef); + if (search != mCommandRefToIndex.end()) + { + return CHIP_ERROR_DUPLICATE_KEY_ID; + } + mCommandRefToIndex[aCommandRef] = aIndex; + return CHIP_NO_ERROR; + } + private: PyObject mAppContext = nullptr; + std::unordered_map mCommandRefToIndex; + bool mIsBatchedCommands; }; } // namespace python @@ -142,7 +197,8 @@ PyChipError pychip_CommandSender_SendCommand(void * appContext, DeviceProxy * de VerifyOrReturnError(device->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION)); - std::unique_ptr callback = std::make_unique(appContext); + std::unique_ptr callback = + std::make_unique(appContext, /* isBatchedCommands =*/false); std::unique_ptr sender = std::make_unique(callback.get(), device->GetExchangeManager(), /* is timed request */ timedRequestTimeoutMs != 0, suppressResponse); @@ -172,12 +228,94 @@ PyChipError pychip_CommandSender_SendCommand(void * appContext, DeviceProxy * de sender.release(); callback.release(); + // TODO(#30985): Reconsider the purpose of busyWait and if it can be broken out into it's + // own method/primitive. + if (busyWaitMs) + { + usleep(busyWaitMs * 1000); + } + +exit: + return ToPyChipError(err); +} + +PyChipError pychip_CommandSender_SendBatchCommands(void * appContext, DeviceProxy * device, uint16_t timedRequestTimeoutMs, + uint16_t interactionTimeoutMs, uint16_t busyWaitMs, bool suppressResponse, + size_t n, ...) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrReturnError(device->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION)); + auto remoteSessionParameters = device->GetSecureSession().Value()->GetRemoteSessionParameters(); + CommandSender::ConfigParameters config; + config.SetRemoteMaxPathsPerInvoke(remoteSessionParameters.GetMaxPathsPerInvoke()); + + std::unique_ptr callback = + std::make_unique(appContext, /* isBatchedCommands =*/true); + std::unique_ptr sender = + std::make_unique(callback.get(), device->GetExchangeManager(), + /* is timed request */ timedRequestTimeoutMs != 0, suppressResponse); + + // TODO(#30986): Move away from passing these command through variadic arguments. + va_list args; + va_start(args, n); + + SuccessOrExit(err = sender->SetCommandSenderConfig(config)); + + { + for (size_t i = 0; i < n; i++) + { + void * commandPath = va_arg(args, void *); + void * tlv = va_arg(args, void *); + int length = va_arg(args, int); + + python::CommandPath invokeRequestInfoObj; + memcpy(&invokeRequestInfoObj, commandPath, sizeof(python::CommandPath)); + const uint8_t * tlvBuffer = reinterpret_cast(tlv); + + app::CommandPathParams cmdParams = { invokeRequestInfoObj.endpointId, /* group id */ 0, invokeRequestInfoObj.clusterId, + invokeRequestInfoObj.commandId, (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSender::AdditionalCommandParameters additionalParams; + + SuccessOrExit(err = sender->PrepareCommand(cmdParams, additionalParams)); + { + auto writer = sender->GetCommandDataIBTLVWriter(); + VerifyOrExit(writer != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + TLV::TLVReader reader; + reader.Init(tlvBuffer, static_cast(length)); + reader.Next(); + SuccessOrExit(err = writer->CopyContainer(TLV::ContextTag(CommandDataIB::Tag::kFields), reader)); + } + + SuccessOrExit(err = sender->FinishCommand(timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) + : Optional::Missing(), + additionalParams)); + + // CommandSender provides us with the CommandReference for this associated command. In order to match responses + // we have to add CommandRef to index lookup. + VerifyOrExit(additionalParams.mCommandRef.HasValue(), err = CHIP_ERROR_INVALID_ARGUMENT); + SuccessOrExit(err = callback->AddCommandRefToIndexLookup(additionalParams.mCommandRef.Value(), i)); + } + } + + SuccessOrExit(err = sender->SendCommandRequest(device->GetSecureSession().Value(), + interactionTimeoutMs != 0 + ? MakeOptional(System::Clock::Milliseconds32(interactionTimeoutMs)) + : Optional::Missing())); + + sender.release(); + callback.release(); + + // TODO(#30985): Reconsider the purpose of busyWait and if it can be broken out into it's + // own method/primitive. if (busyWaitMs) { usleep(busyWaitMs * 1000); } exit: + va_end(args); return ToPyChipError(err); } @@ -191,8 +329,9 @@ PyChipError pychip_CommandSender_TestOnlySendCommandTimedRequestNoTimedInvoke( VerifyOrReturnError(device->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION)); - std::unique_ptr callback = std::make_unique(appContext); - std::unique_ptr sender = std::make_unique(callback.get(), device->GetExchangeManager(), + std::unique_ptr callback = + std::make_unique(appContext, /* isBatchedCommands =*/false); + std::unique_ptr sender = std::make_unique(callback.get(), device->GetExchangeManager(), /* is timed request */ true, suppressResponse); app::CommandPathParams cmdParams = { endpointId, /* group id */ 0, clusterId, commandId, @@ -219,6 +358,8 @@ PyChipError pychip_CommandSender_TestOnlySendCommandTimedRequestNoTimedInvoke( sender.release(); callback.release(); + // TODO(#30985): Reconsider the purpose of busyWait and if it can be broken out into it's + // own method/primitive. if (busyWaitMs) { usleep(busyWaitMs * 1000); @@ -264,6 +405,8 @@ PyChipError pychip_CommandSender_SendGroupCommand(chip::GroupId groupId, chip::C SuccessOrExit(err = sender->SendGroupCommandRequest(chip::SessionHandle(session))); } + // TODO(#30985): Reconsider the purpose of busyWait and if it can be broken out into it's + // own method/primitive. if (busyWaitMs) { usleep(busyWaitMs * 1000); diff --git a/src/controller/python/chip/interaction_model/__init__.py b/src/controller/python/chip/interaction_model/__init__.py index a2eb5d7ab4ff04..97c185bdcd96e5 100644 --- a/src/controller/python/chip/interaction_model/__init__.py +++ b/src/controller/python/chip/interaction_model/__init__.py @@ -26,12 +26,12 @@ from chip.exceptions import ChipStackException -from .delegate import (AttributePath, AttributePathIBstruct, DataVersionFilterIBstruct, EventPath, EventPathIBstruct, - SessionParameters, SessionParametersStruct) +from .delegate import (AttributePath, AttributePathIBstruct, CommandPathIBStruct, DataVersionFilterIBstruct, EventPath, + EventPathIBstruct, SessionParameters, SessionParametersStruct) -__all__ = ["AttributePath", "AttributePathIBstruct", "DataVersionFilterIBstruct", - "EventPath", "EventPathIBstruct", "InteractionModelError", - "SessionParameters", "SessionParametersStruct", "Status"] +__all__ = ["AttributePath", "AttributePathIBstruct", "CommandPathIBStruct", + "DataVersionFilterIBstruct", "EventPath", "EventPathIBstruct", + "InteractionModelError", "SessionParameters", "SessionParametersStruct", "Status"] # defined src/controller/python/chip/interaction_model/Delegate.h diff --git a/src/controller/python/chip/interaction_model/delegate.py b/src/controller/python/chip/interaction_model/delegate.py index 74acb3921ec820..6ce577b94580de 100644 --- a/src/controller/python/chip/interaction_model/delegate.py +++ b/src/controller/python/chip/interaction_model/delegate.py @@ -46,6 +46,12 @@ "AttributeId" / Int32ul, ) +CommandPathIBStruct = Struct( + "EndpointId" / Int16ul, + "ClusterId" / Int32ul, + "CommandId" / Int32ul, +) + # AttributePath should not contain padding AttributePathIBstruct = Struct( "EndpointId" / Int16ul, diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 85f8b8c6449592..88e3e37e8c3736 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -68,6 +68,7 @@ buildconfig_header("chip_buildconfig") { "CHIP_CONFIG_BIG_ENDIAN_TARGET=${chip_target_is_big_endian}", "CHIP_CONFIG_TLV_VALIDATE_CHAR_STRING_ON_WRITE=${chip_tlv_validate_char_string_on_write}", "CHIP_CONFIG_TLV_VALIDATE_CHAR_STRING_ON_READ=${chip_tlv_validate_char_string_on_read}", + "CHIP_CONFIG_SENDING_BATCH_COMMANDS_ENABLED=${chip_enable_sending_batch_commands}", ] visibility = [ ":chip_config_header" ] diff --git a/src/lib/core/DataModelTypes.h b/src/lib/core/DataModelTypes.h index 1d84c00e114afc..e0cd1d2fa1d773 100644 --- a/src/lib/core/DataModelTypes.h +++ b/src/lib/core/DataModelTypes.h @@ -32,6 +32,7 @@ typedef uint32_t AttributeId; typedef uint32_t ClusterId; typedef uint8_t ClusterStatus; typedef uint32_t CommandId; +typedef uint16_t CommandRef; typedef uint64_t CompressedFabricId; typedef uint32_t DataVersion; typedef uint32_t DeviceTypeId; diff --git a/src/lib/core/core.gni b/src/lib/core/core.gni index 51ef44493b8461..8c7032ebac675a 100644 --- a/src/lib/core/core.gni +++ b/src/lib/core/core.gni @@ -98,6 +98,9 @@ declare_args() { # - SHALL be valid UTF8 chip_tlv_validate_char_string_on_write = true chip_tlv_validate_char_string_on_read = false + + chip_enable_sending_batch_commands = + current_os == "linux" || current_os == "mac" || current_os == "ios" } if (chip_target_style == "") { diff --git a/src/platform/Linux/SystemPlatformConfig.h b/src/platform/Linux/SystemPlatformConfig.h index 8edc16c1c00307..21495f93a38b82 100644 --- a/src/platform/Linux/SystemPlatformConfig.h +++ b/src/platform/Linux/SystemPlatformConfig.h @@ -41,3 +41,4 @@ struct ChipDeviceEvent; #define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1 // ========== Platform-specific Configuration Overrides ========= +#define CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS 5 diff --git a/src/platform/telink/1m_flash.overlay b/src/platform/telink/1m_flash.overlay index 698d7721d5012c..0b1fd1b2213c23 100644 --- a/src/platform/telink/1m_flash.overlay +++ b/src/platform/telink/1m_flash.overlay @@ -21,15 +21,15 @@ }; slot0_partition: partition@19000 { label = "image-0"; - reg = <0x19000 0xDC000>; + reg = <0x19000 0xda000>; }; - factory_partition: partition@F5000 { + factory_partition: partition@f3000 { label = "factory-data"; - reg = <0xF5000 0x1000>; + reg = <0xf3000 0x1000>; }; - storage_partition: partition@F6000 { + storage_partition: partition@f4000 { label = "storage"; - reg = <0xF6000 0x8000>; + reg = <0xf4000 0xa000>; }; vendor_partition: partition@fe000 { label = "vendor-data"; diff --git a/src/platform/telink/2m_flash.overlay b/src/platform/telink/2m_flash.overlay index 8a12e9c02aad02..95f1a749057436 100644 --- a/src/platform/telink/2m_flash.overlay +++ b/src/platform/telink/2m_flash.overlay @@ -21,19 +21,19 @@ }; slot0_partition: partition@19000 { label = "image-0"; - reg = <0x19000 0xee000>; + reg = <0x19000 0xed000>; }; - factory_partition: partition@107000 { + factory_partition: partition@106000{ label = "factory-data"; - reg = <0x107000 0x1000>; + reg = <0x106000 0x1000>; }; - storage_partition: partition@108000 { + storage_partition: partition@107000 { label = "storage"; - reg = <0x108000 0x8000>; + reg = <0x107000 0xa000>; }; - slot1_partition: partition@110000 { + slot1_partition: partition@111000 { label = "image-1"; - reg = <0x110000 0xee000>; + reg = <0x111000 0xed000>; }; vendor_partition: partition@1fe000 { label = "vendor-data"; diff --git a/src/platform/telink/4m_flash.overlay b/src/platform/telink/4m_flash.overlay index 52a3f1c9a6f2fc..e22c007e0bc235 100644 --- a/src/platform/telink/4m_flash.overlay +++ b/src/platform/telink/4m_flash.overlay @@ -21,19 +21,19 @@ }; slot0_partition: partition@19000 { label = "image-0"; - reg = <0x19000 0x1ee000>; + reg = <0x19000 0x1ed000>; }; - factory_partition: partition@207000 { + factory_partition: partition@206000 { label = "factory-data"; - reg = <0x207000 0x1000>; + reg = <0x206000 0x1000>; }; - storage_partition: partition@208000 { + storage_partition: partition@207000 { label = "storage"; - reg = <0x208000 0x8000>; + reg = <0x207000 0xa000>; }; - slot1_partition: partition@210000 { + slot1_partition: partition@211000 { label = "image-1"; - reg = <0x210000 0x1ee000>; + reg = <0x211000 0x1ed000>; }; vendor_partition: partition@3fe000 { label = "vendor-data"; diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index 840015f0764ae2..ec645d1773ce9f 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -45,6 +45,8 @@ static_library("telink") { "ConnectivityManagerImpl.h", "InetPlatformConfig.h", "KeyValueStoreManagerImpl.h", + "NFCManagerImpl.cpp", + "NFCManagerImpl.h", "PlatformManagerImpl.h", "SystemPlatformConfig.h", ] diff --git a/src/platform/telink/NFCManagerImpl.cpp b/src/platform/telink/NFCManagerImpl.cpp new file mode 100644 index 00000000000000..bb40b55305da73 --- /dev/null +++ b/src/platform/telink/NFCManagerImpl.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2022-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 + +#if CHIP_DEVICE_CONFIG_ENABLE_NFC +#include + +#include + +#include +#include +#include + +void nfc_callback(const struct device * dev, enum nfc_tag_event event, const uint8_t * data, size_t data_len) +{ + ARG_UNUSED(dev); + ARG_UNUSED(data); + ARG_UNUSED(data_len); +} + +namespace chip { +namespace DeviceLayer { + +NFCManagerImpl NFCManagerImpl::sInstance; + +CHIP_ERROR NFCManagerImpl::_Init() +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR NFCManagerImpl::_StartTagEmulation(const char * payload, size_t payloadLength) +{ + /* Set up NFC driver*/ + uint8_t ndef_msg_buf[NDEF_MSG_BUF_SIZE]; + uint32_t len = sizeof(ndef_msg_buf); + + int err; + + err = nfc_tag_init(dev, nfc_callback); + if (err != 0) + { + ChipLogError(DeviceLayer, "Cannot setup NFC subsys!"); + return CHIP_ERROR_INTERNAL; + } + + /* Set up Tag mode */ + err = nfc_tag_set_type(dev, NFC_TAG_TYPE_T5T); + if (err != 0) + { + ChipLogError(DeviceLayer, "Cannot setup NFC Tag mode!"); + return CHIP_ERROR_INTERNAL; + } + + err = nfc_ndef_uri_msg_encode(NFC_URI_NONE, (const uint8_t *) payload, payloadLength, ndef_msg_buf, &len); + if (err != 0) + { + ChipLogError(DeviceLayer, "Cannot encode message!"); + return CHIP_ERROR_INTERNAL; + } + + err = nfc_tag_set_ndef(dev, ndef_msg_buf, len); + if (err != 0) + { + ChipLogError(DeviceLayer, "Cannot set payload!"); + return CHIP_ERROR_INTERNAL; + } + + err = nfc_tag_start(dev); + if (err != 0) + { + return CHIP_ERROR_INTERNAL; + } + + sInstance.mIsStarted = true; + return CHIP_NO_ERROR; +} + +CHIP_ERROR NFCManagerImpl::_StopTagEmulation() +{ + if (nfc_tag_stop(dev)) + { + return CHIP_ERROR_INTERNAL; + } + sInstance.mIsStarted = false; + return CHIP_NO_ERROR; +} + +} // namespace DeviceLayer +} // namespace chip +#endif diff --git a/src/platform/telink/NFCManagerImpl.h b/src/platform/telink/NFCManagerImpl.h new file mode 100644 index 00000000000000..27ba6e0f7c5c5d --- /dev/null +++ b/src/platform/telink/NFCManagerImpl.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022-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. + */ + +#pragma once + +namespace chip { +namespace DeviceLayer { + +namespace { +#define NFC_DEV st25dvxxkc +#define DEV_PTR DEVICE_DT_GET(DT_NODELABEL(NFC_DEV)) +#define NDEF_MSG_BUF_SIZE 128 +} // namespace + +class NFCManagerImpl final : public NFCManager +{ + friend class NFCManager; + +private: + // ===== Members that implement the NFCManager internal interface. + + CHIP_ERROR _Init(); + CHIP_ERROR _StartTagEmulation(const char * payload, size_t payloadLength); + CHIP_ERROR _StopTagEmulation(); + bool _IsTagEmulationStarted() const { return mIsStarted; }; + + // ===== Members for internal use by this class. + bool mIsStarted; + const struct device * dev = DEV_PTR; + // ===== Members for internal use by the following friends. + + friend NFCManager & NFCMgr(); + friend NFCManagerImpl & NFCMgrImpl(); + + static NFCManagerImpl sInstance; +}; + +inline NFCManager & NFCMgr() +{ + return NFCManagerImpl::sInstance; +} + +inline NFCManagerImpl & NFCMgrImpl() +{ + return NFCManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/protocols/user_directed_commissioning/UDCClientState.h b/src/protocols/user_directed_commissioning/UDCClientState.h index 983cfb73e21c0c..944a1e156ad9f2 100644 --- a/src/protocols/user_directed_commissioning/UDCClientState.h +++ b/src/protocols/user_directed_commissioning/UDCClientState.h @@ -43,6 +43,15 @@ enum class UDCClientProcessingState : uint8_t using PeerAddress = ::chip::Transport::PeerAddress; +/** + * Represents information in the TargetAppList of the Identification Declaration message + */ +struct TargetAppInfo +{ + uint16_t vendorId = 0; + uint16_t productId = 0; +}; + /** * Defines the handling state of a UDC Client. * @@ -99,25 +108,29 @@ class UDCClientState uint16_t GetPairingHint() const { return mPairingHint; } void SetPairingHint(uint16_t pairingHint) { mPairingHint = pairingHint; } - bool GetAppVendorId(size_t index, uint16_t & vid) const + bool GetTargetAppInfo(uint8_t index, TargetAppInfo & info) const { - if (index < mNumAppVendorIds) + if (index < mNumTargetAppInfos) { - vid = mAppVendorIds[index]; + info.vendorId = mTargetAppInfos[index].vendorId; + info.productId = mTargetAppInfos[index].productId; return true; } return false; } - size_t GetNumAppVendorIds() const { return mNumAppVendorIds; } + size_t GetNumTargetAppInfos() const { return mNumTargetAppInfos; } - void AddAppVendorId(uint16_t vid) + bool AddTargetAppInfo(TargetAppInfo vid) { - if (mNumAppVendorIds >= sizeof(mAppVendorIds)) + if (mNumTargetAppInfos >= sizeof(mTargetAppInfos)) { // already at max - return; + return false; } - mAppVendorIds[mNumAppVendorIds++] = vid; + mTargetAppInfos[mNumTargetAppInfos].vendorId = vid.vendorId; + mTargetAppInfos[mNumTargetAppInfos].productId = vid.productId; + mNumTargetAppInfos++; + return true; } UDCClientProcessingState GetUDCClientProcessingState() const { return mUDCClientProcessingState; } @@ -183,9 +196,9 @@ class UDCClientState char mPairingInst[chip::Dnssd::kMaxPairingInstructionLen + 1] = {}; uint16_t mPairingHint = 0; - constexpr static size_t kMaxAppVendorIds = 10; - size_t mNumAppVendorIds = 0; // number of vendor Ids - uint16_t mAppVendorIds[kMaxAppVendorIds]; + constexpr static size_t kMaxTargetAppInfos = 10; + uint8_t mNumTargetAppInfos = 0; // number of vendor Ids + TargetAppInfo mTargetAppInfos[kMaxTargetAppInfos]; bool mNoPasscode = false; bool mCdUponPasscodeDialog = false; diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h index 12315a06b29041..d05a80a857f200 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h @@ -81,7 +81,7 @@ class DLL_EXPORT IdentificationDeclaration bool HasDiscoveryInfo() { return mVendorId != 0 || mProductId != 0 || mCdPort != 0 || strlen(mDeviceName) > 0 || GetRotatingIdLength() > 0 || - mNumAppVendorIds > 0 || mNoPasscode || mCdUponPasscodeDialog || mCommissionerPasscode || mCommissionerPasscodeReady; + mNumTargetAppInfos > 0 || mNoPasscode || mCdUponPasscodeDialog || mCommissionerPasscode || mCommissionerPasscodeReady; } const char * GetDeviceName() const { return mDeviceName; } @@ -105,25 +105,29 @@ class DLL_EXPORT IdentificationDeclaration memcpy(mRotatingId, rotatingId, mRotatingIdLen); } - bool GetAppVendorId(uint8_t index, uint16_t & vid) const + bool GetTargetAppInfo(uint8_t index, TargetAppInfo & info) const { - if (index < mNumAppVendorIds) + if (index < mNumTargetAppInfos) { - vid = mAppVendorIds[index]; + info.vendorId = mTargetAppInfos[index].vendorId; + info.productId = mTargetAppInfos[index].productId; return true; } return false; } - size_t GetNumAppVendorIds() const { return mNumAppVendorIds; } + size_t GetNumTargetAppInfos() const { return mNumTargetAppInfos; } - void AddAppVendorId(uint16_t vid) + bool AddTargetAppInfo(TargetAppInfo vid) { - if (mNumAppVendorIds >= sizeof(mAppVendorIds)) + if (mNumTargetAppInfos >= sizeof(mTargetAppInfos)) { // already at max - return; + return false; } - mAppVendorIds[mNumAppVendorIds++] = vid; + mTargetAppInfos[mNumTargetAppInfos].vendorId = vid.vendorId; + mTargetAppInfos[mNumTargetAppInfos].productId = vid.productId; + mNumTargetAppInfos++; + return true; } const char * GetPairingInst() const { return mPairingInst; } @@ -170,12 +174,12 @@ class DLL_EXPORT IdentificationDeclaration client->SetRotatingId(GetRotatingId(), GetRotatingIdLength()); client->SetPairingInst(GetPairingInst()); client->SetPairingHint(GetPairingHint()); - for (uint8_t i = 0; i < GetNumAppVendorIds(); i++) + for (uint8_t i = 0; i < GetNumTargetAppInfos(); i++) { - uint16_t vid; - if (GetAppVendorId(i, vid)) + TargetAppInfo info; + if (GetTargetAppInfo(i, info)) { - client->AddAppVendorId(vid); + client->AddTargetAppInfo(info); } } @@ -214,9 +218,10 @@ class DLL_EXPORT IdentificationDeclaration Encoding::BytesToUppercaseHexString(mRotatingId, mRotatingIdLen, rotatingIdString, sizeof(rotatingIdString)); ChipLogDetail(AppServer, "\trotating id: %s", rotatingIdString); } - for (uint8_t i = 0; i < mNumAppVendorIds; i++) + for (uint8_t i = 0; i < mNumTargetAppInfos; i++) { - ChipLogDetail(AppServer, "\tapp vendor id [%d]: %u", i, mAppVendorIds[i]); + ChipLogDetail(AppServer, "\tapp vendor id / product id [%d]: %u/%u", i, mTargetAppInfos[i].vendorId, + mTargetAppInfos[i].productId); } if (strlen(mPairingInst) != 0) { @@ -256,13 +261,16 @@ class DLL_EXPORT IdentificationDeclaration { kVendorIdTag = 1, kProductIdTag, - kNameTag, - kRotatingIdTag, - kCdPortTag, + kDeviceNameTag, + kDeviceTypeTag, kPairingInstTag, kPairingHintTag, - kAppVendorIdListTag, + kRotatingIdTag, + kCdPortTag, + kTargetAppListTag, + kTargetAppTag, kAppVendorIdTag, + kAppProductIdTag, kNoPasscodeTag, kCdUponPasscodeDialogTag, kCommissionerPasscodeTag, @@ -281,9 +289,9 @@ class DLL_EXPORT IdentificationDeclaration uint8_t mRotatingId[chip::Dnssd::kMaxRotatingIdLen]; size_t mRotatingIdLen = 0; - constexpr static size_t kMaxAppVendorIds = 10; - uint8_t mNumAppVendorIds = 0; // number of vendor Ids - uint16_t mAppVendorIds[kMaxAppVendorIds]; + constexpr static size_t kMaxTargetAppInfos = 10; + uint8_t mNumTargetAppInfos = 0; // number of vendor Ids + TargetAppInfo mTargetAppInfos[kMaxTargetAppInfos]; char mPairingInst[chip::Dnssd::kMaxPairingInstructionLen + 1] = {}; uint16_t mPairingHint = 0; diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp b/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp index a3086826402e8c..1d93ae5bb1d75e 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp @@ -120,7 +120,8 @@ uint32_t IdentificationDeclaration::WritePayload(uint8_t * payloadBuffer, size_t VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kVendorIdTag), GetVendorId())), LogErrorOnFailure(err)); VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kProductIdTag), GetProductId())), LogErrorOnFailure(err)); - VerifyOrExit(CHIP_NO_ERROR == (err = writer.PutString(chip::TLV::ContextTag(kNameTag), mDeviceName)), LogErrorOnFailure(err)); + VerifyOrExit(CHIP_NO_ERROR == (err = writer.PutString(chip::TLV::ContextTag(kDeviceNameTag), mDeviceName)), + LogErrorOnFailure(err)); VerifyOrExit(CHIP_NO_ERROR == (err = writer.PutString(chip::TLV::ContextTag(kPairingInstTag), mPairingInst)), LogErrorOnFailure(err)); VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kPairingHintTag), mPairingHint)), LogErrorOnFailure(err)); @@ -134,12 +135,22 @@ uint32_t IdentificationDeclaration::WritePayload(uint8_t * payloadBuffer, size_t // AppVendorIdList VerifyOrExit( CHIP_NO_ERROR == - (err = writer.StartContainer(chip::TLV::ContextTag(kAppVendorIdListTag), chip::TLV::kTLVType_List, listContainerType)), + (err = writer.StartContainer(chip::TLV::ContextTag(kTargetAppListTag), chip::TLV::kTLVType_List, listContainerType)), LogErrorOnFailure(err)); - for (size_t i = 0; i < mNumAppVendorIds; i++) + for (size_t i = 0; i < mNumTargetAppInfos; i++) { - VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kAppVendorIdTag), mAppVendorIds[i])), + // start the TargetApp structure + VerifyOrExit(CHIP_NO_ERROR == + (err = writer.StartContainer(chip::TLV::ContextTag(kTargetAppTag), chip::TLV::kTLVType_Structure, + outerContainerType)), + LogErrorOnFailure(err)); + // add the vendor Id + VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kAppVendorIdTag), mTargetAppInfos[i].vendorId)), + LogErrorOnFailure(err)); + VerifyOrExit(CHIP_NO_ERROR == (err = writer.Put(chip::TLV::ContextTag(kAppProductIdTag), mTargetAppInfos[i].productId)), LogErrorOnFailure(err)); + // end the TargetApp structure + VerifyOrExit(CHIP_NO_ERROR == (err = writer.EndContainer(outerContainerType)), LogErrorOnFailure(err)); } VerifyOrExit(CHIP_NO_ERROR == (err = writer.EndContainer(listContainerType)), LogErrorOnFailure(err)); @@ -180,7 +191,12 @@ CHIP_ERROR CommissionerDeclaration::ReadPayload(uint8_t * udcPayload, size_t pay while ((err = reader.Next()) == CHIP_NO_ERROR) { chip::TLV::Tag containerTag = reader.GetTag(); - uint8_t tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); + if (!TLV::IsContextTag(containerTag)) + { + ChipLogError(AppServer, "Unexpected non-context TLV tag."); + return CHIP_ERROR_INVALID_TLV_TAG; + } + uint8_t tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); switch (tagNum) { diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp index 266ca764c20ec9..1a2f125ae5d282 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp @@ -209,7 +209,12 @@ CHIP_ERROR IdentificationDeclaration::ReadPayload(uint8_t * udcPayload, size_t p while ((err = reader.Next()) == CHIP_NO_ERROR) { chip::TLV::Tag containerTag = reader.GetTag(); - uint8_t tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); + if (!TLV::IsContextTag(containerTag)) + { + ChipLogError(AppServer, "Unexpected non-context TLV tag."); + return CHIP_ERROR_INVALID_TLV_TAG; + } + uint8_t tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); switch (tagNum) { @@ -225,7 +230,7 @@ CHIP_ERROR IdentificationDeclaration::ReadPayload(uint8_t * udcPayload, size_t p // port err = reader.Get(mCdPort); break; - case kNameTag: + case kDeviceNameTag: // deviceName err = reader.GetString(mDeviceName, sizeof(mDeviceName)); break; @@ -242,25 +247,66 @@ CHIP_ERROR IdentificationDeclaration::ReadPayload(uint8_t * udcPayload, size_t p mRotatingIdLen = reader.GetLength(); err = reader.GetBytes(mRotatingId, sizeof(mRotatingId)); break; - case kAppVendorIdListTag: + case kTargetAppListTag: // app vendor list { + ChipLogProgress(AppServer, "TLV found an applist"); chip::TLV::TLVType listContainerType = chip::TLV::kTLVType_List; ReturnErrorOnFailure(reader.EnterContainer(listContainerType)); - while ((err = reader.Next()) == CHIP_NO_ERROR && mNumAppVendorIds < sizeof(mAppVendorIds)) + while ((err = reader.Next()) == CHIP_NO_ERROR && mNumTargetAppInfos < sizeof(mTargetAppInfos)) { containerTag = reader.GetTag(); - tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); - if (tagNum == kAppVendorIdTag) + if (!TLV::IsContextTag(containerTag)) + { + ChipLogError(AppServer, "Unexpected non-context TLV tag."); + return CHIP_ERROR_INVALID_TLV_TAG; + } + tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); + if (tagNum == kTargetAppTag) + { + ReturnErrorOnFailure(reader.EnterContainer(outerContainerType)); + uint16_t appVendorId = 0; + uint16_t appProductId = 0; + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + containerTag = reader.GetTag(); + if (!TLV::IsContextTag(containerTag)) + { + ChipLogError(AppServer, "Unexpected non-context TLV tag."); + return CHIP_ERROR_INVALID_TLV_TAG; + } + tagNum = static_cast(chip::TLV::TagNumFromTag(containerTag)); + if (tagNum == kAppVendorIdTag) + { + err = reader.Get(appVendorId); + } + else if (tagNum == kAppProductIdTag) + { + err = reader.Get(appProductId); + } + } + if (err == CHIP_END_OF_TLV) + { + ChipLogProgress(AppServer, "TLV end of struct TLV"); + ReturnErrorOnFailure(reader.ExitContainer(outerContainerType)); + } + if (appVendorId != 0) + { + mTargetAppInfos[mNumTargetAppInfos].vendorId = appVendorId; + mTargetAppInfos[mNumTargetAppInfos].productId = appProductId; + mNumTargetAppInfos++; + } + } + else { - err = reader.Get(mAppVendorIds[mNumAppVendorIds]); - mNumAppVendorIds++; + ChipLogError(AppServer, "unrecognized tag %d", tagNum); } } if (err == CHIP_END_OF_TLV) { - ChipLogError(AppServer, "TLV end of array TLV"); + ChipLogProgress(AppServer, "TLV end of array"); ReturnErrorOnFailure(reader.ExitContainer(listContainerType)); } } diff --git a/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp b/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp index eac29c24b4ade7..f7e7c2ab4a65d9 100644 --- a/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp +++ b/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp @@ -369,10 +369,11 @@ void TestUDCIdentificationDeclaration(nlTestSuite * inSuite, void * inContext) uint16_t productId = 2222; uint16_t port = 123; const char * deviceName = "device1"; - uint16_t vendorIdTemp = 0; uint16_t pairingHint = 33; const char * pairingInst = "Read 6 digit code from screen"; + TargetAppInfo appInfo; + // Rotating ID is given as up to 50 hex bytes char rotatingIdString[chip::Dnssd::kMaxRotatingIdLen * 2 + 1]; uint8_t rotatingId[chip::Dnssd::kMaxRotatingIdLen]; @@ -390,9 +391,19 @@ void TestUDCIdentificationDeclaration(nlTestSuite * inSuite, void * inContext) id.SetCdPort(port); id.SetNoPasscode(true); - id.AddAppVendorId(1); - id.AddAppVendorId(2); - id.AddAppVendorId(3); + + appInfo.vendorId = 1; + appInfo.productId = 9; + id.AddTargetAppInfo(appInfo); + + appInfo.vendorId = 2; + appInfo.productId = 8; + id.AddTargetAppInfo(appInfo); + + appInfo.vendorId = 3; + appInfo.productId = 7; + id.AddTargetAppInfo(appInfo); + id.SetCdUponPasscodeDialog(true); id.SetCommissionerPasscode(true); id.SetCommissionerPasscodeReady(true); @@ -408,10 +419,10 @@ void TestUDCIdentificationDeclaration(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, pairingHint == id.GetPairingHint()); NL_TEST_ASSERT(inSuite, strcmp(id.GetPairingInst(), pairingInst) == 0); - NL_TEST_ASSERT(inSuite, id.GetNumAppVendorIds() == 3); - NL_TEST_ASSERT(inSuite, id.GetAppVendorId(0, vendorIdTemp) && vendorIdTemp == 1); - NL_TEST_ASSERT(inSuite, id.GetAppVendorId(1, vendorIdTemp) && vendorIdTemp == 2); - NL_TEST_ASSERT(inSuite, id.GetAppVendorId(2, vendorIdTemp) && vendorIdTemp == 3); + NL_TEST_ASSERT(inSuite, id.GetNumTargetAppInfos() == 3); + NL_TEST_ASSERT(inSuite, id.GetTargetAppInfo(0, appInfo) && appInfo.vendorId == 1 && appInfo.productId == 9); + NL_TEST_ASSERT(inSuite, id.GetTargetAppInfo(1, appInfo) && appInfo.vendorId == 2 && appInfo.productId == 8); + NL_TEST_ASSERT(inSuite, id.GetTargetAppInfo(2, appInfo) && appInfo.vendorId == 3 && appInfo.productId == 7); NL_TEST_ASSERT(inSuite, id.GetNoPasscode() == true); NL_TEST_ASSERT(inSuite, id.GetCdUponPasscodeDialog() == true); NL_TEST_ASSERT(inSuite, id.GetCommissionerPasscode() == true); @@ -436,10 +447,10 @@ void TestUDCIdentificationDeclaration(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, strcmp(idOut.GetPairingInst(), pairingInst) == 0); NL_TEST_ASSERT(inSuite, pairingHint == idOut.GetPairingHint()); - NL_TEST_ASSERT(inSuite, id.GetNumAppVendorIds() == idOut.GetNumAppVendorIds()); - NL_TEST_ASSERT(inSuite, idOut.GetAppVendorId(0, vendorIdTemp) && vendorIdTemp == 1); - NL_TEST_ASSERT(inSuite, idOut.GetAppVendorId(1, vendorIdTemp) && vendorIdTemp == 2); - NL_TEST_ASSERT(inSuite, idOut.GetAppVendorId(2, vendorIdTemp) && vendorIdTemp == 3); + NL_TEST_ASSERT(inSuite, id.GetNumTargetAppInfos() == idOut.GetNumTargetAppInfos()); + NL_TEST_ASSERT(inSuite, idOut.GetTargetAppInfo(0, appInfo) && appInfo.vendorId == 1 && appInfo.productId == 9); + NL_TEST_ASSERT(inSuite, idOut.GetTargetAppInfo(1, appInfo) && appInfo.vendorId == 2 && appInfo.productId == 8); + NL_TEST_ASSERT(inSuite, idOut.GetTargetAppInfo(2, appInfo) && appInfo.vendorId == 3 && appInfo.productId == 7); NL_TEST_ASSERT(inSuite, id.GetNoPasscode() == idOut.GetNoPasscode()); NL_TEST_ASSERT(inSuite, id.GetCdUponPasscodeDialog() == idOut.GetCdUponPasscodeDialog()); diff --git a/src/tracing/esp32_trace/esp32_tracing.cpp b/src/tracing/esp32_trace/esp32_tracing.cpp index 414cdd83edcc0d..24a7166dde04eb 100644 --- a/src/tracing/esp32_trace/esp32_tracing.cpp +++ b/src/tracing/esp32_trace/esp32_tracing.cpp @@ -17,6 +17,7 @@ */ #include "esp32_tracing.h" +#include #include #include #include @@ -26,6 +27,107 @@ namespace chip { namespace Tracing { namespace Insights { +namespace { + +constexpr size_t kPermitListMaxSize = 10; +using HashValue = uint32_t; + +// Implements a murmurhash with 0 seed. +uint32_t MurmurHash(const void * key) +{ + const uint32_t kMultiplier = 0x5bd1e995; + const uint32_t kShift = 24; + const unsigned char * data = (const unsigned char *) key; + uint32_t hash = 0; + + while (*data) + { + uint32_t value = *data++; + value *= kMultiplier; + value ^= value >> kShift; + value *= kMultiplier; + hash *= kMultiplier; + hash ^= value; + } + + hash ^= hash >> 13; + hash *= kMultiplier; + hash ^= hash >> 15; + + if (hash == 0) + { + ESP_LOGW("Tracing", "MurmurHash resulted in a hash value of 0"); + } + + return hash; +} + +/* PASESession,CASESession,NetworkCommissioning,GeneralCommissioning,OperationalCredentials + * are well known permitted entries. + */ + +HashValue gPermitList[kPermitListMaxSize] = { + MurmurHash("PASESession"), + MurmurHash("CASESession"), + MurmurHash("NetworkCommissioning"), + MurmurHash("GeneralCommissioning"), + MurmurHash("OperationalCredentials"), +}; + +bool IsPermitted(HashValue hashValue) +{ + for (HashValue permitted : gPermitList) + { + if (permitted == 0) + { + break; + } + if (hashValue == permitted) + { + return true; + } + } + return false; +} + +} // namespace + +namespace ESP32Filter { + +CHIP_ERROR AddHashToPermitlist(const char * str) +{ + HashValue hashValue = MurmurHash(str); + if (hashValue == 0) + { + ESP_LOGW("TRC", "Hash value for '%s' is 0", str); + return CHIP_ERROR_INCORRECT_STATE; + } + + for (HashValue & permitted : gPermitList) + { + if (permitted == 0) + { + permitted = hashValue; + return CHIP_NO_ERROR; + } + if (hashValue == permitted) + { + ESP_LOGW("TRC", "Hash value for '%s' is colliding with an existing entry", str); + return CHIP_ERROR_DUPLICATE_KEY_ID; + } + } + return CHIP_ERROR_NO_MEMORY; +} + +void RemoveHashFromPermitlist(const char * str) +{ + HashValue hashValue = MurmurHash(str); + + auto * end = gPermitList + kPermitListMaxSize; + std::fill(std::remove(gPermitList, end, hashValue), end, 0); +} + +} // namespace ESP32Filter #define LOG_HEAP_INFO(label, group, entry_exit) \ do \ @@ -48,12 +150,20 @@ void ESP32Backend::LogNodeDiscoveryFailed(NodeDiscoveryFailedInfo & info) {} void ESP32Backend::TraceBegin(const char * label, const char * group) { - LOG_HEAP_INFO(label, group, "Entry"); + HashValue hashValue = MurmurHash(group); + if (IsPermitted(hashValue)) + { + LOG_HEAP_INFO(label, group, "Entry"); + } } void ESP32Backend::TraceEnd(const char * label, const char * group) { - LOG_HEAP_INFO(label, group, "Exit"); + HashValue hashValue = MurmurHash(group); + if (IsPermitted(hashValue)) + { + LOG_HEAP_INFO(label, group, "Exit"); + } } void ESP32Backend::TraceInstant(const char * label, const char * group) @@ -63,4 +173,3 @@ void ESP32Backend::TraceInstant(const char * label, const char * group) } // namespace Insights } // namespace Tracing } // namespace chip -// namespace chip diff --git a/src/tracing/esp32_trace/esp32_tracing.h b/src/tracing/esp32_trace/esp32_tracing.h index 9857eb111b2c3d..7fe783d817d8d8 100644 --- a/src/tracing/esp32_trace/esp32_tracing.h +++ b/src/tracing/esp32_trace/esp32_tracing.h @@ -1,11 +1,18 @@ +#include #include #include - namespace chip { namespace Tracing { namespace Insights { +// Provide the user the ability to add/remove trace filters. +namespace ESP32Filter { + +CHIP_ERROR AddHashToPermitlist(const char * alabel); +void RemoveHashFromPermitlist(const char * alabel); +} // namespace ESP32Filter + /// A Backend that outputs data to chip logging. /// /// Structured data is formatted as json strings. diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h index e79d1281b33a8c..c14a0614f6a1c4 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h @@ -27,7 +27,6 @@ enum ZCL_BOOLEAN_ATTRIBUTE_TYPE = 0x10, // Boolean ZCL_BITMAP8_ATTRIBUTE_TYPE = 0x18, // 8-bit bitmap ZCL_BITMAP16_ATTRIBUTE_TYPE = 0x19, // 16-bit bitmap - ZCL_BITMAP24_ATTRIBUTE_TYPE = 0x1A, // 24-bit bitmap ZCL_BITMAP32_ATTRIBUTE_TYPE = 0x1B, // 32-bit bitmap ZCL_BITMAP64_ATTRIBUTE_TYPE = 0x1F, // 64-bit bitmap ZCL_INT8U_ATTRIBUTE_TYPE = 0x20, // Unsigned 8-bit integer diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 66f3ff69bb6949..c418c95d1b55ea 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -6570,6 +6570,68 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace IcdManagement { namespace Attributes { +namespace UserActiveModeTriggerHint { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace UserActiveModeTriggerHint + +namespace UserActiveModeTriggerInstruction { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) +{ + uint8_t zclString[128 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + + VerifyOrReturnError(value.size() == 128, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(value.data(), &zclString[1], 128); + value.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + static_assert(128 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 128, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[128 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace UserActiveModeTriggerInstruction + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 4222d40ea76f9f..70f24570d9770e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1274,6 +1274,18 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace IcdManagement { namespace Attributes { +namespace UserActiveModeTriggerHint { +EmberAfStatus +Get(chip::EndpointId endpoint, + chip::BitMask * value); // UserActiveModeTriggerBitmap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); +} // namespace UserActiveModeTriggerHint + +namespace UserActiveModeTriggerInstruction { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace UserActiveModeTriggerInstruction + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value);