From 5f94d380c22c46267c521a008aff36653b902ecb Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 23 Aug 2022 18:48:29 +0530 Subject: [PATCH 01/32] [ESP32] Support disabling SOFTAP for saving some flash (#22096) * [ESP32] Support disabling SOFTAP support for saving some flash * Disable softap by default in examples * If rendezvous mode is softap then enable softap configurations --- config/esp32/components/chip/Kconfig | 1 + .../esp32/main/Kconfig.projbuild | 2 + .../all-clusters-app/esp32/sdkconfig.defaults | 3 ++ .../esp32/main/Kconfig.projbuild | 2 + .../esp32/sdkconfig.defaults | 3 ++ examples/bridge-app/esp32/sdkconfig.defaults | 3 ++ examples/chef/esp32/main/Kconfig.projbuild | 2 + examples/chef/esp32/sdkconfig.defaults | 3 ++ .../light-switch-app/esp32/sdkconfig.defaults | 5 ++- .../lighting-app/esp32/sdkconfig.defaults | 3 ++ examples/lock-app/esp32/sdkconfig.defaults | 3 ++ .../ota-provider-app/esp32/sdkconfig.defaults | 3 ++ .../esp32/sdkconfig.defaults | 3 ++ .../esp32/sdkconfig.defaults | 3 ++ src/platform/ESP32/CHIPDevicePlatformConfig.h | 2 + src/platform/ESP32/ConnectivityManagerImpl.h | 42 +++++++++++-------- .../ESP32/ConnectivityManagerImpl_WiFi.cpp | 23 ++++++++-- src/platform/ESP32/ESP32Utils.cpp | 9 +++- src/platform/ESP32/ESP32Utils.h | 2 + src/platform/ESP32/PlatformManagerImpl.cpp | 3 +- 20 files changed, 95 insertions(+), 25 deletions(-) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 4a6cc6dd6e889e..55cafa1c8a07a8 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -387,6 +387,7 @@ menu "CHIP Device Layer" menu "WiFi AP Options" config ENABLE_WIFI_AP + depends on ESP_WIFI_SOFTAP_SUPPORT bool "Enable CHIP WIFI AP" default y help diff --git a/examples/all-clusters-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-app/esp32/main/Kconfig.projbuild index 8791a80a443e71..22edca7a03b264 100644 --- a/examples/all-clusters-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-app/esp32/main/Kconfig.projbuild @@ -53,6 +53,7 @@ menu "Demo" config RENDEZVOUS_MODE_SOFTAP bool "Soft-AP" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE bool "BLE" depends on BT_ENABLED @@ -60,6 +61,7 @@ menu "Demo" bool "On-Network" config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK bool "Soft-AP / On-Network" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE_ON_NETWORK bool "BLE / On-Network" endchoice diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults b/examples/all-clusters-app/esp32/sdkconfig.defaults index 5f996f40946d68..a9c28a1a863a25 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y # Serial Flasher config CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild index 8791a80a443e71..22edca7a03b264 100644 --- a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild @@ -53,6 +53,7 @@ menu "Demo" config RENDEZVOUS_MODE_SOFTAP bool "Soft-AP" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE bool "BLE" depends on BT_ENABLED @@ -60,6 +61,7 @@ menu "Demo" bool "On-Network" config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK bool "Soft-AP / On-Network" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE_ON_NETWORK bool "BLE / On-Network" endchoice diff --git a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults index 5f996f40946d68..a9c28a1a863a25 100644 --- a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y # Serial Flasher config CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/bridge-app/esp32/sdkconfig.defaults b/examples/bridge-app/esp32/sdkconfig.defaults index 6a6589e1040577..d76496f541c9ba 100644 --- a/examples/bridge-app/esp32/sdkconfig.defaults +++ b/examples/bridge-app/esp32/sdkconfig.defaults @@ -39,3 +39,6 @@ CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/chef/esp32/main/Kconfig.projbuild b/examples/chef/esp32/main/Kconfig.projbuild index 307b7f6ccb83bc..695222b7f43c45 100644 --- a/examples/chef/esp32/main/Kconfig.projbuild +++ b/examples/chef/esp32/main/Kconfig.projbuild @@ -55,6 +55,7 @@ menu "Demo" bool "Bypass" config RENDEZVOUS_MODE_SOFTAP bool "Soft-AP" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE bool "BLE" depends on BT_ENABLED @@ -62,6 +63,7 @@ menu "Demo" bool "On-Network" config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK bool "Soft-AP / On-Network" + select ESP_WIFI_SOFTAP_SUPPORT config RENDEZVOUS_MODE_BLE_ON_NETWORK bool "BLE / On-Network" endchoice diff --git a/examples/chef/esp32/sdkconfig.defaults b/examples/chef/esp32/sdkconfig.defaults index ab2bb7c5dcb419..a3a1d8a272b8b3 100644 --- a/examples/chef/esp32/sdkconfig.defaults +++ b/examples/chef/esp32/sdkconfig.defaults @@ -47,3 +47,6 @@ CONFIG_STACK_CHECK=y # Serial Flasher config CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/light-switch-app/esp32/sdkconfig.defaults b/examples/light-switch-app/esp32/sdkconfig.defaults index f8d119e98c2bec..4e780d862ad614 100644 --- a/examples/light-switch-app/esp32/sdkconfig.defaults +++ b/examples/light-switch-app/esp32/sdkconfig.defaults @@ -45,4 +45,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" #enable debug shell -CONFIG_ENABLE_CHIP_SHELL=y \ No newline at end of file +CONFIG_ENABLE_CHIP_SHELL=y + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/lighting-app/esp32/sdkconfig.defaults b/examples/lighting-app/esp32/sdkconfig.defaults index 23a3766c340c04..e051a3f2b37aee 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults +++ b/examples/lighting-app/esp32/sdkconfig.defaults @@ -43,3 +43,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y # Serial Flasher config CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/lock-app/esp32/sdkconfig.defaults b/examples/lock-app/esp32/sdkconfig.defaults index c9b513d752fc6c..d53bfc85c76c22 100644 --- a/examples/lock-app/esp32/sdkconfig.defaults +++ b/examples/lock-app/esp32/sdkconfig.defaults @@ -43,3 +43,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y #Lock app PID CONFIG_DEVICE_PRODUCT_ID=0x8006 + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/ota-provider-app/esp32/sdkconfig.defaults b/examples/ota-provider-app/esp32/sdkconfig.defaults index 537c6deab2897f..7fce894e5a80d8 100644 --- a/examples/ota-provider-app/esp32/sdkconfig.defaults +++ b/examples/ota-provider-app/esp32/sdkconfig.defaults @@ -58,3 +58,6 @@ CONFIG_USE_TEST_SETUP_DISCRIMINATOR=0xF01 # Enable chip shell CONFIG_ENABLE_CHIP_SHELL=y + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/ota-requestor-app/esp32/sdkconfig.defaults b/examples/ota-requestor-app/esp32/sdkconfig.defaults index beec4822b35cdf..17b6e378f65ca9 100644 --- a/examples/ota-requestor-app/esp32/sdkconfig.defaults +++ b/examples/ota-requestor-app/esp32/sdkconfig.defaults @@ -59,3 +59,6 @@ CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER=2 # Enable Chip Shell CONFIG_ENABLE_CHIP_SHELL=y + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/examples/temperature-measurement-app/esp32/sdkconfig.defaults b/examples/temperature-measurement-app/esp32/sdkconfig.defaults index 4659af909a144f..dcd05c0734f36a 100644 --- a/examples/temperature-measurement-app/esp32/sdkconfig.defaults +++ b/examples/temperature-measurement-app/esp32/sdkconfig.defaults @@ -84,3 +84,6 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 #enable lwIP route hooks CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Disable softap support by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index 3bc56162c00350..c40cd8c565e11d 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -59,11 +59,13 @@ #define CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS CONFIG_MAX_SCAN_NETWORKS_RESULTS #define CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT #define CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT CONFIG_WIFI_CONNECTIVITY_TIMEOUT +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP #define CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX CONFIG_WIFI_AP_SSID_PREFIX #define CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL CONFIG_WIFI_AP_CHANNEL #define CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS CONFIG_WIFI_AP_MAX_STATIONS #define CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL CONFIG_WIFI_AP_BEACON_INTERVAL #define CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT CONFIG_WIFI_AP_IDLE_TIMEOUT +#endif /* CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP */ #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY CONFIG_ENABLE_WIFI_TELEMETRY #define CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP | CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION #endif // CONFIG_IDF_TARGET_ESP32H2 diff --git a/src/platform/ESP32/ConnectivityManagerImpl.h b/src/platform/ESP32/ConnectivityManagerImpl.h index 3bdd1418c23564..9c7f7774317318 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl.h +++ b/src/platform/ESP32/ConnectivityManagerImpl.h @@ -109,15 +109,6 @@ class ConnectivityManagerImpl final : public ConnectivityManager, CHIP_ERROR _SetWiFiStationReconnectInterval(System::Clock::Timeout val); bool _IsWiFiStationProvisioned(void); void _ClearWiFiStationProvision(void); - WiFiAPMode _GetWiFiAPMode(void); - CHIP_ERROR _SetWiFiAPMode(WiFiAPMode val); - bool _IsWiFiAPActive(void); - bool _IsWiFiAPApplicationControlled(void); - void _DemandStartWiFiAP(void); - void _StopOnDemandWiFiAP(void); - void _MaintainOnDemandWiFiAP(void); - System::Clock::Timeout _GetWiFiAPIdleTimeout(void); - void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); CHIP_ERROR _GetAndLogWiFiStatsCounters(void); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); @@ -126,13 +117,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, // ===== Private members reserved for use by this class only. System::Clock::Timestamp mLastStationConnectFailTime; - System::Clock::Timestamp mLastAPDemandTime; WiFiStationMode mWiFiStationMode; WiFiStationState mWiFiStationState; - WiFiAPMode mWiFiAPMode; - WiFiAPState mWiFiAPState; System::Clock::Timeout mWiFiStationReconnectInterval; - System::Clock::Timeout mWiFiAPIdleTimeout; BitFlags mFlags; CHIP_ERROR InitWiFi(void); @@ -144,10 +131,27 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void ChangeWiFiStationState(WiFiStationState newState); static void DriveStationState(::chip::System::Layer * aLayer, void * aAppState); +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP + WiFiAPMode _GetWiFiAPMode(void); + CHIP_ERROR _SetWiFiAPMode(WiFiAPMode val); + bool _IsWiFiAPActive(void); + void _DemandStartWiFiAP(void); + void _StopOnDemandWiFiAP(void); + void _MaintainOnDemandWiFiAP(void); + System::Clock::Timeout _GetWiFiAPIdleTimeout(void); + void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); + bool _IsWiFiAPApplicationControlled(void); + + System::Clock::Timestamp mLastAPDemandTime; + WiFiAPMode mWiFiAPMode; + WiFiAPState mWiFiAPState; + System::Clock::Timeout mWiFiAPIdleTimeout; + void DriveAPState(void); CHIP_ERROR ConfigureWiFiAP(void); void ChangeWiFiAPState(WiFiAPState newState); static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP void UpdateInternetConnectivityState(void); void OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip); @@ -174,16 +178,12 @@ inline bool ConnectivityManagerImpl::_IsWiFiStationConnected(void) return mWiFiStationState == kWiFiStationState_Connected; } -inline bool ConnectivityManagerImpl::_IsWiFiAPApplicationControlled(void) -{ - return mWiFiAPMode == kWiFiAPMode_ApplicationControlled; -} - inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiStationReconnectInterval(void) { return mWiFiStationReconnectInterval; } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP inline ConnectivityManager::WiFiAPMode ConnectivityManagerImpl::_GetWiFiAPMode(void) { return mWiFiAPMode; @@ -199,6 +199,12 @@ inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiAPIdleTimeout(voi return mWiFiAPIdleTimeout; } +inline bool ConnectivityManagerImpl::_IsWiFiAPApplicationControlled(void) +{ + return mWiFiAPMode == kWiFiAPMode_ApplicationControlled; +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP + inline bool ConnectivityManagerImpl::_CanStartWiFiScan() { return mWiFiStationState != kWiFiStationState_Connecting; diff --git a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp index f00c92803908aa..2eb2e1b3ad11e0 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp @@ -110,10 +110,13 @@ void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) esp_wifi_set_config(WIFI_IF_STA, &stationConfig); DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL); +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP DeviceLayer::SystemLayer().ScheduleWork(DriveAPState, NULL); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP } } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP CHIP_ERROR ConnectivityManagerImpl::_SetWiFiAPMode(WiFiAPMode val) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -167,6 +170,7 @@ void ConnectivityManagerImpl::_SetWiFiAPIdleTimeout(System::Clock::Timeout val) mWiFiAPIdleTimeout = val; DeviceLayer::SystemLayer().ScheduleWork(DriveAPState, NULL); } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP #define WIFI_BAND_2_4GHZ 2400 #define WIFI_BAND_5_0GHZ 5000 @@ -382,13 +386,17 @@ CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void) CHIP_ERROR ConnectivityManagerImpl::InitWiFi() { mLastStationConnectFailTime = System::Clock::kZero; - mLastAPDemandTime = System::Clock::kZero; mWiFiStationMode = kWiFiStationMode_Disabled; mWiFiStationState = kWiFiStationState_NotConnected; - mWiFiAPMode = kWiFiAPMode_Disabled; - mWiFiAPState = kWiFiAPState_NotActive; mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL); - mWiFiAPIdleTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT); + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP + mLastAPDemandTime = System::Clock::kZero; + mWiFiAPMode = kWiFiAPMode_Disabled; + mWiFiAPState = kWiFiAPState_NotActive; + mWiFiAPIdleTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP + mFlags.SetRaw(0); // TODO Initialize the Chip Addressing and Routing Module. @@ -435,7 +443,10 @@ CHIP_ERROR ConnectivityManagerImpl::InitWiFi() // Queue work items to bootstrap the AP and station state machines once the Chip event loop is running. ReturnErrorOnFailure(DeviceLayer::SystemLayer().ScheduleWork(DriveStationState, NULL)); + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP ReturnErrorOnFailure(DeviceLayer::SystemLayer().ScheduleWork(DriveAPState, NULL)); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP return CHIP_NO_ERROR; } @@ -478,6 +489,7 @@ void ConnectivityManagerImpl::OnWiFiPlatformEvent(const ChipDeviceEvent * event) ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_STOP"); DriveStationState(); break; +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP case WIFI_EVENT_AP_START: ChipLogProgress(DeviceLayer, "WIFI_EVENT_AP_START"); ChangeWiFiAPState(kWiFiAPState_Active); @@ -492,6 +504,7 @@ void ConnectivityManagerImpl::OnWiFiPlatformEvent(const ChipDeviceEvent * event) ChipLogProgress(DeviceLayer, "WIFI_EVENT_AP_STACONNECTED"); MaintainOnDemandWiFiAP(); break; +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP default: break; } @@ -769,6 +782,7 @@ void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, sInstance.DriveStationState(); } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP void ConnectivityManagerImpl::DriveAPState() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -952,6 +966,7 @@ void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void { sInstance.DriveAPState(); } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP void ConnectivityManagerImpl::UpdateInternetConnectivityState(void) { diff --git a/src/platform/ESP32/ESP32Utils.cpp b/src/platform/ESP32/ESP32Utils.cpp index 9391ee586e3eb6..e6dd3ea4df09c3 100644 --- a/src/platform/ESP32/ESP32Utils.cpp +++ b/src/platform/ESP32/ESP32Utils.cpp @@ -38,6 +38,7 @@ using namespace ::chip::DeviceLayer::Internal; using chip::DeviceLayer::Internal::DeviceNetworkInfo; +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP CHIP_ERROR ESP32Utils::IsAPEnabled(bool & apEnabled) { wifi_mode_t curWiFiMode; @@ -53,6 +54,7 @@ CHIP_ERROR ESP32Utils::IsAPEnabled(bool & apEnabled) return CHIP_NO_ERROR; } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP CHIP_ERROR ESP32Utils::IsStationEnabled(bool & staEnabled) { @@ -130,6 +132,7 @@ CHIP_ERROR ESP32Utils::EnableStationMode(void) return ESP32Utils::MapError(err); } +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP // If station mode is not already enabled (implying the current mode is WIFI_MODE_AP), change // the mode to WIFI_MODE_APSTA. if (curWiFiMode == WIFI_MODE_AP) @@ -144,15 +147,19 @@ CHIP_ERROR ESP32Utils::EnableStationMode(void) return ESP32Utils::MapError(err); } } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP return CHIP_NO_ERROR; } CHIP_ERROR ESP32Utils::SetAPMode(bool enabled) { - wifi_mode_t curWiFiMode, targetWiFiMode; + wifi_mode_t curWiFiMode; + wifi_mode_t targetWiFiMode = WIFI_MODE_STA; +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP targetWiFiMode = (enabled) ? WIFI_MODE_APSTA : WIFI_MODE_STA; +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP // Get the current ESP WiFI mode. esp_err_t err = esp_wifi_get_mode(&curWiFiMode); diff --git a/src/platform/ESP32/ESP32Utils.h b/src/platform/ESP32/ESP32Utils.h index 94a98e0f8b281e..716b85e8434d3a 100644 --- a/src/platform/ESP32/ESP32Utils.h +++ b/src/platform/ESP32/ESP32Utils.h @@ -29,7 +29,9 @@ namespace Internal { class ESP32Utils { public: +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP static CHIP_ERROR IsAPEnabled(bool & apEnabled); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP static CHIP_ERROR IsStationEnabled(bool & staEnabled); static bool IsStationProvisioned(void); static CHIP_ERROR IsStationConnected(bool & connected); diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index c96caeb03934ef..d2254692924cca 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -84,8 +84,9 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) wifi_init_config_t cfg; uint8_t ap_mac[6]; wifi_mode_t mode; - +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP esp_netif_create_default_wifi_ap(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP esp_netif_create_default_wifi_sta(); esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); From 543ae309d7ddcb313a8e706a91f15c2fce35e104 Mon Sep 17 00:00:00 2001 From: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:22:23 -0400 Subject: [PATCH 02/32] address PR22049 post-merge commments (#22085) --- examples/chef/efr32/BUILD.gn | 2 +- examples/light-switch-app/efr32/BUILD.gn | 2 +- examples/lighting-app/efr32/BUILD.gn | 2 +- examples/lock-app/efr32/BUILD.gn | 2 +- examples/shell/shell_common/BUILD.gn | 2 +- examples/thermostat/efr32/BUILD.gn | 2 +- examples/window-app/efr32/BUILD.gn | 2 +- src/inet/BUILD.gn | 2 +- src/platform/EFR32/BUILD.gn | 2 +- src/test_driver/efr32/BUILD.gn | 2 +- third_party/openthread/BUILD.gn | 4 ++-- third_party/silabs/BUILD.gn | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index c567ae9d8f1cbf..e23b747fcad1dd 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -207,7 +207,7 @@ efr32_executable("chef_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index e2705abdedcb65..2d628f537f9f6e 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -200,7 +200,7 @@ efr32_executable("light_switch_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 060b9f67343aa0..fbd5a88a7909b9 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -205,7 +205,7 @@ efr32_executable("lighting_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index 2f8f2dc6bf67b4..e76b9cd48f1d1e 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -202,7 +202,7 @@ efr32_executable("lock_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/examples/shell/shell_common/BUILD.gn b/examples/shell/shell_common/BUILD.gn index 0217eb057fdff4..d601f0b54764b8 100644 --- a/examples/shell/shell_common/BUILD.gn +++ b/examples/shell/shell_common/BUILD.gn @@ -53,8 +53,8 @@ static_library("shell_common") { if (chip_enable_openthread && (current_os == "freertos" || current_os == "zephyr")) { public_deps += [ + "${chip_root}/third_party/openthread:openthread", "${chip_root}/third_party/openthread:openthread_cli", - "${chip_root}/third_party/openthread:openthread_device", ] } diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index edb03073686e3e..7e4e923992ff70 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -196,7 +196,7 @@ efr32_executable("thermostat_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index c7a3f57e4b9ff8..a9aa7cf402911c 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -188,7 +188,7 @@ efr32_executable("window_app") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index a042007d02c5a3..cb86a45780df9c 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -107,7 +107,7 @@ static_library("inet") { } if (chip_system_config_use_open_thread_inet_endpoints) { - public_deps += [ "${chip_root}/third_party/openthread:openthread_device" ] + public_deps += [ "${chip_root}/third_party/openthread:openthread" ] } if (chip_inet_config_enable_tcp_endpoint) { diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index eb73a6f80f85cf..1b5d6c45bbe3ba 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -98,7 +98,7 @@ static_library("EFR32") { "$dir_pw_kvs", ] if (chip_enable_openthread) { - public_deps += [ "${chip_root}/third_party/openthread:openthread_device" ] + public_deps += [ "${chip_root}/third_party/openthread:openthread" ] deps += [ "${chip_root}/third_party/openthread:openthread_cli" ] diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 8ee3c4f3e59c69..1d6f87637a99db 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -96,7 +96,7 @@ efr32_executable("efr32_device_tests") { if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread:openthread", - "${chip_root}/third_party/openthread:openthread_device", + "${chip_root}/third_party/openthread:openthread-platform", "${examples_plat_dir}:efr-matter-shell", ] } diff --git a/third_party/openthread/BUILD.gn b/third_party/openthread/BUILD.gn index 9ee8e905551837..7a183e681867dc 100644 --- a/third_party/openthread/BUILD.gn +++ b/third_party/openthread/BUILD.gn @@ -8,7 +8,7 @@ declare_args() { chip_openthread_target = "" } -group("openthread") { +group("openthread-platform") { if (chip_openthread_target != "") { public_deps = [ chip_openthread_target ] } else { @@ -19,7 +19,7 @@ group("openthread") { } } -group("openthread_device") { +group("openthread") { if (chip_openthread_target != "") { public_deps = [ chip_openthread_target ] } else { diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 1589f72e7865ae..7e885642cdd6f2 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -131,7 +131,7 @@ if (use_silabs_thread_lib) { ":libopenthread-platform", ":openthread_core_config_efr32", "${segger_rtt_root}:segger_rtt", - "${sl_openthread_root}/include/openthread:openthread", + "${sl_openthread_root}/include/openthread:openthread-platform", "${sl_openthread_root}/src/core/:libopenthread_core_headers", ] From 65d9ccf7461f8c45b4a07c4ca3e9c764dcc5793d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Tue, 23 Aug 2022 15:34:51 +0200 Subject: [PATCH 03/32] [nrfconnect] Fix Docker build due to conflicting PIP packages (#22072) nRF Connect Docker image build started to fail due to some conflicts in documentation dependencies. We don't need those dependencies in Matter CI, so get rid off them. Signed-off-by: Damian Krolik Signed-off-by: Damian Krolik --- integrations/docker/images/chip-build-nrf-platform/Dockerfile | 2 +- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index f27f0813c748b3..280534cac6c9fe 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -61,7 +61,7 @@ RUN set -x \ && (apt-get remove -fy python3-yaml && apt-get autoremove || exit 0) \ && python3 -m pip install -U --no-cache-dir cmake==3.22.5 \ && python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/zephyr/scripts/requirements.txt \ - && python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements.txt \ + && python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements-build.txt \ && python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/bootloader/mcuboot/scripts/requirements.txt \ && : # last line diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 0791656d59351a..1cb8eca1c7f032 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.94 Version bump reason: Install ccache to the chip-build image +0.5.95 Version bump reason: Fix nrfconnect Docker build From ae16a8c75815c6b92c1c2788947a76a3127e3a56 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 23 Aug 2022 19:07:41 +0530 Subject: [PATCH 04/32] [ESP32] Fix namespace for unique id and added rotating device id (#22063) unique id key in chip-factory namespace Unique-id should be changed after every factory reset and to do that it should be stored in chip-config namespace. Earlier it was stored in chip-factory which is not erased on factory reset. --- .../tools/generate_esp32_chip_factory_bin.py | 12 +++++------ src/platform/ESP32/ESP32Config.cpp | 3 ++- src/platform/ESP32/ESP32Config.h | 21 +++++++++++-------- .../ESP32/ESP32FactoryDataProvider.cpp | 5 +++-- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index d5f6ed380a91c6..64b6c293fd6510 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -140,7 +140,7 @@ 'encoding': 'string', 'value': None, }, - 'unique-id': { + 'rd-id-uid': { 'type': 'data', 'encoding': 'hex2bin', 'value': None, @@ -260,7 +260,7 @@ def validate_args(args): check_str_range(args.product_name, 1, 32, 'Product name') check_str_range(args.hw_ver_str, 1, 64, 'Hardware version string') check_str_range(args.mfg_date, 8, 16, 'Manufacturing date') - check_str_range(args.unique_id, 32, 32, 'Unique id') + check_str_range(args.rd_id_uid, 32, 32, 'Rotating device Unique id') logging.info('Discriminator:{} Passcode:{}'.format(args.discriminator, args.passcode)) @@ -295,8 +295,8 @@ def populate_factory_data(args, spake2p_params): if args.serial_num is not None: FACTORY_DATA['serial-num']['value'] = args.serial_num - if args.unique_id is not None: - FACTORY_DATA['unique-id']['value'] = args.unique_id + if args.rd_id_uid is not None: + FACTORY_DATA['rd-id-uid']['value'] = args.rd_id_uid if args.mfg_date is not None: FACTORY_DATA['mfg-date']['value'] = args.mfg_date if args.vendor_id is not None: @@ -460,8 +460,8 @@ def any_base_int(s): return int(s, 0) parser.add_argument('--hw-ver-str', type=str, required=False, help='Hardware version string') parser.add_argument('--mfg-date', type=str, required=False, help='Manufacturing date in format YYYY-MM-DD') parser.add_argument('--serial-num', type=str, required=False, help='Serial number') - parser.add_argument('--unique-id', type=str, required=False, - help='128-bit unique identifier, provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"') + parser.add_argument('--rd-id-uid', type=str, required=False, + help='128-bit unique identifier for generating rotating device identifier, provide 32-byte hex string, e.g. "1234567890abcdef1234567890abcdef"') # These will be used by DeviceInfoProvider parser.add_argument('--calendar-types', type=str, nargs='+', required=False, diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 0feaa568886f29..537ec90375c754 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -72,9 +72,9 @@ const ESP32Config::Key ESP32Config::kConfigKey_VendorId = { kConfig const ESP32Config::Key ESP32Config::kConfigKey_VendorName = { kConfigNamespace_ChipFactory, "vendor-name" }; const ESP32Config::Key ESP32Config::kConfigKey_ProductId = { kConfigNamespace_ChipFactory, "product-id" }; const ESP32Config::Key ESP32Config::kConfigKey_ProductName = { kConfigNamespace_ChipFactory, "product-name" }; -const ESP32Config::Key ESP32Config::kConfigKey_UniqueId = { kConfigNamespace_ChipFactory, "unique-id" }; const ESP32Config::Key ESP32Config::kConfigKey_SupportedCalTypes = { kConfigNamespace_ChipFactory, "cal-types" }; const ESP32Config::Key ESP32Config::kConfigKey_SupportedLocaleSize = { kConfigNamespace_ChipFactory, "locale-sz" }; +const ESP32Config::Key ESP32Config::kConfigKey_RotatingDevIdUniqueId = { kConfigNamespace_ChipFactory, "rd-id-uid" }; // Keys stored in the chip-config namespace const ESP32Config::Key ESP32Config::kConfigKey_ServiceConfig = { kConfigNamespace_ChipConfig, "service-config" }; @@ -85,6 +85,7 @@ const ESP32Config::Key ESP32Config::kConfigKey_FailSafeArmed = { kConfigNam const ESP32Config::Key ESP32Config::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" }; const ESP32Config::Key ESP32Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "reg-location" }; const ESP32Config::Key ESP32Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; +const ESP32Config::Key ESP32Config::kConfigKey_UniqueId = { kConfigNamespace_ChipConfig, "unique-id" }; // Keys stored in the Chip-counters namespace const ESP32Config::Key ESP32Config::kCounterKey_RebootCount = { kConfigNamespace_ChipCounters, "reboot-count" }; diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index 86138368352a7f..e038b664fb8a09 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -53,7 +53,6 @@ class ESP32Config // Key definitions for well-known keys. static const Key kConfigKey_SerialNum; - static const Key kConfigKey_UniqueId; static const Key kConfigKey_MfrDeviceId; static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; @@ -62,15 +61,7 @@ class ESP32Config static const Key kConfigKey_HardwareVersionString; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; - static const Key kConfigKey_ServiceConfig; - static const Key kConfigKey_PairedAccountId; - static const Key kConfigKey_ServiceId; - static const Key kConfigKey_LastUsedEpochKeyId; - static const Key kConfigKey_FailSafeArmed; - static const Key kConfigKey_WiFiStationSecType; static const Key kConfigKey_SetupDiscriminator; - static const Key kConfigKey_RegulatoryLocation; - static const Key kConfigKey_CountryCode; static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; @@ -85,6 +76,18 @@ class ESP32Config static const Key kConfigKey_ProductName; static const Key kConfigKey_SupportedCalTypes; static const Key kConfigKey_SupportedLocaleSize; + static const Key kConfigKey_RotatingDevIdUniqueId; + + // CHIP Config keys + static const Key kConfigKey_ServiceConfig; + static const Key kConfigKey_PairedAccountId; + static const Key kConfigKey_ServiceId; + static const Key kConfigKey_LastUsedEpochKeyId; + static const Key kConfigKey_FailSafeArmed; + static const Key kConfigKey_WiFiStationSecType; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_UniqueId; // CHIP Counter keys static const Key kCounterKey_RebootCount; diff --git a/src/platform/ESP32/ESP32FactoryDataProvider.cpp b/src/platform/ESP32/ESP32FactoryDataProvider.cpp index 443374b2c4421b..8239a96b159f48 100644 --- a/src/platform/ESP32/ESP32FactoryDataProvider.cpp +++ b/src/platform/ESP32/ESP32FactoryDataProvider.cpp @@ -198,12 +198,13 @@ CHIP_ERROR ESP32FactoryDataProvider::GetHardwareVersionString(char * buf, size_t CHIP_ERROR ESP32FactoryDataProvider::GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) { ChipError err = CHIP_ERROR_WRONG_KEY_TYPE; -#if CHIP_ENABLE_ROTATING_DEVICE_ID && defined(CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID) +#if CHIP_ENABLE_ROTATING_DEVICE_ID static_assert(ConfigurationManager::kRotatingDeviceIDUniqueIDLength >= ConfigurationManager::kMinRotatingDeviceIDUniqueIDLength, "Length of unique ID for rotating device ID is smaller than minimum."); size_t uniqueIdLen = 0; - err = ESP32Config::ReadConfigValueBin(ESP32Config::kConfigKey_UniqueId, uniqueIdSpan.data(), uniqueIdSpan.size(), uniqueIdLen); + err = ESP32Config::ReadConfigValueBin(ESP32Config::kConfigKey_RotatingDevIdUniqueId, uniqueIdSpan.data(), uniqueIdSpan.size(), + uniqueIdLen); ReturnErrorOnFailure(err); uniqueIdSpan.reduce_size(uniqueIdLen); #endif From db3ce611a967ce9a93e3c6cf63519ef020f5c0ea Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 23 Aug 2022 19:10:03 +0530 Subject: [PATCH 05/32] [ESP32] Remove stale USE_ECHO_CLIENT and ECHO_HOST_IP kconfig options (#22097) --- .../all-clusters-app/esp32/main/Kconfig.projbuild | 7 ------- .../esp32/main/Kconfig.projbuild | 7 ------- examples/chef/esp32/main/Kconfig.projbuild | 7 ------- examples/lock-app/esp32/main/Kconfig.projbuild | 14 -------------- .../esp32/main/Kconfig.projbuild | 14 -------------- 5 files changed, 49 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-app/esp32/main/Kconfig.projbuild index 22edca7a03b264..dbf11ecaab5a57 100644 --- a/examples/all-clusters-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-app/esp32/main/Kconfig.projbuild @@ -66,13 +66,6 @@ menu "Demo" bool "BLE / On-Network" endchoice - config ECHO_HOST_IP - string "IPV4 address" - default "127.0.0.1" - depends on USE_ECHO_CLIENT - help - The IPV4 Address of the ECHO Server. - # NOTE: This config is not displayed as a input in the Kconfig menu, as its value is # entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE # define that is produced is needed to configure the TFT library correctly. diff --git a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild index 22edca7a03b264..dbf11ecaab5a57 100644 --- a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild @@ -66,13 +66,6 @@ menu "Demo" bool "BLE / On-Network" endchoice - config ECHO_HOST_IP - string "IPV4 address" - default "127.0.0.1" - depends on USE_ECHO_CLIENT - help - The IPV4 Address of the ECHO Server. - # NOTE: This config is not displayed as a input in the Kconfig menu, as its value is # entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE # define that is produced is needed to configure the TFT library correctly. diff --git a/examples/chef/esp32/main/Kconfig.projbuild b/examples/chef/esp32/main/Kconfig.projbuild index 695222b7f43c45..a2b3ea3ce1c34c 100644 --- a/examples/chef/esp32/main/Kconfig.projbuild +++ b/examples/chef/esp32/main/Kconfig.projbuild @@ -68,13 +68,6 @@ menu "Demo" bool "BLE / On-Network" endchoice - config ECHO_HOST_IP - string "IPV4 address" - default "127.0.0.1" - depends on USE_ECHO_CLIENT - help - The IPV4 Address of the ECHO Server. - # NOTE: This config is not displayed as a input in the Kconfig menu, as its value is # entirely derived from the Device Type choice. However the CONFIG_EXAMPLE_DISPLAY_TYPE # define that is produced is needed to configure the TFT library correctly. diff --git a/examples/lock-app/esp32/main/Kconfig.projbuild b/examples/lock-app/esp32/main/Kconfig.projbuild index e2ec051d774fe1..4ec2e859c0b1f5 100644 --- a/examples/lock-app/esp32/main/Kconfig.projbuild +++ b/examples/lock-app/esp32/main/Kconfig.projbuild @@ -36,20 +36,6 @@ menu "Demo" bool "Ethernet" endchoice - config USE_ECHO_CLIENT - bool "Enable the built-in Echo Client" - default "n" - help - This enables a local FreeRTOS Echo Client so that the end-to-end echo server can be - tested easily - - config ECHO_HOST_IP - string "IPV4 address" - default "127.0.0.1" - depends on USE_ECHO_CLIENT - help - The IPV4 Address of the ECHO Server. - config RENDEZVOUS_MODE int range 0 8 diff --git a/examples/temperature-measurement-app/esp32/main/Kconfig.projbuild b/examples/temperature-measurement-app/esp32/main/Kconfig.projbuild index e2ec051d774fe1..4ec2e859c0b1f5 100644 --- a/examples/temperature-measurement-app/esp32/main/Kconfig.projbuild +++ b/examples/temperature-measurement-app/esp32/main/Kconfig.projbuild @@ -36,20 +36,6 @@ menu "Demo" bool "Ethernet" endchoice - config USE_ECHO_CLIENT - bool "Enable the built-in Echo Client" - default "n" - help - This enables a local FreeRTOS Echo Client so that the end-to-end echo server can be - tested easily - - config ECHO_HOST_IP - string "IPV4 address" - default "127.0.0.1" - depends on USE_ECHO_CLIENT - help - The IPV4 Address of the ECHO Server. - config RENDEZVOUS_MODE int range 0 8 From cfdb308152223458dfb28a4a606ef4c68c79245d Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Tue, 23 Aug 2022 06:41:28 -0700 Subject: [PATCH 06/32] TC_RR_1_1: Updated Method that Was Used to Generate Large Sized Operational Certificates (#22088) * TC_RR_1_1: Updated Method that Was Used to Generate Large Sized Operational Certificates. Instead of padding the subject DN this method adds size by adding Future Extension. This new approach doesen't have certain limitations compare to the previous approach and allows generation of larger certificates of approximate sizes: {RCAC, ICAC, NOC} ~ {400, 400, 350} bytes in TLV encoded form. * Update src/credentials/tests/TestChipCert.cpp Co-authored-by: Tennessee Carmel-Veilleux Co-authored-by: Tennessee Carmel-Veilleux --- .../ExampleOperationalCredentialsIssuer.cpp | 39 ++++++++----------- src/credentials/CHIPCert.h | 7 ++++ src/credentials/GenerateChipX509Cert.cpp | 30 +++++++++++++- src/credentials/tests/TestChipCert.cpp | 36 +++++++++++++++++ src/tools/chip-cert/CertUtils.cpp | 4 +- src/tools/chip-cert/Cmd_GenCert.cpp | 26 ++++++------- src/tools/chip-cert/chip-cert.h | 12 +++--- 7 files changed, 109 insertions(+), 45 deletions(-) diff --git a/src/controller/ExampleOperationalCredentialsIssuer.cpp b/src/controller/ExampleOperationalCredentialsIssuer.cpp index 9c0b376b13716c..dc026dbbf88bfd 100644 --- a/src/controller/ExampleOperationalCredentialsIssuer.cpp +++ b/src/controller/ExampleOperationalCredentialsIssuer.cpp @@ -52,10 +52,11 @@ CHIP_ERROR IssueX509Cert(uint32_t now, uint32_t validity, ChipDN issuerDn, ChipD const Crypto::P256PublicKey & subjectPublicKey, Crypto::P256Keypair & issuerKeypair, MutableByteSpan & outX509Cert) { - constexpr size_t kDERCertDnEncodingOverhead = 11; - constexpr size_t kTLVCertDnEncodingOverhead = 3; - constexpr size_t kMaxCertPaddingLength = 150; - constexpr size_t kTLVDesiredSize = kMaxCHIPCertLength - 50; + constexpr size_t kDERCertFutureExtEncodingOverhead = 12; + constexpr size_t kTLVCertFutureExtEncodingOverhead = kDERCertFutureExtEncodingOverhead + 5; + constexpr size_t kMaxCertPaddingLength = 200; + constexpr size_t kTLVDesiredSize = kMaxCHIPCertLength; + constexpr uint8_t sOID_Extension_SubjectAltName[] = { 0x55, 0x1d, 0x11 }; Platform::ScopedMemoryBuffer derBuf; ReturnErrorCodeIf(!derBuf.Alloc(kMaxDERCertLength), CHIP_ERROR_NO_MEMORY); @@ -84,7 +85,7 @@ CHIP_ERROR IssueX509Cert(uint32_t now, uint32_t validity, ChipDN issuerDn, ChipD return CHIP_ERROR_INVALID_ARGUMENT; } - if (maximizeSize && (desiredDn.RDNCount() < CHIP_CONFIG_CERT_MAX_RDN_ATTRIBUTES)) + if (maximizeSize) { Platform::ScopedMemoryBuffer paddedTlvBuf; ReturnErrorCodeIf(!paddedTlvBuf.Alloc(kMaxCHIPCertLength + kMaxCertPaddingLength), CHIP_ERROR_NO_MEMORY); @@ -99,15 +100,8 @@ CHIP_ERROR IssueX509Cert(uint32_t now, uint32_t validity, ChipDN issuerDn, ChipD ReturnErrorCodeIf(!fillerBuf.Alloc(kMaxCertPaddingLength), CHIP_ERROR_NO_MEMORY); memset(fillerBuf.Get(), 'A', kMaxCertPaddingLength); - int derPaddingLen = static_cast(kMaxDERCertLength - kDERCertDnEncodingOverhead - derSpan.size()); - int tlvPaddingLen = static_cast(kTLVDesiredSize - kTLVCertDnEncodingOverhead - paddedTlvSpan.size()); - if (certType == CertType::kRcac) - { - // For RCAC the issuer/subject DN are the same so padding will be present in both - derPaddingLen = (derPaddingLen - static_cast(kDERCertDnEncodingOverhead)) / 2; - tlvPaddingLen = (tlvPaddingLen - static_cast(kTLVCertDnEncodingOverhead)) / 2; - } - + int derPaddingLen = static_cast(kMaxDERCertLength - kDERCertFutureExtEncodingOverhead - derSpan.size()); + int tlvPaddingLen = static_cast(kTLVDesiredSize - kTLVCertFutureExtEncodingOverhead - paddedTlvSpan.size()); size_t paddingLen = 0; if (derPaddingLen >= 1 && tlvPaddingLen >= 1) { @@ -119,24 +113,25 @@ CHIP_ERROR IssueX509Cert(uint32_t now, uint32_t validity, ChipDN issuerDn, ChipD paddedDerSpan = MutableByteSpan{ paddedDerBuf.Get(), kMaxDERCertLength + kMaxCertPaddingLength }; paddedTlvSpan = MutableByteSpan{ paddedTlvBuf.Get(), kMaxCHIPCertLength + kMaxCertPaddingLength }; - ChipDN certDn = desiredDn; - // Fill the padding in the DomainNameQualifier DN - certDn.AddAttribute_DNQualifier(CharSpan(fillerBuf.Get(), paddingLen), false); + Optional futureExt; + FutureExtension ext = { ByteSpan(sOID_Extension_SubjectAltName), + ByteSpan(reinterpret_cast(fillerBuf.Get()), paddingLen) }; + futureExt.SetValue(ext); switch (certType) { case CertType::kRcac: { - X509CertRequestParams rcacRequest = { serialNumber, now, now + validity, certDn, certDn }; + X509CertRequestParams rcacRequest = { serialNumber, now, now + validity, desiredDn, desiredDn, futureExt }; ReturnErrorOnFailure(NewRootX509Cert(rcacRequest, issuerKeypair, paddedDerSpan)); break; } case CertType::kIcac: { - X509CertRequestParams icacRequest = { serialNumber, now, now + validity, certDn, issuerDn }; + X509CertRequestParams icacRequest = { serialNumber, now, now + validity, desiredDn, issuerDn, futureExt }; ReturnErrorOnFailure(NewICAX509Cert(icacRequest, subjectPublicKey, issuerKeypair, paddedDerSpan)); break; } case CertType::kNoc: { - X509CertRequestParams nocRequest = { serialNumber, now, now + validity, certDn, issuerDn }; + X509CertRequestParams nocRequest = { serialNumber, now, now + validity, desiredDn, issuerDn, futureExt }; ReturnErrorOnFailure(NewNodeOperationalX509Cert(nocRequest, subjectPublicKey, issuerKeypair, paddedDerSpan)); break; } @@ -146,10 +141,10 @@ CHIP_ERROR IssueX509Cert(uint32_t now, uint32_t validity, ChipDN issuerDn, ChipD ReturnErrorOnFailure(ConvertX509CertToChipCert(paddedDerSpan, paddedTlvSpan)); - ChipLogProgress(Controller, "Generated maximized certificate with %u DER bytes, %u TLV bytes", - static_cast(paddedDerSpan.size()), static_cast(paddedTlvSpan.size())); if (paddedDerSpan.size() <= kMaxDERCertLength && paddedTlvSpan.size() <= kMaxCHIPCertLength) { + ChipLogProgress(Controller, "Generated maximized certificate with %u DER bytes, %u TLV bytes", + static_cast(paddedDerSpan.size()), static_cast(paddedTlvSpan.size())); return CopySpanToMutableSpan(paddedDerSpan, outX509Cert); } } diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 2f3fb7f0d76253..d95671ee74c3a4 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -507,6 +507,12 @@ CHIP_ERROR ConvertChipCertToX509Cert(const ByteSpan chipCert, MutableByteSpan & */ CHIP_ERROR ValidateChipRCAC(const ByteSpan & rcac); +struct FutureExtension +{ + ByteSpan OID; + ByteSpan Extension; +}; + struct X509CertRequestParams { int64_t SerialNumber; @@ -514,6 +520,7 @@ struct X509CertRequestParams uint32_t ValidityEnd; ChipDN SubjectDN; ChipDN IssuerDN; + Optional FutureExt; }; /** diff --git a/src/credentials/GenerateChipX509Cert.cpp b/src/credentials/GenerateChipX509Cert.cpp index e1c6fe5002ce3b..b51c49e0174f22 100644 --- a/src/credentials/GenerateChipX509Cert.cpp +++ b/src/credentials/GenerateChipX509Cert.cpp @@ -230,7 +230,31 @@ CHIP_ERROR EncodeNOCSpecificExtensions(ASN1Writer & writer) return err; } -CHIP_ERROR EncodeExtensions(bool isCA, const Crypto::P256PublicKey & SKI, const Crypto::P256PublicKey & AKI, ASN1Writer & writer) +CHIP_ERROR EncodeFutureExtension(const Optional & futureExt, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrReturnError(futureExt.HasValue(), CHIP_NO_ERROR); + + ASN1_START_SEQUENCE + { + ReturnErrorOnFailure(writer.PutObjectId(futureExt.Value().OID.data(), static_cast(futureExt.Value().OID.size()))); + + ASN1_START_OCTET_STRING_ENCAPSULATED + { + ReturnErrorOnFailure(writer.PutOctetString(futureExt.Value().Extension.data(), + static_cast(futureExt.Value().Extension.size()))); + } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeExtensions(bool isCA, const Crypto::P256PublicKey & SKI, const Crypto::P256PublicKey & AKI, + const Optional & futureExt, ASN1Writer & writer) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -250,6 +274,8 @@ CHIP_ERROR EncodeExtensions(bool isCA, const Crypto::P256PublicKey & SKI, const ReturnErrorOnFailure(EncodeSubjectKeyIdentifierExtension(SKI, writer)); ReturnErrorOnFailure(EncodeAuthorityKeyIdentifierExtension(AKI, writer)); + + ReturnErrorOnFailure(EncodeFutureExtension(futureExt, writer)); } ASN1_END_SEQUENCE; } @@ -336,7 +362,7 @@ CHIP_ERROR EncodeTBSCert(const X509CertRequestParams & requestParams, const Cryp ReturnErrorOnFailure(EncodeSubjectPublicKeyInfo(subjectPubkey, writer)); // certificate extensions - ReturnErrorOnFailure(EncodeExtensions(isCA, subjectPubkey, issuerPubkey, writer)); + ReturnErrorOnFailure(EncodeExtensions(isCA, subjectPubkey, issuerPubkey, requestParams.FutureExt, writer)); } ASN1_END_SEQUENCE; diff --git a/src/credentials/tests/TestChipCert.cpp b/src/credentials/tests/TestChipCert.cpp index 97c00d7ca555bd..c84b18db79024c 100644 --- a/src/credentials/tests/TestChipCert.cpp +++ b/src/credentials/tests/TestChipCert.cpp @@ -102,6 +102,14 @@ static const BitFlags sKCandCR(sKC, sCR); static const BitFlags sKCandEO(sKC, sEO); static const BitFlags sKCandDO(sKC, sDO); +constexpr uint8_t sOID_Extension_SubjectAltName[] = { 0x55, 0x1d, 0x11 }; +constexpr char kExtension_SubjectAltName[] = "test@example.com"; + +FutureExtension ext{ ByteSpan(sOID_Extension_SubjectAltName), + ByteSpan(reinterpret_cast(const_cast(kExtension_SubjectAltName)), + strlen(kExtension_SubjectAltName)) }; +Optional kSubjectAltNameAsFutureExt(ext); + static CHIP_ERROR LoadTestCertSet01(ChipCertificateSet & certSet) { CHIP_ERROR err; @@ -1247,6 +1255,15 @@ static void TestChipCert_GenerateRootCert(nlTestSuite * inSuite, void * inContex NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test with FutureExtension + X509CertRequestParams root_params2 = { 1234, 631161876, 729942000, root_dn, root_dn, kSubjectAltNameAsFutureExt }; + MutableByteSpan signed_cert_span2(signed_cert); + NL_TEST_ASSERT(inSuite, NewRootX509Cert(root_params2, keypair, signed_cert_span2) == CHIP_NO_ERROR); + outCert = MutableByteSpan(outCertBuf); + + NL_TEST_ASSERT(inSuite, ConvertX509CertToChipCert(signed_cert_span2, outCert) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test error case: root cert subject provided ICA OID Attribute. root_params.SubjectDN.Clear(); NL_TEST_ASSERT(inSuite, root_params.SubjectDN.AddAttribute_MatterICACId(0xabcdabcd) == CHIP_NO_ERROR); @@ -1325,6 +1342,15 @@ static void TestChipCert_GenerateICACert(nlTestSuite * inSuite, void * inContext NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test with FutureExtension + X509CertRequestParams ica_params2 = { 1234, 631161876, 729942000, ica_dn, issuer_dn, kSubjectAltNameAsFutureExt }; + MutableByteSpan signed_cert_span2(signed_cert); + NL_TEST_ASSERT(inSuite, NewICAX509Cert(ica_params2, ica_keypair.Pubkey(), keypair, signed_cert_span2) == CHIP_NO_ERROR); + outCert = MutableByteSpan(outCertBuf); + + NL_TEST_ASSERT(inSuite, ConvertX509CertToChipCert(signed_cert_span2, outCert) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test error case: ICA cert subject provided a node ID attribute ica_params.SubjectDN.Clear(); NL_TEST_ASSERT(inSuite, ica_params.SubjectDN.AddAttribute_MatterNodeId(0xABCDABCDABCDABCD) == CHIP_NO_ERROR); @@ -1372,6 +1398,16 @@ static void TestChipCert_GenerateNOCRoot(nlTestSuite * inSuite, void * inContext NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test with FutureExtension + X509CertRequestParams noc_params2 = { 123456, 631161876, 729942000, noc_dn, issuer_dn, kSubjectAltNameAsFutureExt }; + MutableByteSpan signed_cert_span2(signed_cert); + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params2, noc_keypair.Pubkey(), keypair, signed_cert_span2) == CHIP_NO_ERROR); + outCert = MutableByteSpan(outCertBuf); + + NL_TEST_ASSERT(inSuite, ConvertX509CertToChipCert(signed_cert_span2, outCert) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCert, certData) == CHIP_NO_ERROR); + // Test error case: NOC cert subject doesn't have NodeId attribute noc_params.SubjectDN.Clear(); NL_TEST_ASSERT(inSuite, noc_params.SubjectDN.AddAttribute_MatterFabricId(0xFAB00000FAB00001) == CHIP_NO_ERROR); diff --git a/src/tools/chip-cert/CertUtils.cpp b/src/tools/chip-cert/CertUtils.cpp index f929e1446317e2..0c22503628bc31 100644 --- a/src/tools/chip-cert/CertUtils.cpp +++ b/src/tools/chip-cert/CertUtils.cpp @@ -772,7 +772,7 @@ bool WriteChipCert(const char * fileName, const ByteSpan & chipCert, CertFormat } bool MakeCert(uint8_t certType, const ToolChipDN * subjectDN, X509 * caCert, EVP_PKEY * caKey, const struct tm & validFrom, - uint32_t validDays, int pathLen, const FutureExtension * futureExts, uint8_t futureExtsCount, X509 * newCert, + uint32_t validDays, int pathLen, const FutureExtensionWithNID * futureExts, uint8_t futureExtsCount, X509 * newCert, EVP_PKEY * newKey, CertStructConfig & certConfig) { bool res = true; @@ -925,7 +925,7 @@ bool MakeCert(uint8_t certType, const ToolChipDN * subjectDN, X509 * caCert, EVP } CHIP_ERROR MakeCertChipTLV(uint8_t certType, const ToolChipDN * subjectDN, X509 * caCert, EVP_PKEY * caKey, - const struct tm & validFrom, uint32_t validDays, int pathLen, const FutureExtension * futureExts, + const struct tm & validFrom, uint32_t validDays, int pathLen, const FutureExtensionWithNID * futureExts, uint8_t futureExtsCount, X509 * x509Cert, EVP_PKEY * newKey, CertStructConfig & certConfig, MutableByteSpan & chipCert) { diff --git a/src/tools/chip-cert/Cmd_GenCert.cpp b/src/tools/chip-cert/Cmd_GenCert.cpp index e944bdb07733c9..6a0a1c6784335d 100644 --- a/src/tools/chip-cert/Cmd_GenCert.cpp +++ b/src/tools/chip-cert/Cmd_GenCert.cpp @@ -243,19 +243,19 @@ OptionSet *gCmdOptionSets[] = // clang-format on ToolChipDN gSubjectDN; -uint8_t gCertType = kCertType_NotSpecified; -int gPathLengthConstraint = kPathLength_NotSpecified; -bool gSelfSign = false; -const char * gCACertFileName = nullptr; -const char * gCAKeyFileName = nullptr; -const char * gInKeyFileName = nullptr; -const char * gOutCertFileName = nullptr; -const char * gOutKeyFileName = nullptr; -CertFormat gOutCertFormat = kCertFormat_Default; -KeyFormat gOutKeyFormat = kKeyFormat_Default; -uint32_t gValidDays = kCertValidDays_Undefined; -FutureExtension gFutureExtensions[3] = { { 0, nullptr } }; -uint8_t gFutureExtensionsCount = 0; +uint8_t gCertType = kCertType_NotSpecified; +int gPathLengthConstraint = kPathLength_NotSpecified; +bool gSelfSign = false; +const char * gCACertFileName = nullptr; +const char * gCAKeyFileName = nullptr; +const char * gInKeyFileName = nullptr; +const char * gOutCertFileName = nullptr; +const char * gOutKeyFileName = nullptr; +CertFormat gOutCertFormat = kCertFormat_Default; +KeyFormat gOutKeyFormat = kKeyFormat_Default; +uint32_t gValidDays = kCertValidDays_Undefined; +FutureExtensionWithNID gFutureExtensions[3] = { { 0, nullptr } }; +uint8_t gFutureExtensionsCount = 0; struct tm gValidFrom; CertStructConfig gCertConfig; diff --git a/src/tools/chip-cert/chip-cert.h b/src/tools/chip-cert/chip-cert.h index 6bdd41855c3a01..39e32fbe580c8b 100644 --- a/src/tools/chip-cert/chip-cert.h +++ b/src/tools/chip-cert/chip-cert.h @@ -141,7 +141,7 @@ enum AttCertType kAttCertType_DAC, /**< Device Attestation Certificate (DAC). */ }; -struct FutureExtension +struct FutureExtensionWithNID { int nid; const char * info; @@ -410,12 +410,12 @@ extern bool WriteCert(const char * fileName, X509 * cert, CertFormat certFmt); extern bool WriteChipCert(const char * fileName, const chip::ByteSpan & cert, CertFormat certFmt); extern bool MakeCert(uint8_t certType, const ToolChipDN * subjectDN, X509 * caCert, EVP_PKEY * caKey, const struct tm & validFrom, - uint32_t validDays, int pathLen, const FutureExtension * futureExts, uint8_t futureExtsCount, X509 * newCert, - EVP_PKEY * newKey, CertStructConfig & certConfig); + uint32_t validDays, int pathLen, const FutureExtensionWithNID * futureExts, uint8_t futureExtsCount, + X509 * newCert, EVP_PKEY * newKey, CertStructConfig & certConfig); extern CHIP_ERROR MakeCertChipTLV(uint8_t certType, const ToolChipDN * subjectDN, X509 * caCert, EVP_PKEY * caKey, - const struct tm & validFrom, uint32_t validDays, int pathLen, const FutureExtension * futureExts, - uint8_t futureExtsCount, X509 * x509Cert, EVP_PKEY * newKey, CertStructConfig & certConfig, - chip::MutableByteSpan & chipCert); + const struct tm & validFrom, uint32_t validDays, int pathLen, + const FutureExtensionWithNID * futureExts, uint8_t futureExtsCount, X509 * x509Cert, + EVP_PKEY * newKey, CertStructConfig & certConfig, chip::MutableByteSpan & chipCert); extern bool ResignCert(X509 * cert, X509 * caCert, EVP_PKEY * caKey); extern bool MakeAttCert(AttCertType attCertType, const char * subjectCN, uint16_t subjectVID, uint16_t subjectPID, From 4ab1882b52a66a99b66126034581ae716e3e668f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 23 Aug 2022 10:24:52 -0400 Subject: [PATCH 07/32] Add libnl-dev to chip-build Dockerfile (#22047) --- integrations/docker/images/chip-build/Dockerfile | 4 +++- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/chip-build/Dockerfile b/integrations/docker/images/chip-build/Dockerfile index bfcfea5e40e755..861f5ecb2df4e7 100644 --- a/integrations/docker/images/chip-build/Dockerfile +++ b/integrations/docker/images/chip-build/Dockerfile @@ -28,14 +28,16 @@ RUN set -x \ libcairo2-dev \ libdbus-1-dev \ libdbus-glib-1-dev \ + libdmalloc-dev \ libgif-dev \ libglib2.0-dev \ libical-dev \ libjpeg-dev \ - libdmalloc-dev \ libmbedtls-dev \ libncurses5-dev \ libncursesw5-dev \ + libnl-3-dev \ + libnl-route-3-dev \ libnspr4-dev \ libpango1.0-dev \ libpixman-1-dev \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 1cb8eca1c7f032..b22b98316c9f22 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.95 Version bump reason: Fix nrfconnect Docker build +0.5.96 Version bump reason: add libnl-dev libs to chip-build image From 0f9615d56605ab97e32c53d5cafd8a537666318b Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Tue, 23 Aug 2022 10:22:32 -0500 Subject: [PATCH 08/32] Update KVS to handle zero length elements (#21977) * allow for nullptr in KVS write * complete audit with chip_support_enable_storage_api_audit=true --- .../cc13x2_26x2/CC13X2_26X2Config.cpp | 83 +++++++++++-------- .../cc13x2_26x2/KeyValueStoreManagerImpl.cpp | 7 +- .../cc32xx/KeyValueStoreManagerImpl.cpp | 7 +- 3 files changed, 57 insertions(+), 40 deletions(-) diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index 09e3393e07b1b1..8d25d6673f5ea1 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -165,7 +166,7 @@ CHIP_ERROR CC13X2_26X2Config::ReadConfigValueBin(Key key, uint8_t * buf, size_t /* Iterate through the key range to find a key that matches. */ static uint8_t FindKVSSubID(const char * key, uint16_t & subID) { - char key_scratch[32]; // 32 characters seems large enough for a key + char key_scratch[PersistentStorageDelegate::kKeyLengthMax + 1]; NVINTF_nvProxy_t nvProxy = { 0 }; uint8_t status = NVINTF_SUCCESS; @@ -209,20 +210,23 @@ CHIP_ERROR CC13X2_26X2Config::ReadKVS(const char * key, void * value, size_t val val_item.subID = subID; len = sNvoctpFps.getItemLen(val_item); - VerifyOrExit(len > 0, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND); // key not found - if ((offset_bytes + value_size) > len) + if (value_size >= (len - offset_bytes)) { - // trying to read up to the end of the element + // reading to end of element read_len = len - offset_bytes; } else { read_len = value_size; + err = CHIP_ERROR_BUFFER_TOO_SMALL; } - VerifyOrExit(sNvoctpFps.readItem(val_item, (uint16_t) offset_bytes, read_len, value) == NVINTF_SUCCESS, - err = CHIP_ERROR_PERSISTED_STORAGE_FAILED); + if (read_len > 0) + { + VerifyOrExit(sNvoctpFps.readItem(val_item, (uint16_t) offset_bytes, read_len, value) == NVINTF_SUCCESS, + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED); + } if (read_bytes_size) { @@ -264,22 +268,14 @@ CHIP_ERROR CC13X2_26X2Config::WriteKVS(const char * key, const void * value, siz CHIP_ERROR err = CHIP_NO_ERROR; uint16_t subID; - if (FindKVSSubID(key, subID) == NVINTF_SUCCESS) - { - NVINTF_itemID_t val_item = CC13X2_26X2Config::kConfigKey_KVS_value.nvID; - // key already exists, update value - val_item.subID = subID; - VerifyOrExit(sNvoctpFps.updateItem(val_item, (uint16_t) value_size, (void *) value) == NVINTF_SUCCESS, - err = CHIP_ERROR_PERSISTED_STORAGE_FAILED); - } - else + NVINTF_itemID_t key_item = CC13X2_26X2Config::kConfigKey_KVS_key.nvID; + NVINTF_itemID_t val_item = CC13X2_26X2Config::kConfigKey_KVS_value.nvID; + + if (FindKVSSubID(key, subID) != NVINTF_SUCCESS) { - // key does not exist, likely case + // key item not found, find an empty subID intptr_t lock_key = sNvoctpFps.lockNV(); - NVINTF_itemID_t key_item = CC13X2_26X2Config::kConfigKey_KVS_key.nvID; - NVINTF_itemID_t val_item = CC13X2_26X2Config::kConfigKey_KVS_value.nvID; - /* Iterate through the subID range to find an unused subID in the * keyspace. SubID is a 10 bit value, reference * `/source/ti/common/nv/nvocmp.c:MVOCMP_MAXSUBID`. @@ -289,26 +285,39 @@ CHIP_ERROR CC13X2_26X2Config::WriteKVS(const char * key, const void * value, siz key_item.subID = i; if (sNvoctpFps.getItemLen(key_item) == 0U) { - val_item.subID = i; + subID = i; break; } } + sNvoctpFps.unlockNV(lock_key); + // write they key item - if (sNvoctpFps.writeItem(key_item, (uint16_t) strlen(key), (void *) key) == NVINTF_SUCCESS) + VerifyOrExit(sNvoctpFps.writeItem(key_item, (uint16_t) strlen(key), (void *) key) == NVINTF_SUCCESS, + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED); + } + + key_item.subID = subID; + val_item.subID = subID; + + if (value_size == 0U) + { + // delete the value item if it exists + int8_t ret = sNvoctpFps.deleteItem(val_item); + if (ret != NVINTF_SUCCESS && ret != NVINTF_NOTFOUND) { - if (sNvoctpFps.writeItem(val_item, (uint16_t) value_size, (void *) value) != NVINTF_SUCCESS) - { - // try to delete the key item - sNvoctpFps.deleteItem(key_item); - err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; - } + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - else + } + else + { + if (sNvoctpFps.writeItem(val_item, (uint16_t) value_size, (void *) value) != NVINTF_SUCCESS) { + // try to delete the key item + sNvoctpFps.deleteItem(key_item); err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - sNvoctpFps.unlockNV(lock_key); } + exit: return err; } @@ -325,25 +334,31 @@ CHIP_ERROR CC13X2_26X2Config::WriteConfigValueBin(Key key, const uint8_t * data, CHIP_ERROR CC13X2_26X2Config::ClearKVS(const char * key) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; uint16_t subID; NVINTF_itemID_t key_item = CC13X2_26X2Config::kConfigKey_KVS_key.nvID; NVINTF_itemID_t val_item = CC13X2_26X2Config::kConfigKey_KVS_value.nvID; if (FindKVSSubID(key, subID) == NVINTF_SUCCESS) { + int8_t ret; + key_item.subID = subID; val_item.subID = subID; - // delete the value item - if (sNvoctpFps.deleteItem(val_item) != NVINTF_SUCCESS) + // delete the value item if it exists + ret = sNvoctpFps.deleteItem(val_item); + if (ret != NVINTF_SUCCESS && ret != NVINTF_NOTFOUND) { err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } - // delete the key item - if (sNvoctpFps.deleteItem(key_item) != NVINTF_SUCCESS) + // delete the key item if it exists + ret = sNvoctpFps.deleteItem(key_item); + if (ret != NVINTF_SUCCESS && ret != NVINTF_NOTFOUND) { err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; } + + err = CHIP_NO_ERROR; } return err; diff --git a/src/platform/cc13x2_26x2/KeyValueStoreManagerImpl.cpp b/src/platform/cc13x2_26x2/KeyValueStoreManagerImpl.cpp index b74146c1de3704..5227b55e5e65df 100644 --- a/src/platform/cc13x2_26x2/KeyValueStoreManagerImpl.cpp +++ b/src/platform/cc13x2_26x2/KeyValueStoreManagerImpl.cpp @@ -44,7 +44,10 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t CHIP_ERROR err; VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); + if (0U != value_size) + { + VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); + } err = CC13X2_26X2Config::ReadKVS(key, value, value_size, read_bytes_size, offset_bytes); @@ -58,8 +61,6 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value_size > 0, CHIP_ERROR_INVALID_ARGUMENT); return CC13X2_26X2Config::WriteKVS(key, value, value_size); } diff --git a/src/platform/cc32xx/KeyValueStoreManagerImpl.cpp b/src/platform/cc32xx/KeyValueStoreManagerImpl.cpp index 13c1a023443594..ea0f2e546ce6c4 100644 --- a/src/platform/cc32xx/KeyValueStoreManagerImpl.cpp +++ b/src/platform/cc32xx/KeyValueStoreManagerImpl.cpp @@ -42,7 +42,10 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t size_t offset_bytes) const { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); + if (0U != value_size) + { + VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); + } return CC32XXConfig::ReadKVS(key, value, value_size, read_bytes_size, offset_bytes); } @@ -50,8 +53,6 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(value_size > 0, CHIP_ERROR_INVALID_ARGUMENT); return CC32XXConfig::WriteKVS(key, value, value_size); } From 8702d3ab976f06815e3f4d69d2f2a6bdda1852e4 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 23 Aug 2022 23:40:33 +0800 Subject: [PATCH 09/32] Support lighting-app on ESP32H2-beta2 with idf tag v5.0-beta1 (#22064) --- config/esp32/components/chip/CMakeLists.txt | 12 ++++++--- docs/guides/esp32/setup_idf_chip.md | 6 ++--- examples/lighting-app/esp32/main/Button.cpp | 18 +++++++++++++ .../lighting-app/esp32/main/CMakeLists.txt | 2 +- .../lighting-app/esp32/main/LEDWidget.cpp | 18 +++++++++++-- .../esp32/main/include/LEDWidget.h | 4 +++ .../esp32/sdkconfig.defaults.esp32h2 | 24 ++++++++---------- .../esp32/common/CommonDeviceCallbacks.cpp | 25 +++++++++++++++---- src/lib/shell/streamer_esp32.cpp | 6 ++++- src/platform/ESP32/ESP32Config.cpp | 6 +++++ src/platform/ESP32/OpenthreadLauncher.c | 2 +- src/platform/ESP32/nimble/BLEManagerImpl.cpp | 7 ++++-- 12 files changed, 98 insertions(+), 32 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 63dff3ee1f5589..74b79dffc93466 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -31,7 +31,11 @@ endif() include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake) -set(CHIP_REQURIE_COMPONENTS freertos lwip bt mdns mbedtls fatfs app_update console openthread) +set(CHIP_REQURIE_COMPONENTS freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash) + +if(NOT "${IDF_TARGET}" STREQUAL "esp32h2") + list(APPEND CHIP_REQURIE_COMPONENTS mdns) +endif() if (NOT CMAKE_BUILD_EARLY_EXPANSION) if (CONFIG_COMPILER_OPTIMIZATION_DEFAULT OR CONFIG_COMPILER_OPTIMIZATION_NONE) @@ -270,7 +274,9 @@ if(CONFIG_BT_ENABLED) idf_component_get_property(bt_lib bt COMPONENT_LIB) idf_component_get_property(bt_dir bt COMPONENT_DIR) list(APPEND chip_libraries $) - list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/libcontroller_5p0_seq.a) + if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2) + list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a) + endif() else() idf_component_get_property(bt_lib bt COMPONENT_LIB) list(APPEND chip_libraries $ -lbtdm_app) @@ -287,7 +293,7 @@ if(CONFIG_OPENTHREAD_ENABLED) list(APPEND chip_libraries $) endif() -if(NOT CONFIG_USE_MINIMAL_MDNS) +if(NOT CONFIG_USE_MINIMAL_MDNS AND NOT CONFIG_IDF_TARGET_ESP32H2) idf_component_get_property(mdns_lib mdns COMPONENT_LIB) list(APPEND chip_libraries $) endif() diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/guides/esp32/setup_idf_chip.md index acc001e67a6874..f6c7f649834fd7 100644 --- a/docs/guides/esp32/setup_idf_chip.md +++ b/docs/guides/esp32/setup_idf_chip.md @@ -39,13 +39,13 @@ step. $ ./install.sh ``` -- For ESP32H2, please checkout commit id - [10f3aba770](https://github.com/espressif/esp-idf/tree/10f3aba770), +- For ESP32H2, please checkout tag + [v5.0-beta1](https://github.com/espressif/esp-idf/tree/v5.0-beta1), currently only lighting-app is supported on H2 ``` $ cd esp-idf - $ git checkout 10f3aba770 + $ git checkout v5.0-beta1 $ git submodule update --init $ ./install.sh ``` diff --git a/examples/lighting-app/esp32/main/Button.cpp b/examples/lighting-app/esp32/main/Button.cpp index 73a3758818070f..aadae002bc2d08 100644 --- a/examples/lighting-app/esp32/main/Button.cpp +++ b/examples/lighting-app/esp32/main/Button.cpp @@ -1,4 +1,22 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include "Button.h" +#include "esp_attr.h" #define GPIO_INPUT_IO_0 9 #define GPIO_INPUT_PIN_SEL (1ULL << GPIO_INPUT_IO_0) diff --git a/examples/lighting-app/esp32/main/CMakeLists.txt b/examples/lighting-app/esp32/main/CMakeLists.txt index 097f5ba8c41357..233b25d29ada1f 100644 --- a/examples/lighting-app/esp32/main/CMakeLists.txt +++ b/examples/lighting-app/esp32/main/CMakeLists.txt @@ -65,7 +65,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" - PRIV_REQUIRES chip QRCode bt led_strip app_update openthread) + PRIV_REQUIRES chip QRCode bt led_strip app_update openthread driver nvs_flash) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/lighting-app/esp32/main/LEDWidget.cpp b/examples/lighting-app/esp32/main/LEDWidget.cpp index 12cbf0f6d3295a..bf2221b26446c9 100644 --- a/examples/lighting-app/esp32/main/LEDWidget.cpp +++ b/examples/lighting-app/esp32/main/LEDWidget.cpp @@ -17,6 +17,7 @@ #include "LEDWidget.h" #include "ColorFormat.h" +#include "led_strip.h" static const char * TAG = "LEDWidget"; @@ -26,6 +27,14 @@ void LEDWidget::Init(void) mBrightness = UINT8_MAX; #if CONFIG_LED_TYPE_RMT +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + led_strip_config_t strip_config = { + .strip_gpio_num = CONFIG_LED_GPIO, + .max_leds = 1, + }; + + led_strip_new_rmt_device(&strip_config, &mStrip); +#else rmt_config_t config = RMT_DEFAULT_CONFIG_TX((gpio_num_t) CONFIG_LED_GPIO, (rmt_channel_t) CONFIG_LED_RMT_CHANNEL); led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t) config.channel); @@ -33,7 +42,8 @@ void LEDWidget::Init(void) rmt_config(&config); rmt_driver_install(config.channel, 0, 0); - mStrip = led_strip_new_rmt_ws2812(&strip_config); + mStrip = led_strip_new_rmt_ws2812(&strip_config); +#endif mHue = 0; mSaturation = 0; #else @@ -121,9 +131,13 @@ void LEDWidget::DoSet(void) { HsvColor_t hsv = { mHue, mSaturation, brightness }; RgbColor_t rgb = HsvToRgb(hsv); - +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + led_strip_set_pixel(mStrip, 0, rgb.r, rgb.g, rgb.b); + led_strip_refresh(mStrip); +#else mStrip->set_pixel(mStrip, 0, rgb.r, rgb.g, rgb.b); mStrip->refresh(mStrip, 100); +#endif } #else ESP_LOGI(TAG, "DoSet to GPIO number %d", mGPIONum); diff --git a/examples/lighting-app/esp32/main/include/LEDWidget.h b/examples/lighting-app/esp32/main/include/LEDWidget.h index c390d63ac1024f..f9d00a2b6882a9 100644 --- a/examples/lighting-app/esp32/main/include/LEDWidget.h +++ b/examples/lighting-app/esp32/main/include/LEDWidget.h @@ -50,7 +50,11 @@ class LEDWidget #if CONFIG_LED_TYPE_RMT uint8_t mHue; uint8_t mSaturation; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + led_strip_handle_t mStrip; +#else led_strip_t * mStrip; +#endif #else gpio_num_t mGPIONum; #endif diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 index 3a6d8da8ff4033..dc637d31dc7a2e 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 @@ -1,4 +1,5 @@ CONFIG_IDF_TARGET="esp32h2" +CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2=y # Default to 921600 baud when flashing and monitoring device CONFIG_ESPTOOLPY_BAUD_921600B=y @@ -16,14 +17,9 @@ CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y # NIMBLE CONFIG_BT_ENABLED=y -CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT=y CONFIG_BT_NIMBLE_EXT_ADV=n -CONFIG_BT_NIMBLE_USE_ESP_TIMER=n -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 CONFIG_DEINIT_BLE_ON_COMMISSIONING_COMPLETE=n # Enable OpenThread @@ -45,22 +41,19 @@ CONFIG_LWIP_MULTICAST_PING=y CONFIG_MBEDTLS_HARDWARE_AES=n CONFIG_MBEDTLS_HARDWARE_MPI=n CONFIG_MBEDTLS_HARDWARE_SHA=n +CONFIG_MBEDTLS_HARDWARE_ECC=y CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN=n CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY=n CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_SSL_PROTO_DTLS=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y +# rtc clk for ble +# CONFIG_ESP32H2_RTC_CLK_SRC_EXT_CRYS=y + # MDNS platform CONFIG_USE_MINIMAL_MDNS=n - -# Increase stacks size -CONFIG_NIMBLE_CONTROLLER_TASK_STACK_SIZE=5120 -CONFIG_NIMBLE_HOST_TASK_STACK_SIZE=5120 - -# ESP32H2 BLE using a ext 32k crystal -CONFIG_ESP32H2_RTC_CLK_SRC_EXT_CRYS=y -CONFIG_ESP32H2_RTC_CLK_CAL_CYCLES=576 +CONFIG_ENABLE_EXTENDED_DISCOVERY=y # FreeRTOS should use legacy API CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y @@ -71,3 +64,6 @@ CONFIG_ENABLE_WIFI_AP=n # Enable OTA Requestor CONFIG_ENABLE_OTA_REQUESTOR=y + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y diff --git a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp index e975dce62914f2..ba9eafc19c1397 100644 --- a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp @@ -20,7 +20,9 @@ #if CONFIG_BT_ENABLED #include "esp_bt.h" #if CONFIG_BT_NIMBLE_ENABLED +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include "esp_nimble_hci.h" +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include "nimble/nimble_port.h" #endif // CONFIG_BT_NIMBLE_ENABLED #endif // CONFIG_BT_ENABLED @@ -45,6 +47,9 @@ using namespace chip::DeviceLayer; using namespace chip::System; DeviceCallbacksDelegate * appDelegate = nullptr; +#if CONFIG_ENABLE_OTA_REQUESTOR +static bool isOTAInitialized = false; +#endif void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) { @@ -62,17 +67,30 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i ESP_LOGI(TAG, "CHIPoBLE disconnected"); break; + case DeviceEventType::kThreadConnectivityChange: +#if CONFIG_ENABLE_OTA_REQUESTOR + if (event->ThreadConnectivityChange.Result == kConnectivity_Established && !isOTAInitialized) + { + OTAHelpers::Instance().InitOTARequestor(); + isOTAInitialized = true; + } +#endif + break; + case DeviceEventType::kCommissioningComplete: { ESP_LOGI(TAG, "Commissioning complete"); #if CONFIG_BT_NIMBLE_ENABLED && CONFIG_DEINIT_BLE_ON_COMMISSIONING_COMPLETE if (ble_hs_is_enabled()) { - int ret = nimble_port_stop(); + int ret = nimble_port_stop(); + esp_err_t err = ESP_OK; if (ret == 0) { nimble_port_deinit(); - esp_err_t err = esp_nimble_hci_and_controller_deinit(); +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) + err = esp_nimble_hci_and_controller_deinit(); +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) err += esp_bt_mem_release(ESP_BT_MODE_BLE); if (err == ESP_OK) { @@ -114,9 +132,6 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i void CommonDeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) { -#if CONFIG_ENABLE_OTA_REQUESTOR - static bool isOTAInitialized = false; -#endif appDelegate = DeviceCallbacksDelegate::Instance().GetAppDelegate(); if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) { diff --git a/src/lib/shell/streamer_esp32.cpp b/src/lib/shell/streamer_esp32.cpp index c35abed55c5eb0..7d51afd7399cbe 100644 --- a/src/lib/shell/streamer_esp32.cpp +++ b/src/lib/shell/streamer_esp32.cpp @@ -62,7 +62,11 @@ int streamer_esp32_init(streamer_t * streamer) .stop_bits = UART_STOP_BITS_1, .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, .rx_flow_ctrl_thresh = 0, - .source_clk = UART_SCLK_APB, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + .source_clk = UART_SCLK_DEFAULT, +#else + .source_clk = UART_SCLK_APB, +#endif }; ESP_ERROR_CHECK(uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config)); esp_vfs_dev_uart_use_driver(0); diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 537ec90375c754..dc65ab772d696d 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -353,8 +353,14 @@ CHIP_ERROR ESP32Config::ClearConfigValue(Key key) bool ESP32Config::ConfigValueExists(Key key) { +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + nvs_iterator_t iterator = NULL; + esp_err_t err = nvs_entry_find(NVS_DEFAULT_PART_NAME, key.Namespace, NVS_TYPE_ANY, &iterator); + for (; iterator && err == ESP_OK; err = nvs_entry_next(&iterator)) +#else nvs_iterator_t iterator = nvs_entry_find(NVS_DEFAULT_PART_NAME, key.Namespace, NVS_TYPE_ANY); for (; iterator; iterator = nvs_entry_next(iterator)) +#endif { nvs_entry_info_t info; nvs_entry_info(iterator, &info); diff --git a/src/platform/ESP32/OpenthreadLauncher.c b/src/platform/ESP32/OpenthreadLauncher.c index c9ef95fb5cb4de..c1ad467e032174 100644 --- a/src/platform/ESP32/OpenthreadLauncher.c +++ b/src/platform/ESP32/OpenthreadLauncher.c @@ -53,7 +53,7 @@ static void ot_task_worker(void * context) // Initialize the OpenThread stack ESP_ERROR_CHECK(esp_openthread_init(&config)); // The OpenThread log level directly matches ESP log level - (void) otLoggingSetLevel(OT_LOG_LEVEL_INFO); + (void) otLoggingSetLevel(CONFIG_LOG_DEFAULT_LEVEL); // Initialize the esp_netif bindings openthread_netif = init_openthread_netif(&config); diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 2cf626c1751c50..b4459196fd9baa 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -40,7 +40,9 @@ #include #include "esp_log.h" +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include "esp_nimble_hci.h" +#endif #include "host/ble_hs.h" #include "host/ble_hs_pvcy.h" #include "host/ble_uuid.h" @@ -152,7 +154,7 @@ CHIP_ERROR BLEManagerImpl::_Init() mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); mFlags.Set(Flags::kFastAdvertisingEnabled, true); mNumGAPCons = 0; - memset(mCons, 0, sizeof(mCons)); + memset(reinterpret_cast(mCons), 0, sizeof(mCons)); mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; memset(mDeviceName, 0, sizeof(mDeviceName)); @@ -613,9 +615,10 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void) { mSubscribedConIds[i] = BLE_CONNECTION_UNINITIALIZED; } - +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) err = MapBLEError(esp_nimble_hci_and_controller_init()); SuccessOrExit(err); +#endif nimble_port_init(); From 27ca0452dd86d6b777e24ad90b9939e79ce2e9e8 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:08:00 +0800 Subject: [PATCH 10/32] [KVS] Check NULL pointer for getPref_bin_new (#21854) * [KVS] Add NULL pointer check for getPref_bin_new Invalid read_bytes_size pointer could cause hard fault on getPref_bin_new function. * [KVS] Pass in dummy_read_bytes when read_bytes is nullptr * [Restyle] Fix styling * [KVS] Add nullptr check after pvPortMalloc * [Restyle] Fix style Co-authored-by: Andrei Litvin --- src/platform/Ameba/KeyValueStoreManagerImpl.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/platform/Ameba/KeyValueStoreManagerImpl.cpp b/src/platform/Ameba/KeyValueStoreManagerImpl.cpp index 74e8a2882f6cb7..93ec38b8611b58 100644 --- a/src/platform/Ameba/KeyValueStoreManagerImpl.cpp +++ b/src/platform/Ameba/KeyValueStoreManagerImpl.cpp @@ -49,7 +49,20 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t return (err = CHIP_ERROR_NOT_IMPLEMENTED); } - ret = getPref_bin_new(key, key, (uint8_t *) value, value_size, read_bytes_size); + if (read_bytes_size) + { + ret = getPref_bin_new(key, key, (uint8_t *) value, value_size, read_bytes_size); + } + else + { + size_t * dummy_read_bytes_size = (size_t *) pvPortMalloc(sizeof(size_t)); + if (!dummy_read_bytes_size) + { + return CHIP_ERROR_INTERNAL; + } + ret = getPref_bin_new(key, key, (uint8_t *) value, value_size, dummy_read_bytes_size); + vPortFree(dummy_read_bytes_size); + } switch (ret) { case 0: From 1a1d887dfe015a4f85a98846d7a5eddcc1fa4b15 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:13:00 -0700 Subject: [PATCH 11/32] Fixing typo in mapping mediaPlayback_stopPlayback correctly in CastingServerBridge.mm (#22087) --- .../MatterTvCastingBridge/CastingServerBridge.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index e854db7092e9eb..2eccbf8242a0a9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -309,7 +309,7 @@ - (void)mediaPlayback_stopPlayback:(void (^_Nonnull)(bool))responseCallback _mediaPlayback_pauseResponseCallback = responseCallback; dispatch_async(_chipWorkQueue, ^{ - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Pause([](CHIP_ERROR err) { + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_StopPlayback([](CHIP_ERROR err) { [CastingServerBridge getSharedInstance].mediaPlayback_stopPlaybackResponseCallback(CHIP_NO_ERROR == err); }); dispatch_async(clientQueue, ^{ From c3fcbc1781c4c9e1e1dc8cf986b20837285c0edb Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 23 Aug 2022 13:33:40 -0400 Subject: [PATCH 12/32] Make StartUpColorTemperatureMireds nullable, per spec. (#21858) Fixes https://github.com/project-chip/connectedhomeip/issues/21855 --- .../all-clusters-app.matter | 2 +- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 2 +- .../light-switch-app.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 2 +- .../placeholder/linux/apps/app2/config.matter | 2 +- .../color-control-server.cpp | 16 ++--- .../zcl/data-model/silabs/ha.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../CHIPAttributeTLVValueDecoder.cpp | 15 +++-- .../zap-generated/CHIPClustersWrite-JNI.cpp | 12 +++- .../java/zap-generated/CHIPReadCallbacks.cpp | 67 +++++++++++++++++++ .../java/zap-generated/CHIPReadCallbacks.h | 30 +++++++++ .../chip/devicecontroller/ChipClusters.java | 20 ++++-- .../devicecontroller/ClusterReadMapping.java | 4 +- .../python/chip/clusters/Objects.py | 8 +-- .../MTRAttributeTLVValueDecoder.mm | 8 ++- .../CHIP/zap-generated/MTRBaseClusters.h | 4 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 27 +++++--- .../zap-generated/endpoint_config.h | 3 +- .../zap-generated/attributes/Accessors.cpp | 32 +++++++-- .../zap-generated/attributes/Accessors.h | 4 +- .../zap-generated/cluster-objects.h | 8 +-- .../zap-generated/endpoint_config.h | 3 +- .../zap-generated/cluster/Commands.h | 5 +- .../cluster/logging/DataModelLogger.cpp | 2 +- .../chip-tool/zap-generated/test/Commands.h | 2 +- .../zap-generated/cluster/Commands.h | 2 +- .../zap-generated/test/Commands.h | 10 ++- .../zap-generated/endpoint_config.h | 3 +- .../app1/zap-generated/endpoint_config.h | 3 +- .../app2/zap-generated/endpoint_config.h | 3 +- 32 files changed, 238 insertions(+), 69 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 18d7c48c099ad3..96c706ad0ed1fe 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2851,7 +2851,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMinMireds = 16395; readonly attribute int16u colorTempPhysicalMaxMireds = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index e9d7612115a077..7fa6bae61d59dc 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1614,7 +1614,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMinMireds = 16395; readonly attribute int16u colorTempPhysicalMaxMireds = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 0a6d27521c8a74..27a458acdc6195 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1565,7 +1565,7 @@ client cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMinMireds = 16395; readonly attribute int16u colorTempPhysicalMaxMireds = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute int16u clusterRevision = 65533; request struct MoveToHueRequest { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index d538c8232f7bb0..43839293478d6d 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1511,7 +1511,7 @@ server cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMinMireds = 16395; readonly attribute int16u colorTempPhysicalMaxMireds = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 48822ed58e83bf..eb235f5eaa24fa 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1916,7 +1916,7 @@ server cluster ColorControl = 768 { readonly attribute int16u currentY = 4; attribute bitmap8 options = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 48822ed58e83bf..eb235f5eaa24fa 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1916,7 +1916,7 @@ server cluster ColorControl = 768 { readonly attribute int16u currentY = 4; attribute bitmap8 options = 15; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index ec61efd6ac2867..e523921bdaf9b3 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -2071,13 +2071,13 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // the StartUpColorTemperatureMireds attribute are listed in the table below. // Value Action on power up // 0x0000-0xffef Set the ColorTemperatureMireds attribute to this value. - // 0xffff Set the ColorTemperatureMireds attribute to its previous value. + // null Set the ColorTemperatureMireds attribute to its previous value. - // Initialize startUpColorTempMireds to "maintain previous value" value 0xFFFF - uint16_t startUpColorTemp = 0xFFFF; - EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, &startUpColorTemp); + // Initialize startUpColorTempMireds to "maintain previous value" value null + app::DataModel::Nullable startUpColorTemp; + EmberAfStatus status = Attributes::StartUpColorTemperatureMireds::Get(endpoint, startUpColorTemp); - if (status == EMBER_ZCL_STATUS_SUCCESS) + if (status == EMBER_ZCL_STATUS_SUCCESS && !startUpColorTemp.IsNull()) { uint16_t updatedColorTemp = MAX_TEMPERATURE_VALUE; status = Attributes::ColorTemperature::Get(endpoint, &updatedColorTemp); @@ -2090,13 +2090,13 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; Attributes::ColorTempPhysicalMaxMireds::Get(endpoint, &tempPhysicalMax); - if (tempPhysicalMin <= startUpColorTemp && startUpColorTemp <= tempPhysicalMax) + if (tempPhysicalMin <= startUpColorTemp.Value() && startUpColorTemp.Value() <= tempPhysicalMax) { // Apply valid startup color temp value that is within physical limits of device. // Otherwise, the startup value is outside the device's supported range, and the // existing setting of ColorTemp attribute will be left unchanged (i.e., treated as - // if startup color temp was set to 0xFFFF). - updatedColorTemp = startUpColorTemp; + // if startup color temp was set to null). + updatedColorTemp = startUpColorTemp.Value(); status = Attributes::ColorTemperature::Set(endpoint, updatedColorTemp); if (status == EMBER_ZCL_STATUS_SUCCESS) diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index f9ea448209d444..b40807c1b39211 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -243,7 +243,7 @@ limitations under the License. CoupleColorTempToLevelMinMireds - + StartUpColorTemperatureMireds diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index f8a88c7b66bb5f..2d71e362638858 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3178,7 +3178,7 @@ client cluster ColorControl = 768 { readonly attribute int16u colorTempPhysicalMinMireds = 16395; readonly attribute int16u colorTempPhysicalMaxMireds = 16396; readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; - attribute access(write: manage) int16u startUpColorTemperatureMireds = 16400; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index fe0eb5ce4cd193..d20ce4a2f36cf0 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12925,10 +12925,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } case Attributes::GeneratedCommandList::Id: { diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 4612f4b7b96bae..e453c781ffd1f4 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -4488,8 +4488,16 @@ JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribut std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 2dab6e13780b9d..d6c410be3f605e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -18957,6 +18957,73 @@ void CHIPColorControlColorPointBIntensityAttributeCallback::CallbackFn(void * co env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback::CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback::~CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPColorControlGeneratedCommandListAttributeCallback::CHIPColorControlGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index f5dc7866c0e0c9..d1a4b63b04c84e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -7912,6 +7912,36 @@ class CHIPColorControlColorPointBIntensityAttributeCallback bool keepAlive; }; +class CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback(); + + static void maybeDestroy(CHIPColorControlStartUpColorTemperatureMiredsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPColorControlGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 73c28214ab6173..bd9914f596dbab 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16188,6 +16188,14 @@ public interface ColorPointBIntensityAttributeCallback { default void onSubscriptionEstablished() {} } + public interface StartUpColorTemperatureMiredsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -16784,7 +16792,8 @@ public void subscribeCoupleColorTempToLevelMinMiredsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void readStartUpColorTemperatureMiredsAttribute(IntegerAttributeCallback callback) { + public void readStartUpColorTemperatureMiredsAttribute( + StartUpColorTemperatureMiredsAttributeCallback callback) { readStartUpColorTemperatureMiredsAttribute(chipClusterPtr, callback); } @@ -16800,7 +16809,7 @@ public void writeStartUpColorTemperatureMiredsAttribute( } public void subscribeStartUpColorTemperatureMiredsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + StartUpColorTemperatureMiredsAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpColorTemperatureMiredsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } @@ -17262,7 +17271,7 @@ private native void subscribeCoupleColorTempToLevelMinMiredsAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartUpColorTemperatureMiredsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, StartUpColorTemperatureMiredsAttributeCallback callback); private native void writeStartUpColorTemperatureMiredsAttribute( long chipClusterPtr, @@ -17271,7 +17280,10 @@ private native void writeStartUpColorTemperatureMiredsAttribute( @Nullable Integer timedWriteTimeoutMs); private native void subscribeStartUpColorTemperatureMiredsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + StartUpColorTemperatureMiredsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index bb881021b50feb..a059be7651a3a9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -8715,7 +8715,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) .readStartUpColorTemperatureMiredsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.ColorControlCluster + .StartUpColorTemperatureMiredsAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readColorControlStartUpColorTemperatureMiredsCommandParams); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index d8032d8f508063..94dbba01c44523 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18134,7 +18134,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="colorTempPhysicalMinMireds", Tag=0x0000400B, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="colorTempPhysicalMaxMireds", Tag=0x0000400C, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="coupleColorTempToLevelMinMireds", Tag=0x0000400D, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="startUpColorTemperatureMireds", Tag=0x00004010, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="startUpColorTemperatureMireds", Tag=0x00004010, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -18193,7 +18193,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: colorTempPhysicalMinMireds: 'typing.Optional[uint]' = None colorTempPhysicalMaxMireds: 'typing.Optional[uint]' = None coupleColorTempToLevelMinMireds: 'typing.Optional[uint]' = None - startUpColorTemperatureMireds: 'typing.Optional[uint]' = None + startUpColorTemperatureMireds: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -19501,9 +19501,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 671a368001c51d..4e215d6702d9b5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11155,8 +11155,12 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::GeneratedCommandList::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 201b0844d66305..90980c2f1a0f2c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13792,9 +13792,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler; /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 1d1c90e8e4359c..7bc25323f1a8d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -57847,24 +57847,24 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su - (void)readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt16uAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, + new MTRNullableInt16uAttributeCallbackBridge(self.callbackQueue, self.device, completionHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { - [self writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnull) value + [self writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullable) value params:nil completionHandler:completionHandler]; } -- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completionHandler:(StatusCompletion)completionHandler { @@ -57888,7 +57888,12 @@ new MTRDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); @@ -57910,7 +57915,7 @@ - (void)subscribeAttributeStartUpColorTemperatureMiredsWithMinInterval:(NSNumber minInterval = [minInterval copy]; maxInterval = [maxInterval copy]; params = [params copy]; - new MTRInt16uAttributeCallbackSubscriptionBridge( + new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, self.device, reportHandler, ^(ExchangeManager & exchangeManager, const SessionHandle & session, Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -57918,13 +57923,13 @@ new MTRInt16uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + MTRNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -57937,7 +57942,7 @@ + (void)readAttributeStartUpColorTemperatureMiredsWithAttributeCache:(MTRAttribu completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new MTRNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; @@ -57946,7 +57951,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 64446dd4aec170..6a2279cb2179ca 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1153,7 +1153,8 @@ { 0x0000400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ColorTempPhysicalMinMireds */ \ { 0x0000400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* ColorTempPhysicalMaxMireds */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* CoupleColorTempToLevelMinMireds */ \ - { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x00004010, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(37) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1F) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ 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 d1b8ec87b5220a..60f4de6eae617f 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 @@ -19517,24 +19517,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace StartUpColorTemperatureMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -19544,6 +19547,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace StartUpColorTemperatureMireds namespace FeatureMap { 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 d26576e7723a10..73deb29ea144ab 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 @@ -3270,8 +3270,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CoupleColorTempToLevelMinMireds namespace StartUpColorTemperatureMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace StartUpColorTemperatureMireds namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 5500c0d3c8ce28..924bfe735eef96 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -19205,9 +19205,9 @@ struct TypeInfo namespace StartUpColorTemperatureMireds { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpColorTemperatureMireds::Id; } @@ -19305,7 +19305,7 @@ struct TypeInfo Attributes::ColorTempPhysicalMaxMireds::TypeInfo::DecodableType colorTempPhysicalMaxMireds = static_cast(0); Attributes::CoupleColorTempToLevelMinMireds::TypeInfo::DecodableType coupleColorTempToLevelMinMireds = static_cast(0); - Attributes::StartUpColorTemperatureMireds::TypeInfo::DecodableType startUpColorTemperatureMireds = static_cast(0); + Attributes::StartUpColorTemperatureMireds::TypeInfo::DecodableType startUpColorTemperatureMireds; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h index 58cae4639d8ccf..e7f99834ec16d9 100644 --- a/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h @@ -505,7 +505,8 @@ { 0x0000400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ColorTempPhysicalMinMireds */ \ { 0x0000400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* ColorTempPhysicalMaxMireds */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CoupleColorTempToLevelMinMireds */ \ - { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x00004010, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1f) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 897d45dff7d486..a812e26aec450c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -11499,8 +11499,9 @@ void registerClusterColorControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig), // make_unique>>( Id, "color-point-bintensity", 0, UINT8_MAX, Attributes::ColorPointBIntensity::Id, credsIssuerConfig), // - make_unique>(Id, "start-up-color-temperature-mireds", 0, UINT16_MAX, - Attributes::StartUpColorTemperatureMireds::Id, credsIssuerConfig), // + make_unique>>( + Id, "start-up-color-temperature-mireds", 0, UINT16_MAX, Attributes::StartUpColorTemperatureMireds::Id, + credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "current-hue", Attributes::CurrentHue::Id, credsIssuerConfig), // make_unique(Id, "current-saturation", Attributes::CurrentSaturation::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 3c74e880afe835..d0e87f6efe4086 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7866,7 +7866,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("CoupleColorTempToLevelMinMireds", 1, value); } case ColorControl::Attributes::StartUpColorTemperatureMireds::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpColorTemperatureMireds", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 1179318cf4ecb9..5a0c3c87c27d82 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -3751,7 +3751,7 @@ class Test_TC_CC_2_1Suite : public TestCommand case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 59a1a11c980eb2..ec3f6fbaf1e027 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -57788,7 +57788,7 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nonnull value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 3e6b294d6b85c1..2d5a690968a3c5 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -6267,9 +6267,13 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("startUpColorTemperatureMireds", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startUpColorTemperatureMireds", [value unsignedShortValue], 65279U)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("startUpColorTemperatureMireds", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("startUpColorTemperatureMireds", [value unsignedShortValue], 65279U)); + } NextTest(); }]; diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 1361aff82ab860..4db663755aea03 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -532,7 +532,8 @@ { 0x0000400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ColorTempPhysicalMinMireds */ \ { 0x0000400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* ColorTempPhysicalMaxMireds */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* CoupleColorTempToLevelMinMireds */ \ - { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x00004010, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(3) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0x1F) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index 765846c3745642..9f3438484cfb72 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -626,7 +626,8 @@ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* CurrentY */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* Options */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* CoupleColorTempToLevelMinMireds */ \ - { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x00004010, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(16) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index 765846c3745642..9f3438484cfb72 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -626,7 +626,8 @@ { 0x00000004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* CurrentY */ \ { 0x0000000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* Options */ \ { 0x0000400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* CoupleColorTempToLevelMinMireds */ \ - { 0x00004010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x00004010, ZAP_TYPE(INT16U), 2, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(16) }, /* StartUpColorTemperatureMireds */ \ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ From f740b750cd5ba8ca079ca42e3698567320991aec Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Tue, 23 Aug 2022 10:54:32 -0700 Subject: [PATCH 13/32] urgent event needs to honor min interval for subscription. (#21938) * Improve urgent event -- In latest spec, urgent event needs to honor min interval for subscription. -- Add new fflag, urgentEvent, and remove unused flag, SuppressResponse -- ForceDirty would be used when recieving the initial request, where it mark the corresponding handler with dirtiness. -- When there is urgent event, we would set new flag, UrgentEvent, in readHandler instead of setting ForceDirty, after minInterval elapsed, the urgent event would be sent out. Modify the existing urgent event test and check if event can be generated after minInterval elapsed. * address comments * address comment --- src/app/ReadHandler.cpp | 2 +- src/app/ReadHandler.h | 16 +++------ src/app/reporting/Engine.cpp | 42 ++-------------------- src/app/reporting/Engine.h | 6 ---- src/app/tests/TestReadInteraction.cpp | 51 ++++++++++++++++++--------- 5 files changed, 43 insertions(+), 74 deletions(-) diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 4422edaf6d0e35..6b609098a87cf4 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -243,7 +243,7 @@ CHIP_ERROR ReadHandler::SendReportData(System::PacketBufferHandle && aPayload, b if (!aMoreChunks) { mPreviousReportsBeginGeneration = mCurrentReportsBeginGeneration; - ClearDirty(); + ClearForceDirtyFlag(); InteractionModelEngine::GetInstance()->ReleaseDataVersionFilterList(mpDataVersionFilterList); } diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index 88b8ad8e13f2b5..b07ef01b2c956a 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -198,9 +198,7 @@ class ReadHandler : public Messaging::ExchangeDelegate enum class ReadHandlerFlags : uint8_t { // mHoldReport is used to prevent subscription data delivery while we are - // waiting for the min reporting interval to elapse. If we have to send a - // report immediately due to an urgent event being queued, - // UnblockUrgentEventDelivery can be used to force mHoldReport to false. + // waiting for the min reporting interval to elapse. HoldReport = (1 << 0), // mHoldSync is used to prevent subscription empty report delivery while we @@ -219,7 +217,6 @@ class ReadHandler : public Messaging::ExchangeDelegate PrimingReports = (1 << 3), ActiveSubscription = (1 << 4), FabricFiltered = (1 << 5), - // For subscriptions, we record the dirty set generation when we started to generate the last report. // The mCurrentReportsBeginGeneration records the generation at the start of the current report. This only/ // has a meaningful value while IsReporting() is true. @@ -227,6 +224,8 @@ class ReadHandler : public Messaging::ExchangeDelegate // mPreviousReportsBeginGeneration will be set to mCurrentReportsBeginGeneration after we send the last // chunk of the current report. Anything that was dirty with a generation earlier than // mPreviousReportsBeginGeneration has had its value sent to the client. + // when receiving initial request, it needs mark current handler as dirty. + // when there is urgent event, it needs mark current handler as dirty. ForceDirty = (1 << 6), // Don't need the response for report data if true @@ -300,8 +299,7 @@ class ReadHandler : public Messaging::ExchangeDelegate { return (mDirtyGeneration > mPreviousReportsBeginGeneration) || mFlags.Has(ReadHandlerFlags::ForceDirty); } - void ClearDirty() { mFlags.Clear(ReadHandlerFlags::ForceDirty); } - + void ClearForceDirtyFlag() { mFlags.Clear(ReadHandlerFlags::ForceDirty); } NodeId GetInitiatorNodeId() const { auto session = GetSession(); @@ -319,11 +317,7 @@ class ReadHandler : public Messaging::ExchangeDelegate auto GetTransactionStartGeneration() const { return mTransactionStartGeneration; } - void UnblockUrgentEventDelivery() - { - mFlags.Clear(ReadHandlerFlags::HoldReport); - mFlags.Set(ReadHandlerFlags::ForceDirty); - } + void UnblockUrgentEventDelivery() { mFlags.Set(ReadHandlerFlags::ForceDirty); } const AttributeValueEncoder::AttributeEncodeState & GetAttributeEncodeState() const { return mAttributeEncoderState; } void SetAttributeEncodeState(const AttributeValueEncoder::AttributeEncodeState & aState) { mAttributeEncoderState = aState; } diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 792631f58acdac..b1c2f5a3db54ea 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -653,8 +653,7 @@ void Engine::Run() bool allReadClean = true; - imEngine->mReadHandlers.ForEachActiveObject([this, &allReadClean](ReadHandler * handler) { - UpdateReadHandlerDirty(*handler); + imEngine->mReadHandlers.ForEachActiveObject([&allReadClean](ReadHandler * handler) { if (handler->IsDirty()) { allReadClean = false; @@ -850,41 +849,6 @@ CHIP_ERROR Engine::SetDirty(AttributePathParams & aAttributePath) return CHIP_NO_ERROR; } -void Engine::UpdateReadHandlerDirty(ReadHandler & aReadHandler) -{ - if (!aReadHandler.IsDirty()) - { - return; - } - - if (!aReadHandler.IsType(ReadHandler::InteractionType::Subscribe)) - { - return; - } - - bool intersected = false; - for (auto object = aReadHandler.GetAttributePathList(); object != nullptr; object = object->mpNext) - { - mGlobalDirtySet.ForEachActiveObject([&](auto * path) { - if (path->Intersects(object->mValue) && path->mGeneration > aReadHandler.mPreviousReportsBeginGeneration) - { - intersected = true; - return Loop::Break; - } - return Loop::Continue; - }); - if (intersected) - { - break; - } - } - if (!intersected) - { - aReadHandler.ClearDirty(); - ChipLogDetail(InteractionModel, "clear read handler dirty in UpdateReadHandlerDirty!"); - } -} - CHIP_ERROR Engine::SendReport(ReadHandler * apReadHandler, System::PacketBufferHandle && aPayload, bool aHasMoreChunks) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -974,8 +938,8 @@ CHIP_ERROR Engine::ScheduleEventDelivery(ConcreteEventPath & aPath, uint32_t aBy if (isUrgentEvent) { - ChipLogDetail(DataManagement, "urgent event schedule run"); - return ScheduleRun(); + ChipLogDetail(DataManagement, "urgent event would be sent after min interval"); + return CHIP_NO_ERROR; } return ScheduleBufferPressureEventDelivery(aBytesWritten); diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h index dc6b6f5ea920a5..45754b490ee7c8 100644 --- a/src/app/reporting/Engine.h +++ b/src/app/reporting/Engine.h @@ -170,12 +170,6 @@ class Engine bool IsClusterDataVersionMatch(const ObjectList * aDataVersionFilterList, const ConcreteReadAttributePath & aPath); - /** - * Check all active subscription, if the subscription has no paths that intersect with global dirty set, - * it would clear dirty flag for that subscription - * - */ - void UpdateReadHandlerDirty(ReadHandler & aReadHandler); /** * Send Report via ReadHandler * diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index d97b11f3213a8d..f96f5279e75023 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -1515,9 +1515,8 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a { app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, chip::app::ReadClient::InteractionType::Subscribe); - readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; - delegate.mGotReport = false; - err = readClient.SendRequest(readPrepareParams); + delegate.mGotReport = false; + err = readClient.SendRequest(readPrepareParams); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); ctx.DrainAndServiceIO(); @@ -1532,8 +1531,6 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); GenerateEvents(apSuite, apContext); - NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); chip::app::AttributePathParams dirtyPath1; dirtyPath1.mClusterId = kTestClusterId; dirtyPath1.mEndpointId = kTestEndpointId; @@ -1563,6 +1560,7 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a // Test report with 2 different path delegate.mpReadHandler->mFlags.Set(ReadHandler::ReadHandlerFlags::HoldReport, false); delegate.mGotReport = false; + delegate.mGotEventResponse = false; delegate.mNumAttributeResponse = 0; printf("HereHere\n"); @@ -1575,6 +1573,7 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a ctx.DrainAndServiceIO(); NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse == true); NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); // Test report with 2 different path, and 1 same path @@ -1701,6 +1700,8 @@ void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite ctx.DrainAndServiceIO(); + System::Clock::Timestamp startTime = System::SystemClock().GetMonotonicTimestamp(); + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers() == 1); NL_TEST_ASSERT(apSuite, engine->ActiveHandlerAt(0) != nullptr); delegate.mpReadHandler = engine->ActiveHandlerAt(0); @@ -1711,12 +1712,37 @@ void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); GenerateEvents(apSuite, apContext); - NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty() == true); delegate.mGotEventResponse = false; delegate.mGotReport = false; - ctx.DrainAndServiceIO(); - NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + + // wait for min interval 2 seconds(in test, we use 1.9second considering the time variation), expect no event is received, + // then wait for 0.5 seconds, then the urgent event would be sent out + // currently DriveIOUntil will call `DriveIO` at least once, which means that if there is any CPU scheduling issues, + // there's a chance 1.9s will already have elapsed by the time we get there, which will result in DriveIO being called when + // it shouldn't. Better fix could happen inside DriveIOUntil, not sure the sideeffect there. + while (true) + { + if ((System::SystemClock().GetMonotonicTimestamp() - startTime) >= System::Clock::Milliseconds32(1900)) + { + break; + } + ctx.GetIOContext().DriveIO(); // at least one IO loop is guaranteed + } + + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse != true); + + startTime = System::SystemClock().GetMonotonicTimestamp(); + while (true) + { + if ((System::SystemClock().GetMonotonicTimestamp() - startTime) >= System::Clock::Milliseconds32(500)) + { + break; + } + ctx.GetIOContext().DriveIO(); // at least one IO loop is guaranteed + } + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse == true); } // By now we should have closed all exchanges and sent all pending acks, so @@ -2228,7 +2254,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripStatusReportTimeout(nlTestSu { app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, chip::app::ReadClient::InteractionType::Subscribe); - readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; printf("\nSend first subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); delegate.mGotReport = false; err = readClient.SendRequest(readPrepareParams); @@ -2246,8 +2271,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripStatusReportTimeout(nlTestSu NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); GenerateEvents(apSuite, apContext); - NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); chip::app::AttributePathParams dirtyPath1; dirtyPath1.mClusterId = kTestClusterId; dirtyPath1.mEndpointId = kTestEndpointId; @@ -2548,7 +2571,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkStatusReportTimeout(nlT { app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, chip::app::ReadClient::InteractionType::Subscribe); - readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; printf("\nSend first subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); delegate.mGotReport = false; err = readClient.SendRequest(readPrepareParams); @@ -2565,8 +2587,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkStatusReportTimeout(nlT NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); GenerateEvents(apSuite, apContext); - NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); chip::app::AttributePathParams dirtyPath1; dirtyPath1.mClusterId = Test::MockClusterId(2); dirtyPath1.mEndpointId = Test::kMockEndpoint3; @@ -2645,7 +2665,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkReportTimeout(nlTestSui { app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, chip::app::ReadClient::InteractionType::Subscribe); - readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; printf("\nSend first subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); delegate.mGotReport = false; err = readClient.SendRequest(readPrepareParams); @@ -2662,8 +2681,6 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkReportTimeout(nlTestSui NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); GenerateEvents(apSuite, apContext); - NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->mFlags.Has(ReadHandler::ReadHandlerFlags::HoldReport)); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); chip::app::AttributePathParams dirtyPath1; dirtyPath1.mClusterId = Test::MockClusterId(2); dirtyPath1.mEndpointId = Test::kMockEndpoint3; From 245830b2d3a08b47d32b7bf1c9277e8ddf3f6694 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:59:05 -0400 Subject: [PATCH 14/32] Fix building thermostat (#22073) --- .../platform/efr32/display/demo-ui-bitmaps.h | 30 +++++++++++++++++++ examples/thermostat/efr32/BUILD.gn | 11 +++++-- examples/thermostat/efr32/include/AppConfig.h | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/examples/platform/efr32/display/demo-ui-bitmaps.h b/examples/platform/efr32/display/demo-ui-bitmaps.h index 6f77ce4b733139..4eca9c0c48e7aa 100644 --- a/examples/platform/efr32/display/demo-ui-bitmaps.h +++ b/examples/platform/efr32/display/demo-ui-bitmaps.h @@ -264,6 +264,36 @@ 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#elif IS_DEMO_THERMOSTAT +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x81, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC1, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, \ + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ + 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#define OFF_DEMO_BITMAP ON_DEMO_BITMAP + #else // Unknown demo.... #define ON_DEMO_BITMAP \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index 7e4e923992ff70..415d9c5e80d212 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -245,8 +245,15 @@ efr32_executable("thermostat_app") { } if (!disable_lcd) { - sources += [ "${examples_plat_dir}/display/lcd.c" ] - defines += [ "DISPLAY_ENABLED" ] + sources += [ + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", + ] + include_dirs += [ "${examples_plat_dir}/display" ] + defines += [ + "DISPLAY_ENABLED", + "IS_DEMO_THERMOSTAT=1", + ] if (show_qr_code) { defines += [ "QR_CODE_ENABLED" ] deps += [ "${chip_root}/examples/common/QRCode" ] diff --git a/examples/thermostat/efr32/include/AppConfig.h b/examples/thermostat/efr32/include/AppConfig.h index 91501d889a6234..946b593cab50a4 100644 --- a/examples/thermostat/efr32/include/AppConfig.h +++ b/examples/thermostat/efr32/include/AppConfig.h @@ -32,7 +32,7 @@ extern "C" { #endif -void efr32LogInit(void); +void efr32InitLog(void); void efr32Log(const char * aFormat, ...); #define EFR32_LOG(...) efr32Log(__VA_ARGS__); From fee403eeb94824bd759f7dd34e2c6e2a2dcf16be Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Tue, 23 Aug 2022 15:56:32 -0400 Subject: [PATCH 15/32] Fix shutdown ordering in DeviceControllerSystemState::Shutdown (#22048) DeviceControllerSystemState shuts down PlatformMgr before higher level objects that use timers such as ExchangeMgr. This leads to calls into the system layer after it has been shut down. Fix the ordering so that PlatformMgr is shut down last. Co-authored-by: Andrei Litvin --- .../CHIPDeviceControllerFactory.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/controller/CHIPDeviceControllerFactory.cpp b/src/controller/CHIPDeviceControllerFactory.cpp index 1c06e8217f3eeb..45ab785e508640 100644 --- a/src/controller/CHIPDeviceControllerFactory.cpp +++ b/src/controller/CHIPDeviceControllerFactory.cpp @@ -419,19 +419,6 @@ void DeviceControllerSystemState::Shutdown() mTransportMgr = nullptr; } -#if CONFIG_DEVICE_LAYER - // - // We can safely call PlatformMgr().Shutdown(), which like DeviceController::Shutdown(), - // expects to be called with external thread synchronization and will not try to acquire the - // stack lock. - // - // Actually stopping the event queue is a separable call that applications will have to sequence. - // Consumers are expected to call PlaformMgr().StopEventLoopTask() before calling - // DeviceController::Shutdown() in the CONFIG_DEVICE_LAYER configuration - // - DeviceLayer::PlatformMgr().Shutdown(); -#endif - if (mExchangeMgr != nullptr) { mExchangeMgr->Shutdown(); @@ -483,6 +470,19 @@ void DeviceControllerSystemState::Shutdown() // so that SetupController/Commissioner can use it mFabrics = nullptr; } + +#if CONFIG_DEVICE_LAYER + // + // We can safely call PlatformMgr().Shutdown(), which like DeviceController::Shutdown(), + // expects to be called with external thread synchronization and will not try to acquire the + // stack lock. + // + // Actually stopping the event queue is a separable call that applications will have to sequence. + // Consumers are expected to call PlaformMgr().StopEventLoopTask() before calling + // DeviceController::Shutdown() in the CONFIG_DEVICE_LAYER configuration + // + DeviceLayer::PlatformMgr().Shutdown(); +#endif } } // namespace Controller From fa24ab6f8c19bdf4817542aba8562142a1ae1c60 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:40:44 -0400 Subject: [PATCH 16/32] [EFR32] Add Board Support for efr32 boards (#22099) * add BRD2703A config files * Add Explorer Board to gn files * Update sdk build files * Fix external flash issue * Update submodule to main * remove unwanted change * Add support for BRD4162A --- examples/chef/efr32/BUILD.gn | 5 +++-- examples/light-switch-app/efr32/BUILD.gn | 5 +++-- examples/lighting-app/efr32/BUILD.gn | 5 +++-- examples/lock-app/efr32/BUILD.gn | 5 +++-- examples/thermostat/efr32/BUILD.gn | 5 +++-- examples/window-app/efr32/BUILD.gn | 5 +++-- third_party/silabs/efr32_board.gni | 8 +++++++- third_party/silabs/efr32_sdk.gni | 17 +++++++++++++++-- third_party/silabs/matter_support | 2 +- 9 files changed, 41 insertions(+), 16 deletions(-) diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index e23b747fcad1dd..3d1bf35352fa93 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -91,8 +91,9 @@ chip_data_model("chef-common") { is_server = true } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 2d628f537f9f6e..4b6c15741224d0 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -84,8 +84,9 @@ if (chip_enable_wifi) { assert(use_rs911x || use_wf200) } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index fbd5a88a7909b9..6301fede13a30a 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -84,8 +84,9 @@ if (chip_enable_wifi) { assert(use_rs911x || use_wf200) } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index e76b9cd48f1d1e..d757da6c50c4ff 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -84,8 +84,9 @@ if (chip_enable_wifi) { assert(use_rs911x || use_wf200) } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/examples/thermostat/efr32/BUILD.gn b/examples/thermostat/efr32/BUILD.gn index 415d9c5e80d212..bb4e2cb7a17e61 100644 --- a/examples/thermostat/efr32/BUILD.gn +++ b/examples/thermostat/efr32/BUILD.gn @@ -81,8 +81,9 @@ if (chip_enable_wifi) { assert(use_rs911x || use_wf200) } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index a9aa7cf402911c..a9e0c030a9c292 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -77,8 +77,9 @@ if (chip_enable_wifi) { assert(use_rs911x || use_wf200) } -# ThunderBoards (No LCD) -if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B") { +# ThunderBoards and Explorer Kit (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD2601B" || + efr32_board == "BRD2703A") { show_qr_code = false disable_lcd = true } diff --git a/third_party/silabs/efr32_board.gni b/third_party/silabs/efr32_board.gni index b697d2bb3afbc8..3de8aa1337bc6a 100644 --- a/third_party/silabs/efr32_board.gni +++ b/third_party/silabs/efr32_board.gni @@ -44,6 +44,9 @@ if (efr32_board == "BRD4304A") { } else if (efr32_board == "BRD4161A") { efr32_family = "efr32mg12" efr32_mcu = "EFR32MG12P432F1024GL125" +} else if (efr32_board == "BRD4162A") { + efr32_family = "efr32mg12" + efr32_mcu = "EFR32MG12P332F1024GL125" } else if (efr32_board == "BRD4163A") { efr32_family = "efr32mg12" efr32_mcu = "EFR32MG12P433F1024GL125" @@ -75,8 +78,11 @@ if (efr32_board == "BRD4304A") { } else if (efr32_board == "BRD2601B") { efr32_family = "efr32mg24" efr32_mcu = "EFR32MG24B310F1536IM48" +} else if (efr32_board == "BRD2703A") { + efr32_family = "efr32mg24" + efr32_mcu = "EFR32MG24B020F1536IM48" } else { print( - "Please provide a valid value for EFR32_BOARD env variable (currently supported BRD4304A, BRD4161A, BRD4163A, BRD4164A BRD4166A, BRD4170A, BRD4186C, BRD4187C, BRD2601B)") + "Please provide a valid value for EFR32_BOARD env variable (currently supported BRD4304A, BRD4161A, BRD4163A, BRD4164A BRD4166A, BRD4170A, BRD4186C, BRD4187C, BRD2601B, BRD2703A)") assert(false, "The board ${efr32_board} is unsupported") } diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 727ecea7acd5ef..93354bcc5594e6 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -33,6 +33,11 @@ declare_args() { use_external_flash = true } +# Explorer Kit does not have external flash +if (efr32_board == "BRD2703A") { + use_external_flash = false +} + assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") # Defines an efr32 SDK build target. @@ -210,13 +215,14 @@ template("efr32_sdk") { if (defined(invoker.use_external_flash) && use_external_flash) { defines += [ "CONFIG_USE_EXTERNAL_FLASH" ] + + _include_dirs += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart" ] } _include_dirs += [ "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", "${efr32_sdk_root}/platform/emdrv/uartdrv/config", "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/inc/sl_mx25_flash_shutdown_usart", ] } @@ -226,6 +232,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config", + "${efr32_sdk_root}/platform/service/device_init/config/s1/", ] libs += [ @@ -243,6 +250,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config", + "${efr32_sdk_root}/platform/service/device_init/config/s2/", ] libs += [ @@ -263,6 +271,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", + "${efr32_sdk_root}/platform/service/device_init/config/s2/", ] libs += [ @@ -365,6 +374,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfrco.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager.c", "${efr32_sdk_root}/platform/service/legacy_hal/src/token_legacy.c", @@ -527,13 +537,16 @@ template("efr32_sdk") { (defined(invoker.use_external_flash) && use_external_flash)) { sources += [ "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", - "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c", "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", "${efr32_sdk_root}/platform/emlib/src/em_eusart.c", "${efr32_sdk_root}/platform/emlib/src/em_leuart.c", "${efr32_sdk_root}/platform/emlib/src/em_usart.c", "${sdk_support_root}/matter/efr32/${efr32_family}/${efr32_board}/autogen/sl_uartdrv_init.c", ] + + if (defined(invoker.use_external_flash) && use_external_flash) { + sources += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c" ] + } } if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 16c1ed8eca039b..0c84c861c036fb 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 16c1ed8eca039bb9527421411bd605de8ce21442 +Subproject commit 0c84c861c036fba5ba35eccca3f366925700b2b5 From 82d974bf9a2c770048a80f62650fafd9f4efee53 Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Tue, 23 Aug 2022 17:58:05 -0500 Subject: [PATCH 17/32] update to SysConfig 1.13.0 (#22022) Co-authored-by: Andrei Litvin --- integrations/docker/images/chip-build-ti/Dockerfile | 8 ++++---- integrations/docker/images/chip-build/version | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integrations/docker/images/chip-build-ti/Dockerfile b/integrations/docker/images/chip-build-ti/Dockerfile index 5e99fb9f44fc5a..20eb5889c16f36 100644 --- a/integrations/docker/images/chip-build-ti/Dockerfile +++ b/integrations/docker/images/chip-build-ti/Dockerfile @@ -11,9 +11,9 @@ RUN set -x \ # Install Sysconfig RUN set -x \ - && wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run \ - && chmod +x sysconfig-1.11.0_2225-setup.run \ - && ./sysconfig-1.11.0_2225-setup.run --mode unattended \ + && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.13.0.2553/sysconfig-1.13.0_2553-setup.run \ + && chmod +x sysconfig-1.13.0_2553-setup.run \ + && ./sysconfig-1.13.0_2553-setup.run --mode unattended \ && : # last line -ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.11.0 +ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.13.0 diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index b22b98316c9f22..1baaf2f8150e0b 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.96 Version bump reason: add libnl-dev libs to chip-build image +0.5.97 Version bump reason: [TI] Update SysConfig to 1.13.0 From ee88e15dabd73481c33ae3fa724a840f3fba3f56 Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Wed, 24 Aug 2022 19:15:52 +0530 Subject: [PATCH 18/32] Modified manual automation scripts (#22100) * Modified Manual scripts TC-BIND-2.* TC-BR-4 TC-CADMIN-1.2 * Auto generated files * Restyled by whitespace * Restyled by prettier-yaml * Modified Manual scripts * Restyled by whitespace Co-authored-by: Restyled.io --- .../certification/Test_TC_BIND_2_1.yaml | 2 +- .../certification/Test_TC_BIND_2_2.yaml | 2 +- .../certification/Test_TC_BIND_2_3.yaml | 4 +- .../certification/Test_TC_BINFO_2_1.yaml | 10 + .../suites/certification/Test_TC_BR_4.yaml | 40 +- .../certification/Test_TC_CADMIN_1_12.yaml | 300 ++-- .../certification/Test_TC_CADMIN_1_17.yaml | 10 +- .../certification/Test_TC_CADMIN_1_2.yaml | 7 +- .../certification/Test_TC_CADMIN_1_8.yaml | 2 +- .../suites/certification/Test_TC_CC_2_2.yaml | 2 +- .../suites/certification/Test_TC_CC_3_1.yaml | 6 +- .../suites/certification/Test_TC_CC_3_4.yaml | 9 + .../suites/certification/Test_TC_CC_5_1.yaml | 5 + .../suites/certification/Test_TC_CC_6_3.yaml | 4 +- .../suites/certification/Test_TC_CC_6_4.yaml | 19 +- .../suites/certification/Test_TC_CC_7_1.yaml | 2 +- .../certification/Test_TC_CGEN_2_2.yaml | 122 +- .../certification/Test_TC_CGEN_2_4.yaml | 6 +- .../certification/Test_TC_CNET_4_11.yaml | 85 +- .../certification/Test_TC_CNET_4_14.yaml | 38 + .../certification/Test_TC_CNET_4_2.yaml | 3 +- .../certification/Test_TC_CNET_4_22.yaml | 8 +- .../certification/Test_TC_CNET_4_5.yaml | 2 +- .../suites/certification/Test_TC_DA_1_5.yaml | 10 +- .../suites/certification/Test_TC_DA_1_7.yaml | 4 +- .../certification/Test_TC_DESC_2_2.yaml | 114 +- .../certification/Test_TC_DGGEN_2_1.yaml | 106 +- .../certification/Test_TC_DGSW_2_2.yaml | 41 +- .../certification/Test_TC_DRLK_2_10.yaml | 18 +- .../certification/Test_TC_DRLK_3_2.yaml | 7 + .../suites/certification/Test_TC_IDM_3_1.yaml | 3 + .../suites/certification/Test_TC_I_1_1.yaml | 57 +- .../suites/certification/Test_TC_LVL_2_3.yaml | 10 +- .../suites/certification/Test_TC_LVL_3_1.yaml | 6 +- .../suites/certification/Test_TC_LVL_5_1.yaml | 6 +- .../suites/certification/Test_TC_LVL_6_1.yaml | 13 - .../suites/certification/Test_TC_MOD_3_1.yaml | 5 + .../suites/certification/Test_TC_MOD_3_4.yaml | 11 +- .../suites/certification/Test_TC_OCC_2_2.yaml | 2 +- .../certification/Test_TC_OPCREDS_3_1.yaml | 8 + src/app/tests/suites/ciTests.json | 2 +- src/app/tests/suites/manualTests.json | 2 +- .../chip-tool/zap-generated/test/Commands.h | 747 +++++----- .../zap-generated/test/Commands.h | 1315 ++++++++++------- 44 files changed, 1746 insertions(+), 1429 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml index 0be1511b414bf6..e37c58ebd917e0 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml @@ -95,7 +95,7 @@ tests: - label: "TH1 enables DUT as Controller" verification: | - verification step to be updated. + disabled: true - label: "DUT is triggered to send On command to its binding node entries" diff --git a/src/app/tests/suites/certification/Test_TC_BIND_2_2.yaml b/src/app/tests/suites/certification/Test_TC_BIND_2_2.yaml index e55907df9aaf6f..c7a463b52543b1 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_2_2.yaml @@ -60,7 +60,7 @@ tests: - label: "TH1 enables DUT as Controller" verification: | - verification step to be updated. + disabled: true - label: "Commission TH2 to TH1s fabric (Node ID = 2)" diff --git a/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml b/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml index 3457cdc91e536e..870f3a188ac896 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml @@ -60,7 +60,7 @@ tests: - label: "TH1 enables DUT as Controller" verification: | - verification step to be updated. + disabled: true - label: "Commission TH2 to TH1s fabric (Node ID = 2)" @@ -238,7 +238,7 @@ tests: - label: "TH1 sets up group settings on DUT" verification: | - verification step to be updated. + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml index 66119c8d9b517a..bef34663834d7d 100644 --- a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml @@ -39,6 +39,7 @@ tests: verification: | While commissioning TH Saves the CountryCode Information from SetRegulatoryConfig command + ./chip-tool pairing ble-wifi 1 GRLPrivate_EXT matter123 20202021 3840 TH END: @@ -48,6 +49,15 @@ tests: DUT END: [1641381202.306840][4431:4431] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0) + + After pairing, Verify the countrycode Information by reading location atrribute from TH to DUT. + ./chip-tool basic read location 1 0 + + On TH, Verify that TH reads Location from the DUT successfully, the name should be string and length is less than or equal to 2 bytes. + [1656495999.760797][2249:2254] CHIP:DMG: } + [1656495999.761084][2249:2254] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 941124320 + [1656495999.761187][2249:2254] CHIP:TOO: Location: XX + [1656495999.761371][2249:2254] CHIP:EM: Sending Standalone Ack for MessageCounter:7663506 on exchange 28126i cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT diff --git a/src/app/tests/suites/certification/Test_TC_BR_4.yaml b/src/app/tests/suites/certification/Test_TC_BR_4.yaml index 0effe409a9420b..298ed854fb7598 100644 --- a/src/app/tests/suites/certification/Test_TC_BR_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_4.yaml @@ -34,7 +34,6 @@ tests: 1. Test Harness simulating a bridge with some bridged devices; can use the bridge-app for this purpose 2.DUT (client and commissioner) - disabled: true - label: @@ -752,7 +751,7 @@ tests: [1659972886.386056][3652:3652] CHIP:DMG: Cluster 1d, Attribute 3 is dirty disabled: true - - label: "" + - label: "Verify DUT contains the (supported) devices from the above list" PICS: MCORE.DEVLIST.UseDevices verification: | Verify DUT contains the (supported) devices from the above list @@ -1404,7 +1403,10 @@ tests: [1659972886.386056][3652:3652] CHIP:DMG: Cluster 1d, Attribute 3 is dirty disabled: true - - label: "" + - label: + "Verify DUT has (during step 1a) read the NodeLabel attribute from the + Bridged Device Basic Information cluster on various endpoints ,Verify + DUT contains the names for the (supported) devices from the above list" PICS: MCORE.DEVLIST.UseDeviceNames verification: | NodeLabel is supported for endpoints 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 @@ -1707,7 +1709,10 @@ tests: [1659973028.617572][3652:3652] CHIP:DMG: Cluster 39, Attribute 5 is dirty disabled: true - - label: "" + - label: + "Verify DUT has read or reads OnOff attribute from the On/Off cluster + for the various endpoints containing an On/Off light ,Verify DUT + contains the state for the (supported) devices from the above list" PICS: MCORE.DEVLIST.UseDeviceState verification: | Read onoff attribute from OnOff cluster with applicable EP (refer step 1a ) @@ -1768,7 +1773,12 @@ tests: [1659973152.264922][3652:3652] CHIP:DMG: Cluster 6, Attribute 0 is dirty disabled: true - - label: "" + - label: + "Verify DUT has read or reads MeasuredValue attribute from the + Temperature Measurement cluster for the various endpoints containing a + Temperature Sensor (or receives updates because of a previously set up + subscription) ,Verify DUT contains the state for the (supported) + device from the above list" PICS: MCORE.DEVLIST.UseDeviceState verification: | ./chip-tool temperaturemeasurement read measured-value 1 4 @@ -1816,7 +1826,11 @@ tests: [1659351542.393552][12212:12217] CHIP:EM: Sending Standalone Ack for MessageCounter:120981971 on exchange 25924i disabled: true - - label: "" + - label: + "Verify DUT has read or reads BatChargeLevel attribute from the Power + Source cluster from the relevant endpoint (or receives updates because + of a previously set up subscription) ,Verify DUT contains the state of + the battery of the (supported) devices from the above list" PICS: MCORE.DEVLIST.UseBatInfo verification: | ./chip-tool powersource read bat-charge-level 1 9 @@ -1845,11 +1859,6 @@ tests: [1659973227.631262][3652:3652] CHIP:DMG: Cluster 402, Attribute 0 is dirty disabled: true - - label: "" - verification: | - verification step to be updated. - disabled: true - - label: "Use the DUT to change the on/off state of one or more of the bridged On/Off lights" @@ -1880,11 +1889,6 @@ tests: [1659973152.264922][3652:3652] CHIP:DMG: Cluster 6, Attribute 0 is dirty disabled: true - - label: "" - verification: | - verification step to be updated. - disabled: true - - label: "Use TH/bridge-app to rename a bridged light (use key b in the console to bridge-app to rename Light 1 to Light 1b)" @@ -1946,7 +1950,7 @@ tests: [1659973028.617572][3652:3652] CHIP:DMG: Cluster 39, Attribute 5 is dirty disabled: true - - label: "" + - label: "Verify DUT contains the added device in the list of devices" PICS: MCORE.DEVLIST.UseDeviceNames verification: | Verify on DUT(chip-tool) Log @@ -2066,7 +2070,7 @@ tests: [1659972694.733520][3652:3652] CHIP:DMG: AccessControl: allowed disabled: true - - label: "" + - label: "Verify DUT contains the added device in the list of devices" PICS: MCORE.DEVLIST.UseDevices verification: | Verify on DUT(chip-tool) Log diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_12.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_12.yaml index c736e2199f821e..e846b0783df6c3 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_12.yaml @@ -41,8 +41,7 @@ tests: - label: "DUT_CR1 starts a commissioning process with TH_CE" PICS: CADMIN.C verification: | - "1. Provision the device using your DUT controller (use above instructions) , - " + "1. Provision the TH_CE (all-cluster-app) device using DUT_CR1 (chip-tool ) on the raspi" disabled: true - label: @@ -51,29 +50,34 @@ tests: TH_CR3 Commissions with TH_CE" PICS: CADMIN.C.C00.Tx verification: | - On your first controller, open commissioning window using ECM + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + - Below is the example is using chip tool as controller ./chip-tool pairing open-commissioning-window 1 1 300 1000 3840 - [1635874557.409509][4549:4554] CHIP:SC: Success status report received. Session was established - [1635874557.409553][4549:4554] CHIP:IN: New secure session created for device 0x0000000000000001, key 76!! - [1635874557.409649][4549:4554] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635874557.416929][4549:4554] CHIP:DMG: ICR moving to [AddingComm] - [1635874557.417092][4549:4554] CHIP:DMG: ICR moving to [AddedComma] - [1635874557.417215][4549:4554] CHIP:IN: Prepared encrypted message 0xaaaac5947d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 5541i with MessageCounter:0. - [1635874557.417271][4549:4554] CHIP:IN: Sending encrypted msg 0xaaaac5947d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 16129075 msec + + Verify the Open commisioning window on the TH_CE(all-cluster-app) Log: + + [1660904553.796857][3537:3537] CHIP:DMG: Received command for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 + [1660904553.796951][3537:3537] CHIP:ZCL: Received command to open commissioning window + [1660904553.797255][3537:3537] CHIP:IN: SecureSession[0xaaab142ef7f0]: Allocated Type:1 LSID:34523 + + Verify Manual pairing code on DUT_CR1(chip-tool) Log + + 0x0000000000000001 at monotonic time: 16129075 msec [1635874557.417449][4549:4554] CHIP:DMG: ICR moving to [CommandSen] [1635874557.417505][4549:4554] CHIP:CTL: Manual pairing code: [35484132896] [1635874557.417577][4549:4554] CHIP:CTL: SetupQRCode: [MT:00000CQM00AT-F5A510] - On 3rd controller using chip tool connect using manual code + On TH_CR2 send the below command ./chip-tool pairing code 1 35484132896 --commissioner-name gamma - Verify you got below message + Verify you got below message on TH_CE(all-clusters-app) log Device commissioning completed with success disabled: true @@ -83,29 +87,26 @@ tests: TH_CR2 Commissions with TH_CE" PICS: CADMIN.C.C00.Tx verification: | - On your first controller, open commissioning window using ECM + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + - Below is the example is using chip tool as controller ./chip-tool pairing open-commissioning-window 1 1 300 1000 3840 - [1635874557.409509][4549:4554] CHIP:SC: Success status report received. Session was established - [1635874557.409553][4549:4554] CHIP:IN: New secure session created for device 0x0000000000000001, key 76!! - [1635874557.409649][4549:4554] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635874557.416929][4549:4554] CHIP:DMG: ICR moving to [AddingComm] - [1635874557.417092][4549:4554] CHIP:DMG: ICR moving to [AddedComma] - [1635874557.417215][4549:4554] CHIP:IN: Prepared encrypted message 0xaaaac5947d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 5541i with MessageCounter:0. - [1635874557.417271][4549:4554] CHIP:IN: Sending encrypted msg 0xaaaac5947d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 16129075 msec + Verify Manual pairing code on TH_CR2(chip-tool) Log + + 0x0000000000000001 at monotonic time: 16129075 msec [1635874557.417449][4549:4554] CHIP:DMG: ICR moving to [CommandSen] [1635874557.417505][4549:4554] CHIP:CTL: Manual pairing code: [35484132896] [1635874557.417577][4549:4554] CHIP:CTL: SetupQRCode: [MT:00000CQM00AT-F5A510] - On 2nd controller using chip tool connect using manual code ./chip-tool pairing code 2 35484132896 --commissioner-name beta - Verify you got below message + Verify you got below message on TH1(all-clusters-app) log Device commissioning completed with success disabled: true @@ -114,11 +115,15 @@ tests: commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" PICS: CADMIN.C.C00.Tx verification: | - On your first controller, open commissioning window using ECM + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + - Below is the example is using chip tool as controller ./chip-tool pairing open-commissioning-window 1 1 300 1000 3840 + Verify Manual pairing code on DUT_CR1(CHIP-TOOL) Log + [1635874557.409509][4549:4554] CHIP:SC: Success status report received. Session was established [1635874557.409553][4549:4554] CHIP:IN: New secure session created for device 0x0000000000000001, key 76!! [1635874557.409649][4549:4554] CHIP:CTL: OpenCommissioningWindow for device ID 1 @@ -137,36 +142,14 @@ tests: attribute" PICS: CADMIN.C.A0000 verification: | - On first controller read window status + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool administratorcommissioning read window-status 1 0 - [1658838248.886555][9273:9278] CHIP:DMG: ReportDataMessage = - [1658838248.886599][9273:9278] CHIP:DMG: { - [1658838248.886634][9273:9278] CHIP:DMG: AttributeReportIBs = - [1658838248.886683][9273:9278] CHIP:DMG: [ - [1658838248.886722][9273:9278] CHIP:DMG: AttributeReportIB = - [1658838248.886774][9273:9278] CHIP:DMG: { - [1658838248.886816][9273:9278] CHIP:DMG: AttributeDataIB = - [1658838248.886872][9273:9278] CHIP:DMG: { - [1658838248.886925][9273:9278] CHIP:DMG: DataVersion = 0x906dac1f, - [1658838248.886981][9273:9278] CHIP:DMG: AttributePathIB = - [1658838248.887036][9273:9278] CHIP:DMG: { - [1658838248.887086][9273:9278] CHIP:DMG: Endpoint = 0x0, - [1658838248.887146][9273:9278] CHIP:DMG: Cluster = 0x3c, - [1658838248.887208][9273:9278] CHIP:DMG: Attribute = 0x0000_0000, - [1658838248.887256][9273:9278] CHIP:DMG: } - [1658838248.887316][9273:9278] CHIP:DMG: - [1658838248.887367][9273:9278] CHIP:DMG: Data = 1, - [1658838248.887417][9273:9278] CHIP:DMG: }, - [1658838248.887469][9273:9278] CHIP:DMG: - [1658838248.887514][9273:9278] CHIP:DMG: }, - [1658838248.887562][9273:9278] CHIP:DMG: - [1658838248.887597][9273:9278] CHIP:DMG: ], - [1658838248.887630][9273:9278] CHIP:DMG: - [1658838248.887658][9273:9278] CHIP:DMG: SuppressResponse = true, - [1658838248.887687][9273:9278] CHIP:DMG: InteractionModelRevision = 1 - [1658838248.887740][9273:9278] CHIP:DMG: } + Verify on DUT_CR1(CHIP-TOOL) log successfully reads the WindowStatus + [1658838248.887888][9273:9278] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003C Attribute 0x0000_0000 DataVersion: 2423106591 [1658838248.887959][9273:9278] CHIP:TOO: WindowStatus: 1 [1658838248.888038][9273:9278] CHIP:EM: Sending Standalone Ack for MessageCounter:253317720 on exchange 63644i @@ -179,25 +162,16 @@ tests: using ECM" PICS: CADMIN.C.C00.Tx verification: | - On your first controller, open commissioning window using ECM before the timer expiry from the above step + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + - Below is the example is using chip tool as controller ./chip-tool pairing open-commissioning-window 1 1 300 1000 3840 - CHIP:DMG: InvokeResponseMessage = - [1650527622.373450][15824:15829] CHIP:DMG: { - [1650527622.373531][15824:15829] CHIP:DMG: suppressResponse = false, - [1650527622.373628][15824:15829] CHIP:DMG: InvokeResponseIBs = - [1650527622.373734][15824:15829] CHIP:DMG: [ - [1650527622.373817][15824:15829] CHIP:DMG: InvokeResponseIB = - [1650527622.373913][15824:15829] CHIP:DMG: { - [1650527622.374001][15824:15829] CHIP:DMG: CommandStatusIB = - [1650527622.374087][15824:15829] CHIP:DMG: { - [1650527622.374182][15824:15829] CHIP:DMG: CommandPathIB = - [1650527622.374296][15824:15829] CHIP:DMG: { - [1650527622.374382][15824:15829] CHIP:DMG: EndpointId = 0x0, - [1650527622.374490][15824:15829] CHIP:DMG: ClusterId = 0x3c, - [1650527622.374593][15824:15829] CHIP:DMG: CommandId = 0x1, + Verify that the TH_CE is rejecting the opening of second commissioning session with the response status 0x01 failure (TH (all-clusters-app) Log) + + [1650527622.374682][15824:15829] CHIP:DMG: }, [1650527622.374799][15824:15829] CHIP:DMG: [1650527622.374896][15824:15829] CHIP:DMG: StatusIB = @@ -207,22 +181,13 @@ tests: [1650527622.375320][15824:15829] CHIP:DMG: }, [1650527622.375426][15824:15829] CHIP:DMG: [1650527622.375527][15824:15829] CHIP:DMG: }, - [1650527622.375616][15824:15829] CHIP:DMG: - [1650527622.375704][15824:15829] CHIP:DMG: }, - [1650527622.375786][15824:15829] CHIP:DMG: - [1650527622.375864][15824:15829] CHIP:DMG: ], - [1650527622.375940][15824:15829] CHIP:DMG: - [1650527622.376000][15824:15829] CHIP:DMG: InteractionModelRevision = 1 - [1650527622.376058][15824:15829] CHIP:DMG: }, - [1650527622.376202][15824:15829] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x1 - [1650527622.376278][15824:15829] CHIP:TOO: Error: IM Error 0x00000601: Cluster-specific error: 0x01 disabled: true - label: "Wait for the expiration of PIXIT.CADMIN.CwDuration seconds that was set in step 4" verification: | - verification step to be updated. + Wait for the expiration of PIXIT.CADMIN.CwDuration seconds that was set in step 4 disabled: true - label: @@ -231,27 +196,16 @@ tests: BCM" PICS: CADMIN.C.C01.Tx verification: | - On your first controller, open commissioning window using BCM + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + - Below is the example when using chip tool as controller ./chip-tool administratorcommissioning open-basic-commissioning-window 500 1 0 --timedInteractionTimeoutMs 1000 + Verify success response On DUT_CR1(CHIP-TOOL) Log - CHIP:DMG: InvokeResponseMessage = - [1650278416.248379][11064:11069] CHIP:DMG: { - [1650278416.248436][11064:11069] CHIP:DMG: suppressResponse = false, - [1650278416.248495][11064:11069] CHIP:DMG: InvokeResponseIBs = - [1650278416.248570][11064:11069] CHIP:DMG: [ - [1650278416.248630][11064:11069] CHIP:DMG: InvokeResponseIB = - [1650278416.248718][11064:11069] CHIP:DMG: { - [1650278416.248783][11064:11069] CHIP:DMG: CommandStatusIB = - [1650278416.248860][11064:11069] CHIP:DMG: { - [1650278416.248931][11064:11069] CHIP:DMG: CommandPathIB = - [1650278416.249011][11064:11069] CHIP:DMG: { - [1650278416.249100][11064:11069] CHIP:DMG: EndpointId = 0x0, - [1650278416.249186][11064:11069] CHIP:DMG: ClusterId = 0x3c, - [1650278416.249268][11064:11069] CHIP:DMG: CommandId = 0x1, [1650278416.249347][11064:11069] CHIP:DMG: }, [1650278416.249430][11064:11069] CHIP:DMG: [1650278416.249501][11064:11069] CHIP:DMG: StatusIB = @@ -260,15 +214,6 @@ tests: [1650278416.249738][11064:11069] CHIP:DMG: }, [1650278416.249823][11064:11069] CHIP:DMG: [1650278416.249889][11064:11069] CHIP:DMG: }, - [1650278416.249969][11064:11069] CHIP:DMG: - [1650278416.250035][11064:11069] CHIP:DMG: }, - [1650278416.250113][11064:11069] CHIP:DMG: - [1650278416.250169][11064:11069] CHIP:DMG: ], - [1650278416.250241][11064:11069] CHIP:DMG: - [1650278416.250298][11064:11069] CHIP:DMG: InteractionModelRevision = 1 - [1650278416.250355][11064:11069] CHIP:DMG: }, - [1650278416.250535][11064:11069] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1650278416.250634][11064:11069] CHIP:DMG: ICR moving to [AwaitingDe] disabled: true - label: @@ -277,36 +222,15 @@ tests: attribute" PICS: CADMIN.C.A0000 verification: | - On first controller read window status + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool administratorcommissioning read window-status 1 0 - [1658838248.886555][9273:9278] CHIP:DMG: ReportDataMessage = - [1658838248.886599][9273:9278] CHIP:DMG: { - [1658838248.886634][9273:9278] CHIP:DMG: AttributeReportIBs = - [1658838248.886683][9273:9278] CHIP:DMG: [ - [1658838248.886722][9273:9278] CHIP:DMG: AttributeReportIB = - [1658838248.886774][9273:9278] CHIP:DMG: { - [1658838248.886816][9273:9278] CHIP:DMG: AttributeDataIB = - [1658838248.886872][9273:9278] CHIP:DMG: { - [1658838248.886925][9273:9278] CHIP:DMG: DataVersion = 0x906dac1f, - [1658838248.886981][9273:9278] CHIP:DMG: AttributePathIB = - [1658838248.887036][9273:9278] CHIP:DMG: { - [1658838248.887086][9273:9278] CHIP:DMG: Endpoint = 0x0, - [1658838248.887146][9273:9278] CHIP:DMG: Cluster = 0x3c, - [1658838248.887208][9273:9278] CHIP:DMG: Attribute = 0x0000_0000, - [1658838248.887256][9273:9278] CHIP:DMG: } - [1658838248.887316][9273:9278] CHIP:DMG: - [1658838248.887367][9273:9278] CHIP:DMG: Data = 1, - [1658838248.887417][9273:9278] CHIP:DMG: }, - [1658838248.887469][9273:9278] CHIP:DMG: - [1658838248.887514][9273:9278] CHIP:DMG: }, - [1658838248.887562][9273:9278] CHIP:DMG: - [1658838248.887597][9273:9278] CHIP:DMG: ], - [1658838248.887630][9273:9278] CHIP:DMG: - [1658838248.887658][9273:9278] CHIP:DMG: SuppressResponse = true, - [1658838248.887687][9273:9278] CHIP:DMG: InteractionModelRevision = 1 - [1658838248.887740][9273:9278] CHIP:DMG: } + Verify on DUT_CR1(CHIP-TOOL) log successfully reads the WindowStatus + + [1658838248.887888][9273:9278] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003C Attribute 0x0000_0000 DataVersion: 2423106591 [1658838248.887959][9273:9278] CHIP:TOO: WindowStatus: 1 [1658838248.888038][9273:9278] CHIP:EM: Sending Standalone Ack for MessageCounter:253317720 on exchange 63644i @@ -319,49 +243,28 @@ tests: using BCM" PICS: CADMIN.C.C01.Tx verification: | - On third controller open commissioning window verify status code 1 + On TH_CR3 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + ./chip-tool administratorcommissioning open-basic-commissioning-window 500 3 0 --timedInteractionTimeoutMs 1000 --commissioner-name gamma - [1658838344.191922][9291:9296] CHIP:DMG: InvokeResponseMessage = - [1658838344.191947][9291:9296] CHIP:DMG: { - [1658838344.191971][9291:9296] CHIP:DMG: suppressResponse = false, - [1658838344.192003][9291:9296] CHIP:DMG: InvokeResponseIBs = - [1658838344.192035][9291:9296] CHIP:DMG: [ - [1658838344.192059][9291:9296] CHIP:DMG: InvokeResponseIB = - [1658838344.192091][9291:9296] CHIP:DMG: { - [1658838344.192116][9291:9296] CHIP:DMG: CommandStatusIB = - [1658838344.192149][9291:9296] CHIP:DMG: { - [1658838344.192181][9291:9296] CHIP:DMG: CommandPathIB = - [1658838344.192212][9291:9296] CHIP:DMG: { - [1658838344.192251][9291:9296] CHIP:DMG: EndpointId = 0x0, - [1658838344.192290][9291:9296] CHIP:DMG: ClusterId = 0x3c, - [1658838344.192328][9291:9296] CHIP:DMG: CommandId = 0x1, - [1658838344.192364][9291:9296] CHIP:DMG: }, - [1658838344.192401][9291:9296] CHIP:DMG: + Verify that the TH_CE is rejecting the opening of second commissioning session with the response status 0x01 failure (TH (all-clusters-app) Log) + [1658838344.192430][9291:9296] CHIP:DMG: StatusIB = [1658838344.192461][9291:9296] CHIP:DMG: { [1658838344.192500][9291:9296] CHIP:DMG: status = 0x01 (FAILURE), [1658838344.192538][9291:9296] CHIP:DMG: cluster-status = 0x1, [1658838344.192574][9291:9296] CHIP:DMG: }, [1658838344.192611][9291:9296] CHIP:DMG: - [1658838344.192640][9291:9296] CHIP:DMG: }, - [1658838344.192673][9291:9296] CHIP:DMG: - [1658838344.192698][9291:9296] CHIP:DMG: }, - [1658838344.192728][9291:9296] CHIP:DMG: - [1658838344.192752][9291:9296] CHIP:DMG: ], - [1658838344.192782][9291:9296] CHIP:DMG: - [1658838344.192805][9291:9296] CHIP:DMG: InteractionModelRevision = 1 - [1658838344.192828][9291:9296] CHIP:DMG: }, - [1658838344.192887][9291:9296] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x1 - [1658838344.192922][9291:9296] CHIP:TOO: Error: IM Error 0x00000601: Cluster-specific error: 0x01 disabled: true - label: "Wait for the expiration of PIXIT.CADMIN.CwDuration seconds that was set in step 8" verification: | - verification step to be updated. + Wait for the expiration of PIXIT.CADMIN.CwDuration seconds that was set in step 8 disabled: true - label: @@ -369,25 +272,15 @@ tests: commissioning timeout of PIXIT.CADMIN.CwDuration seconds using BCM" PICS: CADMIN.C.C01.Tx verification: | - On your first controller, open commissioning window using BCM + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers - Below is the example when using chip tool as controller ./chip-tool administratorcommissioning open-basic-commissioning-window 500 2 0 --timedInteractionTimeoutMs 1000 - CHIP:DMG: InvokeResponseMessage = - [1650278416.248379][11064:11069] CHIP:DMG: { - [1650278416.248436][11064:11069] CHIP:DMG: suppressResponse = false, - [1650278416.248495][11064:11069] CHIP:DMG: InvokeResponseIBs = - [1650278416.248570][11064:11069] CHIP:DMG: [ - [1650278416.248630][11064:11069] CHIP:DMG: InvokeResponseIB = - [1650278416.248718][11064:11069] CHIP:DMG: { - [1650278416.248783][11064:11069] CHIP:DMG: CommandStatusIB = - [1650278416.248860][11064:11069] CHIP:DMG: { - [1650278416.248931][11064:11069] CHIP:DMG: CommandPathIB = - [1650278416.249011][11064:11069] CHIP:DMG: { - [1650278416.249100][11064:11069] CHIP:DMG: EndpointId = 0x0, - [1650278416.249186][11064:11069] CHIP:DMG: ClusterId = 0x3c, - [1650278416.249268][11064:11069] CHIP:DMG: CommandId = 0x1, + Verify success response On DUT_CR1(CHIP-TOOL) Log + + [1650278416.249347][11064:11069] CHIP:DMG: }, [1650278416.249430][11064:11069] CHIP:DMG: [1650278416.249501][11064:11069] CHIP:DMG: StatusIB = @@ -396,15 +289,6 @@ tests: [1650278416.249738][11064:11069] CHIP:DMG: }, [1650278416.249823][11064:11069] CHIP:DMG: [1650278416.249889][11064:11069] CHIP:DMG: }, - [1650278416.249969][11064:11069] CHIP:DMG: - [1650278416.250035][11064:11069] CHIP:DMG: }, - [1650278416.250113][11064:11069] CHIP:DMG: - [1650278416.250169][11064:11069] CHIP:DMG: ], - [1650278416.250241][11064:11069] CHIP:DMG: - [1650278416.250298][11064:11069] CHIP:DMG: InteractionModelRevision = 1 - [1650278416.250355][11064:11069] CHIP:DMG: }, - [1650278416.250535][11064:11069] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1650278416.250634][11064:11069] CHIP:DMG: ICR moving to [AwaitingDe] disabled: true - label: @@ -414,27 +298,15 @@ tests: seconds using BCM" PICS: CADMIN.C.C01.Tx verification: | - On the 2nd controller using chip tool, open commissioning window using BCM before the timer expiry from above step - - ./chip-tool administratorcommissioning open-basic-commissioning-window 500 2 0 --timedInteractionTimeoutMs 1000 --commissioner-name beta + On TH_CR2 send the below command + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + ./chip-tool administratorcommissioning open-basic-commissioning-window 500 2 0 --timedInteractionTimeoutMs 1000 --commissioner-name beta + Verify that the TH_CE is rejecting the opening of second commissioning session with the response status 0x01 failure (TH (all-clusters-app) Log) - CHIP:DMG: InvokeResponseMessage = - [1650527622.373450][15824:15829] CHIP:DMG: { - [1650527622.373531][15824:15829] CHIP:DMG: suppressResponse = false, - [1650527622.373628][15824:15829] CHIP:DMG: InvokeResponseIBs = - [1650527622.373734][15824:15829] CHIP:DMG: [ - [1650527622.373817][15824:15829] CHIP:DMG: InvokeResponseIB = - [1650527622.373913][15824:15829] CHIP:DMG: { - [1650527622.374001][15824:15829] CHIP:DMG: CommandStatusIB = - [1650527622.374087][15824:15829] CHIP:DMG: { - [1650527622.374182][15824:15829] CHIP:DMG: CommandPathIB = - [1650527622.374296][15824:15829] CHIP:DMG: { - [1650527622.374382][15824:15829] CHIP:DMG: EndpointId = 0x0, - [1650527622.374490][15824:15829] CHIP:DMG: ClusterId = 0x3c, - [1650527622.374593][15824:15829] CHIP:DMG: CommandId = 0x1, + , [1650527622.374682][15824:15829] CHIP:DMG: }, [1650527622.374799][15824:15829] CHIP:DMG: [1650527622.374896][15824:15829] CHIP:DMG: StatusIB = @@ -444,24 +316,18 @@ tests: [1650527622.375320][15824:15829] CHIP:DMG: }, [1650527622.375426][15824:15829] CHIP:DMG: [1650527622.375527][15824:15829] CHIP:DMG: }, - [1650527622.375616][15824:15829] CHIP:DMG: - [1650527622.375704][15824:15829] CHIP:DMG: }, - [1650527622.375786][15824:15829] CHIP:DMG: - [1650527622.375864][15824:15829] CHIP:DMG: ], - [1650527622.375940][15824:15829] CHIP:DMG: - [1650527622.376000][15824:15829] CHIP:DMG: InteractionModelRevision = 1 - [1650527622.376058][15824:15829] CHIP:DMG: }, - [1650527622.376202][15824:15829] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x1 - [1650527622.376278][15824:15829] CHIP:TOO: Error: IM Error 0x00000601: Cluster-specific error: 0x01 disabled: true - label: "DUT_CR1 sends command to TH_CE to read WindowStatus attribute" PICS: CADMIN.C.A0000 verification: | - On first controller read window status + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool administratorcommissioning read window-status 1 0 + Verify on DUT_CR1(CHIP-TOOL) log successfully reads the WindowStatus [1658838248.887888][9273:9278] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003C Attribute 0x0000_0000 DataVersion: 2423106591 [1658838248.887959][9273:9278] CHIP:TOO: WindowStatus: 1 @@ -471,10 +337,14 @@ tests: - label: "DUT_CR1 sends command to TH_CE to read AdminFabricIndex attribute" PICS: CADMIN.C.A0001 verification: | - On first controller read AdminFabricIndex + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool administratorcommissioning read admin-fabric-index 1 0 + Verify on DUT_CR1(CHIP-TOOL) log successfully reads the AdminFabricIndex + [1658838491.852418][9309:9314] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003C Attribute 0x0000_0001 DataVersion: 2423106591 [1658838491.852516][9309:9314] CHIP:TOO: AdminFabricIndex: 1 [1658838491.852595][9309:9314] CHIP:EM: Sending Standalone Ack for MessageCounter:72459812 on exchange 35132i @@ -483,10 +353,14 @@ tests: - label: "DUT_CR1 sends command to TH_CE to read AdminVendorId attribute" PICS: CADMIN.C.A0002 verification: | - On first controller read AdminVendorId + On DUT_CR1 send the below command + + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool administratorcommissioning read admin-vendor-id 1 0 + Verify on DUT_CR1(CHIP-TOOL) log successfully reads the AdminVendorId + [1658838521.588942][9317:9322] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003C Attribute 0x0000_0002 DataVersion: 2423106591 [1658838521.589005][9317:9322] CHIP:TOO: AdminVendorId: 0 [1658838521.589079][9317:9322] CHIP:EM: Sending Standalone Ack for MessageCounter:217165763 on exchange 55683i diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml index fecdf6fc80af4d..1ba1ab6e992c8b 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml @@ -300,13 +300,13 @@ tests: commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" PICS: CADMIN.C.C00.Tx verification: | - On first controller chip tool, open commissioning window using ECM + On DUT_CR1 (chip tool) , open commissioning window using ECM - Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool pairing open-commissioning-window 1 1 300 1000 3840 - Verify Manual pairing code on TH1(all-clusters-app) Log + Verify Manual pairing code on DUT_CR1(chip-tool) Log [1635925713.966786][9695:9700] CHIP:SC: Success status report received. Session was established @@ -327,7 +327,7 @@ tests: verification: | On TH_CR2 using chip tool connect to the accessory - Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool pairing code 1 36217551633 --commissioner-name beta @@ -342,7 +342,7 @@ tests: verification: | On TH_CR2 , read fabrics list - Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers ./chip-tool operationalcredentials read fabrics 1234 0 --fabric-filtered 0 --commissioner-name beta diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_2.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_2.yaml index 7696714ea2df48..2ee488565564ac 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_2.yaml @@ -286,14 +286,15 @@ tests: Information Clusters NodeLabel mandatory attribute" PICS: BINFO.C.A0005 verification: | - On second controller read, write attribute and then read attribute to and from TH_CE + On DUT_CR2 read, write attribute and then read attribute to and from TH_CE Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers + On DUT_CR2 send the below command ./chip-tool basic write node-label te5new 2 0 --commissioner-name beta - On TH2(all-clusters-app) Log + Verify the success response On DUT_CR2(Chip-tool) Log CHIP:DMG: WriteResponseMessage = @@ -326,7 +327,7 @@ tests: ./chip-tool basic read node-label 2 0 --commissioner-name beta - On TH2(all-clusters-app) Log + Verify the NodeLabel response On DUT_CR2(Chip-tool) Log CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3061847068 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml index b5bec5f1454f45..242b9b19e7b367 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml @@ -321,7 +321,7 @@ tests: ./chip-tool pairing onnetwork 3 20202021 --commissioner-name gamma - verify you got the following message in the TH_CR3(all-clusters-app) log + verify you got the following message in the TH_CR3(Chip-tool) log CHIP:SC: PASESession timed out while waiting for a response from the peer. Expected message type was 33 CHIP:TOO: Secure Pairing Failed diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml index 1633c8b1f41e04..f39cdea4238875 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_2_2.yaml @@ -31,7 +31,7 @@ tests: - label: "Commission TH to DUT" verification: | - verification step to be updated. + disabled: true - label: "DUT reads from the TH the (0x0000) CurrentHue attribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml index a22b906e0b6a99..897c1a0ead771b 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml @@ -21,7 +21,7 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 - timeout: 150 + timeout: 200 tests: - label: "Wait for the commissioned device to be retrieved" @@ -135,7 +135,9 @@ tests: command: "readAttribute" attribute: "CurrentHue" response: - value: 120 + constraints: + minValue: 102 + maxValue: 120 - label: "Wait 5s" cluster: "DelayCommands" diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml index eddc65458d3002..d8acbf87ed991d 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_4.yaml @@ -29,6 +29,15 @@ tests: For DUT as client test cases, Chip-tool command used below are an example to verify the functionality. For certification test, we expect DUT should have a capability or way to run the equivalent command. disabled: true + - label: "Precondition" + verification: | + 1. Commission DUT to TH + + 2. Set DUT OnOff to On + + 3. DUT supports CC.C.F00(HS) + disabled: true + - label: "DUT sends MoveToHue command to TH" PICS: CC.C.C00.Rsp verification: | diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml index e55fd7d4fc45c2..dbcdd80a8c09d3 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml @@ -189,6 +189,11 @@ tests: response: value: 0 + - label: "TH sends On command to DUT" + PICS: OO.S.C01.Rsp + cluster: "On/Off" + command: "On" + - label: "TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) ColorY = 19660/0x4CCC (y=0.3) TransitionTime = 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml index 7a6236647b0019..4d88f7fd6dfb7d 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -244,13 +244,13 @@ tests: minValue: ColorTempPhysicalMinMiredsValue maxValue: ColorTemperatureMiredsStep3b - - label: "Wait 10s" + - label: "Wait 5s" cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: 5000 - label: "TH reads ColorTemperatureMireds attribute from DUT." PICS: CC.S.F04 && CC.S.A0007 && CC.S.C4c.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml index 19ec1699bb490f..734c0d62d389ba 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_4.yaml @@ -29,6 +29,15 @@ tests: For DUT as client test cases, Chip-tool command used below are an example to verify the functionality. For certification test, we expect DUT should have a capability or way to run the equivalent command. disabled: true + - label: "Precondition" + verification: | + 1. Commission DUT to TH + + 2. Set DUT OnOff to On + + 3. DUT supports CC.C.F04(CT) + disabled: true + - label: "* TH provides a server implementation of Color Control with F04(CT)=true and reasonable values of ColorTempPhysicalMinMireds (e.g. @@ -407,13 +416,3 @@ tests: [1659955633.976650][2718:2718] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0300 e=1 p=v [1659955633.976696][2718:2718] CHIP:DMG: AccessControl: allowed disabled: true - - - label: "" - verification: | - verification step to be updated. - disabled: true - - - label: "" - verification: | - verification step to be updated. - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml index 5245c74c1b6ab4..6b1fb45985681a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml @@ -21,7 +21,7 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 - timeout: 150 + timeout: 200 tests: - label: "Wait for the commissioned device to be retrieved" diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_2_2.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_2_2.yaml index 1660f93e10be43..7b1c3292a7b051 100644 --- a/src/app/tests/suites/certification/Test_TC_CGEN_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CGEN_2_2.yaml @@ -30,7 +30,7 @@ tests: numTrustedRootsOriginal" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 verify the TrustedRootCertificates entries from DUT and saves the number of list items as numTrustedRootsOriginal [1658482014.176273][26852:26857] CHIP:DMG: } [1658482014.176359][26852:26857] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687668 @@ -45,7 +45,7 @@ tests: PICS: CGEN.S.A0001 verification: | ./chip-tool generalcommissioning read basic-commissioning-info 1 0 - On TH1 verify the BasicCommissioningInfo attribute from DUT + On TH1 verify the BasicCommissioningInfo attribute from DUT and saves the MaxCumulativeFailsafeSeconds as maxFailsafe [1658482413.950617][27013:27018] CHIP:DMG: } [1658482413.950753][27013:27018] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0001 DataVersion: 2195123768 @@ -63,7 +63,7 @@ tests: PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 - On TH1 verify the ArmFailSafe command from DUT + On TH1 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty [1658482454.092676][27036:27041] CHIP:DMG: }, [1658482454.092739][27036:27041] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 @@ -81,7 +81,7 @@ tests: verification: | ./chip-tool generalcommissioning read breadcrumb 1 0 - On TH1 Verify the breadcrumb attribute value + On TH1 Verify that the breadcrumb attribute value is 1 [1658482504.991161][27058:27064] CHIP:DMG: } [1658482504.991205][27058:27064] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0000 DataVersion: 2195123769 [1658482504.991215][27058:27064] CHIP:TOO: Breadcrumb: 1 @@ -134,7 +134,7 @@ tests: "TH1 waits for PIXIT.CGEN.FailsafeExpiryLengthSeconds to ensure the failsafe timer has expired" verification: | - The expiry length is mentioned in above step as 900 secs so wait till 900secs and proced for next step + The expiry length is mentioned in above step as 900 secs so wait till 900secs and proceed for next step disabled: true - label: @@ -142,7 +142,7 @@ tests: Operational Credentials cluster" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 Verify that the number of items in the returned list is numTrustedRootsOriginal [1658483361.121153][27343:27348] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687668 [1658483361.121212][27343:27348] CHIP:TOO: TrustedRootCertificates: 1 entries [1658483361.121257][27343:27348] CHIP:TOO: [1]: 1530010100240201370324140018260480228127260580254D3A370624140018240701240801300941045B7F0549925832A9A1294607ADC4695EA3477D3DC9E584431F53A60FC57629C6A616814389C479D3E059D931600F62CA328087462582A350AD015B32756DDC69370A3501290118240260300414A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF3300514A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF318300B40E878725378AEA74A5F6CB6267CB9F7ACD0DACF26741FB24356379D850DD5F23A746281C845FD76D89E97AB188E9BF8A98047B43E3E868A5A8B8E50BAE62F116F18 @@ -154,7 +154,7 @@ tests: verification: | ./chip-tool generalcommissioning read breadcrumb 1 0 - On TH1 Verify the breadcrumb attribute value + On TH1 Verify that the breadcrumb attribute is 0 [1658483428.627422][27375:27380] CHIP:DMG: } [1658483428.627566][27375:27380] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0000 DataVersion: 2195123770 [1658483428.627610][27375:27380] CHIP:TOO: Breadcrumb: 0 @@ -163,11 +163,9 @@ tests: - label: "TH1 repeats steps 3 through 5" verification: | - TH1 repeats steps 3 through 5 - To repeat Step 3 please send below mentioned command ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 - On TH1 verify that TH reads ArmFailSafe command from DUT + On TH1 verify the ArmFailSafeResponse from DUT [1658482454.092676][27036:27041] CHIP:DMG: }, [1658482454.092739][27036:27041] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 @@ -182,7 +180,7 @@ tests: To repeat Step 4 please send below mentioned command ./chip-tool generalcommissioning read breadcrumb 1 0 - On TH1 Verify that the breadcrumb attribute value + On TH1 Verify that the breadcrumb attribute value as 1 [1658482504.991161][27058:27064] CHIP:DMG: } [1658482504.991205][27058:27064] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0000 DataVersion: 2195123769 [1658482504.991215][27058:27064] CHIP:TOO: Breadcrumb: 1 @@ -217,7 +215,7 @@ tests: PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx verification: | ./chip-tool generalcommissioning arm-fail-safe 0 1 1 0 - On TH1 verify the ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty from DUT + On TH1 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty [1658483503.637026][27397:27402] CHIP:DMG: }, [1658483503.637054][27397:27402] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 [1658483503.637074][27397:27402] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 @@ -231,7 +229,6 @@ tests: - label: "Repeat steps 8 through 9" verification: | - Repeat steps 8 through 9 To repeat Step 8 please send below mentioned command ./chip-tool operationalcredentials read trusted-root-certificates 1 0 On TH1 verify the TrustedRootCertificates entries from DUT @@ -242,7 +239,7 @@ tests: To repeat Step 9 please send below mentioned command ./chip-tool generalcommissioning read breadcrumb 1 0 - On TH1 Verify the breadcrumb attribute value + On TH1 Verify the breadcrumb attribute value as 0 [1658483428.627422][27375:27380] CHIP:DMG: } [1658483428.627566][27375:27380] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Attribute 0x0000_0000 DataVersion: 2195123770 [1658483428.627610][27375:27380] CHIP:TOO: Breadcrumb: 0 @@ -269,7 +266,7 @@ tests: PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 - On TH1 verify that ArmFailSafe command from DUT + On TH1 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as BusyWithOtherAdmin(4) [1658483622.896405][27446:27451] CHIP:DMG: }, [1658483622.896466][27446:27451] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 [1658483622.896509][27446:27451] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 @@ -390,7 +387,7 @@ tests: establishing a CASE connection, but DOES NOT send the CommissioningComplete command" verification: | - While pairing between DUT and TH2, On TH2 verify that the CASE establishment successful respose from DUT + While pairing between DUT and TH2, On TH2 verify that the CASE established successfully from DUT [1658483765.375804][8082:8087] CHIP:DMG: }, [1658483765.375942][8082:8087] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 [1658483765.376024][8082:8087] CHIP:CTL: Device returned status 0 on receiving the NOC @@ -418,13 +415,21 @@ tests: cluster using a non-fabric-filtered read" verification: | ./chip-tool operationalcredentials read nocs 1 0 - On TH1 verify the nocs entries from DUT - [1658484226.587652][27658:27663] CHIP:DMG: } - [1658484226.587884][27658:27663] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 - [1658484226.587936][27658:27663] CHIP:TOO: TrustedRootCertificates: 2 entries - [1658484226.587965][27658:27663] CHIP:TOO: [1]: 1530010100240201370324140018260480228127260580254D3A370624140018240701240801300941045B7F0549925832A9A1294607ADC4695EA3477D3DC9E584431F53A60FC57629C6A616814389C479D3E059D931600F62CA328087462582A350AD015B32756DDC69370A3501290118240260300414A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF3300514A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF318300B40E878725378AEA74A5F6CB6267CB9F7ACD0DACF26741FB24356379D850DD5F23A746281C845FD76D89E97AB188E9BF8A98047B43E3E868A5A8B8E50BAE62F116F18 - [1658484226.587994][27658:27663] CHIP:TOO: [2]: 1530010100240201370324140018260480228127260580254D3A370624140018240701240801300941042B0716ED651EBABF1B37198D6722B01C40B61ADBA286FA0BAEC566068BB98B1B752264B4510716473E7CD6CBFE771733254B6489BF02AF1EF9C448EA88F17629370A3501290118240260300414386906595DA80026C699034E368C4BF528F581AE300514386906595DA80026C699034E368C4BF528F581AE18300B404BFA1D1897E64C216DC7003245C5FB781B168A7BF152A4114017AFB8A19CE8271E22612CFBFCDC74DDFFE41683CE644B7E8F7DBE36833D91B5B233D853E47F0018 - [1658484226.588062][27658:27663] CHIP:EM: Sending Standalone Ack for MessageCounter:261685492 on exchange 62042i + On TH1 verify the nocs entries from DUT and Verify that the returned list matches nocs + [1658484050.459056][27576:27582] CHIP:DMG: } + [1658484050.459316][27576:27582] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0000 DataVersion: 527687672 + [1658484050.459362][27576:27582] CHIP:TOO: NOCs: 2 entries + [1658484050.459394][27576:27582] CHIP:TOO: [1]: { + [1658484050.459420][27576:27582] CHIP:TOO: Noc: 1530010101240201370324130118260480228127260580254D3A37062415012411011824070124080130094104D1FEC456CB358665A14971F896E876442C90E881FB9ED2CF54628F0DDF6298A0BBB4DCF1156F8A7CA469B9CB1EDFEA2138EF9C0EAC4111CF073A60EAF870AEB0370A3501280118240201360304020401183004149B8576578FF95883D7BCEBCD09C4708B29FC6210300514B92621DEFAD8BB81798C14070F4F90955057B41518300B405D4940E87ABE12A37EB8F32F251E8085A64BEB818B1A5954B568D22816534E8049CCF6A9D8FC65F5794A2BF8F138D2821284452DE96F27FC651014AF259C066D18 + [1658484050.459458][27576:27582] CHIP:TOO: Icac: 1530010100240201370324140018260480228127260580254D3A370624130118240701240801300941040DAF5C326E671D0956DE7D39ACD3D07EC88D668754941B689576A904A91D42B2706599463826738C42D692831A46C74D71CA58288AB5DECD6ABCDDABC81A78A7370A3501290118240260300414B92621DEFAD8BB81798C14070F4F90955057B415300514A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF318300B40449C941A0F5388E41E9E598B021BDA6833C2F6CEDFF77F02D27ED431D70564289AAAACC6718C398759B1D692CEE20CF179694883A6A4740F00E30EC816AE208618 + [1658484050.459476][27576:27582] CHIP:TOO: FabricIndex: 1 + [1658484050.459488][27576:27582] CHIP:TOO: } + [1658484050.459505][27576:27582] CHIP:TOO: [2]: { + [1658484050.459517][27576:27582] CHIP:TOO: Noc: + [1658484050.459528][27576:27582] CHIP:TOO: Icac: null + [1658484050.459540][27576:27582] CHIP:TOO: FabricIndex: 2 + [1658484050.459551][27576:27582] CHIP:TOO: } + [1658484050.459609][27576:27582] CHIP:EM: Sending Standalone Ack for MessageCounter:155357005 on exchange 49985i disabled: true - label: @@ -432,7 +437,7 @@ tests: cluster using a non-fabric-filtered read" verification: | ./chip-tool operationalcredentials read fabrics 1 0 --fabric-filtered 0 - On TH1 verify the fabrics list from DUT + On TH1 verify the fabrics list from DUT and Verify that the returned list matches fabrics [1658484405.562192][27710:27716] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 527687672 [1658484405.562321][27710:27716] CHIP:TOO: Fabrics: 2 entries [1658484405.562395][27710:27716] CHIP:TOO: [1]: { @@ -459,7 +464,7 @@ tests: Operational Credentials cluster" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 verify the TrustedRootCertificates entries from DUT and Verify that the returned list matches trustedroots [1658484601.144043][28501:28506] CHIP:DMG: InteractionModelRevision = 1 [1658484601.144050][28501:28506] CHIP:DMG: } [1658484601.144213][28501:28506] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 @@ -496,6 +501,7 @@ tests: 4. ./chip-cert gen-cert --type r --subject-chip-id CACACACA00000001 --valid-from "2020-10-15 14:23:43" --lifetime 7305 --out-key Chip-Root-Key.txt --out Chip-Root-Cert.txt --out-format chip-hex 5. cat Chip-Root-Cert.txt + While adding new add-trusted-root-certificate please use the above generated new root key ./chip-tool operationalcredentials add-trusted-root-certificate 04614D01D2897082D7F85832CE00AC787A5A221A6F7B19C4202C069E3D70DDC615E5B9436919266360AC847F2FAB3EAEE3902B43812A13D18C061CC5028EADB775583DCB1008E4CEBFF810EEB2BC60FF7A3CF954C57101798443DA39E75F5FFDEA 2 0 --commissioner-name beta On TH2 verify that DUT responds with FAILSAFE_REQUIRED @@ -512,20 +518,26 @@ tests: cluster using a non-fabric-filtered read" verification: | ./chip-tool operationalcredentials read fabrics 1 0 --fabric-filtered 0 - On TH1 verify the fabrics list from DUT - [1658484969.071455][28631:28636] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0000 DataVersion: 527687672 - [1658484969.071527][28631:28636] CHIP:TOO: NOCs: 2 entries - [1658484969.071587][28631:28636] CHIP:TOO: [1]: { - [1658484969.071625][28631:28636] CHIP:TOO: Noc: 1530010101240201370324130118260480228127260580254D3A37062415012411011824070124080130094104D1FEC456CB358665A14971F896E876442C90E881FB9ED2CF54628F0DDF6298A0BBB4DCF1156F8A7CA469B9CB1EDFEA2138EF9C0EAC4111CF073A60EAF870AEB0370A3501280118240201360304020401183004149B8576578FF95883D7BCEBCD09C4708B29FC6210300514B92621DEFAD8BB81798C14070F4F90955057B41518300B405D4940E87ABE12A37EB8F32F251E8085A64BEB818B1A5954B568D22816534E8049CCF6A9D8FC65F5794A2BF8F138D2821284452DE96F27FC651014AF259C066D18 - [1658484969.071669][28631:28636] CHIP:TOO: Icac: 1530010100240201370324140018260480228127260580254D3A370624130118240701240801300941040DAF5C326E671D0956DE7D39ACD3D07EC88D668754941B689576A904A91D42B2706599463826738C42D692831A46C74D71CA58288AB5DECD6ABCDDABC81A78A7370A3501290118240260300414B92621DEFAD8BB81798C14070F4F90955057B415300514A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF318300B40449C941A0F5388E41E9E598B021BDA6833C2F6CEDFF77F02D27ED431D70564289AAAACC6718C398759B1D692CEE20CF179694883A6A4740F00E30EC816AE208618 - [1658484969.071696][28631:28636] CHIP:TOO: FabricIndex: 1 - [1658484969.071712][28631:28636] CHIP:TOO: } - [1658484969.071734][28631:28636] CHIP:TOO: [2]: { - [1658484969.071750][28631:28636] CHIP:TOO: Noc: - [1658484969.071766][28631:28636] CHIP:TOO: Icac: null - [1658484969.071782][28631:28636] CHIP:TOO: FabricIndex: 2 - [1658484969.071796][28631:28636] CHIP:TOO: } - [1658484969.071889][28631:28636] CHIP:EM: Sending Standalone Ack for MessageCounter:202454119 on exchange 59946i + On TH1 verify the fabrics list from DUT and Verify that the returned list includes an additional entry for TH2 when compared to fabrics + [1658484405.562192][27710:27716] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 527687672 + [1658484405.562321][27710:27716] CHIP:TOO: Fabrics: 2 entries + [1658484405.562395][27710:27716] CHIP:TOO: [1]: { + [1658484405.562428][27710:27716] CHIP:TOO: RootPublicKey: 045B7F0549925832A9A1294607ADC4695EA3477D3DC9E584431F53A60FC57629C6A616814389C479D3E059D931600F62CA328087462582A350AD015B32756DDC69 + [1658484405.562467][27710:27716] CHIP:TOO: VendorId: 65521 + [1658484405.562487][27710:27716] CHIP:TOO: FabricId: 1 + [1658484405.562505][27710:27716] CHIP:TOO: NodeId: 1 + [1658484405.562523][27710:27716] CHIP:TOO: Label: + [1658484405.562543][27710:27716] CHIP:TOO: FabricIndex: 1 + [1658484405.562561][27710:27716] CHIP:TOO: } + [1658484405.562594][27710:27716] CHIP:TOO: [2]: { + [1658484405.562621][27710:27716] CHIP:TOO: RootPublicKey: 042B0716ED651EBABF1B37198D6722B01C40B61ADBA286FA0BAEC566068BB98B1B752264B4510716473E7CD6CBFE771733254B6489BF02AF1EF9C448EA88F17629 + [1658484405.562643][27710:27716] CHIP:TOO: VendorId: 65521 + [1658484405.562662][27710:27716] CHIP:TOO: FabricId: 1 + [1658484405.562686][27710:27716] CHIP:TOO: NodeId: 2 + [1658484405.562735][27710:27716] CHIP:TOO: Label: + [1658484405.562753][27710:27716] CHIP:TOO: FabricIndex: 2 + [1658484405.562771][27710:27716] CHIP:TOO: } + [1658484405.562881][27710:27716] CHIP:EM: Sending Standalone Ack for MessageCounter:161805931 on exchange 9158i disabled: true - label: @@ -534,8 +546,8 @@ tests: value as 1" PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx verification: | - ./chip-tool generalcommissioning arm-fail-safe 60 1 1 0 - On TH1 verify the ArmFailSafe command from DUT + ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 + On TH1 Verify that DUT responds with ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty [1658485224.066397][28732:28737] CHIP:DMG: InteractionModelRevision = 1 [1658485224.066407][28732:28737] CHIP:DMG: }, [1658485224.066441][28732:28737] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 @@ -553,6 +565,18 @@ tests: TH1. TH1 sends an AddTrustedRootCertificate command to the Node Operational Credentials cluster to install this new certificate" verification: | + To generate TrustedRootCertificate, need to buld chip-cert in connectedhomeip by giving below mentioned commands + 1. gn gen --check out/debug + 2. ninja -v -C out/debug chip-cert + Once build completes + 3. cd out/debug + 4. ./chip-cert gen-cert --type r --subject-chip-id CACACACA00000001 --valid-from "2020-10-15 14:23:43" --lifetime 7305 --out-key Chip-Root-Key.txt --out Chip-Root-Cert.txt --out-format chip-hex + 5. cat Chip-Root-Cert.txt + + + While adding new add-trusted-root-certificate please use the above generated new root key + + ./chip-tool operationalcredentials add-trusted-root-certificate hex:1530010828c376ebc17f21512402013703271401000000cacacaca182604ef171b2726056eb5b94c3706271401000000cacacaca182407012408013009410452c19fd9d329a738fd65722a8309fa68bcaa9ffe87d8114b802c922e5066d0b2f0573b89b38bf98fc9c424ab8ffdabcb18d42e623d82a02d0ca0c062ccadb4bc370a350129011824026030041457934de5405e9a40eacb86ee647e583141ae78f430051457934de5405e9a40eacb86ee647e583141ae78f418300b40a0b0d57bddbc7bcf44480a8b7bd0231d54ccacd68d90efb67b7aa3206adbd268725092992a0388c8e934504178613c5b932d422eed7463f38fd82aaa429b574a18 1 0 On TH1 verify that DUT responds as success @@ -570,7 +594,7 @@ tests: verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 verify the TrustedRootCertificates entries from DUT and Verify that the number of items in the returned list is numTrustedRootsOriginal + 1 [1658485696.739931][28920:28925] CHIP:DMG: InteractionModelRevision = 1 [1658485696.739936][28920:28925] CHIP:DMG: } [1658485696.740122][28920:28925] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 @@ -609,7 +633,7 @@ tests: Operational Credentials cluster" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify that TH reads TrustedRootCertificates entries from DUT + On TH1 verify that TH reads TrustedRootCertificates entries from DUT and Verify that the number of entries in the returned list is still numTrustedRootsOriginal + 1 [1658486366.493185][29315:29320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 [1658486366.493236][29315:29320] CHIP:TOO: TrustedRootCertificates: 2 entries [1658486366.493266][29315:29320] CHIP:TOO: [1]: 1530010100240201370324140018260480228127260580254D3A370624140018240701240801300941045B7F0549925832A9A1294607ADC4695EA3477D3DC9E584431F53A60FC57629C6A616814389C479D3E059D931600F62CA328087462582A350AD015B32756DDC69370A3501290118240260300414A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF3300514A1BBCB2500D57101023ACB4AFD7EBD4FC0487AF318300B40E878725378AEA74A5F6CB6267CB9F7ACD0DACF26741FB24356379D850DD5F23A746281C845FD76D89E97AB188E9BF8A98047B43E3E868A5A8B8E50BAE62F116F18 @@ -624,7 +648,7 @@ tests: PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 2 0 --commissioner-name beta - On TH2 verify the ArmFailSafe command from DUT + On TH2 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as BusyWithOtherAdmin [1658486289.473526][8200:8205] CHIP:DMG: InteractionModelRevision = 1 [1658486289.473563][8200:8205] CHIP:DMG: }, [1658486289.473639][8200:8205] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 @@ -660,7 +684,7 @@ tests: PICS: CGEN.S.C00.Rsp verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 - On TH1 verify the ArmFailSafe command from DUT + On TH1 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty [1658486418.024554][29343:29348] CHIP:DMG: InteractionModelRevision = 1 [1658486418.024559][29343:29348] CHIP:DMG: }, [1658486418.024588][29343:29348] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 @@ -692,7 +716,7 @@ tests: 4. ./chip-cert gen-cert --type r --subject-chip-id CACACACA00000001 --valid-from "2020-10-15 14:23:43" --lifetime 7305 --out-key Chip-Root-Key.txt --out Chip-Root-Cert.txt --out-format chip-hex 5. cat Chip-Root-Cert.txt - + While adding new add-trusted-root-certificate please use the above generated new root key ./chip-tool operationalcredentials add-trusted-root-certificate hex:1530010828c376ebc17f21512402013703271401000000cacacaca182604ef171b2726056eb5b94c3706271401000000cacacaca182407012408013009410452c19fd9d329a738fd65722a8309fa68bcaa9ffe87d8114b802c922e5066d0b2f0573b89b38bf98fc9c424ab8ffdabcb18d42e623d82a02d0ca0c062ccadb4bc370a350129011824026030041457934de5405e9a40eacb86ee647e583141ae78f430051457934de5405e9a40eacb86ee647e583141ae78f418300b40a0b0d57bddbc7bcf44480a8b7bd0231d54ccacd68d90efb67b7aa3206adbd268725092992a0388c8e934504178613c5b932d422eed7463f38fd82aaa429b574a18 1 0 @@ -708,7 +732,7 @@ tests: Operational Credentials cluster" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 Verify that the number of items in the returned list is numTrustedRootsOriginal + 1 [1658487613.357548][30232:30237] CHIP:DMG: } [1658487613.358000][30232:30237] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 @@ -734,7 +758,7 @@ tests: PICS: CGEN.S.C00.Rsp verification: | ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 - On TH1 verify the ArmFailSafe command from DUT + On TH1 Verify that the DUT responds with ArmFailSafeResponse with ErrorCode as "OK"(0) and DebugText argument is of type string with max length 512 or empty [1658487663.593485][30268:30273] CHIP:DMG: InteractionModelRevision = 1 [1658487663.593506][30268:30273] CHIP:DMG: }, @@ -762,7 +786,7 @@ tests: Operational Credentials cluster" verification: | ./chip-tool operationalcredentials read trusted-root-certificates 1 0 - On TH1 verify the TrustedRootCertificates entries from DUT + On TH1 Verify that the number of items in the returned list is numTrustedRootsOriginal [1658489869.278413][31188:31193] CHIP:DMG: } [1658489869.278997][31188:31193] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0004 DataVersion: 527687672 [1658489869.279090][31188:31193] CHIP:TOO: TrustedRootCertificates: 2 entries diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_2_4.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_2_4.yaml index 7c9a3cff918b98..7cfc6e6f1fb871 100644 --- a/src/app/tests/suites/certification/Test_TC_CGEN_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CGEN_2_4.yaml @@ -28,7 +28,7 @@ config: tests: - label: "Start the commissioning process of TH1 on DUT" verification: | - verification step to be updated. + disabled: true - label: @@ -36,12 +36,12 @@ tests: DUT" PICS: CGEN.S.C04.Rsp && CGEN.S.C05.Tx verification: | - Not testable as the execution is in PASE session + Out of scope for V1.0 disabled: true - label: "Complete the Commission for TH1 and DUT" verification: | - verification step to be updated. + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml index 968242ff11c7db..c96b2cd8d500c4 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_11.yaml @@ -26,6 +26,61 @@ config: endpoint: 0 tests: + - label: "Commission TH and DUT over BLE to setup the Wi-Fi" + verification: | + All the below commands are to check the Pre-Condition note mentioned in D column. + disabled: true + + - label: + "The cluster Identifier 49 (0x0031) is present in the ServerList + attribute" + verification: | + ./chip-tool descriptor read server-list 1 0 + + Verify the "descriptor" on the TH(Chip-tool) log + + [1653478221.662178][27661:27666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1626448966 + [1653478221.662314][27661:27666] CHIP:TOO: server list: 26 entries + [1653478221.662350][27661:27666] CHIP:TOO: [1]: 3 + [1653478221.662376][27661:27666] CHIP:TOO: [2]: 4 + [1653478221.662401][27661:27666] CHIP:TOO: [3]: 29 + [1653478221.662426][27661:27666] CHIP:TOO: [4]: 30 + [1653478221.662450][27661:27666] CHIP:TOO: [5]: 31 + [1653478221.662474][27661:27666] CHIP:TOO: [6]: 40 + [1653478221.662499][27661:27666] CHIP:TOO: [7]: 42 + [1653478221.662523][27661:27666] CHIP:TOO: [8]: 43 + [1653478221.662548][27661:27666] CHIP:TOO: [9]: 44 + [1653478221.662572][27661:27666] CHIP:TOO: [10]: 45 + [1653478221.662596][27661:27666] CHIP:TOO: [11]: 46 + [1653478221.662621][27661:27666] CHIP:TOO: [12]: 47 + [1653478221.662645][27661:27666] CHIP:TOO: [13]: 48 + [1653478221.662669][27661:27666] CHIP:TOO: [14]: 49 + [1653478221.662693][27661:27666] CHIP:TOO: [15]: 50 + [1653478221.662717][27661:27666] CHIP:TOO: [16]: 51 + [1653478221.662742][27661:27666] CHIP:TOO: [17]: 52 + [1653478221.662766][27661:27666] CHIP:TOO: [18]: 53 + [1653478221.662791][27661:27666] CHIP:TOO: [19]: 54 + [1653478221.662815][27661:27666] CHIP:TOO: [20]: 55 + [1653478221.662839][27661:27666] CHIP:TOO: [21]: 60 + [1653478221.662863][27661:27666] CHIP:TOO: [22]: 62 + [1653478221.662888][27661:27666] CHIP:TOO: [23]: 63 + [1653478221.662912][27661:27666] CHIP:TOO: [24]: 64 + [1653478221.662937][27661:27666] CHIP:TOO: [25]: 65 + [1653478221.662962][27661:27666] CHIP:TOO: [26]: 1029 + disabled: true + + - label: "The FeatureMap attribute value is 1" + verification: | + ./chip-tool networkcommissioning read feature-map 1 0 + + Verify the "feature-map" on the TH(Chip-tool) log + + [1653478255.044168][27668:27673] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 3424382863 + [1653478255.044240][27668:27673] CHIP:TOO: FeatureMap: 1 + [1653478255.044352][27668:27673] CHIP:EM: Sending Standalone Ack for MessageCounter:8977728 on exchange 59777i + [1653478255.044428][27668:27673] CHIP:IN: Prepared secure message 0xffffa77ed958 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 5 + disabled: true + - label: "TH sends ArmFailSafe command to the DUT" verification: | ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 @@ -70,7 +125,7 @@ tests: PIXIT.CNET.WIFI_ 1ST_ACCESSPOINT _SSID and Breadcrumb field set to 1" PICS: CNET.S.C04.Rsp && CNET.S.C05.Tx verification: | - ./chip-tool networkcommissioning remove-network hex: 1 0 + ./chip-tool networkcommissioning remove-network hex: 1 0 Below is an example: @@ -123,12 +178,12 @@ tests: disabled: true - label: - "TH sends ConnectNetwork command to the DUT with NetworkID - field set to PIXIT.CNET.WIFI_ 2ND_ACCESSPOIN T_SSID - and Breadcrumb field set to 2" + "TH sends ConnectNetwork command to the DUT with NetworkID field set + to PIXIT.CNET.WIFI_ 2ND_ACCESSPOIN T_SSID and Breadcrumb field set to + 2" PICS: CNET.S.C06.Rsp verification: | - ./chip-tool networkcommissioning connect-network hex: 1 0 + ./chip-tool networkcommissioning connect-network hex: 1 0 Below is an example: @@ -150,7 +205,7 @@ tests: "TH changes its WiFi connection to PIXIT.CNET.WIFI_2ND_ACCESSPOINT_SSID" verification: | - verification step to be updated. + Make sure TH also joins the 2nd Wifi network to have a connectivity to the DUT. disabled: true - label: @@ -188,6 +243,8 @@ tests: fail-safe and is expected to cause the changes of configuration to NetworkCommissi oning cluster done so far to be reverted." verification: | + Mark as not applicable and proceed to next step + ./chip-tool generalcommissioning arm-fail-safe 0 0 1 0 Verify "ArmFailSafeResponse" on the TH(Chip-tool) Log: @@ -204,13 +261,15 @@ tests: "TH changes its WiFi connection to PIXIT.CNET.WIFI_ 1ST_ACCESSPOINT _SSID" verification: | - verification step to be updated. + Mark as not applicable and proceed to next step disabled: true - label: "TH discovers and connects to DUT on the PIXIT.CNET.WIFI_ 1ST_ACCESSPOINT _SSID operational network" verification: | + Mark as not applicable and proceed to next step + ./chip-tool networkcommissioning read networks 1 0 Verify "Networks entiries and its status" on the TH(Chip-tool) Log: @@ -224,7 +283,9 @@ tests: "TH sends ArmFailSafe command to the DUT with ExpiryLengthSeco nds set to 900" verification: | - ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 + Mark as not applicable and proceed to next step + + ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 Verify "ArmFailSafeResponse" on the TH(Chip-tool) Log: @@ -242,7 +303,9 @@ tests: and Breadcrumb field set to 1" PICS: CNET.S.C04.Rsp && CNET.S.C05.Tx verification: | - ./chip-tool networkcommissioning remove-network hex: 1 0 + Mark as not applicable and proceed to next step + + ./chip-tool networkcommissioning remove-network hex: 1 0 Below is an example: ./chip-tool networkcommissioning remove-network hex:47524C50726976617465 1 0 --Breadcrumb 1 @@ -265,7 +328,9 @@ tests: Breadcrumb field set to 1" PICS: CNET.S.C02.Rsp && CNET.S.C05.Tx verification: | - ./chip-tool networkcommissioning add-or-update-wi-fi-network-network hex: 1 0 + Mark as not applicable and proceed to next step + + ./chip-tool networkcommissioning add-or-update-wi-fi-network-network hex: 1 0 Below is an example: ./chip-tool networkcommissioning add-or-update-wi-fi-network Sbee_Moto Sunsuraj 1 0 --Breadcrumb 1 ( second network) diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml index db445de96a72be..e8aad2ab6e3875 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_14.yaml @@ -97,6 +97,8 @@ tests: "TH sends ArmFailSafe command to the DUT with ExpiryLengthSeco nds set to 900" verification: | + ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -106,6 +108,8 @@ tests: entries as NumNetworks" PICS: CNET.S.A0001 verification: | + ./chip-tool network-commissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -123,6 +127,8 @@ tests: "TH calculates the midpoint of the network list as floor((MaxNetwor ksValue + 1)/2) and saves as Midpoint" verification: | + ./chip-tool networkcommissioning add-or-update-thread-network hex:1011101122222229 1 0 --Breadcrumb 1 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -131,6 +137,9 @@ tests: "TH sends ArmFailSafe command to the DUT with the ExpiryLengthSeco nds field set to 900" verification: | + ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 + + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -142,6 +151,8 @@ tests: credentials are NOT required to be connectable." PICS: CNET.S.C02.Rsp && CNET.S.C05.Tx verification: | + ./chip-tool networkcommissioning add-or-update-thread-network hex:1011101122222229 1 0 --Breadcrumb 1 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -151,6 +162,8 @@ tests: as OriginalNetworkL ist" PICS: CNET.S.A0001 verification: | + ./chip-tool networkcommissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -162,6 +175,8 @@ tests: is MaxNetwo rksValue 3. Breadcrum b is 2" PICS: CNET.S.C08.Rsp && CNET.S.C05.Tx verification: | + ./chip-tool network-commissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -169,6 +184,8 @@ tests: - label: "TH reads Breadcumb attribute from the General Commissioning Cluster" verification: | + ./chip-tool generalcommissioning read breadcrumb 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -187,6 +204,8 @@ tests: - label: "TH reads Breadcumb attribute from the General Commissioning Cluster" verification: | + ./chip-tool generalcommissioning read breadcrumb 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -198,6 +217,8 @@ tests: is Midpoint 3. Breadcrum b is 2" PICS: CNET.S.C08.Rsp && CNET.S.C05.Tx verification: | + ./chip-tool networkcommissioning reorder-network hex:1011101122222229 1 0 --Breadcrumb 1 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -206,6 +227,8 @@ tests: "TH reads Breadcumb attribute from the General Commissioning Cluster" verification: | + ./chip-tool generalcommissioning read breadcrumb 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -213,6 +236,8 @@ tests: - label: "TH reads Networks attribute list from the DUT" PICS: CNET.S.A0001 verification: | + ./chip-tool network-commissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -221,6 +246,8 @@ tests: "TH sends ArmFailSafe command to the DUT with ExpiryLengthSeco nds set to 0" verification: | + ./chip-tool generalcommissioning arm-fail-safe 0 0 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -228,6 +255,8 @@ tests: - label: "TH reads Networks attribute list from the DUT" PICS: CNET.S.A0001 verification: | + ./chip-tool network-commissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -236,6 +265,9 @@ tests: "TH sends ArmFailSafe command to the DUT with ExpiryLengthSeco nds set to 900" verification: | + ./chip-tool generalcommissioning arm-fail-safe 900 0 1 0 + + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -265,6 +297,8 @@ tests: - label: "TH sends the CommissioningCo mplete command to the DUT" verification: | + ./chip-tool generalcommissioning CommissioningComplete 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -273,6 +307,8 @@ tests: "TH sends ArmFailSafe command to the DUT with ExpiryLengthSeco nds set to 0" verification: | + ./chip-tool generalcommissioning arm-fail-safe 0 0 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true @@ -280,6 +316,8 @@ tests: - label: "TH reads Networks attribute list from the DUT" PICS: CNET.S.A0001 verification: | + ./chip-tool network-commissioning read networks 1 0 + The test case is not verifiable in RPI platform. As MaxNetworks value is 1 but expected is 4 ( Pre-Condition) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml index 1314b35ff91704..c60e429d5b53b4 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_2.yaml @@ -14,7 +14,8 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 12.4.1. [TC-CNET-4.1] [Wi-Fi] Verification for attributes check [DUT-Server] + 12.4.2. [TC-CNET-4.2] [Thread] Verification for attributes check + [DUT-Server] PICS: - CNET.S.F01 diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml index 0d5946a130707a..7be01ff5a7fe9d 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_22.yaml @@ -28,26 +28,26 @@ config: tests: - label: "DUT supports CNET.S.F01(TH)" verification: | - verification step to be updated. + disabled: true - label: "DUT has a Network Commissioning cluster on endpoint PIXIT.CNET.ENDPOINT_THREAD with FeatureMap attribute of 2" verification: | - verification step to be updated. + disabled: true - label: "DUT is commissioned on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET" verification: | - verification step to be updated. + disabled: true - label: "TH can communicate with the DUT on PIXIT.CNET.THREAD_1ST_OPERATIONALDATASET" verification: | - verification step to be updated. + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml index 5ca63fec18f1fc..f74c55e8283bfa 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_5.yaml @@ -35,7 +35,7 @@ tests: "The cluster Identifier 49 (0x0031) is present in the ServerList attribute" verification: | - verification step to be updated. + disabled: true - label: "The FeatureMap attribute value is 1" diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_5.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_5.yaml index 717ee8f06dc1d0..19cb85a9ef2784 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_5.yaml @@ -101,19 +101,21 @@ tests: CSRNonce is saved as csr_nonce_returned if present, vendor_reserved fields are saved as vendor1, vendor2 and vendor3" verification: | - verification step to be updated. disabled: true - label: "TH1 creates nocsr_tbs = nosr_elements_message || attestation_challenge" verification: | - verification step to be updated. + disabled: true - - label: "" + - label: + "if vendor_reserved fields are present in the noscr_elements_message, + TH1 verifies that attestation_challenge does not appear in any of the + vendor fields" verification: | - verification step to be updated. + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_7.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_7.yaml index f0e874045bb00b..124b0f9e0134ea 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_7.yaml @@ -24,9 +24,9 @@ config: endpoint: 0 tests: - - label: "Pre-Conditions TH only has official PAAs from DCL" + - label: "Pre-Conditions" verification: | - verification step to be updated. + TH only has official PAAs from DCL disabled: true - label: "Commission DUT1 to TH fabric" diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_2.yaml index 3a880dd487816d..b31816c2524a44 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_2.yaml @@ -29,6 +29,11 @@ tests: Chip-tool command used below are an example to verify the DUT as client test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. disabled: true + - label: "Pre-Conditions" + verification: | + Commission TH to DUT + disabled: true + - label: "DUT reads DeviceTypeList from TH." PICS: DESC.C.A0000 verification: | @@ -38,12 +43,23 @@ tests: verify the " device-list response" on the TH (all-cluster-app) log: - [1657095358.858070][3443:3448] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2880250959 - [1657095358.858130][3443:3448] CHIP:TOO: device list: 1 entries - [1657095358.858213][3443:3448] CHIP:TOO: [1]: { - [1657095358.858255][3443:3448] CHIP:TOO: Type: 22 - [1657095358.858283][3443:3448] CHIP:TOO: Revision: 1 - [1657095358.858310][3443:3448] CHIP:TOO: } + [1660049876.238277][36511:36511] CHIP:IM: Received Read request + [1660049876.238408][36511:36511] CHIP:DMG: ReadRequestMessage = + [1660049876.238477][36511:36511] CHIP:DMG: { + [1660049876.238525][36511:36511] CHIP:DMG: AttributePathIBs = + [1660049876.238602][36511:36511] CHIP:DMG: [ + [1660049876.238677][36511:36511] CHIP:DMG: AttributePathIB = + [1660049876.238766][36511:36511] CHIP:DMG: { + [1660049876.238857][36511:36511] CHIP:DMG: Endpoint = 0x0, + [1660049876.238963][36511:36511] CHIP:DMG: Cluster = 0x1d, + [1660049876.239062][36511:36511] CHIP:DMG: Attribute = 0x0000_0000, + [1660049876.239156][36511:36511] CHIP:DMG: } + [1660049876.239246][36511:36511] CHIP:DMG: + [1660049876.239331][36511:36511] CHIP:DMG: ], + [1660049876.239408][36511:36511] CHIP:DMG: + [1660049876.239490][36511:36511] CHIP:DMG: isFabricFiltered = true, + [1660049876.239568][36511:36511] CHIP:DMG: InteractionModelRevision = 1 + [1660049876.239639][36511:36511] CHIP:DMG: }, disabled: true - label: "DUT reads ServerList from the TH" @@ -54,33 +70,23 @@ tests: verify the " server-list response" on the TH (all-cluster-app) log: [1657095388.496869][3451:3456] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 2880250959 - [1657095388.496964][3451:3456] CHIP:TOO: server list: 26 entries - [1657095388.496996][3451:3456] CHIP:TOO: [1]: 3 - [1657095388.497023][3451:3456] CHIP:TOO: [2]: 4 - [1657095388.497049][3451:3456] CHIP:TOO: [3]: 29 - [1657095388.497074][3451:3456] CHIP:TOO: [4]: 30 - [1657095388.497098][3451:3456] CHIP:TOO: [5]: 31 - [1657095388.497123][3451:3456] CHIP:TOO: [6]: 40 - [1657095388.497147][3451:3456] CHIP:TOO: [7]: 42 - [1657095388.497172][3451:3456] CHIP:TOO: [8]: 43 - [1657095388.497197][3451:3456] CHIP:TOO: [9]: 44 - [1657095388.497221][3451:3456] CHIP:TOO: [10]: 45 - [1657095388.497246][3451:3456] CHIP:TOO: [11]: 46 - [1657095388.497271][3451:3456] CHIP:TOO: [12]: 47 - [1657095388.497295][3451:3456] CHIP:TOO: [13]: 48 - [1657095388.497320][3451:3456] CHIP:TOO: [14]: 49 - [1657095388.497344][3451:3456] CHIP:TOO: [15]: 50 - [1657095388.497369][3451:3456] CHIP:TOO: [16]: 51 - [1657095388.497394][3451:3456] CHIP:TOO: [17]: 52 - [1657095388.497418][3451:3456] CHIP:TOO: [18]: 53 - [1657095388.497443][3451:3456] CHIP:TOO: [19]: 54 - [1657095388.497468][3451:3456] CHIP:TOO: [20]: 55 - [1657095388.497493][3451:3456] CHIP:TOO: [21]: 60 - [1657095388.497517][3451:3456] CHIP:TOO: [22]: 62 - [1657095388.497542][3451:3456] CHIP:TOO: [23]: 63 - [1657095388.497567][3451:3456] CHIP:TOO: [24]: 64 - [1657095388.497591][3451:3456] CHIP:TOO: [25]: 65 - [1657095388.497616][3451:3456] CHIP:TOO: [26]: 1029 + [1660049905.629940][36511:36511] CHIP:IM: Received Read request + [1660049905.630388][36511:36511] CHIP:DMG: ReadRequestMessage = + [1660049905.630834][36511:36511] CHIP:DMG: { + [1660049905.631175][36511:36511] CHIP:DMG: AttributePathIBs = + [1660049905.631815][36511:36511] CHIP:DMG: [ + [1660049905.632509][36511:36511] CHIP:DMG: AttributePathIB = + [1660049905.633291][36511:36511] CHIP:DMG: { + [1660049905.634105][36511:36511] CHIP:DMG: Endpoint = 0x0, + [1660049905.634422][36511:36511] CHIP:DMG: Cluster = 0x1d, + [1660049905.634714][36511:36511] CHIP:DMG: Attribute = 0x0000_0001, + [1660049905.635065][36511:36511] CHIP:DMG: } + [1660049905.635366][36511:36511] CHIP:DMG: + [1660049905.635466][36511:36511] CHIP:DMG: ], + [1660049905.635925][36511:36511] CHIP:DMG: + [1660049905.636339][36511:36511] CHIP:DMG: isFabricFiltered = true, + [1660049905.636431][36511:36511] CHIP:DMG: InteractionModelRevision = 1 + [1660049905.636651][36511:36511] CHIP:DMG: }, disabled: true - label: "DUT reads ClientList from the TH" @@ -89,10 +95,23 @@ tests: ./chip-tool descriptor read client-list 1 0 verify the " client-list response" on the TH (all-cluster-app) log: - - [1657095415.492647][3459:3464] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 2880250959 - [1657095415.492717][3459:3464] CHIP:TOO: client list: 1 entries - [1657095415.492749][3459:3464] CHIP:TOO: [1]: 41 + [1660049929.094511][36511:36511] CHIP:IM: Received Read request + [1660049929.094621][36511:36511] CHIP:DMG: ReadRequestMessage = + [1660049929.094659][36511:36511] CHIP:DMG: { + [1660049929.094680][36511:36511] CHIP:DMG: AttributePathIBs = + [1660049929.094706][36511:36511] CHIP:DMG: [ + [1660049929.094729][36511:36511] CHIP:DMG: AttributePathIB = + [1660049929.094761][36511:36511] CHIP:DMG: { + [1660049929.094788][36511:36511] CHIP:DMG: Endpoint = 0x0, + [1660049929.094821][36511:36511] CHIP:DMG: Cluster = 0x1d, + [1660049929.094855][36511:36511] CHIP:DMG: Attribute = 0x0000_0002, + [1660049929.094886][36511:36511] CHIP:DMG: } + [1660049929.094914][36511:36511] CHIP:DMG: + [1660049929.094940][36511:36511] CHIP:DMG: ], + [1660049929.094966][36511:36511] CHIP:DMG: + [1660049929.094993][36511:36511] CHIP:DMG: isFabricFiltered = true, + [1660049929.095019][36511:36511] CHIP:DMG: InteractionModelRevision = 1 + [1660049929.095041][36511:36511] CHIP:DMG: }, disabled: true - label: "DUT reads PartsList from the TH" @@ -102,8 +121,21 @@ tests: verify the " parts-list response" on the TH (all-cluster-app) log: - [1657095439.967554][3470:3475] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 2880250959 - [1657095439.967633][3470:3475] CHIP:TOO: parts list: 2 entries - [1657095439.967668][3470:3475] CHIP:TOO: [1]: 1 - [1657095439.967697][3470:3475] CHIP:TOO: [2]: 2 + [1660049948.708577][36511:36511] CHIP:IM: Received Read request + [1660049948.708668][36511:36511] CHIP:DMG: ReadRequestMessage = + [1660049948.708701][36511:36511] CHIP:DMG: { + [1660049948.708723][36511:36511] CHIP:DMG: AttributePathIBs = + [1660049948.708748][36511:36511] CHIP:DMG: [ + [1660049948.708771][36511:36511] CHIP:DMG: AttributePathIB = + [1660049948.708832][36511:36511] CHIP:DMG: { + [1660049948.708925][36511:36511] CHIP:DMG: Endpoint = 0x0, + [1660049948.709818][36511:36511] CHIP:DMG: Cluster = 0x1d, + [1660049948.710771][36511:36511] CHIP:DMG: Attribute = 0x0000_0003, + [1660049948.711682][36511:36511] CHIP:DMG: } + [1660049948.712502][36511:36511] CHIP:DMG: + [1660049948.713252][36511:36511] CHIP:DMG: ], + [1660049948.713823][36511:36511] CHIP:DMG: + [1660049948.714389][36511:36511] CHIP:DMG: isFabricFiltered = true, + [1660049948.714998][36511:36511] CHIP:DMG: InteractionModelRevision = 1 + [1660049948.715573][36511:36511] CHIP:DMG: }, disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml index 671b6cb71c911e..288434637e8088 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml @@ -154,9 +154,63 @@ tests: - label: "TH reads ActiveHardwareFaults attribute value from DUT." verification: | ./chip-tool generaldiagnostics read active-hardware-faults 1 0 + On TH(chip-tool), verify that ActiveHardwareFaults attribute the attribute response should be empty. But when a hardware fault occurs, the return attribute value must match the value listed in the HardwareFault ENUM table 11.11.6.1 + [1654682785.894724][33006:33011] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0005 DataVersion: 804003636 [1654682785.894846][33006:33011] CHIP:TOO: ActiveHardwareFaults: 0 entries [1654682785.894952][33006:33011] CHIP:EM: Sending Standalone Ack for MessageCounter:30803984 on exchange 62441i + + + Please use Interactive mode to Verify subscription test cases + Here the command to enter interactive mode:-- ./chip-tool interactive start + + Verify in TH(chip-tool) log + + [1657539676.878976][10068:10073] CHIP:DMG: ReportDataMessage = + [1657539676.879047][10068:10073] CHIP:DMG: { + [1657539676.879109][10068:10073] CHIP:DMG: SubscriptionId = 0xd985fd71, + [1657539676.879215][10068:10073] CHIP:DMG: AttributeReportIBs = + [1657539676.879302][10068:10073] CHIP:DMG: [ + [1657539676.879366][10068:10073] CHIP:DMG: AttributeReportIB = + [1657539676.879490][10068:10073] CHIP:DMG: { + [1657539676.879588][10068:10073] CHIP:DMG: AttributeDataIB = + [1657539676.879833][10068:10073] CHIP:DMG: { + [1657539676.879952][10068:10073] CHIP:DMG: DataVersion = 0x3dc6b482, + [1657539676.880061][10068:10073] CHIP:DMG: AttributePathIB = + [1657539676.880175][10068:10073] CHIP:DMG: { + [1657539676.880291][10068:10073] CHIP:DMG: Endpoint = 0x0, + [1657539676.880410][10068:10073] CHIP:DMG: Cluster = 0x33, + [1657539676.880528][10068:10073] CHIP:DMG: Attribute = 0x0000_0005, + [1657539676.880639][10068:10073] CHIP:DMG: } + [1657539676.880758][10068:10073] CHIP:DMG: + [1657539676.880870][10068:10073] CHIP:DMG: Data = [ + [1657539676.880981][10068:10073] CHIP:DMG: + [1657539676.881097][10068:10073] CHIP:DMG: ], + [1657539676.881205][10068:10073] CHIP:DMG: }, + [1657539676.881321][10068:10073] CHIP:DMG: + [1657539676.881415][10068:10073] CHIP:DMG: }, + [1657539676.881523][10068:10073] CHIP:DMG: + [1657539676.881589][10068:10073] CHIP:DMG: ], + [1657539676.881667][10068:10073] CHIP:DMG: + [1657539676.881728][10068:10073] CHIP:DMG: InteractionModelRevision = 1 + [1657539676.881816][10068:10073] CHIP:DMG: } + [1657539676.882117][10068:10073] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0005 DataVersion: 1036432514 + [1657539676.882225][10068:10073] CHIP:TOO: ActiveHardwareFaults: 0 entries + [1657539676.882319][10068:10073] CHIP:DMG: MoveToState ReadClient[0xffff70009ef0]: Moving to [AwaitingSu] + [1657539676.882445][10068:10073] CHIP:EM: Piggybacking Ack for MessageCounter:144228832 on exchange: 14723i + [1657539676.882594][10068:10073] CHIP:IN: Prepared secure message 0xffff700046b8 to 0x0000000000000001 (1) of type 0x1 and protocolId (0, 1) on exchange 14723i with MessageCounter:6634271. + [1657539676.882686][10068:10073] CHIP:IN: Sending encrypted msg 0xffff700046b8 with MessageCounter:6634271 to 0x0000000000000001 (1) at monotonic time: 00000000016FEF43 msec + [1657539676.884825][10068:10073] CHIP:EM: Received message of type 0x4 with protocolId (0, 1) and MessageCounter:144228833 on exchange 14723i + [1657539676.884920][10068:10073] CHIP:EM: Found matching exchange: 14723i, Delegate: 0xffff70009ef0 + [1657539676.885002][10068:10073] CHIP:EM: Rxd Ack; Removing MessageCounter:6634271 from Retrans Table on exchange 14723i + [1657539676.885062][10068:10073] CHIP:EM: Removed CHIP MessageCounter:6634271 from RetransTable on exchange 14723i + [1657539676.885171][10068:10073] CHIP:DMG: SubscribeResponseMessage = + [1657539676.885237][10068:10073] CHIP:DMG: { + [1657539676.885298][10068:10073] CHIP:DMG: SubscriptionId = 0xd985fd71, + [1657539676.885407][10068:10073] CHIP:DMG: MaxInterval = 0x64, + [1657539676.885477][10068:10073] CHIP:DMG: InteractionModelRevision = 1 + [1657539676.885549][10068:10073] CHIP:DMG: } + [1657539676.885617][10068:10073] CHIP:DMG: Subscription established with SubscriptionID = 0xd985fd71 MinInterval = 20s MaxInterval = 100s Peer = 01:0000000000000001 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && DGGEN.S.A0005 @@ -170,13 +224,17 @@ tests: - label: "TH reads ActiveRadioFaults attribute value from DUT." verification: | ./chip-tool generaldiagnostics read active-radio-faults 1 0 + On TH(chip-tool), verify that ActiveRadioFaults attribute response should be empty. But when a radio fault occurs, the return attribute value must match the value listed in the RadioFault ENUM table. 11.11.6.2. + [1654682886.109092][33026:33031] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0006 DataVersion: 804003636 [1654682886.109197][33026:33031] CHIP:TOO: ActiveRadioFaults: 0 entries [1654682886.109321][33026:33031] CHIP:EM: Sending Standalone Ack for MessageCounter:174138703 on exchange 49820i + Please use Interactive mode to Verify subscription test cases + Here the command to enter interactive mode:-- ./chip-tool interactive start + generaldiagnostics subscribe active-radio-faults 100 1000 1 0 - ./chip-tool generaldiagnostics subscribe active-radio-faults 100 1000 1 0 - + Verify in TH(chip-tool) Log [1654682933.931539][33037:33042] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0006 DataVersion: 804003636 [1654682933.931617][33037:33042] CHIP:TOO: ActiveRadioFaults: 0 entries [1654682933.931659][33037:33042] CHIP:DMG: MoveToState ReadClient[0xffff7c0042e0]: Moving to [AwaitingSu] @@ -209,9 +267,35 @@ tests: verification: | ./chip-tool generaldiagnostics read active-network-faults 1 0 + On TH(chip-tool), verify that ActiveNetworkFaults attribute value attribute response should be empty. But when a network fault occurs, the return attribute value must match the value listed in the NetworkFault ENUM table 11.11.6.3 + [1654683004.591353][33044:33049] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0007 DataVersion: 804003636 [1654683004.591438][33044:33049] CHIP:TOO: ActiveNetworkFaults: 0 entries [1654683004.591526][33044:33049] CHIP:EM: Sending Standalone Ack for MessageCounter:113863817 on exchange 44900i + + Please use Interactive mode to Verify subscription test cases + Here the command to enter interactive mode:-- ./chip-tool interactive start + generaldiagnostics subscribe active-network-faults 100 1000 1 0 + + Verify on TH(chip-tool) + [1654683075.593822][33054:33059] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0007 DataVersion: 804003636 + [1654683075.593966][33054:33059] CHIP:TOO: ActiveNetworkFaults: 0 entries + [1654683075.594038][33054:33059] CHIP:DMG: MoveToState ReadClient[0xffff80004340]: Moving to [AwaitingSu] + [1654683075.594125][33054:33059] CHIP:EM: Piggybacking Ack for MessageCounter:222691244 on exchange: 29895i + [1654683075.594231][33054:33059] CHIP:IN: Prepared secure message 0xaaaadcf2ae78 to 0x0000000000000001 (1) of type 0x1 and protocolId (0, 1) on exchange 29895i with MessageCounter:9439431. + [1654683075.594299][33054:33059] CHIP:IN: Sending encrypted msg 0xaaaadcf2ae78 with MessageCounter:9439431 to 0x0000000000000001 (1) at monotonic time: 0000000000CFB459 msec + [1654683075.595402][33054:33059] CHIP:EM: Received message of type 0x4 with protocolId (0, 1) and MessageCounter:222691245 on exchange 29895i + [1654683075.595461][33054:33059] CHIP:EM: Found matching exchange: 29895i, Delegate: 0xffff80004340 + [1654683075.595522][33054:33059] CHIP:EM: Rxd Ack; Removing MessageCounter:9439431 from Retrans Table on exchange 29895i + [1654683075.595568][33054:33059] CHIP:EM: Removed CHIP MessageCounter:9439431 from RetransTable on exchange 29895i + [1654683075.595649][33054:33059] CHIP:DMG: SubscribeResponseMessage = + [1654683075.595700][33054:33059] CHIP:DMG: { + [1654683075.595743][33054:33059] CHIP:DMG: SubscriptionId = 0x41507073, + [1654683075.595792][33054:33059] CHIP:DMG: MinIntervalFloorSeconds = 0x64, + [1654683075.595840][33054:33059] CHIP:DMG: MaxIntervalCeilingSeconds = 0x3e8, + [1654683075.595886][33054:33059] CHIP:DMG: InteractionModelRevision = 1 + [1654683075.595929][33054:33059] CHIP:DMG: } + [1654683075.595984][33054:33059] CHIP:DMG: Subscription established with SubscriptionID = 0x41507073 MinInterval = 100s MaxInterval = 1000s Peer = 01:0000000000000001 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && DGGEN.S.A0007 @@ -221,3 +305,21 @@ tests: value: "Please enter 'y' for success" - name: "expectedValue" value: "y" + + - label: "TH reads TestEventTriggersEnabled attribute value" + verification: | + ./chip-tool generaldiagnostics read test-event-triggers-enabled 1 0 + On TH (chip-tool), verify that TestEventTriggersEnabled attribute value should be data type bool + + [1655188892.957794][2868:2873] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0008 DataVersion: 3562689442 + [1655188892.957869][2868:2873] CHIP:TOO: TestEventTriggersEnabled: FALSE + [1655188892.957999][2868:2873] CHIP:EM: Sending Standalone Ack for MessageCounter:133140817 on exchange 23176i + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DGGEN.S.A0008 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_DGSW_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DGSW_2_2.yaml index 69103872c6d0b7..65c69c5a7a461a 100644 --- a/src/app/tests/suites/certification/Test_TC_DGSW_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGSW_2_2.yaml @@ -37,22 +37,33 @@ tests: "Reads a list of SoftwareFault struct from DUT and data type in each field of the struct must match the value listed in spec" verification: | - Not implemented in SDK - /chip-tool softwarediagnostics read-event software-fault 1 0 + Provision DUT and TH. - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Event 0x0000_0000 - [1649682271.390023][9722:9727] CHIP:TOO: Event number: 4 - [16 - 49682271.390072][9722:9727] CHIP:TOO: Priority: Info - [1649682271.390120][9722:9727] CHIP:TOO: Timestamp: 30512303 - [1649682271.390253][9722:9727] CHIP:TOO: SoftwareFault: { - [1649682271.390304][9722:9727] CHIP:TOO: SoftwareFault: { - [1649682271.390365][9722:9727] CHIP:TOO: Id: 11927 - [1649682271.390413][9722:9727] CHIP:TOO: Name: 11927 - [1649682271.390464][9722:9727] CHIP:TOO: FaultRecording: 4661756C745265636F7264696E67 - [1649682271.390516][9722:9727] CHIP:TOO: } - [1649682271.390562][9722:9727] CHIP:TOO: } - [1649682271.390714][9722:9727] CHIP:EM: Sending Standalone Ack for MessageCounter:4574884 on exchange 14495i + On Raspi platform To trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor Dut should have capability to generate this event) + + echo '{"Name":"SoftwareFault"}' > /tmp/chip_all_clusters_fifo- (PID of all-clusters-app by using command provided in note above) + + + On TH Send the below command + + 2. ./chip-tool softwarediagnostics read-event software-fault 1 0 + + Verify SoftwareFault Struct is listed that is Softwarefault, ID, Name, Fault recording should be present in struct and Priority should be Info in TH(chip-tool) Log + + [1655375196.291424][35133:35138] CHIP:DMG: SuppressResponse = true, + [1655375196.291478][35133:35138] CHIP:DMG: InteractionModelRevision = 1 + [1655375196.291527][35133:35138] CHIP:DMG: } + [1655375196.291829][35133:35138] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0034 Event 0x0000_0000 + [1655375196.291882][35133:35138] CHIP:TOO: Event number: 6 + [1655375196.291931][35133:35138] CHIP:TOO: Priority: Info + [1655375196.291978][35133:35138] CHIP:TOO: Timestamp: 6164894 + [1655375196.292119][35133:35138] CHIP:TOO: SoftwareFault: { + [1655375196.292173][35133:35138] CHIP:TOO: SoftwareFault: { + [1655375196.292235][35133:35138] CHIP:TOO: Id: 2677 + [1655375196.292287][35133:35138] CHIP:TOO: Name: 2677 + [1655375196.292341][35133:35138] CHIP:TOO: FaultRecording: 546875204A756E2031362031303A32363A313420323032320A + [1655375196.292391][35133:35138] CHIP:TOO: } + [1655375196.292438][35133:35138] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && DGSW.S.E00 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml index fd9b809155774e..7039726d2ab189 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_10.yaml @@ -44,11 +44,11 @@ tests: scenario)" PICS: DRLK.S.E00 && DRLK.S.DetectLockJammed verification: | - To trigger the event give below command by opening an another terminal of DUT + To trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in lock-app to generate the event, Vendor Dut should have capability to generate this event) - echo "{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }" > /tmp/chip_lock_app_fifo- (PID of lock-app) + echo '{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }' > /tmp/chip_lock_app_fifo- (PID of lock-app) For example : - echo "{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }" > /tmp/chip_lock_app_fifo-3940 + echo '{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }' > /tmp/chip_lock_app_fifo-3940 (PID may vary based on the actual DUT) disabled: true - label: "TH reads the DoorLockAlarm event from DUT" @@ -70,8 +70,8 @@ tests: - label: "Trigger the DUT to generate DoorStateChange Event" PICS: DRLK.S.F05 && DRLK.S.E01 verification: | - To trigger the event give below command in another terminal of DUT - echo "{"Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 1 } }" > /tmp/chip_lock_app_fifo-4055 (4055 - value changes) + To trigger the event give the below command in another terminal of DUT + echo '{"Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 1 } }' > /tmp/chip_lock_app_fifo-4055 (4055 - value changes) disabled: true - label: "TH reads the DoorStateChange event from DUT" @@ -101,7 +101,7 @@ tests: [1656497453.684077][25847:25853] CHIP:DMG: status = 0x00 (SUCCESS), - ./chip-tool doorlock set-credential 0 "{ "credentialType" : 1 , "credentialIndex" : 1 }" 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 1 }' 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 Verify "DUT sends SUCCESS response" on the TH(Chip-tool) Log: @@ -518,7 +518,7 @@ tests: 123456 UserIndex as 1 UserStatus as 0 UserType as 0" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx verification: | - ./chip-tool doorlock clear-credential "{ "credentialType" : 1 , "credentialIndex" : 1 }" 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock clear-credential '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 Verify "DUT sends SUCCESS response" on the TH(Chip-tool) Log: @@ -540,7 +540,7 @@ tests: [1659778601.601785][3414:3419] CHIP:DMG: }, [1659778601.601823][3414:3419] CHIP:DMG: - ./chip-tool doorlock set-credential 0 "{ "credentialType" : 1 , "credentialIndex" : 1 }" 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 1 }' 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 Verify "DUT sends Set Credential Response command with status as SUCCESS" on the TH(Chip-tool) Log: @@ -593,7 +593,7 @@ tests: - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.C26.Rsp verification: | - ./chip-tool doorlock clear-credential "{ "credentialType" : 1 , "credentialIndex" : 1 }" 1 1 --timedInteractionTimeoutMs 1000 + ./chip-tool doorlock clear-credential '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 Verify "DUT sends SUCCESS response" on the TH(Chip-tool) Log: diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml index 9913e84fb2f000..e8b0fc81e46332 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml @@ -29,6 +29,13 @@ tests: For DUT as client test cases, Chip-tool command used below are an example to verify the functionality. For certification test, we expect DUT should have a capability or way to run the equivalent command. disabled: true + - label: "Note" + verification: | + 1. TH is commissioned with the DUT + + 2.Steps 4- 12 need a User added to the lock + disabled: true + - label: "DUT sends Lock Door command to TH." PICS: DRLK.C.C00.Tx verification: | diff --git a/src/app/tests/suites/certification/Test_TC_IDM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_3_1.yaml index f7a6ebbc7eeb10..2252e4fa8d01bb 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_3_1.yaml @@ -15,6 +15,9 @@ name: 3.3.1. [TC-IDM-3.1] Write Request Action from DUT to TH. [{DUT_Client}] +PICS: + - MCORE.IDM.C.WriteRequest + config: nodeId: 0x12344321 cluster: "Basic" diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml index 8531e6d8a1cc9e..b9bd3c92c77d24 100644 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml @@ -40,7 +40,6 @@ tests: type: int16u - label: "TH reads the FeatureMap attribute from the DUT" - PICS: " !I.S.F00 " command: "readAttribute" attribute: "FeatureMap" response: @@ -48,14 +47,15 @@ tests: constraints: type: bitmap32 - - label: "TH reads the FeatureMap attribute from the DUT" - PICS: I.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 1 - constraints: - type: bitmap32 + #Commenting out the step FeatureMap attribute feature PICS I.S.F00(QRY) which is out of scope for matter V1.0 + #- label: "TH reads the FeatureMap attribute from the DUT" + # PICS: I.S.F00 + # command: "readAttribute" + # attribute: "FeatureMap" + # response: + # value: 1 + # constraints: + # type: bitmap32 - label: "Read the global attribute: AttributeList" command: "readAttribute" @@ -82,14 +82,15 @@ tests: type: list contains: [64] - - label: "Read the optional attribute(IdentifyQuery) in AcceptedCommandList" - PICS: I.C.C01.Tx - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1] + #Commenting out the step IdentifyQuery (0x01) is not supported by Matter 1.0. + #- label: "Read the optional attribute(IdentifyQuery) in AcceptedCommandList" + # PICS: I.C.C01.Tx + # command: "readAttribute" + # attribute: "AcceptedCommandList" + # response: + # constraints: + # type: list + # contains: [1] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" @@ -98,17 +99,17 @@ tests: value: [] constraints: type: list - - - label: - "Read the optional attribute(IdentifyQueryResponse) in - GeneratedCommandList" - PICS: I.S.C00.Tx - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [0] - constraints: - type: list + #Commenting out the step IdentifyQueryResponse (0x00) is not supported by Matter 1.0 + #- label: + # "Read the optional command(IdentifyQueryResponse) in + # GeneratedCommandList" + # PICS: I.S.C00.Tx + # command: "readAttribute" + # attribute: "GeneratedCommandList" + # response: + # value: [0] + # constraints: + # type: list #Commenting out the step EventList attribute which is out of scope for matter V1.0 #- label: # "Read EventList attribute from the DUT and Verify that the DUT diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml index 061f1b8d05ac29..41342ece3a99b4 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_2_3.yaml @@ -638,9 +638,9 @@ tests: TH all-clusters-minimal-app does not support optional attributes To verify this behaviour send the below mentioned commands and check the result as unsupported attribute - ./chip-tool levelcontrol write on-off-transition-time 5 1 1 - ./chip-tool levelcontrol write on-transition-time 5 1 1 - ./chip-tool levelcontrol write off-transition-time 5 1 1 - ./chip-tool levelcontrol write default-move-rate 5 1 1 - ./chip-tool levelcontrol write start-up-current-level 5 1 1 + ./chip-tool levelcontrol write on-off-transition-time 5 1 1 + ./chip-tool levelcontrol write on-transition-time 5 1 1 + ./chip-tool levelcontrol write off-transition-time 5 1 1 + ./chip-tool levelcontrol write default-move-rate 5 1 1 + ./chip-tool levelcontrol write start-up-current-level 5 1 1 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml index 507813609a736f..cff9707bda319c 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml @@ -128,7 +128,7 @@ tests: "TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). This means the level should increase by 150 units in 30s, so 5 units/s" - PICS: LVL.S.C00.Rsp && LVL.S.M.VarRate + PICS: LVL.S.C00.Rsp command: "MoveToLevel" arguments: values: @@ -142,6 +142,7 @@ tests: value: 0 - label: "Wait 10000ms" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -159,6 +160,7 @@ tests: maxValue: 115 - label: "Wait 10000ms" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -176,6 +178,7 @@ tests: maxValue: 173 - label: "Wait 10000ms" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -193,6 +196,7 @@ tests: maxValue: 200 - label: "Wait 5000ms" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml index 4febf9ad1e5248..7b7a7d695644d6 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml @@ -122,7 +122,7 @@ tests: - label: "TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and TransitionTime =300" - PICS: LVL.S.C02.Rsp && LVL.S.M.VarRate + PICS: LVL.S.C02.Rsp command: "Step" arguments: values: @@ -138,6 +138,7 @@ tests: value: 0 - label: "Wait 10s" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -155,6 +156,7 @@ tests: maxValue: 115 - label: "Wait 10s" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -172,6 +174,7 @@ tests: maxValue: 173 - label: "Wait 10s" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -189,6 +192,7 @@ tests: maxValue: 200 - label: "Wait 5000ms" + PICS: LVL.S.M.VarRate cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml index e9793c96a37ea0..f6ef1f8840db76 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml @@ -31,19 +31,6 @@ tests: - name: "nodeId" value: nodeId - - label: "Precondition Send On Command" - cluster: "On/Off" - PICS: OO.S.C01.Rsp - command: "On" - - - label: "Check on/off attribute value is true after on command" - cluster: "On/Off" - PICS: OO.S.A0000 - command: "readAttribute" - attribute: "OnOff" - response: - value: 1 - #Adding below step resolve the issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/499 - label: "Precondition: write default value of OnOffTransitionTime attribute" diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml index 3e4d2cc36f7f1f..92d237f11cc5d2 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml @@ -24,6 +24,11 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + To execute this test case set onmode to any integer value because as default it value has null. + disabled: true + - label: "TH reads the OnMode attribute from the DUT" PICS: MOD.S.A0005 && MOD.S.F00 verification: | diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml index fd5883aecea22f..e7dc212c8685c5 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml @@ -28,16 +28,7 @@ config: tests: - label: "Note" verification: | - To Execute the TC-MOD-3.4 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. + To execute this test case set onmode to any integer value because as default it value has null. disabled: true - label: "TH reads the StartUpMode attribute from the DUT" diff --git a/src/app/tests/suites/certification/Test_TC_OCC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OCC_2_2.yaml index 6fed52808eb096..94f483cd93ea9f 100644 --- a/src/app/tests/suites/certification/Test_TC_OCC_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OCC_2_2.yaml @@ -31,7 +31,7 @@ tests: - label: "Commission DUT to TH" verification: | - verification step to be updated. + disabled: true - label: "DUT reads from the TH the (0x0000) Occupancy attribute" diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_1.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_1.yaml index 7e59af1e090f4f..bdf23dd6402339 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_1.yaml @@ -26,6 +26,14 @@ config: endpoint: 0 tests: + - label: "Pre-Conditions" + verification: | + 1. PAI, DAC certificates are obtained and validated against externally obtained PAA certificate + 2. This test case assumes that during Commissioning AddNOC will be sent with ICACValue + 3. TH2 is set up with at least one valid CASE Authenticated Tag specified in its NOC, saved as CAT_TH2 + 4. Read SupportedFabrics attributes from the DUT and saves as NumSupportedFabrics . Ensure there are NumSupportedFabrics test harness instances that can each commission the DUT + disabled: true + - label: "Factory Reset DUT (to ensure NOC list is empty at the beginning of the following steps)" diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index b8864448e0902b..2243d7c4c48a61 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -67,7 +67,7 @@ "Test_TC_LVL_6_1" ], "LocalizationConfiguration": ["Test_TC_LCFG_1_1"], - "TimeFormatLocalization": ["Test_TC_LTIME_1_1"], + "TimeFormatLocalization": ["Test_TC_LTIME_1_2"], "UnitLocalization": ["Test_TC_LUNIT_1_1"], "UserLabel": [ "Test_TC_ULABEL_1_1", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 0dbf826cca2bee..5078d593deb35a 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -296,7 +296,7 @@ "Test_TC_ACT_3_2" ], "TimeFormatLocalization": [ - "Test_TC_LTIME_1_2", + "Test_TC_LTIME_1_1", "Test_TC_LTIME_2_1", "Test_TC_LTIME_3_1" ], diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 5a0c3c87c27d82..7149c0df95f586 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -94,7 +94,7 @@ class TestList : public Command printf("Test_TC_LVL_6_1\n"); printf("Test_TC_LCFG_1_1\n"); printf("Test_TC_LUNIT_1_1\n"); - printf("Test_TC_LTIME_1_1\n"); + printf("Test_TC_LTIME_1_2\n"); printf("Test_TC_LOWPOWER_1_1\n"); printf("Test_TC_KEYPADINPUT_1_2\n"); printf("Test_TC_APPLAUNCHER_1_3\n"); @@ -546,7 +546,7 @@ class ManualTestList : public Command printf("Test_TC_ACT_2_2\n"); printf("Test_TC_ACT_3_1\n"); printf("Test_TC_ACT_3_2\n"); - printf("Test_TC_LTIME_1_2\n"); + printf("Test_TC_LTIME_1_1\n"); printf("Test_TC_LTIME_2_1\n"); printf("Test_TC_LTIME_3_1\n"); printf("Test_TC_LUNIT_1_2\n"); @@ -6921,7 +6921,7 @@ class Test_TC_CC_4_4Suite : public TestCommand class Test_TC_CC_5_1Suite : public TestCommand { public: - Test_TC_CC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_1", 58, credsIssuerConfig) + Test_TC_CC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_1", 59, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -7070,9 +7070,12 @@ class Test_TC_CC_5_1Suite : public TestCommand break; case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7080,7 +7083,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 32768U)); } break; - case 22: + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7088,17 +7091,17 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 19660U)); } break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7106,7 +7109,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 32768U)); } break; - case 27: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7114,14 +7117,14 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 19660U)); } break; - case 28: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 29: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 30: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7129,7 +7132,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 32768U)); } break; - case 31: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7137,14 +7140,14 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 19660U)); } break; - case 32: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 33: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 34: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7152,7 +7155,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 26214U)); } break; - case 35: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7160,10 +7163,10 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 32768U)); } break; - case 36: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 37: + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -7171,17 +7174,17 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("options", value, 1U)); } break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7189,7 +7192,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 32768U)); } break; - case 42: + case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7197,17 +7200,17 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 19660U)); } break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7215,7 +7218,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 13107U)); } break; - case 47: + case 48: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7223,14 +7226,14 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 13107U)); } break; - case 48: + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 49: + case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 50: + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7238,7 +7241,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 13107U)); } break; - case 51: + case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7246,14 +7249,14 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 13107U)); } break; - case 52: + case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 53: + case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 54: + case 55: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7261,7 +7264,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentX", value, 26214U)); } break; - case 55: + case 56: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -7269,7 +7272,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentY", value, 32768U)); } break; - case 56: + case 57: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -7278,7 +7281,7 @@ class Test_TC_CC_5_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); } break; - case 57: + case 58: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -7453,7 +7456,16 @@ class Test_TC_CC_5_1Suite : public TestCommand chip::NullOptional); } case 19: { - LogStep(19, + LogStep(19, "TH sends On command to DUT"); + VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) ColorY = 19660/0x4CCC " "(y=0.3) TransitionTime = 0 (immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7469,27 +7481,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 20: { - LogStep(20, "Wait 100ms"); + case 21: { + LogStep(21, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 21: { - LogStep(21, "TH reads CurrentX attribute from DUT"); + case 22: { + LogStep(22, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 22: { - LogStep(22, "TH reads CurrentY attribute from DUT"); + case 23: { + LogStep(23, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 23: { - LogStep(23, "TH sends Off command to DUT"); + case 24: { + LogStep(24, "TH sends Off command to DUT"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -7497,8 +7509,8 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 24: { - LogStep(24, + case 25: { + LogStep(25, "TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7514,27 +7526,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 25: { - LogStep(25, "Wait 100ms"); + case 26: { + LogStep(26, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 26: { - LogStep(26, "TH reads CurrentX attribute from DUT"); + case 27: { + LogStep(27, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 27: { - LogStep(27, "TH reads CurrentY attribute from DUT"); + case 28: { + LogStep(28, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 28: { - LogStep(28, + case 29: { + LogStep(29, "TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7550,27 +7562,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 29: { - LogStep(29, "Wait 100ms"); + case 30: { + LogStep(30, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 30: { - LogStep(30, "TH reads CurrentX attribute from DUT"); + case 31: { + LogStep(31, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 31: { - LogStep(31, "TH reads CurrentY attribute from DUT"); + case 32: { + LogStep(32, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 32: { - LogStep(32, + case 33: { + LogStep(33, "TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7586,27 +7598,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 33: { - LogStep(33, "Wait 100ms"); + case 34: { + LogStep(34, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 34: { - LogStep(34, "TH reads CurrentX attribute from DUT"); + case 35: { + LogStep(35, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 35: { - LogStep(35, "TH reads CurrentY attribute from DUT"); + case 36: { + LogStep(36, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 36: { - LogStep(36, "TH writes 1 to the Options attribute"); + case 37: { + LogStep(37, "TH writes 1 to the Options attribute"); VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint8_t value; @@ -7614,14 +7626,14 @@ class Test_TC_CC_5_1Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } - case 37: { - LogStep(37, "TH read Options attribute"); + case 38: { + LogStep(38, "TH read Options attribute"); VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, true, chip::NullOptional); } - case 38: { - LogStep(38, "TH sends On command to DUT"); + case 39: { + LogStep(39, "TH sends On command to DUT"); VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; @@ -7629,8 +7641,8 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 39: { - LogStep(39, + case 40: { + LogStep(40, "TH sends MoveToColor command to DUT, with ColorX = 32768/0x8000 ColorY = 19660/0x4CCC TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7646,27 +7658,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 40: { - LogStep(40, "Wait 100ms"); + case 41: { + LogStep(41, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 41: { - LogStep(41, "TH reads CurrentX attribute from DUT"); + case 42: { + LogStep(42, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 42: { - LogStep(42, "TH reads CurrentY attribute from DUT"); + case 43: { + LogStep(43, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 43: { - LogStep(43, "TH sends Off command to DUT"); + case 44: { + LogStep(44, "TH sends Off command to DUT"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -7674,8 +7686,8 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 44: { - LogStep(44, + case 45: { + LogStep(45, "TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7691,27 +7703,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 45: { - LogStep(45, "Wait 100ms"); + case 46: { + LogStep(46, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 46: { - LogStep(46, "TH reads CurrentX attribute from DUT"); + case 47: { + LogStep(47, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 47: { - LogStep(47, "TH reads CurrentY attribute from DUT"); + case 48: { + LogStep(48, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 48: { - LogStep(48, + case 49: { + LogStep(49, "TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7727,27 +7739,27 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 49: { - LogStep(49, "Wait 100ms"); + case 50: { + LogStep(50, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 50: { - LogStep(50, "TH reads CurrentX attribute from DUT"); + case 51: { + LogStep(51, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 51: { - LogStep(51, "TH reads CurrentY attribute from DUT"); + case 52: { + LogStep(52, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 52: { - LogStep(52, + case 53: { + LogStep(53, "TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 TransitionTime = 0 " "(immediate)"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -7763,33 +7775,33 @@ class Test_TC_CC_5_1Suite : public TestCommand ); } - case 53: { - LogStep(53, "Wait 100ms"); + case 54: { + LogStep(54, "Wait 100ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs(kIdentityAlpha, value); } - case 54: { - LogStep(54, "TH reads CurrentX attribute from DUT"); + case 55: { + LogStep(55, "TH reads CurrentX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } - case 55: { - LogStep(55, "TH reads CurrentY attribute from DUT"); + case 56: { + LogStep(56, "TH reads CurrentY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } - case 56: { - LogStep(56, "TH reads ColorMode attribute from DUT"); + case 57: { + LogStep(57, "TH reads ColorMode attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, chip::NullOptional); } - case 57: { - LogStep(57, "TH reads EnhancedColorMode attribute from DUT"); + case 58: { + LogStep(58, "TH reads EnhancedColorMode attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.F00 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, chip::NullOptional); @@ -9755,10 +9767,10 @@ class Test_TC_CC_6_3Suite : public TestCommand true, chip::NullOptional); } case 20: { - LogStep(20, "Wait 10s"); + LogStep(20, "Wait 5s"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = 5000UL; return WaitForMs(kIdentityAlpha, value); } case 21: { @@ -15556,7 +15568,7 @@ class Test_TC_DGGEN_1_1Suite : public TestCommand class Test_TC_DGGEN_2_1Suite : public TestCommand { public: - Test_TC_DGGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGGEN_2_1", 17, credsIssuerConfig) + Test_TC_DGGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DGGEN_2_1", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -15684,6 +15696,10 @@ class Test_TC_DGGEN_2_1Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -15835,6 +15851,16 @@ class Test_TC_DGGEN_2_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } + case 17: { + LogStep(17, "TH reads TestEventTriggersEnabled attribute value"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } } return CHIP_NO_ERROR; } @@ -15843,7 +15869,7 @@ class Test_TC_DGGEN_2_1Suite : public TestCommand class Test_TC_I_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 10, credsIssuerConfig) + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -15899,15 +15925,6 @@ class Test_TC_I_1_1Suite : public TestCommand } break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 1UL)); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); - } - break; - case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -15922,7 +15939,7 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; - case 5: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -15931,7 +15948,7 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; - case 6: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -15940,16 +15957,7 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); } break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); - } - break; - case 8: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -15961,20 +15969,6 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - } - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -16004,46 +15998,27 @@ class Test_TC_I_1_1Suite : public TestCommand } case 2: { LogStep(2, "TH reads the FeatureMap attribute from the DUT"); - VerifyOrDo(!ShouldSkip(" !I.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 3: { - LogStep(3, "TH reads the FeatureMap attribute from the DUT"); - VerifyOrDo(!ShouldSkip("I.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::FeatureMap::Id, true, - chip::NullOptional); - } - case 4: { - LogStep(4, "Read the global attribute: AttributeList"); + LogStep(3, "Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id, true, chip::NullOptional); } - case 5: { - LogStep(5, "Read the global attribute: AcceptedCommandList"); + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } - case 6: { - LogStep(6, "Read the optional command(TriggerEffect) in AcceptedCommandList"); + case 5: { + LogStep(5, "Read the optional command(TriggerEffect) in AcceptedCommandList"); VerifyOrDo(!ShouldSkip("I.C.C40.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } - case 7: { - LogStep(7, "Read the optional attribute(IdentifyQuery) in AcceptedCommandList"); - VerifyOrDo(!ShouldSkip("I.C.C01.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, - chip::NullOptional); - } - case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, - chip::NullOptional); - } - case 9: { - LogStep(9, "Read the optional attribute(IdentifyQueryResponse) in GeneratedCommandList"); - VerifyOrDo(!ShouldSkip("I.S.C00.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); } @@ -18760,7 +18735,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand LogStep(12, "TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). This means the " "level should increase by 150 units in 30s, so 5 units/s"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; value.level = 200U; @@ -18775,6 +18750,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand } case 13: { LogStep(13, "Wait 10000ms"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -18789,6 +18765,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand } case 15: { LogStep(15, "Wait 10000ms"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -18803,6 +18780,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand } case 17: { LogStep(17, "Wait 10000ms"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -18817,6 +18795,7 @@ class Test_TC_LVL_3_1Suite : public TestCommand } case 19: { LogStep(19, "Wait 5000ms"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; @@ -19764,7 +19743,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand } case 11: { LogStep(11, "TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and TransitionTime =300"); - VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::Step::Type value; value.stepMode = static_cast(0); @@ -19780,6 +19759,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand } case 12: { LogStep(12, "Wait 10s"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -19794,6 +19774,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand } case 14: { LogStep(14, "Wait 10s"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -19808,6 +19789,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand } case 16: { LogStep(16, "Wait 10s"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; @@ -19822,6 +19804,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand } case 18: { LogStep(18, "Wait 5000ms"); + VerifyOrDo(!ShouldSkip("LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; @@ -19863,7 +19846,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand class Test_TC_LVL_6_1Suite : public TestCommand { public: - Test_TC_LVL_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_6_1", 20, credsIssuerConfig) + Test_TC_LVL_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_6_1", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -19905,11 +19888,6 @@ class Test_TC_LVL_6_1Suite : public TestCommand break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - bool value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 1)); - } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -19918,12 +19896,6 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -19932,21 +19904,21 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel.Value()", value.Value(), 50U)); } break; - case 8: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 10: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 12: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -19955,21 +19927,21 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 86U)); } break; - case 13: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 15: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 16: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 17: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -19978,10 +19950,10 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 115U)); } break; - case 18: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 19: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -20012,21 +19984,7 @@ class Test_TC_LVL_6_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Precondition Send On Command"); - VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional - - ); - } - case 2: { - LogStep(2, "Check on/off attribute value is true after on command"); - VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); - } - case 3: { - LogStep(3, "Precondition: write default value of OnOffTransitionTime attribute"); + LogStep(1, "Precondition: write default value of OnOffTransitionTime attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint16_t value; @@ -20034,8 +19992,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnOffTransitionTime::Id, value, chip::NullOptional, chip::NullOptional); } - case 4: { - LogStep(4, "TH writes 0 to the Options attribute"); + case 2: { + LogStep(2, "TH writes 0 to the Options attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint8_t value; @@ -20043,8 +20001,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::Options::Id, value, chip::NullOptional, chip::NullOptional); } - case 5: { - LogStep(5, "TH sends On command to DUT"); + case 3: { + LogStep(3, "TH sends On command to DUT"); VerifyOrDo(!ShouldSkip("OO.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; @@ -20052,8 +20010,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 6: { - LogStep(6, "TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); + case 4: { + LogStep(4, "TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)"); VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; @@ -20067,14 +20025,14 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 7: { - LogStep(7, "TH reads CurrentLevel attribute from DUT"); + case 5: { + LogStep(5, "TH reads CurrentLevel attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, + case 6: { + LogStep(6, "TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set to " "0x05 (5 units/s)"); VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -20090,15 +20048,15 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 9: { - LogStep(9, "Wait 5000ms"); + case 7: { + LogStep(7, "Wait 5000ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; return WaitForMs(kIdentityAlpha, value); } - case 10: { - LogStep(10, "Sends stop command to DUT"); + case 8: { + LogStep(8, "Sends stop command to DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::Stop::Type value; @@ -20109,8 +20067,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 11: { - LogStep(11, "Physically verify that the device has stopped transitioning"); + case 9: { + LogStep(9, "Physically verify that the device has stopped transitioning"); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -20119,15 +20077,15 @@ class Test_TC_LVL_6_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 12: { - LogStep(12, "TH reads CurrentLevel attribute from DUT"); + case 10: { + LogStep(10, "TH reads CurrentLevel attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 13: { - LogStep(13, + case 11: { + LogStep(11, "TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the Rate field set to " "0x05 (5 units/s)"); VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -20143,15 +20101,15 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 14: { - LogStep(14, "Wait 5000ms"); + case 12: { + LogStep(12, "Wait 5000ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; return WaitForMs(kIdentityAlpha, value); } - case 15: { - LogStep(15, "TH sends a StopWithOnOff command to the DUT"); + case 13: { + LogStep(13, "TH sends a StopWithOnOff command to the DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type value; @@ -20162,8 +20120,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 16: { - LogStep(16, "Physically verify that the device has stopped transitioning"); + case 14: { + LogStep(14, "Physically verify that the device has stopped transitioning"); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -20172,15 +20130,15 @@ class Test_TC_LVL_6_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 17: { - LogStep(17, "Reads CurrentLevel attribute from DUT"); + case 15: { + LogStep(15, "Reads CurrentLevel attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 18: { - LogStep(18, "Precondition send Off Command"); + case 16: { + LogStep(16, "Precondition send Off Command"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -20188,8 +20146,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand ); } - case 19: { - LogStep(19, "Check on/off attribute value is false after off command"); + case 17: { + LogStep(17, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -20403,10 +20361,10 @@ class Test_TC_LUNIT_1_1Suite : public TestCommand } }; -class Test_TC_LTIME_1_1Suite : public TestCommand +class Test_TC_LTIME_1_2Suite : public TestCommand { public: - Test_TC_LTIME_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_1", 0, credsIssuerConfig) + Test_TC_LTIME_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_2", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -20414,7 +20372,7 @@ class Test_TC_LTIME_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_1_1Suite() {} + ~Test_TC_LTIME_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -20439,6 +20397,85 @@ class Test_TC_LTIME_1_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -20454,6 +20491,55 @@ class Test_TC_LTIME_1_1Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afffc"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afffb && LTIME.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afffb && LTIME.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads AcceptedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads GeneratedCommandList from DUT"); + VerifyOrDo(!ShouldSkip("LTIME.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, + TimeFormatLocalization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -91835,7 +91921,7 @@ class Test_TC_CC_3_1Suite : public TestCommand ~Test_TC_CC_3_1Suite() {} - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(150)); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } private: chip::Optional mNodeId; @@ -91910,7 +91996,8 @@ class Test_TC_CC_3_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentHue", value, 120U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 102U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 120U)); } break; case 12: @@ -92589,7 +92676,7 @@ class Test_TC_CC_7_1Suite : public TestCommand ~Test_TC_CC_7_1Suite() {} - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(150)); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(200)); } private: chip::Optional mNodeId; @@ -99515,10 +99602,10 @@ class Test_TC_ACT_3_2Suite : public TestCommand } }; -class Test_TC_LTIME_1_2Suite : public TestCommand +class Test_TC_LTIME_1_1Suite : public TestCommand { public: - Test_TC_LTIME_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_2", 8, credsIssuerConfig) + Test_TC_LTIME_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LTIME_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -99526,7 +99613,7 @@ class Test_TC_LTIME_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_LTIME_1_2Suite() {} + ~Test_TC_LTIME_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -99551,85 +99638,6 @@ class Test_TC_LTIME_1_2Suite : public TestCommand switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 1UL)); - } - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); - } - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); - } - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); - } - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - } - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - } - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -99645,55 +99653,6 @@ class Test_TC_LTIME_1_2Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "TH reads the ClusterRevision from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::ClusterRevision::Id, true, chip::NullOptional); - } - case 2: { - LogStep(2, "TH reads the FeatureMap from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afffc"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::FeatureMap::Id, true, chip::NullOptional); - } - case 3: { - LogStep(3, "TH reads AttributeList from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); - } - case 4: { - LogStep(4, "TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afffb && LTIME.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); - } - case 5: { - LogStep(5, "TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afffb && LTIME.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::AttributeList::Id, true, chip::NullOptional); - } - case 6: { - LogStep(6, "TH reads AcceptedCommandList from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); - } - case 7: { - LogStep(7, "TH reads GeneratedCommandList from DUT"); - VerifyOrDo(!ShouldSkip("LTIME.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeFormatLocalization::Id, - TimeFormatLocalization::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); - } } return CHIP_NO_ERROR; } @@ -101581,7 +101540,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -102022,7 +101981,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 2d5a690968a3c5..759a36849af3c0 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -86,7 +86,7 @@ class TestList : public Command { printf("Test_TC_LVL_6_1\n"); printf("Test_TC_LCFG_1_1\n"); printf("Test_TC_LUNIT_1_1\n"); - printf("Test_TC_LTIME_1_1\n"); + printf("Test_TC_LTIME_1_2\n"); printf("Test_TC_LOWPOWER_1_1\n"); printf("Test_TC_KEYPADINPUT_1_2\n"); printf("Test_TC_APPLAUNCHER_1_3\n"); @@ -11737,300 +11737,308 @@ class Test_TC_CC_5_1 : public TestCommandBridge { err = TestThReadOptionsAttribute_18(); break; case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH sends On command to DUT\n"); + if (ShouldSkip("OO.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsOnCommandToDut_19(); + break; + case 20: ChipLogProgress(chipTool, - " ***** Test Step 19 : TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) " + " ***** Test Step 20 : TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) " "ColorY = 19660/0x4CCC (y=0.3) TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveToColorCommandToTheDutWithColorX327680x8000X05PurpleColorY196600x4CCCY03TransitionTime0Immediate_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 100ms\n"); - err = TestWait100ms_20(); + err = TestThSendsAMoveToColorCommandToTheDutWithColorX327680x8000X05PurpleColorY196600x4CCCY03TransitionTime0Immediate_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 100ms\n"); + err = TestWait100ms_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_21(); + err = TestThReadsCurrentXAttributeFromDut_22(); break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads CurrentY attribute from DUT\n"); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_22(); + err = TestThReadsCurrentYAttributeFromDut_23(); break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : TH sends Off command to DUT\n"); + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : TH sends Off command to DUT\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsOffCommandToDut_23(); + err = TestThSendsOffCommandToDut_24(); break; - case 24: + case 25: ChipLogProgress(chipTool, - " ***** Test Step 24 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " + " ***** Test Step 25 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Wait 100ms\n"); - err = TestWait100ms_25(); + err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait 100ms\n"); + err = TestWait100ms_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_26(); + err = TestThReadsCurrentXAttributeFromDut_27(); break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads CurrentY attribute from DUT\n"); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_27(); + err = TestThReadsCurrentYAttributeFromDut_28(); break; - case 28: + case 29: ChipLogProgress(chipTool, - " ***** Test Step 28 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " + " ***** Test Step 29 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Wait 100ms\n"); - err = TestWait100ms_29(); + err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 100ms\n"); + err = TestWait100ms_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_30(); + err = TestThReadsCurrentXAttributeFromDut_31(); break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : TH reads CurrentY attribute from DUT\n"); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_31(); + err = TestThReadsCurrentYAttributeFromDut_32(); break; - case 32: + case 33: ChipLogProgress(chipTool, - " ***** Test Step 32 : TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " + " ***** Test Step 33 : TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Wait 100ms\n"); - err = TestWait100ms_33(); + err = TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_33(); break; case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 34 : Wait 100ms\n"); + err = TestWait100ms_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_34(); + err = TestThReadsCurrentXAttributeFromDut_35(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : TH reads CurrentY attribute from DUT\n"); + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_35(); + err = TestThReadsCurrentYAttributeFromDut_36(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : TH writes 1 to the Options attribute\n"); + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : TH writes 1 to the Options attribute\n"); if (ShouldSkip("CC.S.A000f")) { NextTest(); return; } - err = TestThWrites1ToTheOptionsAttribute_36(); + err = TestThWrites1ToTheOptionsAttribute_37(); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : TH read Options attribute\n"); + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : TH read Options attribute\n"); if (ShouldSkip("CC.S.A000f")) { NextTest(); return; } - err = TestThReadOptionsAttribute_37(); + err = TestThReadOptionsAttribute_38(); break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : TH sends On command to DUT\n"); + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : TH sends On command to DUT\n"); if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_38(); + err = TestThSendsOnCommandToDut_39(); break; - case 39: + case 40: ChipLogProgress(chipTool, - " ***** Test Step 39 : TH sends MoveToColor command to DUT, with ColorX = 32768/0x8000 ColorY = 19660/0x4CCC " + " ***** Test Step 40 : TH sends MoveToColor command to DUT, with ColorX = 32768/0x8000 ColorY = 19660/0x4CCC " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX327680x8000ColorY196600x4CCCTransitionTime0Immediate_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Wait 100ms\n"); - err = TestWait100ms_40(); + err = TestThSendsMoveToColorCommandToDutWithColorX327680x8000ColorY196600x4CCCTransitionTime0Immediate_40(); break; case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 41 : Wait 100ms\n"); + err = TestWait100ms_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_41(); + err = TestThReadsCurrentXAttributeFromDut_42(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads CurrentY attribute from DUT\n"); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_42(); + err = TestThReadsCurrentYAttributeFromDut_43(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : TH sends Off command to DUT\n"); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : TH sends Off command to DUT\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsOffCommandToDut_43(); + err = TestThSendsOffCommandToDut_44(); break; - case 44: + case 45: ChipLogProgress(chipTool, - " ***** Test Step 44 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " + " ***** Test Step 45 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Wait 100ms\n"); - err = TestWait100ms_45(); + err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_45(); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 46 : Wait 100ms\n"); + err = TestWait100ms_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_46(); + err = TestThReadsCurrentXAttributeFromDut_47(); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : TH reads CurrentY attribute from DUT\n"); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_47(); + err = TestThReadsCurrentYAttributeFromDut_48(); break; - case 48: + case 49: ChipLogProgress(chipTool, - " ***** Test Step 48 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " + " ***** Test Step 49 : TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Wait 100ms\n"); - err = TestWait100ms_49(); + err = TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_49(); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 50 : Wait 100ms\n"); + err = TestWait100ms_50(); + break; + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_50(); + err = TestThReadsCurrentXAttributeFromDut_51(); break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : TH reads CurrentY attribute from DUT\n"); + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_51(); + err = TestThReadsCurrentYAttributeFromDut_52(); break; - case 52: + case 53: ChipLogProgress(chipTool, - " ***** Test Step 52 : TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " + " ***** Test Step 53 : TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " "TransitionTime = 0 (immediate)\n"); if (ShouldSkip("CC.S.F03 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Wait 100ms\n"); - err = TestWait100ms_53(); + err = TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_53(); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : TH reads CurrentX attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 54 : Wait 100ms\n"); + err = TestWait100ms_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : TH reads CurrentX attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0003 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentXAttributeFromDut_54(); + err = TestThReadsCurrentXAttributeFromDut_55(); break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : TH reads CurrentY attribute from DUT\n"); + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : TH reads CurrentY attribute from DUT\n"); if (ShouldSkip("CC.S.F03 && CC.S.A0004 && CC.S.C07.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentYAttributeFromDut_55(); + err = TestThReadsCurrentYAttributeFromDut_56(); break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : TH reads ColorMode attribute from DUT\n"); + case 57: + ChipLogProgress(chipTool, " ***** Test Step 57 : TH reads ColorMode attribute from DUT\n"); if (ShouldSkip("CC.S.F00 && CC.S.A0008")) { NextTest(); return; } - err = TestThReadsColorModeAttributeFromDut_56(); + err = TestThReadsColorModeAttributeFromDut_57(); break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : TH reads EnhancedColorMode attribute from DUT\n"); + case 58: + ChipLogProgress(chipTool, " ***** Test Step 58 : TH reads EnhancedColorMode attribute from DUT\n"); if (ShouldSkip("CC.S.F00 && CC.S.A4001")) { NextTest(); return; } - err = TestThReadsEnhancedColorModeAttributeFromDut_57(); + err = TestThReadsEnhancedColorModeAttributeFromDut_58(); break; } @@ -12217,6 +12225,9 @@ class Test_TC_CC_5_1 : public TestCommandBridge { case 57: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -12230,7 +12241,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 58; + const uint16_t mTestCount = 59; chip::Optional mNodeId; chip::Optional mCluster; @@ -12597,97 +12608,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToColorCommandToTheDutWithColorX327680x8000X05PurpleColorY196600x4CCCY03TransitionTime0Immediate_19() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:32768U]; - params.colorY = [NSNumber numberWithUnsignedShort:19660U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) ColorY = " - @"19660/0x4CCC (y=0.3) TransitionTime = 0 (immediate) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_20() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_21() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentX attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentX", actualValue, 32768U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_22() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentY attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentY", actualValue, 19660U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsOffCommandToDut_23() + CHIP_ERROR TestThSendsOnCommandToDut_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Off command to DUT Error: %@", err); + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends On command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -12697,7 +12625,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_24() + CHIP_ERROR TestThSendsAMoveToColorCommandToTheDutWithColorX327680x8000X05PurpleColorY196600x4CCCY03TransitionTime0Immediate_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12706,15 +12634,15 @@ class Test_TC_CC_5_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:13107U]; - params.colorY = [NSNumber numberWithUnsignedShort:13107U]; + params.colorX = [NSNumber numberWithUnsignedShort:32768U]; + params.colorY = [NSNumber numberWithUnsignedShort:19660U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; [cluster moveToColorWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " - @"TransitionTime = 0 (immediate) Error: %@", + NSLog(@"TH sends a MoveToColor command to the DUT with ColorX = 32768/0x8000 (x=0.5) (purple) ColorY = " + @"19660/0x4CCC (y=0.3) TransitionTime = 0 (immediate) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -12725,14 +12653,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_25() + CHIP_ERROR TestWait100ms_21() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_26() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12756,7 +12684,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_27() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12780,90 +12708,24 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_28() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:13107U]; - params.colorY = [NSNumber numberWithUnsignedShort:32768U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " - @"TransitionTime = 0 (immediate) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait100ms_29() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_30() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentX attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentX", actualValue, 32768U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_31() + CHIP_ERROR TestThSendsOffCommandToDut_24() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads CurrentY attribute from DUT Error: %@", err); + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Off command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentY", actualValue, 19660U)); - } - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_32() + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12872,14 +12734,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:26214U]; - params.colorY = [NSNumber numberWithUnsignedShort:32768U]; + params.colorX = [NSNumber numberWithUnsignedShort:13107U]; + params.colorY = [NSNumber numberWithUnsignedShort:13107U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; [cluster moveToColorWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " + NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 13107/0x3333 " @"TransitionTime = 0 (immediate) Error: %@", err); @@ -12891,14 +12753,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_33() + CHIP_ERROR TestWait100ms_26() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_34() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12913,7 +12775,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentX", actualValue, 26214U)); + VerifyOrReturn(CheckValue("CurrentX", actualValue, 32768U)); } NextTest(); @@ -12922,7 +12784,173 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_35() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_28() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentY attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentY", actualValue, 19660U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_29() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; + params.colorX = [NSNumber numberWithUnsignedShort:13107U]; + params.colorY = [NSNumber numberWithUnsignedShort:32768U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster moveToColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 13107/0x3333 ColorY = 32768/0x8000 " + @"TransitionTime = 0 (immediate) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_30() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_31() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentX attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentX", actualValue, 32768U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_32() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentY attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentY", actualValue, 19660U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_33() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRColorControlClusterMoveToColorParams alloc] init]; + params.colorX = [NSNumber numberWithUnsignedShort:26214U]; + params.colorY = [NSNumber numberWithUnsignedShort:32768U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:1U]; + [cluster moveToColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends MoveToColor command to DUT, with ColorX = 26214/0x6666 ColorY = 32768/0x8000 " + @"TransitionTime = 0 (immediate) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_34() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_35() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CurrentX attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentX", actualValue, 26214U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12946,7 +12974,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWrites1ToTheOptionsAttribute_36() + CHIP_ERROR TestThWrites1ToTheOptionsAttribute_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12968,7 +12996,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadOptionsAttribute_37() + CHIP_ERROR TestThReadOptionsAttribute_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -12992,7 +13020,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_38() + CHIP_ERROR TestThSendsOnCommandToDut_39() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -13009,7 +13037,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX327680x8000ColorY196600x4CCCTransitionTime0Immediate_39() + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX327680x8000ColorY196600x4CCCTransitionTime0Immediate_40() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13037,14 +13065,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_40() + CHIP_ERROR TestWait100ms_41() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_41() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13068,7 +13096,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_42() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13092,7 +13120,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOffCommandToDut_43() + CHIP_ERROR TestThSendsOffCommandToDut_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -13109,7 +13137,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_44() + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY131070x3333TransitionTime0Immediate_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13137,14 +13165,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_45() + CHIP_ERROR TestWait100ms_46() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_46() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13168,7 +13196,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_47() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_48() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13192,7 +13220,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_48() + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX131070x3333ColorY327680x8000TransitionTime0Immediate_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13220,14 +13248,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_49() + CHIP_ERROR TestWait100ms_50() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_50() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_51() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13251,7 +13279,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_51() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_52() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13275,7 +13303,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_52() + CHIP_ERROR TestThSendsMoveToColorCommandToDutWithColorX262140x6666ColorY327680x8000TransitionTime0Immediate_53() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13303,14 +13331,14 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_53() + CHIP_ERROR TestWait100ms_54() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThReadsCurrentXAttributeFromDut_54() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_55() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13334,7 +13362,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentYAttributeFromDut_55() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_56() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13358,7 +13386,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsColorModeAttributeFromDut_56() + CHIP_ERROR TestThReadsColorModeAttributeFromDut_57() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -13380,7 +13408,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_57() + CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_58() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -21569,6 +21597,14 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { } err = TestThReadsActiveNetworkFaultsAttributeValueFromDut_16(); break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads TestEventTriggersEnabled attribute value\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsTestEventTriggersEnabledAttributeValue_17(); + break; } if (CHIP_NO_ERROR != err) { @@ -21631,6 +21667,9 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -21644,7 +21683,7 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -21856,6 +21895,15 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } + + CHIP_ERROR TestThReadsTestEventTriggersEnabledAttributeValue_17() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; class Test_TC_I_1_1 : public TestCommandBridge { @@ -21906,56 +21954,27 @@ class Test_TC_I_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip(" !I.S.F00 ")) { - NextTest(); - return; - } err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip("I.S.F00")) { - NextTest(); - return; - } - err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional command(TriggerEffect) in AcceptedCommandList\n"); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional command(TriggerEffect) in AcceptedCommandList\n"); if (ShouldSkip("I.C.C40.Tx")) { NextTest(); return; } - err = TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute(IdentifyQuery) in AcceptedCommandList\n"); - if (ShouldSkip("I.C.C01.Tx")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + err = TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_5(); break; - case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Read the optional attribute(IdentifyQueryResponse) in GeneratedCommandList\n"); - if (ShouldSkip("I.S.C00.Tx")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9(); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); break; } @@ -21989,15 +22008,6 @@ class Test_TC_I_1_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -22011,7 +22021,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -22071,30 +22081,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -22120,7 +22107,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -22140,7 +22127,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_6() + CHIP_ERROR TestReadTheOptionalCommandTriggerEffectInAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -22160,27 +22147,7 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryInAcceptedCommandList_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(IdentifyQuery) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -22202,30 +22169,6 @@ class Test_TC_I_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - - CHIP_ERROR TestReadTheOptionalAttributeIdentifyQueryResponseInGeneratedCommandList_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute(IdentifyQueryResponse) in GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } }; class Test_TC_I_2_1 : public TestCommandBridge { @@ -26662,7 +26605,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends a MoveToLevel command to the DUT with Level = 200 and TransitionTime = 300 (30 s). " "This means the level should increase by 150 units in 30s, so 5 units/s\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.M.VarRate")) { + if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } @@ -26670,6 +26613,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { break; case 13: ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 10000ms\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10000ms_13(); break; case 14: @@ -26682,6 +26629,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { break; case 15: ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 10000ms\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10000ms_15(); break; case 16: @@ -26694,6 +26645,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 10000ms\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10000ms_17(); break; case 18: @@ -26706,6 +26661,10 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { break; case 19: ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 5000ms\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait5000ms_19(); break; case 20: @@ -29041,7 +29000,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends a Step command to the DUT with StepMode =0x00 (up), StepSize =150 and " "TransitionTime =300\n"); - if (ShouldSkip("LVL.S.C02.Rsp && LVL.S.M.VarRate")) { + if (ShouldSkip("LVL.S.C02.Rsp")) { NextTest(); return; } @@ -29049,6 +29008,10 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 10s\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10s_12(); break; case 13: @@ -29061,6 +29024,10 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 10s\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10s_14(); break; case 15: @@ -29073,6 +29040,10 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 10s\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait10s_16(); break; case 17: @@ -29085,6 +29056,10 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { break; case 18: ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 5000ms\n"); + if (ShouldSkip("LVL.S.M.VarRate")) { + NextTest(); + return; + } err = TestWait5000ms_18(); break; case 19: @@ -29711,153 +29686,137 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition Send On Command\n"); - if (ShouldSkip("OO.S.C01.Rsp")) { - NextTest(); - return; - } - err = TestPreconditionSendOnCommand_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - if (ShouldSkip("OO.S.A0000")) { - NextTest(); - return; - } - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Precondition: write default value of OnOffTransitionTime attribute\n"); + ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: write default value of OnOffTransitionTime attribute\n"); if (ShouldSkip("LVL.S.A0013")) { NextTest(); return; } - err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3(); + err = TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH writes 0 to the Options attribute\n"); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH writes 0 to the Options attribute\n"); if (ShouldSkip("LVL.S.A000f")) { NextTest(); return; } - err = TestThWrites0ToTheOptionsAttribute_4(); + err = TestThWrites0ToTheOptionsAttribute_2(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends On command to DUT\n"); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH sends On command to DUT\n"); if (ShouldSkip("OO.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsOnCommandToDut_5(); + err = TestThSendsOnCommandToDut_3(); break; - case 6: + case 4: ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); + " ***** Test Step 4 : TH sends a MoveToLevel command to DUT, with Level =50 and TransitionTime =0 (immediate)\n"); if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_6(); + err = TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads CurrentLevel attribute from DUT\n"); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.A0000 && LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_7(); + err = TestThReadsCurrentLevelAttributeFromDut_5(); break; - case 8: + case 6: ChipLogProgress(chipTool, - " ***** Test Step 8 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " + " ***** Test Step 6 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " "Rate field set to 0x05 (5 units/s)\n"); if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_8(); + err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 5000ms\n"); - err = TestWait5000ms_9(); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 5000ms\n"); + err = TestWait5000ms_7(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Sends stop command to DUT\n"); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Sends stop command to DUT\n"); if (ShouldSkip("LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestSendsStopCommandToDut_10(); + err = TestSendsStopCommandToDut_8(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Physically verify that the device has stopped transitioning\n"); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Physically verify that the device has stopped transitioning\n"); if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C03.Rsp")) { NextTest(); return; } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_11(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads CurrentLevel attribute from DUT\n"); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C03.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestThReadsCurrentLevelAttributeFromDut_12(); + err = TestThReadsCurrentLevelAttributeFromDut_10(); break; - case 13: + case 11: ChipLogProgress(chipTool, - " ***** Test Step 13 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " + " ***** Test Step 11 : TH sends a Move command to the DUT, with the MoveMode field set to 0x00 (move up) and the " "Rate field set to 0x05 (5 units/s)\n"); if (ShouldSkip("LVL.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_13(); + err = TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 5000ms\n"); - err = TestWait5000ms_14(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 5000ms\n"); + err = TestWait5000ms_12(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends a StopWithOnOff command to the DUT\n"); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH sends a StopWithOnOff command to the DUT\n"); if (ShouldSkip("LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestThSendsAStopWithOnOffCommandToTheDut_15(); + err = TestThSendsAStopWithOnOffCommandToTheDut_13(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Physically verify that the device has stopped transitioning\n"); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Physically verify that the device has stopped transitioning\n"); if (ShouldSkip("PICS_USER_PROMPT && LVL.S.C07.Rsp")) { NextTest(); return; } - err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_16(); + err = TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads CurrentLevel attribute from DUT\n"); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.C01.Rsp && LVL.S.C07.Rsp && LVL.S.A0000")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_17(); + err = TestReadsCurrentLevelAttributeFromDut_15(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Precondition send Off Command\n"); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Precondition send Off Command\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestPreconditionSendOffCommand_18(); + err = TestPreconditionSendOffCommand_16(); break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17(); break; } @@ -29924,12 +29883,6 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -29943,7 +29896,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 20; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -29957,46 +29910,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionSendOnCommand_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition Send On Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_3() + CHIP_ERROR TestPreconditionWriteDefaultValueOfOnOffTransitionTimeAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30019,7 +29933,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWrites0ToTheOptionsAttribute_4() + CHIP_ERROR TestThWrites0ToTheOptionsAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30041,7 +29955,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsOnCommandToDut_5() + CHIP_ERROR TestThSendsOnCommandToDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -30058,7 +29972,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_6() + CHIP_ERROR TestThSendsAMoveToLevelCommandToDutWithLevel50AndTransitionTime0Immediate_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30084,7 +29998,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_7() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30109,7 +30023,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_8() + CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30136,14 +30050,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5000ms_9() + CHIP_ERROR TestWait5000ms_7() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestSendsStopCommandToDut_10() + CHIP_ERROR TestSendsStopCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30166,7 +30080,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_11() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_9() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -30175,7 +30089,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_12() + CHIP_ERROR TestThReadsCurrentLevelAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30200,7 +30114,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_13() + CHIP_ERROR TestThSendsAMoveCommandToTheDutWithTheMoveModeFieldSetTo0x00MoveUpAndTheRateFieldSetTo0x055UnitsS_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30227,14 +30141,14 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait5000ms_14() + CHIP_ERROR TestWait5000ms_12() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 5000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestThSendsAStopWithOnOffCommandToTheDut_15() + CHIP_ERROR TestThSendsAStopWithOnOffCommandToTheDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30257,7 +30171,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_16() + CHIP_ERROR TestPhysicallyVerifyThatTheDeviceHasStoppedTransitioning_14() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -30266,7 +30180,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_17() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -30291,7 +30205,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_18() + CHIP_ERROR TestPreconditionSendOffCommand_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -30308,7 +30222,7 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -30643,11 +30557,11 @@ class Test_TC_LUNIT_1_1 : public TestCommandBridge { chip::Optional mTimeout; }; -class Test_TC_LTIME_1_1 : public TestCommandBridge { +class Test_TC_LTIME_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LTIME_1_1() - : TestCommandBridge("Test_TC_LTIME_1_1") + Test_TC_LTIME_1_2() + : TestCommandBridge("Test_TC_LTIME_1_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -30657,7 +30571,7 @@ class Test_TC_LTIME_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LTIME_1_1() {} + ~Test_TC_LTIME_1_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -30665,11 +30579,11 @@ class Test_TC_LTIME_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LTIME_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LTIME_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LTIME_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LTIME_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -30681,6 +30595,68 @@ class Test_TC_LTIME_1_1 : public TestCommandBridge { // but before our function call returns, we won't end up with an // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + if (ShouldSkip("LTIME.S.Afffd")) { + NextTest(); + return; + } + err = TestThReadsTheClusterRevisionFromDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + if (ShouldSkip("LTIME.S.Afffc")) { + NextTest(); + return; + } + err = TestThReadsTheFeatureMapFromDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + if (ShouldSkip("LTIME.S.Afffb")) { + NextTest(); + return; + } + err = TestThReadsAttributeListFromDut_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT\n"); + if (ShouldSkip("LTIME.S.Afffb && LTIME.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT\n"); + if (ShouldSkip("LTIME.S.Afffb && LTIME.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads AcceptedCommandList from DUT\n"); + if (ShouldSkip("LTIME.S.Afff9")) { + NextTest(); + return; + } + err = TestThReadsAcceptedCommandListFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads GeneratedCommandList from DUT\n"); + if (ShouldSkip("LTIME.S.Afff8")) { + NextTest(); + return; + } + err = TestThReadsGeneratedCommandListFromDut_7(); + break; } if (CHIP_NO_ERROR != err) { @@ -30692,6 +30668,30 @@ class Test_TC_LTIME_1_1 : public TestCommandBridge { void OnStatusUpdate(const chip::app::StatusIB & status) override { switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -30705,12 +30705,181 @@ class Test_TC_LTIME_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintMinValue("featureMap", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("featureMap", [value unsignedIntValue], 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAttributeListFromDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeActiveCalendarTypeInAttributeListFromDut_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ActiveCalendarType) in AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeSupportedCalendarTypesInAttributeListFromDut_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SupportedCalendarTypes) in AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAcceptedCommandListFromDut_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsGeneratedCommandListFromDut_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterTimeFormatLocalization * cluster = + [[MTRBaseClusterTimeFormatLocalization alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { @@ -125110,7 +125279,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From 9a1389271dbc206c66be9979f3cbcb23ec5ea632 Mon Sep 17 00:00:00 2001 From: Ricardo Casallas <77841255+rcasallas-silabs@users.noreply.github.com> Date: Wed, 24 Aug 2022 10:14:41 -0400 Subject: [PATCH 19/32] [EFR32] Window Covering app modified to compile on boards without LCD. (#22101) --- .../window-app/efr32/include/WindowAppImpl.h | 5 +++++ .../window-app/efr32/src/WindowAppImpl.cpp | 21 +++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/examples/window-app/efr32/include/WindowAppImpl.h b/examples/window-app/efr32/include/WindowAppImpl.h index a052838add1c89..8bfbe8ead0b7be 100644 --- a/examples/window-app/efr32/include/WindowAppImpl.h +++ b/examples/window-app/efr32/include/WindowAppImpl.h @@ -26,6 +26,9 @@ #include #include #include +#ifdef DISPLAY_ENABLED +#include +#endif class WindowAppImpl : public WindowApp { @@ -81,6 +84,8 @@ class WindowAppImpl : public WindowApp // Get QR Code and emulate its content using NFC tag char mQRCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; +#ifdef DISPLAY_ENABLED Timer mIconTimer; LcdIcon mIcon = LcdIcon::None; +#endif }; diff --git a/examples/window-app/efr32/src/WindowAppImpl.cpp b/examples/window-app/efr32/src/WindowAppImpl.cpp index 8ccfa97ea098a7..3f2cad957c068a 100644 --- a/examples/window-app/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/efr32/src/WindowAppImpl.cpp @@ -16,12 +16,10 @@ */ #include -#include #include #include #include #include -#include #include #include #include @@ -37,6 +35,11 @@ #include "wfx_host_events.h" #endif +#ifdef DISPLAY_ENABLED +#include +SilabsLCD slLCD; +#endif + #define APP_TASK_STACK_SIZE (4096) #define APP_TASK_PRIORITY 2 #define APP_EVENT_QUEUE_SIZE 10 @@ -129,16 +132,16 @@ StaticQueue_t sAppEventQueueStruct; WindowAppImpl WindowAppImpl::sInstance; -#ifdef DISPLAY_ENABLED -SilabsLCD slLCD; -#endif - WindowApp & WindowApp::Instance() { return WindowAppImpl::sInstance; } +#ifdef DISPLAY_ENABLED WindowAppImpl::WindowAppImpl() : mIconTimer("Timer:icon", LCD_ICON_TIMEOUT, OnIconTimeout, this) {} +#else +WindowAppImpl::WindowAppImpl() {} +#endif void WindowAppImpl::OnTaskCallback(void * parameter) { @@ -147,8 +150,10 @@ void WindowAppImpl::OnTaskCallback(void * parameter) void WindowAppImpl::OnIconTimeout(WindowApp::Timer & timer) { +#ifdef DISPLAY_ENABLED sInstance.mIcon = LcdIcon::None; sInstance.UpdateLCD(); +#endif } CHIP_ERROR WindowAppImpl::Init() @@ -331,6 +336,7 @@ void WindowAppImpl::DispatchEvent(const WindowApp::Event & event) case EventId::BLEConnectionsChanged: UpdateLEDs(); break; +#ifdef DISPLAY_ENABLED case EventId::CoverTypeChange: UpdateLCD(); break; @@ -344,6 +350,7 @@ void WindowAppImpl::DispatchEvent(const WindowApp::Event & event) mIcon = mTiltMode ? LcdIcon::Tilt : LcdIcon::Lift; UpdateLCD(); break; +#endif default: break; } @@ -433,10 +440,12 @@ void WindowAppImpl::UpdateLCD() Attributes::CurrentPositionTilt::Get(cover.mEndpoint, tilt); chip::DeviceLayer::PlatformMgr().UnlockChipStack(); +#ifdef DISPLAY_ENABLED if (!tilt.IsNull() && !lift.IsNull()) { LcdPainter::Paint(slLCD, type, lift.Value(), tilt.Value(), mIcon); } +#endif } #ifdef QR_CODE_ENABLED else From 591b3863b7de5e8f05ca774b0fd63cc8a8733ef3 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:48:43 -0700 Subject: [PATCH 20/32] Darwin: Allow partial validation of DAC and CD (for external cloud or custom app based validation) (#22115) --- src/darwin/Framework/CHIP/MTRDeviceController.h | 4 ++++ src/darwin/Framework/CHIP/MTRDeviceController.mm | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index faca45ddde863b..6deca1706934ca 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -124,6 +124,10 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS * Sets this MTRDeviceController to use the given issuer for issuing operational certs. By default, the MTRDeviceController uses an * internal issuer. * + * When a nocChainIssuer is set, the device commissioner will delegate verification to the chip::Credentials::PartialDACVerifier so + * that DAC chain and CD validation can be performed by custom code triggered by MTRNOCChainIssuer.onNOCChainGenerationNeeded(). + * Otherwise, the device commissioner uses the chip::Credentials::DefaultDACVerifier + * * @param[in] nocChainIssuer the NOC Chain issuer to use for issuer operational certs * * @param[in] queue The queue on which the callbacks will be delivered diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index b170771f77ad0b..438ac2409c3ac5 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,7 @@ @interface MTRDeviceController () @property (atomic, readonly) dispatch_queue_t chipWorkQueue; @property (readonly) chip::Controller::DeviceCommissioner * cppCommissioner; +@property (readonly) chip::Credentials::PartialDACVerifier * partialDACVerifier; @property (readonly) MTRDevicePairingDelegateBridge * pairingDelegateBridge; @property (readonly) MTROperationalCredentialsDelegate * operationalCredentialsDelegate; @property (readonly) MTRP256KeypairBridge signingKeypairBridge; @@ -664,7 +666,12 @@ - (void)setNocChainIssuer:(id)nocChainIssuer queue:(dispatch_ dispatch_sync(_chipWorkQueue, ^{ VerifyOrReturn([self checkIsRunning]); - self->_operationalCredentialsDelegate->SetNocChainIssuer(nocChainIssuer, queue); + if (nocChainIssuer != nil) { + self->_operationalCredentialsDelegate->SetNocChainIssuer(nocChainIssuer, queue); + self->_cppCommissioner->SetDeviceAttestationVerifier(_partialDACVerifier); + } else { + self->_cppCommissioner->SetDeviceAttestationVerifier(chip::Credentials::GetDeviceAttestationVerifier()); + } }); } From 83e1bbf9539adb5804142b51633033df274f8711 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 24 Aug 2022 10:48:32 -0700 Subject: [PATCH 21/32] Include missing Descriptor cluster in Secondary Network Commissioning Device Type (#22105) --- .../zap-templates/zcl/data-model/chip/matter-devices.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 210e6a60d91362..582fd4ee829c5d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -2043,6 +2043,12 @@ limitations under the License. 0xF002 + + DEVICE_TYPE_LIST + SERVER_LIST + CLIENT_LIST + PARTS_LIST + From b4776ad0713aac4fc54eea493ed9a6229339fb3c Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Thu, 25 Aug 2022 04:29:18 +0900 Subject: [PATCH 22/32] Remove Android updateDevice API (#22093) --- .../clusterclient/AddressUpdateFragment.kt | 17 +---------------- .../clusterclient/SensorClientFragment.kt | 13 ------------- .../main/res/layout/address_update_fragment.xml | 14 -------------- .../devicecontroller/ChipDeviceController.java | 6 ------ 4 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt index 1bb841b81965b3..217cbc00737721 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt @@ -13,7 +13,6 @@ import com.google.chip.chiptool.R import com.google.chip.chiptool.util.DeviceIdUtil import kotlinx.android.synthetic.main.address_update_fragment.deviceIdEd import kotlinx.android.synthetic.main.address_update_fragment.fabricIdEd -import kotlinx.android.synthetic.main.address_update_fragment.view.updateAddressBtn /** Fragment for updating the address of a device given its fabric and node ID. */ class AddressUpdateFragment: Fragment() { @@ -28,9 +27,7 @@ class AddressUpdateFragment: Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - return inflater.inflate(R.layout.address_update_fragment, container, false).apply { - updateAddressBtn.setOnClickListener { updateAddressClick() } - } + return inflater.inflate(R.layout.address_update_fragment, container, false).apply { } } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -40,16 +37,4 @@ class AddressUpdateFragment: Fragment() { fabricIdEd.setText(compressedFabricId.toULong().toString(16).padStart(16, '0')) deviceIdEd.setText(DeviceIdUtil.getLastDeviceId(requireContext()).toString()) } - - private fun updateAddressClick() { - try { - deviceController.updateDevice( - fabricIdEd.text.toString().toULong(16).toLong(), - deviceIdEd.text.toString().toULong().toLong() - ) - Toast.makeText(requireContext(), "Address update started", Toast.LENGTH_SHORT).show() - } catch (ex: Exception) { - Toast.makeText(requireContext(), "Address update failed: $ex", Toast.LENGTH_SHORT).show() - } - } } \ No newline at end of file diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt index 64f35095652732..587eb85020651c 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt @@ -66,7 +66,6 @@ class SensorClientFragment : Fragment() { ChipClient.getDeviceController(requireContext()).setCompletionListener(null) deviceIdEd.setOnEditorActionListener { textView, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_DONE) { - updateAddress(textView.text.toString()) resetSensorGraph() // reset the graph on device change } actionId == EditorInfo.IME_ACTION_DONE @@ -116,7 +115,6 @@ class SensorClientFragment : Fragment() { override fun onStart() { super.onStart() deviceIdEd.setText(DeviceIdUtil.getLastDeviceId(requireContext()).toString()) - updateAddress(deviceIdEd.text.toString()) } override fun onStop() { @@ -124,17 +122,6 @@ class SensorClientFragment : Fragment() { super.onStop() } - private fun updateAddress(deviceId: String) { - try { - ChipClient.getDeviceController(requireContext()).updateDevice( - /* fabric ID */ 5544332211, - deviceId.toULong().toLong() - ) - } catch (ex: Exception) { - showMessage(R.string.update_device_address_failure, ex.toString()) - } - } - private fun resetSensorGraph() { watchSensorBtn.isChecked = false sensorGraph.visibility = View.INVISIBLE diff --git a/src/android/CHIPTool/app/src/main/res/layout/address_update_fragment.xml b/src/android/CHIPTool/app/src/main/res/layout/address_update_fragment.xml index c76cc76fc7b85e..3a401297e326aa 100644 --- a/src/android/CHIPTool/app/src/main/res/layout/address_update_fragment.xml +++ b/src/android/CHIPTool/app/src/main/res/layout/address_update_fragment.xml @@ -32,18 +32,4 @@ android:layout_height="wrap_content" app:barrierDirection="bottom" app:constraint_referenced_ids="fabricIdEd,deviceIdEd" /> - -