From de9af2665f70372fe6b9acb8e520025994ccf21a Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:12:29 -0500 Subject: [PATCH] [App] Removing af-enums.h (#32110) * Purge EMBER_ZCL_STATUS * Add to_underlying in examples * fix CI * Fix CI and comments --- .github/workflows/lint.yml | 1 - .../include/operational-state-delegate-impl.h | 2 +- .../include/oven-operational-state-delegate.h | 2 +- .../rvc-operational-state-delegate-impl.h | 2 +- .../src/dishwasher-alarm-stub.cpp | 1 - examples/all-clusters-app/asr/src/AppTask.cpp | 2 +- .../infineon/psoc6/src/AppTask.cpp | 2 +- .../nrfconnect/main/ZclDoorLockCallbacks.cpp | 2 +- .../telink/src/ZclDoorLockCallbacks.cpp | 2 +- .../asr/src/AppTask.cpp | 2 +- .../infineon/psoc6/src/AppTask.cpp | 2 +- examples/bridge-app/telink/src/AppTask.cpp | 4 +- .../chef-rvc-operational-state-delegate.h | 2 +- examples/common/imgui_ui/windows/light.cpp | 2 +- .../nxp/k32w/k32w0/main/AppTask.cpp | 2 +- .../nxp/k32w/k32w1/main/AppTask.cpp | 2 +- .../contact-sensor-app/telink/src/AppTask.cpp | 2 +- .../commands/common/MTRError.mm | 1 - .../include/operational-state-delegate-impl.h | 2 +- examples/light-switch-app/qpg/src/AppTask.cpp | 2 +- examples/lighting-app/asr/src/AppTask.cpp | 4 +- examples/lighting-app/esp32/main/AppTask.cpp | 4 +- .../infineon/cyw30739/src/LightingManager.cpp | 6 +- .../infineon/psoc6/src/AppTask.cpp | 2 +- examples/lighting-app/mbed/main/AppTask.cpp | 4 +- .../lighting-app/nrfconnect/main/AppTask.cpp | 4 +- .../nxp/k32w/k32w0/main/AppTask.cpp | 2 +- .../nxp/k32w/k32w1/main/AppTask.cpp | 2 +- examples/lighting-app/qpg/src/AppTask.cpp | 4 +- examples/lighting-app/silabs/src/AppTask.cpp | 2 +- .../stm32/src/STM32WB5/AppTask.cpp | 4 +- examples/lighting-app/telink/src/AppTask.cpp | 4 +- .../lighting-app/tizen/src/DBusInterface.cpp | 6 +- .../lighting-app/tizen/src/LedManager.cpp | 2 +- examples/lock-app/asr/src/AppTask.cpp | 2 +- examples/lock-app/esp32/main/AppTask.cpp | 4 +- examples/lock-app/genio/src/AppTask.cpp | 2 +- examples/lock-app/genio/src/ZclCallbacks.cpp | 12 +-- .../lock-app/infineon/cyw30739/src/main.cpp | 2 +- .../lock-app/infineon/psoc6/src/AppTask.cpp | 2 +- examples/lock-app/mbed/main/AppTask.cpp | 2 +- .../lock-app/nrfconnect/main/ZclCallbacks.cpp | 2 +- .../lock-app/nxp/k32w/k32w0/main/AppTask.cpp | 2 +- examples/lock-app/qpg/src/AppTask.cpp | 2 +- examples/lock-app/qpg/src/ZclCallbacks.cpp | 2 +- examples/lock-app/silabs/src/AppTask.cpp | 2 +- .../include/microwave-oven-device.h | 2 +- .../ota-requestor-app/esp32/main/main.cpp | 1 - examples/platform/asr/shell/matter_shell.cpp | 2 +- .../pump-app/cc13x2x7_26x2x7/main/AppTask.cpp | 38 ++++----- .../pump-app/cc13x4_26x4/main/AppTask.cpp | 38 ++++----- examples/pump-app/nrfconnect/main/AppTask.cpp | 28 +++---- examples/pump-app/silabs/src/AppTask.cpp | 2 +- examples/pump-app/telink/src/AppTask.cpp | 2 +- .../include/rvc-operational-state-delegate.h | 2 +- examples/thermostat/qpg/src/ZclCallbacks.cpp | 2 +- .../android/java/DoorLockManager.cpp | 3 +- .../nrfconnect/main/ZclCallbacks.cpp | 2 +- .../boolean-state-configuration-server.cpp | 48 +++++------ .../boolean-state-configuration-server.h | 3 +- ...ridged-device-basic-information-server.cpp | 6 +- .../dishwasher-alarm-server.cpp | 28 +++---- .../door-lock-server/door-lock-server.cpp | 81 ++++++++++--------- .../door-lock-server/door-lock-server.h | 4 +- .../clusters/groups-server/groups-server.cpp | 2 +- .../identify-server/identify-server.cpp | 8 +- .../microwave-oven-control-server.h | 2 +- .../mode-base-server/mode-base-server.cpp | 2 +- .../supported-modes-manager.h | 4 +- .../operational-state-cluster-objects.h | 2 +- .../ota-requestor/DefaultOTARequestor.cpp | 5 +- .../ota-requestor/OTARequestorInterface.h | 2 +- .../pump-configuration-and-control-server.cpp | 4 +- .../replacement-product-list-manager.h | 2 +- .../clusters/scenes-server/scenes-server.cpp | 4 +- .../supported-temperature-levels-manager.h | 2 +- .../time-synchronization-delegate.h | 3 +- ...valve-configuration-and-control-server.cpp | 41 +++++----- .../valve-configuration-and-control-server.h | 3 +- src/app/icd/server/ICDManager.cpp | 4 +- src/app/util/af-enums.h | 70 ---------------- src/app/util/af-types.h | 1 - src/app/util/generic-callbacks.h | 6 +- src/app/util/im-client-callbacks.h | 1 - src/darwin/Framework/CHIP/MTRError.mm | 1 - .../CHIP/ServerEndpoint/MTRIMDispatch.mm | 2 +- src/protocols/interaction_model/StatusCode.h | 11 ++- 87 files changed, 262 insertions(+), 337 deletions(-) delete mode 100644 src/app/util/af-enums.h diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 92d5ca3598c6b4..189f63837c841e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -119,7 +119,6 @@ jobs: --known-failure app/reporting/tests/MockReportScheduler.h \ --known-failure app/server/AppDelegate.h \ --known-failure app/TestEventTriggerDelegate.h \ - --known-failure app/util/af-enums.h \ --known-failure app/util/af.h \ --known-failure app/util/af-types.h \ --known-failure app/util/attribute-metadata.h \ diff --git a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h index 0bcb76f324a1da..5c6f70bd28a50c 100644 --- a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h +++ b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h index 6d7338214f77ae..f68eec20692d0b 100644 --- a/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h +++ b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h index 4417f9f5a3ab4a..60a2f5d530f9b9 100644 --- a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h +++ b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp index 58d393752c8bfd..f700df068b529f 100644 --- a/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp @@ -17,7 +17,6 @@ */ #include #include -#include using namespace chip; diff --git a/examples/all-clusters-app/asr/src/AppTask.cpp b/examples/all-clusters-app/asr/src/AppTask.cpp index 069954f7adf70d..92b6aaef3dba49 100644 --- a/examples/all-clusters-app/asr/src/AppTask.cpp +++ b/examples/all-clusters-app/asr/src/AppTask.cpp @@ -272,7 +272,7 @@ void AppTask::OnOffUpdateClusterState(void) if (status != Status::Success) { - ASR_LOG("ERR: updating on/off %x", status); + ASR_LOG("ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp index e14bf5ac6278ba..b75b5abfc74294 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp @@ -413,7 +413,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - P6_LOG("ERR: updating on/off %x", status); + P6_LOG("ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp index 8f741fcb83b7c3..eaf2bda516f23e 100644 --- a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp +++ b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp @@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Updating feature map %x", status); + LOG_ERR("Updating feature map %x", to_underlying(status)); } } diff --git a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp index 8f741fcb83b7c3..eaf2bda516f23e 100644 --- a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp +++ b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp @@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Updating feature map %x", status); + LOG_ERR("Updating feature map %x", to_underlying(status)); } } diff --git a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp index b97900d7533bd3..d6f77d2f28a836 100644 --- a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp @@ -225,7 +225,7 @@ void AppTask::OnOffUpdateClusterState(void) if (status != Protocols::InteractionModel::Status::Success) { - ASR_LOG("ERR: updating on/off %x", status); + ASR_LOG("ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp index dd43df8ec5f03f..7cbaf6f447d405 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp @@ -410,7 +410,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - P6_LOG("ERR: updating on/off %x", status); + P6_LOG("ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/bridge-app/telink/src/AppTask.cpp b/examples/bridge-app/telink/src/AppTask.cpp index 2f6f273cc0cbad..d21897bd2d36b6 100644 --- a/examples/bridge-app/telink/src/AppTask.cpp +++ b/examples/bridge-app/telink/src/AppTask.cpp @@ -597,12 +597,12 @@ void AppTask::UpdateClusterState(void) if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Update OnOff fail: %x", status); + LOG_ERR("Update OnOff fail: %x", to_underlying(status)); } uint8_t setLevel = sAppTask.mPwmRgbBlueLed.GetLevel(); status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Update CurrentLevel fail: %x", status); + LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status)); } } diff --git a/examples/chef/common/chef-rvc-operational-state-delegate.h b/examples/chef/common/chef-rvc-operational-state-delegate.h index c8d63c2bb6efc2..f487e38000771d 100644 --- a/examples/chef/common/chef-rvc-operational-state-delegate.h +++ b/examples/chef/common/chef-rvc-operational-state-delegate.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/common/imgui_ui/windows/light.cpp b/examples/common/imgui_ui/windows/light.cpp index a2dd030c218bec..86899e044b2ed1 100644 --- a/examples/common/imgui_ui/windows/light.cpp +++ b/examples/common/imgui_ui/windows/light.cpp @@ -76,7 +76,7 @@ void Light::UpdateState() if (status != chip::Protocols::InteractionModel::Status::Success) { - ChipLogError(AppServer, "Failed to set on/off value: %d", status); + ChipLogError(AppServer, "Failed to set on/off value: %d", chip::to_underlying(status)); } mTargetLightIsOn.ClearValue(); diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp index fd4a449d68d7b9..a46ea5db28df64 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -895,7 +895,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status); + ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status)); } logBooleanStateEvent(newValue); } diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp index b1aa6792340fce..10039bb8c9270e 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp @@ -792,7 +792,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status); + ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status)); } logBooleanStateEvent(newValue); } diff --git a/examples/contact-sensor-app/telink/src/AppTask.cpp b/examples/contact-sensor-app/telink/src/AppTask.cpp index 0c4072d6b8e21e..dbcf9e1ce48405 100644 --- a/examples/contact-sensor-app/telink/src/AppTask.cpp +++ b/examples/contact-sensor-app/telink/src/AppTask.cpp @@ -98,7 +98,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status); + ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status)); } } diff --git a/examples/darwin-framework-tool/commands/common/MTRError.mm b/examples/darwin-framework-tool/commands/common/MTRError.mm index d385983ca2fc94..f7680e822d323d 100644 --- a/examples/darwin-framework-tool/commands/common/MTRError.mm +++ b/examples/darwin-framework-tool/commands/common/MTRError.mm @@ -20,7 +20,6 @@ #import #import -#import #import #import diff --git a/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h b/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h index 9fd023db8194d9..5f017119930e5e 100644 --- a/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h +++ b/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/light-switch-app/qpg/src/AppTask.cpp b/examples/light-switch-app/qpg/src/AppTask.cpp index 91579d7937ef9e..318e61b1e875c8 100644 --- a/examples/light-switch-app/qpg/src/AppTask.cpp +++ b/examples/light-switch-app/qpg/src/AppTask.cpp @@ -500,7 +500,7 @@ void AppTask::UpdateClusterState(void) if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status)); } */ } diff --git a/examples/lighting-app/asr/src/AppTask.cpp b/examples/lighting-app/asr/src/AppTask.cpp index 0889f49e8f686f..b72ff5c8588f31 100755 --- a/examples/lighting-app/asr/src/AppTask.cpp +++ b/examples/lighting-app/asr/src/AppTask.cpp @@ -88,7 +88,7 @@ bool IsLightOn() if (status != Protocols::InteractionModel::Status::Success) { - ASR_LOG("Error Read OnOff Attribute 0x%02x\n", status); + ASR_LOG("Error Read OnOff Attribute 0x%02x\n", to_underlying(status)); } return on != false; @@ -103,7 +103,7 @@ uint8_t GetLightLevel() if (status != Protocols::InteractionModel::Status::Success) { - ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", status); + ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", to_underlying(status)); return -1; } diff --git a/examples/lighting-app/esp32/main/AppTask.cpp b/examples/lighting-app/esp32/main/AppTask.cpp index cfbc87eeb3adf9..562ee4b763faff 100644 --- a/examples/lighting-app/esp32/main/AppTask.cpp +++ b/examples/lighting-app/esp32/main/AppTask.cpp @@ -193,7 +193,7 @@ void AppTask::UpdateClusterState() if (status != Protocols::InteractionModel::Status::Success) { - ESP_LOGE(TAG, "Updating on/off cluster failed: %x", status); + ESP_LOGE(TAG, "Updating on/off cluster failed: %x", to_underlying(status)); } ESP_LOGI(TAG, "Writing to Current Level cluster"); @@ -201,6 +201,6 @@ void AppTask::UpdateClusterState() if (status != Protocols::InteractionModel::Status::Success) { - ESP_LOGE(TAG, "Updating level cluster failed: %x", status); + ESP_LOGE(TAG, "Updating level cluster failed: %x", to_underlying(status)); } } diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp index ce37a3184e85be..3af2ffad095f9b 100644 --- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp +++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp @@ -54,7 +54,7 @@ bool LightingManager::IsLightOn(void) if (status != Protocols::InteractionModel::Status::Success) { - printf("Error ReadServerAttribute 0x%02x\n", status); + printf("Error ReadServerAttribute 0x%02x\n", to_underlying(status)); } return on != false; @@ -103,7 +103,7 @@ void LightingManager::WriteClusterState(uint8_t value) if (status != Protocols::InteractionModel::Status::Success) { - printf("Error WriteServerAttribute 0x%02x\n", status); + printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status)); } } @@ -113,6 +113,6 @@ void LightingManager::WriteClusterLevel(uint8_t value) if (status != Protocols::InteractionModel::Status::Success) { - printf("Error WriteServerAttribute 0x%02x\n", status); + printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status)); } } diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp index c7c8cded19ebb7..49e6278ab032c9 100644 --- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp @@ -558,7 +558,7 @@ void AppTask::UpdateClusterState(intptr_t context) Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - P6_LOG("ERR: updating on/off %x", status); + P6_LOG("ERR: updating on/off %x", to_underlying(status)); } } #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR diff --git a/examples/lighting-app/mbed/main/AppTask.cpp b/examples/lighting-app/mbed/main/AppTask.cpp index 27dba42b12b566..26403bdb5e5b28 100644 --- a/examples/lighting-app/mbed/main/AppTask.cpp +++ b/examples/lighting-app/mbed/main/AppTask.cpp @@ -465,7 +465,7 @@ void AppTask::UpdateClusterState() Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", status); + ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", to_underlying(status)); } uint8_t level = LightingMgr().GetLevel(); @@ -474,6 +474,6 @@ void AppTask::UpdateClusterState() if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "Updating level cluster failed: %x", status); + ChipLogError(NotSpecified, "Updating level cluster failed: %x", to_underlying(status)); } } diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index 12cdbd9db3bfda..5eaa1b1b401524 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -694,7 +694,7 @@ void AppTask::UpdateClusterState() if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Updating on/off cluster failed: %x", status); + LOG_ERR("Updating on/off cluster failed: %x", to_underlying(status)); } // write the current level @@ -702,7 +702,7 @@ void AppTask::UpdateClusterState() if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Updating level cluster failed: %x", status); + LOG_ERR("Updating level cluster failed: %x", to_underlying(status)); } }); } diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp index 1c8130177e18d1..39c9584c883480 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -958,7 +958,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp index 944d68857983e1..2eb2f8e095b8b1 100644 --- a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp @@ -856,7 +856,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index a6574f709024db..2bc0ffafec5d2a 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -647,14 +647,14 @@ void AppTask::UpdateClusterState(void) if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status)); } // Write new level value status = Clusters::LevelControl::Attributes::CurrentLevel::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel()); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating level %x", status); + ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status)); } }); } diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp index 2dc310b2684039..bce7b06cb5cb07 100644 --- a/examples/lighting-app/silabs/src/AppTask.cpp +++ b/examples/lighting-app/silabs/src/AppTask.cpp @@ -250,6 +250,6 @@ void AppTask::UpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - SILABS_LOG("ERR: updating on/off %x", status); + SILABS_LOG("ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp index 415da294ae8259..d102f8a9dfd421 100644 --- a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp +++ b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp @@ -448,14 +448,14 @@ void AppTask::UpdateClusterState(void) Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn()); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status)); } // Write new level value status = Clusters::LevelControl::Attributes::CurrentLevel::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel()); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating level %x", status); + ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status)); } } diff --git a/examples/lighting-app/telink/src/AppTask.cpp b/examples/lighting-app/telink/src/AppTask.cpp index edcb3004d2454c..54dd2703c16ce9 100644 --- a/examples/lighting-app/telink/src/AppTask.cpp +++ b/examples/lighting-app/telink/src/AppTask.cpp @@ -242,13 +242,13 @@ void AppTask::UpdateClusterState(void) status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Update OnOff fail: %x", status); + LOG_ERR("Update OnOff fail: %x", to_underlying(status)); } status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("Update CurrentLevel fail: %x", status); + LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status)); } } diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp index 0332f6f82b4933..e39ca5c1e1232c 100644 --- a/examples/lighting-app/tizen/src/DBusInterface.cpp +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -207,7 +207,7 @@ void DBusInterface::InitOnOff() bool isOn = false; auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn); VerifyOrReturn(status == Protocols::InteractionModel::Status::Success, - ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status)); + ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status))); light_app_on_off_set_on_off(mIfaceOnOff, isOn); } @@ -217,14 +217,14 @@ void DBusInterface::InitColor() uint8_t value = 0; auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value); VerifyOrReturn(status == Protocols::InteractionModel::Status::Success, - ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", status)); + ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status))); light_app_color_control_set_color_mode(mIfaceColorControl, value); } { uint16_t value = 0; auto status = Clusters::ColorControl::Attributes::ColorTemperatureMireds::Get(mEndpointId, &value); VerifyOrReturn(status == Protocols::InteractionModel::Status::Success, - ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", status)); + ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", to_underlying(status))); light_app_color_control_set_color_temperature_mireds(mIfaceColorControl, value); } } diff --git a/examples/lighting-app/tizen/src/LedManager.cpp b/examples/lighting-app/tizen/src/LedManager.cpp index a19f49c3f322ea..474ba612287f16 100644 --- a/examples/lighting-app/tizen/src/LedManager.cpp +++ b/examples/lighting-app/tizen/src/LedManager.cpp @@ -63,7 +63,7 @@ void LedManager::InitOnOff() bool isOn = false; auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn); VerifyOrReturn(status == Protocols::InteractionModel::Status::Success, - ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status)); + ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status))); SetOnOff(isOn); } diff --git a/examples/lock-app/asr/src/AppTask.cpp b/examples/lock-app/asr/src/AppTask.cpp index b71ca5b84418ae..a90d0013761324 100644 --- a/examples/lock-app/asr/src/AppTask.cpp +++ b/examples/lock-app/asr/src/AppTask.cpp @@ -485,7 +485,7 @@ void AppTask::UpdateCluster(intptr_t context) : Protocols::InteractionModel::Status::Failure; if (status != Protocols::InteractionModel::Status::Success) { - ASR_LOG("ERR: updating lock state %x", status); + ASR_LOG("ERR: updating lock state %x", to_underlying(status)); } } diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp index d9f7e1d27df8eb..fbca981316f69b 100644 --- a/examples/lock-app/esp32/main/AppTask.cpp +++ b/examples/lock-app/esp32/main/AppTask.cpp @@ -23,7 +23,7 @@ #include #include #include -#include + #include #include #include @@ -471,6 +471,6 @@ void AppTask::UpdateClusterState(intptr_t context) Protocols::InteractionModel::Status status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ESP_LOGI(TAG, "ERR: updating on/off %x", status); + ESP_LOGI(TAG, "ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/lock-app/genio/src/AppTask.cpp b/examples/lock-app/genio/src/AppTask.cpp index c4e9290d6922b2..7a438dd4974d3d 100644 --- a/examples/lock-app/genio/src/AppTask.cpp +++ b/examples/lock-app/genio/src/AppTask.cpp @@ -602,6 +602,6 @@ void AppTask::UpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - MT793X_LOG("ERR: updating lock state %x", status); + MT793X_LOG("ERR: updating lock state %x", to_underlying(status)); } } diff --git a/examples/lock-app/genio/src/ZclCallbacks.cpp b/examples/lock-app/genio/src/ZclCallbacks.cpp index 20c51773000224..88ebaf641d86c7 100644 --- a/examples/lock-app/genio/src/ZclCallbacks.cpp +++ b/examples/lock-app/genio/src/ZclCallbacks.cpp @@ -66,31 +66,31 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) status = DoorLock::Attributes::LockType::Set(endpoint, DlLockType::kDeadBolt); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set LockType %x", status); + ChipLogError(Zcl, "Failed to set LockType %x", to_underlying(status)); } status = DoorLock::Attributes::NumberOfTotalUsersSupported::Set(endpoint, CONFIG_LOCK_NUM_USERS); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set number of users %x", status); + ChipLogError(Zcl, "Failed to set number of users %x", to_underlying(status)); } status = DoorLock::Attributes::NumberOfPINUsersSupported::Set(endpoint, CONFIG_LOCK_NUM_USERS); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set number of PIN users %x", status); + ChipLogError(Zcl, "Failed to set number of PIN users %x", to_underlying(status)); } status = DoorLock::Attributes::NumberOfRFIDUsersSupported::Set(endpoint, 0); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set number of RFID users %x", status); + ChipLogError(Zcl, "Failed to set number of RFID users %x", to_underlying(status)); } status = DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set number of credentials per user %x", status); + ChipLogError(Zcl, "Failed to set number of credentials per user %x", to_underlying(status)); } // Note: Due to current logic of credential, do not enable PIN and RFID @@ -99,7 +99,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0x101); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set number of credentials per user %x", status); + ChipLogError(Zcl, "Failed to set number of credentials per user %x", to_underlying(status)); } } diff --git a/examples/lock-app/infineon/cyw30739/src/main.cpp b/examples/lock-app/infineon/cyw30739/src/main.cpp index 10beef22c153e6..c82cc894bae5af 100644 --- a/examples/lock-app/infineon/cyw30739/src/main.cpp +++ b/examples/lock-app/infineon/cyw30739/src/main.cpp @@ -330,7 +330,7 @@ void UpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "ERR: updating lock state %x", status); + ChipLogError(Zcl, "ERR: updating lock state %x", to_underlying(status)); } } diff --git a/examples/lock-app/infineon/psoc6/src/AppTask.cpp b/examples/lock-app/infineon/psoc6/src/AppTask.cpp index b69a114c2f9ddb..9f29e32e6c618a 100644 --- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp @@ -665,7 +665,7 @@ void AppTask::UpdateCluster(intptr_t context) : Protocols::InteractionModel::Status::Failure; if (status != Protocols::InteractionModel::Status::Success) { - P6_LOG("ERR: updating lock state %x", status); + P6_LOG("ERR: updating lock state %x", to_underlying(status)); } } diff --git a/examples/lock-app/mbed/main/AppTask.cpp b/examples/lock-app/mbed/main/AppTask.cpp index eaa48d34a711ba..2dd5a4463dcf74 100644 --- a/examples/lock-app/mbed/main/AppTask.cpp +++ b/examples/lock-app/mbed/main/AppTask.cpp @@ -464,6 +464,6 @@ void AppTask::UpdateClusterState() Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ZCL update failed: %lx", status); + ChipLogError(NotSpecified, "ZCL update failed: %lx", to_underlying(status)); } } diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp index ec7871f2d6f92d..63040970d9b9df 100644 --- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp @@ -115,7 +115,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) { if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status); + ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status)); } }; diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 6e8a62e3d00716..7c6cffaf968c02 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -781,7 +781,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) if (status != chip::Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating door lock state %x", status); + ChipLogError(NotSpecified, "ERR: updating door lock state %x", chip::to_underlying(status)); } } diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index 74e22e5892a977..7f9d922cc8558d 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -625,7 +625,7 @@ void AppTask::UpdateClusterState(void) Protocols::InteractionModel::Status status = DoorLock::Attributes::LockState::Set(QPG_LOCK_ENDPOINT_ID, newValue); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: updating DoorLock %x", status); + ChipLogError(NotSpecified, "ERR: updating DoorLock %x", to_underlying(status)); } } else diff --git a/examples/lock-app/qpg/src/ZclCallbacks.cpp b/examples/lock-app/qpg/src/ZclCallbacks.cpp index e633c8eea16f0f..05518bff13cabd 100644 --- a/examples/lock-app/qpg/src/ZclCallbacks.cpp +++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp @@ -117,7 +117,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) { if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status); + ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status)); } }; diff --git a/examples/lock-app/silabs/src/AppTask.cpp b/examples/lock-app/silabs/src/AppTask.cpp index c5bc828beaea5f..2510fa7f351c03 100644 --- a/examples/lock-app/silabs/src/AppTask.cpp +++ b/examples/lock-app/silabs/src/AppTask.cpp @@ -359,6 +359,6 @@ void AppTask::UpdateClusterState(intptr_t context) if (status != Protocols::InteractionModel::Status::Success) { - SILABS_LOG("ERR: updating lock state %x", status); + SILABS_LOG("ERR: updating lock state %x", to_underlying(status)); } } diff --git a/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h b/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h index 4e88aa1117c21e..7799ae6fc7574a 100644 --- a/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h +++ b/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h @@ -22,7 +22,7 @@ #include #include #include -#include + #include #include #include diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp index f8282ccdf22e30..c3ee1d5803b207 100644 --- a/examples/ota-requestor-app/esp32/main/main.cpp +++ b/examples/ota-requestor-app/esp32/main/main.cpp @@ -16,7 +16,6 @@ */ #include "DeviceCallbacks.h" -#include "app/util/af-enums.h" #include "app/util/af.h" #include "esp_heap_caps_init.h" #include "esp_log.h" diff --git a/examples/platform/asr/shell/matter_shell.cpp b/examples/platform/asr/shell/matter_shell.cpp index f8abff11e9ebf7..bfa138f92ff0e5 100644 --- a/examples/platform/asr/shell/matter_shell.cpp +++ b/examples/platform/asr/shell/matter_shell.cpp @@ -88,7 +88,7 @@ void asr_matter_onoff(int value) if (status != Protocols::InteractionModel::Status::Success) { - ChipLogProgress(Zcl, "ERR: updating on/off %x", status); + ChipLogProgress(Zcl, "ERR: updating on/off %x", to_underlying(status)); } } diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index 4bfb9afb9713cb..8ac373b643bfce 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -467,7 +467,7 @@ void AppTask::InitOnOffClusterState() status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Init On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Init On/Off state %x", to_underlying(status)); } } @@ -503,25 +503,25 @@ void AppTask::UpdateCluster(intptr_t context) PumpConfigurationAndControl::ControlModeEnum::kConstantFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Flow error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Flow error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantPressure); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Speed error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Speed error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantTemperature); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", to_underlying(status)); } // Write the new values @@ -529,98 +529,98 @@ void AppTask::UpdateCluster(intptr_t context) status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status)); } int16_t maxPressure = PumpMgr().GetMaxPressure(); status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(PCC_CLUSTER_ENDPOINT, maxPressure); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status)); } uint16_t maxSpeed = PumpMgr().GetMaxSpeed(); status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(PCC_CLUSTER_ENDPOINT, maxSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status)); } uint16_t maxFlow = PumpMgr().GetMaxFlow(); status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(PCC_CLUSTER_ENDPOINT, maxFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status)); } int16_t minConstPress = PumpMgr().GetMinConstPressure(); status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(PCC_CLUSTER_ENDPOINT, minConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status)); } int16_t maxConstPress = PumpMgr().GetMaxConstPressure(); status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(PCC_CLUSTER_ENDPOINT, maxConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status)); } int16_t minCompPress = PumpMgr().GetMinCompPressure(); status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(PCC_CLUSTER_ENDPOINT, minCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status)); } int16_t maxCompPress = PumpMgr().GetMaxCompPressure(); status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(PCC_CLUSTER_ENDPOINT, maxCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status)); } uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed(); status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(PCC_CLUSTER_ENDPOINT, minConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status)); } uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed(); status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(PCC_CLUSTER_ENDPOINT, maxConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status)); } uint16_t minConstFlow = PumpMgr().GetMinConstFlow(); status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(PCC_CLUSTER_ENDPOINT, minConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status)); } uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow(); status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(PCC_CLUSTER_ENDPOINT, maxConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status)); } int16_t minConstTemp = PumpMgr().GetMinConstTemp(); status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(PCC_CLUSTER_ENDPOINT, minConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status)); } int16_t maxConstTemp = PumpMgr().GetMaxConstTemp(); status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(PCC_CLUSTER_ENDPOINT, maxConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status)); } } diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp index 5c5e93919263d9..ea094e96767665 100644 --- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp @@ -464,7 +464,7 @@ void AppTask::InitOnOffClusterState() status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Init On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Init On/Off state %x", to_underlying(status)); } } @@ -500,25 +500,25 @@ void AppTask::UpdateCluster(intptr_t context) PumpConfigurationAndControl::ControlModeEnum::kConstantFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Flow error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Flow error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantPressure); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Speed error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Speed error %x", to_underlying(status)); } status = PumpConfigurationAndControl::Attributes::ControlMode::Set( PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantTemperature); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", status); + ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", to_underlying(status)); } // Write the new values @@ -526,98 +526,98 @@ void AppTask::UpdateCluster(intptr_t context) status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status)); } int16_t maxPressure = PumpMgr().GetMaxPressure(); status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(PCC_CLUSTER_ENDPOINT, maxPressure); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status)); } uint16_t maxSpeed = PumpMgr().GetMaxSpeed(); status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(PCC_CLUSTER_ENDPOINT, maxSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status)); } uint16_t maxFlow = PumpMgr().GetMaxFlow(); status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(PCC_CLUSTER_ENDPOINT, maxFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status)); } int16_t minConstPress = PumpMgr().GetMinConstPressure(); status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(PCC_CLUSTER_ENDPOINT, minConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status)); } int16_t maxConstPress = PumpMgr().GetMaxConstPressure(); status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(PCC_CLUSTER_ENDPOINT, maxConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status)); } int16_t minCompPress = PumpMgr().GetMinCompPressure(); status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(PCC_CLUSTER_ENDPOINT, minCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status)); } int16_t maxCompPress = PumpMgr().GetMaxCompPressure(); status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(PCC_CLUSTER_ENDPOINT, maxCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status)); } uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed(); status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(PCC_CLUSTER_ENDPOINT, minConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status)); } uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed(); status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(PCC_CLUSTER_ENDPOINT, maxConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status)); } uint16_t minConstFlow = PumpMgr().GetMinConstFlow(); status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(PCC_CLUSTER_ENDPOINT, minConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status)); } uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow(); status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(PCC_CLUSTER_ENDPOINT, maxConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status)); } int16_t minConstTemp = PumpMgr().GetMinConstTemp(); status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(PCC_CLUSTER_ENDPOINT, minConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status)); } int16_t maxConstTemp = PumpMgr().GetMaxConstTemp(); status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(PCC_CLUSTER_ENDPOINT, maxConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status)); } } diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index 893c5dfd31794e..3a6eb9023ded0a 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -573,97 +573,97 @@ void AppTask::UpdateClusterState() status = OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status)); } int16_t maxPressure = PumpMgr().GetMaxPressure(); status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(kPccClusterEndpoint, maxPressure); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status)); } uint16_t maxSpeed = PumpMgr().GetMaxSpeed(); status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(kPccClusterEndpoint, maxSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status)); } uint16_t maxFlow = PumpMgr().GetMaxFlow(); status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(kPccClusterEndpoint, maxFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status)); } int16_t minConstPress = PumpMgr().GetMinConstPressure(); status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(kPccClusterEndpoint, minConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status)); } int16_t maxConstPress = PumpMgr().GetMaxConstPressure(); status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(kPccClusterEndpoint, maxConstPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status)); } int16_t minCompPress = PumpMgr().GetMinCompPressure(); status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(kPccClusterEndpoint, minCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status)); } int16_t maxCompPress = PumpMgr().GetMaxCompPressure(); status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(kPccClusterEndpoint, maxCompPress); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status)); } uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed(); status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(kPccClusterEndpoint, minConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status)); } uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed(); status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(kPccClusterEndpoint, maxConstSpeed); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status)); } uint16_t minConstFlow = PumpMgr().GetMinConstFlow(); status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(kPccClusterEndpoint, minConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status)); } uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow(); status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(kPccClusterEndpoint, maxConstFlow); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status)); } int16_t minConstTemp = PumpMgr().GetMinConstTemp(); status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(kPccClusterEndpoint, minConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status)); } int16_t maxConstTemp = PumpMgr().GetMaxConstTemp(); status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(kPccClusterEndpoint, maxConstTemp); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status); + ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status)); } } diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp index 588cd02001b9e8..365c53fc7a33ac 100644 --- a/examples/pump-app/silabs/src/AppTask.cpp +++ b/examples/pump-app/silabs/src/AppTask.cpp @@ -247,6 +247,6 @@ void AppTask::UpdateClusterState(intptr_t context) status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(PCC_CLUSTER_ENDPOINT, onOffState); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status); + ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status)); } } diff --git a/examples/pump-app/telink/src/AppTask.cpp b/examples/pump-app/telink/src/AppTask.cpp index f2832b2b3e6699..368702d51ae11f 100644 --- a/examples/pump-app/telink/src/AppTask.cpp +++ b/examples/pump-app/telink/src/AppTask.cpp @@ -134,7 +134,7 @@ void AppTask::UpdateClusterState() Protocols::InteractionModel::Status status = Clusters::OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState); if (status != Protocols::InteractionModel::Status::Success) { - LOG_ERR("ERR: Updating On/Off state %x", status); + LOG_ERR("ERR: Updating On/Off state %x", to_underlying(status)); } int16_t maxPressure = PumpMgr().GetMaxPressure(); diff --git a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h index 3081a27ea3e625..6522793ac94dc9 100644 --- a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h +++ b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/examples/thermostat/qpg/src/ZclCallbacks.cpp b/examples/thermostat/qpg/src/ZclCallbacks.cpp index 0232634dd2effd..c66901656442cc 100644 --- a/examples/thermostat/qpg/src/ZclCallbacks.cpp +++ b/examples/thermostat/qpg/src/ZclCallbacks.cpp @@ -59,7 +59,7 @@ void emberAfThermostatClusterInitCallback(EndpointId endpoint) const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) { if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status); + ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status)); } }; diff --git a/examples/virtual-device-app/android/java/DoorLockManager.cpp b/examples/virtual-device-app/android/java/DoorLockManager.cpp index 96c66d6bc5bd34..b3e245ea75dac2 100644 --- a/examples/virtual-device-app/android/java/DoorLockManager.cpp +++ b/examples/virtual-device-app/android/java/DoorLockManager.cpp @@ -52,7 +52,8 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0); if (status != Protocols::InteractionModel::Status::Success) { - ChipLogProgress(Zcl, "Device App::DoorLock::emberAfDoorLockClusterInitCallback()::Updating feature map %x", status); + ChipLogProgress(Zcl, "Device App::DoorLock::emberAfDoorLockClusterInitCallback()::Updating feature map %x", + to_underlying(status)); } } diff --git a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp index 428d488ceadc0c..12e95a7f566788 100644 --- a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp @@ -85,7 +85,7 @@ void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint) const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) { if (status != Protocols::InteractionModel::Status::Success) { - ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, status); + ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, to_underlying(status)); } }; diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp index 8fa2f36d3a3aab..b302f468aa38e4 100644 --- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp +++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp @@ -102,7 +102,7 @@ CHIP_ERROR BooleanStateConfigAttrAccess::ReadCurrentSensitivityLevel(const Concr if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) { uint8_t supportedSensLevel; - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == SupportedSensitivityLevels::Get(aPath.mEndpointId, &supportedSensLevel), + VerifyOrReturnError(Status::Success == SupportedSensitivityLevels::Get(aPath.mEndpointId, &supportedSensLevel), CHIP_IM_GLOBAL_STATUS(Failure)); VerifyOrReturnError(supportedSensLevel >= kMinSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(Failure)); VerifyOrReturnError(supportedSensLevel <= kMaxSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(Failure)); @@ -168,13 +168,13 @@ static bool emitAlarmsStateChangedEvent(EndpointId ep) BooleanStateConfiguration::Events::AlarmsStateChanged::Type event; BitMask active; - VerifyOrReturnValue(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &active), false); + VerifyOrReturnValue(Status::Success == AlarmsActive::Get(ep, &active), false); event.alarmsActive = active; if (HasFeature(ep, BooleanStateConfiguration::Feature::kAlarmSuppress)) { BitMask suppressed; - VerifyOrReturnValue(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &suppressed), false); + VerifyOrReturnValue(Status::Success == AlarmsSuppressed::Get(ep, &suppressed), false); event.alarmsSuppressed.SetValue(suppressed); } @@ -214,7 +214,7 @@ static CHIP_ERROR emitSensorFaultEvent(EndpointId ep, BitMask= kMinSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(ConstraintError)); VerifyOrReturnError(supportedSensLevel <= kMaxSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(ConstraintError)); @@ -254,11 +254,10 @@ CHIP_ERROR SetAlarmsActive(EndpointId ep, BitMask alarmsEnabled; - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Get(ep, &alarmsEnabled), - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + VerifyOrReturnError(Status::Success == AlarmsEnabled::Get(ep, &alarmsEnabled), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); VerifyOrReturnError(alarmsEnabled.HasAll(alarms), CHIP_IM_GLOBAL_STATUS(Failure)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarms), CHIP_IM_GLOBAL_STATUS(Failure)); + VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarms), CHIP_IM_GLOBAL_STATUS(Failure)); emitAlarmsStateChangedEvent(ep); return CHIP_NO_ERROR; @@ -271,12 +270,11 @@ CHIP_ERROR SetAllEnabledAlarmsActive(EndpointId ep) CHIP_IM_GLOBAL_STATUS(Failure)); BitMask alarmsEnabled; - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Get(ep, &alarmsEnabled), - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + VerifyOrReturnError(Status::Success == AlarmsEnabled::Get(ep, &alarmsEnabled), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); if (alarmsEnabled.HasAny()) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsEnabled), CHIP_IM_GLOBAL_STATUS(Failure)); + VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarmsEnabled), CHIP_IM_GLOBAL_STATUS(Failure)); emitAlarmsStateChangedEvent(ep); } @@ -288,23 +286,21 @@ CHIP_ERROR ClearAllAlarms(EndpointId ep) BitMask alarmsActive, alarmsSuppressed; bool emitEvent = false; - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive), - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed), + VerifyOrReturnError(Status::Success == AlarmsActive::Get(ep, &alarmsActive), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + VerifyOrReturnError(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); if (alarmsActive.HasAny()) { alarmsActive.ClearAll(); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsActive), - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarmsActive), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); emitEvent = true; } if (alarmsSuppressed.HasAny()) { alarmsSuppressed.ClearAll(); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed), + VerifyOrReturnError(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); emitEvent = true; } @@ -329,10 +325,10 @@ CHIP_ERROR SuppressAlarms(EndpointId ep, BitMask alarmsActive, alarmsSuppressed, alarmsSupported; - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSupported::Get(ep, &alarmsSupported), attribute_error); + VerifyOrReturnError(Status::Success == AlarmsSupported::Get(ep, &alarmsSupported), attribute_error); VerifyOrReturnError(alarmsSupported.HasAll(alarm), CHIP_IM_GLOBAL_STATUS(ConstraintError)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive), attribute_error); + VerifyOrReturnError(Status::Success == AlarmsActive::Get(ep, &alarmsActive), attribute_error); VerifyOrReturnError(alarmsActive.HasAll(alarm), CHIP_IM_GLOBAL_STATUS(InvalidInState)); Delegate * delegate = GetDelegate(ep); @@ -341,9 +337,9 @@ CHIP_ERROR SuppressAlarms(EndpointId ep, BitMaskHandleSuppressAlarm(alarm); } - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed), attribute_error); + VerifyOrReturnError(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed), attribute_error); alarmsSuppressed.Set(alarm); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed), attribute_error); + VerifyOrReturnError(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed), attribute_error); emitAlarmsStateChangedEvent(ep); @@ -409,29 +405,29 @@ bool emberAfBooleanStateConfigurationClusterEnableDisableAlarmCallback( uint8_t rawAlarm = static_cast(~alarms.Raw() & 0x03); // 0x03 is the current max bitmap alarmsToDisable = BitMask(rawAlarm); - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSupported::Get(ep, &alarmsSupported), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsSupported::Get(ep, &alarmsSupported), status.Emplace(Status::Failure)); VerifyOrExit(alarmsSupported.HasAll(alarms), status.Emplace(Status::ConstraintError)); - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Set(ep, alarms), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsEnabled::Set(ep, alarms), status.Emplace(Status::Failure)); if (!isDelegateNull(delegate)) { delegate->HandleEnableDisableAlarms(alarms); } - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsActive::Get(ep, &alarmsActive), status.Emplace(Status::Failure)); if (alarmsActive.HasAny(alarmsToDisable)) { alarmsActive.Clear(alarmsToDisable); - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsActive), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsActive::Set(ep, alarmsActive), status.Emplace(Status::Failure)); emit = true; } - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed), status.Emplace(Status::Failure)); if (alarmsSuppressed.HasAny(alarmsToDisable)) { alarmsSuppressed.Clear(alarmsToDisable); - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed), status.Emplace(Status::Failure)); emit = true; } diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h index 21813208c77249..547096053d04ea 100644 --- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h +++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -46,7 +47,7 @@ CHIP_ERROR EmitSensorFault(EndpointId ep, chip::BitMask #include #include -#include + #include #include #include @@ -33,13 +33,15 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::BridgedDeviceBasicInformation; +using chip::Protocols::InteractionModel::Status; + namespace { void ReachableChanged(EndpointId endpointId) { MATTER_TRACE_INSTANT("ReachableChanged", "BridgeBasicInfo"); bool reachable = false; - if (EMBER_ZCL_STATUS_SUCCESS != Attributes::Reachable::Get(endpointId, &reachable)) + if (Status::Success != Attributes::Reachable::Get(endpointId, &reachable)) { ChipLogError(Zcl, "ReachabledChanged: Failed to get Reachable value"); } diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp index dbf3ee3116b317..40321f8c53297c 100644 --- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp +++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp @@ -92,7 +92,7 @@ Status DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask mask) { BitMask supported; - if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask)) + if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask)) { ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Mask is not supported"); - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } Status status = Status::Success; @@ -194,14 +194,14 @@ Status DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask supported; - if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(latch)) + if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(latch)) { ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Latch is not supported"); - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } Status status = Attributes::Latch::Set(endpoint, latch); @@ -220,17 +220,17 @@ Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask finalNewState; finalNewState.Set(newState); - if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(finalNewState)) + if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(finalNewState)) { ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is not supported"); - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } BitMask mask; - if (GetMaskValue(endpoint, &mask) || !mask.HasAll(finalNewState)) + if (Status::Success != GetMaskValue(endpoint, &mask) || !mask.HasAll(finalNewState)) { ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is suppressed"); - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } Status status = Status::Success; @@ -271,16 +271,16 @@ Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask alarms) { BitMask supported; - if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms)) + if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms)) { ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is not supported"); - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } BitMask state; if (GetStateValue(endpoint, &state) != Status::Success) { - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } state.Clear(alarms); @@ -354,7 +354,7 @@ static Status ResetHandler(const app::ConcreteCommandPath & commandPath, const B if (!DishwasherAlarmServer::Instance().HasResetFeature(endpoint)) { ChipLogProgress(Zcl, "Dishwasher Alarm feature: Unsupport Reset Command"); - return EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND; + return Status::UnsupportedCommand; } // A server that is unable to reset alarms SHALL respond with a status code of FAILURE diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 7f1a99131d4b90..c049e34ba0cec2 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -41,6 +41,7 @@ using namespace chip::app; using namespace chip::app::DataModel; using namespace chip::app::Clusters::DoorLock; using namespace chip::app::Clusters::DoorLock::Attributes; +using chip::Protocols::InteractionModel::ClusterStatusCode; using chip::Protocols::InteractionModel::Status; static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_HOUR = 23; @@ -120,9 +121,9 @@ void DoorLockServer::InitServer(chip::EndpointId endpointId) ChipLogProgress(Zcl, "Door Lock cluster initialized at endpoint #%u", endpointId); auto status = Attributes::LockState::SetNull(endpointId); - if (EMBER_ZCL_STATUS_SUCCESS != status) + if (Status::Success != status) { - ChipLogError(Zcl, "[InitDoorLockServer] Unable to set the Lock State attribute to null [status=%d]", status); + ChipLogError(Zcl, "[InitDoorLockServer] Unable to set the Lock State attribute to null [status=%d]", to_underlying(status)); } SetActuatorEnabled(endpointId, true); @@ -260,7 +261,7 @@ bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId) uint8_t wrongCodeEntryLimit = 0xFF; auto status = Attributes::WrongCodeEntryLimit::Get(endpointId, &wrongCodeEntryLimit); - if (EMBER_ZCL_STATUS_SUCCESS == status) + if (Status::Success == status) { if (++endpointContext->wrongCodeEntryAttempts >= wrongCodeEntryLimit) { @@ -269,7 +270,7 @@ bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId) engageLockout(endpointId); } } - else if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE != status) + else if (Status::UnsupportedAttribute != status) { ChipLogError(Zcl, "Failed to read Wrong Code Entry Limit attribute, status=0x%x", to_underlying(status)); return false; @@ -300,11 +301,11 @@ bool DoorLockServer::engageLockout(chip::EndpointId endpointId) } auto status = Attributes::UserCodeTemporaryDisableTime::Get(endpointId, &lockoutTimeout); - if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status) + if (Status::UnsupportedAttribute == status) { return false; } - if (EMBER_ZCL_STATUS_SUCCESS != status) + if (Status::Success != status) { ChipLogError(Zcl, "Unable to read the UserCodeTemporaryDisableTime attribute [status=%d]", to_underlying(status)); return false; @@ -401,7 +402,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb if (!SupportsUSR(commandPath.mEndpointId)) { ChipLogProgress(Zcl, "[SetUser] User management is not supported [endpointId=%d]", commandPath.mEndpointId); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::UnsupportedCommand)); return; } @@ -410,7 +411,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb { ChipLogError(Zcl, "[SetUser] Unable to get the fabric IDX [endpointId=%d,userIndex=%d]", commandPath.mEndpointId, userIndex); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_FAILURE); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::Failure)); return; } @@ -419,7 +420,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb { ChipLogError(Zcl, "[SetUser] Unable to get the source node index [endpointId=%d,userIndex=%d]", commandPath.mEndpointId, userIndex); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_FAILURE); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::Failure)); return; } @@ -433,7 +434,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb if (!userIndexValid(commandPath.mEndpointId, userIndex)) { ChipLogProgress(Zcl, "[SetUser] User index out of bounds [endpointId=%d,userIndex=%d]", commandPath.mEndpointId, userIndex); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand)); return; } @@ -443,7 +444,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb ChipLogProgress(Zcl, "[SetUser] Unable to set user: userName too long [endpointId=%d,userIndex=%d,userNameSize=%u]", commandPath.mEndpointId, userIndex, static_cast(userName.Value().size())); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand)); return; } @@ -453,7 +454,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb "[SetUser] Unable to set the user: user status is out of range [endpointId=%d,userIndex=%d,userStatus=%u]", commandPath.mEndpointId, userIndex, to_underlying(userStatus.Value())); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand)); return; } @@ -462,11 +463,11 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb ChipLogProgress(Zcl, "[SetUser] Unable to set the user: user type is unknown [endpointId=%d,userIndex=%d,userType=%u]", commandPath.mEndpointId, userIndex, to_underlying(userType.Value())); - sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand)); return; } - Status status = Status::Success; + ClusterStatusCode status(Status::Success); switch (operationType) { case DataOperationTypeEnum::kAdd: @@ -474,14 +475,14 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb userType, credentialRule); break; case DataOperationTypeEnum::kModify: - status = modifyUser(commandPath.mEndpointId, fabricIdx, sourceNodeId, userIndex, userName, userUniqueId, userStatus, - userType, credentialRule); + status = ClusterStatusCode(modifyUser(commandPath.mEndpointId, fabricIdx, sourceNodeId, userIndex, userName, userUniqueId, + userStatus, userType, credentialRule)); break; case DataOperationTypeEnum::kClear: default: // appclusters, 5.2.4.34: SetUser command allow only kAdd/kModify, we should respond with INVALID_COMMAND if we got kClear // or anything else - status = Status::InvalidCommand; + status = ClusterStatusCode(Status::InvalidCommand); ChipLogProgress(Zcl, "[SetUser] Invalid operation type [endpointId=%d,operationType=%u]", commandPath.mEndpointId, to_underlying(operationType)); break; @@ -1873,26 +1874,25 @@ bool DoorLockServer::findUserIndexByCredential(chip::EndpointId endpointId, Cred return false; } -Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId, - uint16_t userIndex, const Nullable & userName, - const Nullable & userUniqueId, const Nullable & userStatus, - const Nullable & userType, const Nullable & credentialRule, - const Nullable & credential) +ClusterStatusCode DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, + chip::NodeId sourceNodeId, uint16_t userIndex, + const Nullable & userName, const Nullable & userUniqueId, + const Nullable & userStatus, const Nullable & userType, + const Nullable & credentialRule, + const Nullable & credential) { EmberAfPluginDoorLockUserInfo user; if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user)) { ChipLogError(Zcl, "[createUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex); - return Status::Failure; + return ClusterStatusCode(Status::Failure); } // appclusters, 5.2.4.34: to modify user its status should be set to Available. If it is we should return OCCUPIED. if (UserStatusEnum::kAvailable != user.userStatus) { ChipLogProgress(Zcl, "[createUser] Unable to overwrite existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex); - // TODO FixMe https://github.com/project-chip/connectedhomeip/issues/32100 - return static_cast(DlStatus::kOccupied); - ; + return ClusterStatusCode::ClusterSpecificFailure(DlStatus::kOccupied); } const auto & newUserName = !userName.IsNull() ? userName.Value() : ""_span; @@ -1918,7 +1918,7 @@ Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex endpointId, creatorFabricIdx, userIndex, static_cast(newUserName.size()), newUserName.data(), newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule), static_cast(newTotalCredentials)); - return Status::Failure; + return ClusterStatusCode(Status::Failure); } ChipLogProgress(Zcl, @@ -1932,7 +1932,7 @@ Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kAdd, sourceNodeId, creatorFabricIdx, userIndex, userIndex); - return EMBER_ZCL_STATUS_SUCCESS; + return ClusterStatusCode(Status::Success); } Status DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId, @@ -2129,15 +2129,17 @@ DlStatus DoorLockServer::createNewCredentialAndUser(chip::EndpointId endpointId, return DlStatus::kOccupied; } - auto status = + ClusterStatusCode status = createUser(endpointId, creatorFabricIdx, sourceNodeId, availableUserIndex, Nullable(), Nullable(), userStatus, userType, Nullable(), Nullable(credential)); - if (EMBER_ZCL_STATUS_SUCCESS != status) + if (!status.IsSuccess()) { ChipLogProgress(Zcl, "[SetCredential] Unable to create new user for credential: internal error " "[endpointId=%d,credentialIndex=%d,userIndex=%d,status=%d]", - endpointId, credential.credentialIndex, availableUserIndex, status); + endpointId, credential.credentialIndex, availableUserIndex, + status.HasClusterSpecificCode() ? status.GetClusterSpecificCode().Value() + : (to_underlying(status.GetStatus()))); return DlStatus::kFailure; } @@ -3406,18 +3408,17 @@ bool DoorLockServer::RemoteOperationEnabled(chip::EndpointId endpointId) const } void DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - Status status) + ClusterStatusCode status) { VerifyOrDie(nullptr != commandObj); - auto statusAsInteger = to_underlying(status); - if (statusAsInteger == to_underlying(DlStatus::kOccupied) || statusAsInteger == to_underlying(DlStatus::kDuplicate)) + if (status.HasClusterSpecificCode()) { - VerifyOrDie(commandObj->AddClusterSpecificFailure(commandPath, static_cast(status)) == CHIP_NO_ERROR); + VerifyOrDie(commandObj->AddClusterSpecificFailure(commandPath, status.GetClusterSpecificCode().Value()) == CHIP_NO_ERROR); } else { - commandObj->AddStatus(commandPath, status); + commandObj->AddStatus(commandPath, status.GetStatus()); } } @@ -3514,7 +3515,7 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma { auto status = Attributes::RequirePINforRemoteOperation::Get(endpoint, &requirePin); VerifyOrExit( - EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status || EMBER_ZCL_STATUS_SUCCESS == status, + Status::UnsupportedAttribute == status || Status::Success == status, ChipLogError(Zcl, "Failed to read Require PIN For Remote Operation attribute, status=0x%x", to_underlying(status))); } // If the PIN is required but not provided we should exit @@ -3957,7 +3958,7 @@ void DoorLockServer::setAliroReaderConfigCommandHandler(CommandHandler * command ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID); status = Status::Failure; } - sendClusterResponse(commandObj, commandPath, status); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(status)); } void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath) @@ -3979,7 +3980,7 @@ void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * comma ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID); status = Status::Failure; } - sendClusterResponse(commandObj, commandPath, status); + sendClusterResponse(commandObj, commandPath, ClusterStatusCode(status)); } // ============================================================================= @@ -4125,7 +4126,7 @@ void DoorLockServer::DoorLockOnAutoRelockCallback(System::Layer *, void * callba auto endpointId = static_cast(reinterpret_cast(callbackContext)); Nullable lockState; - if (Attributes::LockState::Get(endpointId, lockState) != EMBER_ZCL_STATUS_SUCCESS || lockState.IsNull() || + if (Attributes::LockState::Get(endpointId, lockState) != Status::Success || lockState.IsNull() || lockState.Value() != DlLockState::kLocked) { ChipLogProgress(Zcl, "Door Auto relock timer expired. %s", "Locking..."); diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index dd11ebdbd7db3f..f50a666ca67721 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -307,7 +307,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface bool findUserIndexByCredential(chip::EndpointId endpointId, CredentialTypeEnum credentialType, chip::ByteSpan credentialData, uint16_t & userIndex, uint16_t & credentialIndex, EmberAfPluginDoorLockUserInfo & userInfo); - chip::Protocols::InteractionModel::Status + chip::Protocols::InteractionModel::ClusterStatusCode createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId, uint16_t userIndex, const Nullable & userName, const Nullable & userUniqueId, const Nullable & userStatus, const Nullable & userType, @@ -479,7 +479,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface bool engageLockout(chip::EndpointId endpointId); static void sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - chip::Protocols::InteractionModel::Status status); + chip::Protocols::InteractionModel::ClusterStatusCode status); /** * @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 04e26a004b3aed..65bfbc1c3e5952 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -297,7 +297,7 @@ bool emberAfGroupsClusterRemoveGroupCallback(app::CommandHandler * commandObj, c ScenesManagement::ScenesServer::Instance().GroupWillBeRemoved(fabricIndex, commandPath.mEndpointId, commandData.groupID); #endif response.groupID = commandData.groupID; - response.status = GroupRemove(fabricIndex, commandPath.mEndpointId, commandData.groupID); + response.status = to_underlying(GroupRemove(fabricIndex, commandPath.mEndpointId, commandData.groupID)); commandObj->AddResponse(commandPath, response); return true; diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp index c93d96d3016e7e..257adf934a5328 100644 --- a/src/app/clusters/identify-server/identify-server.cpp +++ b/src/app/clusters/identify-server/identify-server.cpp @@ -104,7 +104,7 @@ static void onIdentifyClusterTick(chip::System::Layer * systemLayer, void * appS { EndpointId endpoint = identify->mEndpoint; - if (EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 != identifyTime) + if (Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 != identifyTime) { identifyTime = static_cast(identifyTime == 0 ? 0 : identifyTime - 1); // This tick writes the new attribute, which will trigger the Attribute @@ -145,7 +145,7 @@ void MatterIdentifyClusterServerAttributeChangedCallback(const app::ConcreteAttr return; } - if (EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime)) + if (Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime)) { /* effect identifier changed during identify */ if (identify->mTargetEffectIdentifier != identify->mCurrentEffectIdentifier) @@ -229,8 +229,8 @@ bool emberAfIdentifyClusterTriggerEffectCallback(CommandHandler * commandObj, co identify->mEffectVariant = effectVariant; /* only call the callback if no identify is in progress */ - if (nullptr != identify->mOnEffectIdentifier && - EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 == identifyTime) + if (nullptr != identify->mOnEffectIdentifier && Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && + 0 == identifyTime) { identify->mCurrentEffectIdentifier = identify->mTargetEffectIdentifier; identify->mOnEffectIdentifier(identify); diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h index d82b353f7f3eb1..ef77717bc15480 100644 --- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h +++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h @@ -23,7 +23,7 @@ #include #include #include -#include + #include namespace chip { diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp index 6c5feb1d69c88e..76bd195376e9b0 100644 --- a/src/app/clusters/mode-base-server/mode-base-server.cpp +++ b/src/app/clusters/mode-base-server/mode-base-server.cpp @@ -135,7 +135,7 @@ CHIP_ERROR Instance::Init() DataModel::Nullable onMode = GetOnMode(); bool onOffValueForStartUp = false; if (!emberAfIsKnownVolatileAttribute(mEndpointId, OnOff::Id, OnOff::Attributes::StartUpOnOff::Id) && - OnOffServer::Instance().getOnOffValueForStartUp(mEndpointId, onOffValueForStartUp) == EMBER_ZCL_STATUS_SUCCESS) + OnOffServer::Instance().getOnOffValueForStartUp(mEndpointId, onOffValueForStartUp) == Status::Success) { if (onOffValueForStartUp && !onMode.IsNull()) { diff --git a/src/app/clusters/mode-select-server/supported-modes-manager.h b/src/app/clusters/mode-select-server/supported-modes-manager.h index 4a6ccd20c5f60a..3c36f188cb4a0e 100644 --- a/src/app/clusters/mode-select-server/supported-modes-manager.h +++ b/src/app/clusters/mode-select-server/supported-modes-manager.h @@ -19,7 +19,7 @@ #pragma once #include -#include + #include namespace chip { @@ -74,7 +74,7 @@ class SupportedModesManager * @param mode The mode for which to search the ModeOptionStruct. * @param dataPtr The pointer to receive the ModeOptionStruct, if one is found. * @return Status::Success if successfully found the option. Otherwise, returns appropriate status code (found in - * ) + * ) */ virtual Protocols::InteractionModel::Status getModeOptionByMode(EndpointId endpointId, uint8_t mode, const ModeOptionStructType ** dataPtr) const = 0; diff --git a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h index 58fd8401e8adcc..7a2ffa96d04a89 100644 --- a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h +++ b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h @@ -19,7 +19,7 @@ #pragma once #include -#include + #include namespace chip { diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp index 213d9d64b8b5a4..edd0b5729c2708 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp @@ -410,14 +410,13 @@ void DefaultOTARequestor::CancelImageUpdate() CHIP_ERROR DefaultOTARequestor::GetUpdateStateProgressAttribute(EndpointId endpointId, app::DataModel::Nullable & progress) { - VerifyOrReturnError(OtaRequestorServerGetUpdateStateProgress(endpointId, progress) == EMBER_ZCL_STATUS_SUCCESS, - CHIP_ERROR_BAD_REQUEST); + VerifyOrReturnError(OtaRequestorServerGetUpdateStateProgress(endpointId, progress) == Status::Success, CHIP_ERROR_BAD_REQUEST); return CHIP_NO_ERROR; } CHIP_ERROR DefaultOTARequestor::GetUpdateStateAttribute(EndpointId endpointId, OTAUpdateStateEnum & state) { - VerifyOrReturnError(OtaRequestorServerGetUpdateState(endpointId, state) == EMBER_ZCL_STATUS_SUCCESS, CHIP_ERROR_BAD_REQUEST); + VerifyOrReturnError(OtaRequestorServerGetUpdateState(endpointId, state) == Status::Success, CHIP_ERROR_BAD_REQUEST); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/ota-requestor/OTARequestorInterface.h b/src/app/clusters/ota-requestor/OTARequestorInterface.h index d81b67424f0b60..f03ccab4c75d2d 100644 --- a/src/app/clusters/ota-requestor/OTARequestorInterface.h +++ b/src/app/clusters/ota-requestor/OTARequestorInterface.h @@ -21,7 +21,7 @@ */ #include -#include + #include #pragma once diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index 76f2a3d01830ed..c3eebe257c6b17 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -32,6 +32,8 @@ using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::PumpConfigurationAndControl; +using chip::Protocols::InteractionModel::Status; + namespace chip { namespace app { namespace Clusters { @@ -232,7 +234,7 @@ bool HasFeature(EndpointId endpoint, Feature feature) { bool hasFeature; uint32_t featureMap; - hasFeature = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS); + hasFeature = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success); return hasFeature ? ((featureMap & to_underlying(feature)) != 0) : false; } diff --git a/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h index bd63dabca180c9..cdf64cc2c3dce2 100644 --- a/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h +++ b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h @@ -20,7 +20,7 @@ #include #include -#include + #include namespace chip { diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index a62427dfffadda..fc0c656d17fffd 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -1112,7 +1112,7 @@ void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint) Status status = Attributes::LastConfiguredBy::SetNull(endpoint); if (Status::Success != status) { - ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, status); + ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, to_underlying(status)); } // Initialize the FabricSceneInfo by getting the number of scenes and the remaining capacity for storing fabric scene data @@ -1126,7 +1126,7 @@ void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint) void MatterScenesManagementClusterServerShutdownCallback(EndpointId endpoint) { uint16_t endpointTableSize = 0; - ReturnOnFailure(Attributes::SceneTableSize::Get(endpoint, &endpointTableSize)); + VerifyOrReturn(Status::Success == Attributes::SceneTableSize::Get(endpoint, &endpointTableSize)); // Get Scene Table Instance SceneTable * sceneTable = scenes::GetSceneTableImpl(endpoint, endpointTableSize); diff --git a/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h b/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h index 754be5701dd33c..5ff3db169261be 100644 --- a/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h +++ b/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h @@ -19,7 +19,7 @@ #pragma once #include -#include + #include namespace chip { diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h b/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h index 6ef37f2403927d..7d5bad65ff0d2e 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h +++ b/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -43,7 +44,7 @@ class Delegate inline bool HasFeature(Feature feature) { uint32_t map; - bool success = (Attributes::FeatureMap::Get(mEndpoint, &map) == EMBER_ZCL_STATUS_SUCCESS); + bool success = (Attributes::FeatureMap::Get(mEndpoint, &map) == Protocols::InteractionModel::Status::Success); return success ? (map & to_underlying(feature)) : false; } diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp index 62d5e1b2c77da8..120cd2b3dd8416 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp @@ -280,19 +280,18 @@ CHIP_ERROR CloseValve(EndpointId ep) DataModel::Nullable rDuration; CHIP_ERROR attribute_error = CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kClosed), + VerifyOrReturnError(Status::Success == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kClosed), attribute_error); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == - CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning), + VerifyOrReturnError(Status::Success == CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning), attribute_error); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == OpenDuration::SetNull(ep), attribute_error); + VerifyOrReturnError(Status::Success == OpenDuration::SetNull(ep), attribute_error); if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel)) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetLevel::Set(ep, 0), attribute_error); + VerifyOrReturnError(Status::Success == TargetLevel::Set(ep, 0), attribute_error); } if (HasFeature(ep, ValveConfigurationAndControl::Feature::kTimeSync)) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::SetNull(ep), attribute_error); + VerifyOrReturnError(Status::Success == AutoCloseTime::SetNull(ep), attribute_error); } SetRemainingDurationNull(ep); RemainingDurationTable * item = GetRemainingDurationItem(ep); @@ -329,11 +328,11 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data uint64_t time = openDuration.Value() * chip::kMicrosecondsPerSecond; autoCloseTime.SetNonNull(chipEpochTime + time); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::Set(ep, autoCloseTime), attribute_error); + VerifyOrReturnError(Status::Success == AutoCloseTime::Set(ep, autoCloseTime), attribute_error); } else { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::SetNull(ep), attribute_error); + VerifyOrReturnError(Status::Success == AutoCloseTime::SetNull(ep), attribute_error); } #else return CHIP_ERROR_NOT_IMPLEMENTED; @@ -343,19 +342,18 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data // level can only be null if LVL feature is not supported if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel) && !level.IsNull()) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetLevel::Set(ep, level), attribute_error); + VerifyOrReturnError(Status::Success == TargetLevel::Set(ep, level), attribute_error); } - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == OpenDuration::Set(ep, openDuration), attribute_error); + VerifyOrReturnError(Status::Success == OpenDuration::Set(ep, openDuration), attribute_error); SetRemainingDuration(ep, openDuration); // Trigger report for remainingduration MatterReportingAttributeChangeCallback(ep, ValveConfigurationAndControl::Id, RemainingDuration::Id); // set targetstate to open - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kOpen), + VerifyOrReturnError(Status::Success == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kOpen), attribute_error); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == - CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning), + VerifyOrReturnError(Status::Success == CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning), attribute_error); // start movement towards target @@ -365,7 +363,7 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data DataModel::Nullable cLevel = delegate->HandleOpenValve(level); if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel)) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentLevel::Set(ep, cLevel), attribute_error); + VerifyOrReturnError(Status::Success == CurrentLevel::Set(ep, cLevel), attribute_error); } } // start countdown @@ -378,8 +376,7 @@ CHIP_ERROR UpdateCurrentLevel(EndpointId ep, Percent currentLevel) { if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel)) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentLevel::Set(ep, currentLevel), - CHIP_IM_GLOBAL_STATUS(ConstraintError)); + VerifyOrReturnError(Status::Success == CurrentLevel::Set(ep, currentLevel), CHIP_IM_GLOBAL_STATUS(ConstraintError)); return CHIP_NO_ERROR; } return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); @@ -387,7 +384,7 @@ CHIP_ERROR UpdateCurrentLevel(EndpointId ep, Percent currentLevel) CHIP_ERROR UpdateCurrentState(EndpointId ep, ValveConfigurationAndControl::ValveStateEnum currentState) { - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentState::Set(ep, currentState), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + VerifyOrReturnError(Status::Success == CurrentState::Set(ep, currentState), CHIP_IM_GLOBAL_STATUS(ConstraintError)); emitValveStateChangedEvent(ep, currentState); return CHIP_NO_ERROR; } @@ -406,7 +403,7 @@ void UpdateAutoCloseTime(uint64_t time) if (!d.IsNull() && d.Value() != 0) { uint64_t closingTime = d.Value() * chip::kMicrosecondsPerSecond + time; - if (EMBER_ZCL_STATUS_SUCCESS != AutoCloseTime::Set(t.endpoint, closingTime)) + if (Status::Success != AutoCloseTime::Set(t.endpoint, closingTime)) { ChipLogError(Zcl, "Unable to update AutoCloseTime"); } @@ -431,7 +428,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback( Optional status = Optional::Missing(); // if fault is registered return FailureDueToFault - if (EMBER_ZCL_STATUS_SUCCESS == ValveFault::Get(ep, &fault) && fault.HasAny()) + if (Status::Success == ValveFault::Get(ep, &fault) && fault.HasAny()) { commandObj->AddClusterSpecificFailure(commandPath, to_underlying(ValveConfigurationAndControl::StatusCodeEnum::kFailureDueToFault)); @@ -450,7 +447,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback( } else { - VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == DefaultOpenDuration::Get(ep, duration), status.Emplace(Status::Failure)); + VerifyOrExit(Status::Success == DefaultOpenDuration::Get(ep, duration), status.Emplace(Status::Failure)); } if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel)) @@ -460,7 +457,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback( { level.SetNonNull(targetLevel.Value()); } - else if (EMBER_ZCL_STATUS_SUCCESS == DefaultOpenLevel::Get(ep, &defOpenLevel)) + else if (Status::Success == DefaultOpenLevel::Get(ep, &defOpenLevel)) { level.SetNonNull(defOpenLevel); } @@ -497,7 +494,7 @@ bool emberAfValveConfigurationAndControlClusterCloseCallback( BitMask fault(0); // if fault is registered return FailureDueToFault - if (EMBER_ZCL_STATUS_SUCCESS == ValveFault::Get(ep, &fault) && fault.HasAny()) + if (Status::Success == ValveFault::Get(ep, &fault) && fault.HasAny()) { commandObj->AddClusterSpecificFailure(commandPath, to_underlying(ValveConfigurationAndControl::StatusCodeEnum::kFailureDueToFault)); diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h index 5e94c000aeab27..74c8a623c02c61 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -49,7 +50,7 @@ void UpdateAutoCloseTime(uint64_t time); inline bool HasFeature(EndpointId ep, Feature feature) { uint32_t map; - bool success = (Attributes::FeatureMap::Get(ep, &map) == EMBER_ZCL_STATUS_SUCCESS); + bool success = (Attributes::FeatureMap::Get(ep, &map) == Protocols::InteractionModel::Status::Success); return success ? (map & to_underlying(feature)) : false; } diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp index 05948feb3406a1..2388f7b9b63265 100644 --- a/src/app/icd/server/ICDManager.cpp +++ b/src/app/icd/server/ICDManager.cpp @@ -37,6 +37,8 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::IcdManagement; using namespace System::Clock; +using chip::Protocols::InteractionModel::Status; + static_assert(UINT8_MAX >= CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS, "ICDManager::mOpenExchangeContextCount cannot hold count for the max exchange count"); @@ -105,7 +107,7 @@ bool ICDManager::SupportsFeature(Feature feature) // Can't use attribute accessors/Attributes::FeatureMap::Get in unit tests #if !CONFIG_BUILD_FOR_HOST_UNIT_TEST uint32_t featureMap = 0; - bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == EMBER_ZCL_STATUS_SUCCESS); + bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == Status::Success); return success ? ((featureMap & to_underlying(feature)) != 0) : false; #else return ((mFeatureMap & to_underlying(feature)) != 0); diff --git a/src/app/util/af-enums.h b/src/app/util/af-enums.h deleted file mode 100644 index 50bf0af1786b4e..00000000000000 --- a/src/app/util/af-enums.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Contains standard enum values (non-generated) - */ -#pragma once - -#include -#include - -#define EMBER_ZCL_STATUS_SUCCESS Protocols::InteractionModel::Status::Success -#define EMBER_ZCL_STATUS_FAILURE Protocols::InteractionModel::Status::Failure -#define EMBER_ZCL_STATUS_INVALID_SUBSCRIPTION Protocols::InteractionModel::Status::InvalidSubscription -#define EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS Protocols::InteractionModel::Status::UnsupportedAccess -#define EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT Protocols::InteractionModel::Status::UnsupportedEndpoint -#define EMBER_ZCL_STATUS_MALFORMED_COMMAND Protocols::InteractionModel::Status::InvalidAction -#define EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND Protocols::InteractionModel::Status::UnsupportedCommand -#define EMBER_ZCL_STATUS_DEPRECATED82 Protocols::InteractionModel::Status::Deprecated82 -#define EMBER_ZCL_STATUS_DEPRECATED83 Protocols::InteractionModel::Status::Deprecated83 -#define EMBER_ZCL_STATUS_DEPRECATED84 Protocols::InteractionModel::Status::Deprecated84 -#define EMBER_ZCL_STATUS_INVALID_COMMAND Protocols::InteractionModel::Status::InvalidCommand -#define EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE Protocols::InteractionModel::Status::UnsupportedAttribute -#define EMBER_ZCL_STATUS_CONSTRAINT_ERROR Protocols::InteractionModel::Status::ConstraintError -#define EMBER_ZCL_STATUS_UNSUPPORTED_WRITE Protocols::InteractionModel::Status::UnsupportedWrite -#define EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED Protocols::InteractionModel::Status::ResourceExhausted -#define EMBER_ZCL_STATUS_NOT_FOUND Protocols::InteractionModel::Status::NotFound -#define EMBER_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE Protocols::InteractionModel::Status::UnreportableAttribute -#define EMBER_ZCL_STATUS_INVALID_DATA_TYPE Protocols::InteractionModel::Status::InvalidDataType -#define EMBER_ZCL_STATUS_DEPRECATED8E Protocols::InteractionModel::Status::Deprecated8e -#define EMBER_ZCL_STATUS_UNSUPPORTED_READ Protocols::InteractionModel::Status::UnsupportedRead -#define EMBER_ZCL_STATUS_DEPRECATED90 Protocols::InteractionModel::Status::Deprecated90 -#define EMBER_ZCL_STATUS_DEPRECATED91 Protocols::InteractionModel::Status::Deprecated91 -#define EMBER_ZCL_STATUS_DATA_VERSION_MISMATCH Protocols::InteractionModel::Status::DataVersionMismatch -#define EMBER_ZCL_STATUS_DEPRECATED93 Protocols::InteractionModel::Status::Deprecated93 -#define EMBER_ZCL_STATUS_TIMEOUT Protocols::InteractionModel::Status::Timeout -#define EMBER_ZCL_STATUS_RESERVED95 Protocols::InteractionModel::Status::Reserved95 -#define EMBER_ZCL_STATUS_RESERVED96 Protocols::InteractionModel::Status::Reserved96 -#define EMBER_ZCL_STATUS_RESERVED97 Protocols::InteractionModel::Status::Reserved97 -#define EMBER_ZCL_STATUS_RESERVED98 Protocols::InteractionModel::Status::Reserved98 -#define EMBER_ZCL_STATUS_RESERVED99 Protocols::InteractionModel::Status::Reserved99 -#define EMBER_ZCL_STATUS_RESERVED9A Protocols::InteractionModel::Status::Reserved9a -#define EMBER_ZCL_STATUS_BUSY Protocols::InteractionModel::Status::Busy -#define EMBER_ZCL_STATUS_DEPRECATEDC0 Protocols::InteractionModel::Status::Deprecatedc0 -#define EMBER_ZCL_STATUS_DEPRECATEDC1 Protocols::InteractionModel::Status::Deprecatedc1 -#define EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER Protocols::InteractionModel::Status::UnsupportedCluster -#define EMBER_ZCL_STATUS_DEPRECATEDC4 Protocols::InteractionModel::Status::Deprecatedc4 -#define EMBER_ZCL_STATUS_NO_UPSTREAM_SUBSCRIPTION Protocols::InteractionModel::Status::NoUpstreamSubscription -#define EMBER_ZCL_STATUS_NEEDS_TIMED_INTERACTION Protocols::InteractionModel::Status::NeedsTimedInteraction -#define EMBER_ZCL_STATUS_UNSUPPORTED_EVENT Protocols::InteractionModel::Status::UnsupportedEvent -#define EMBER_ZCL_STATUS_PATHS_EXHAUSTED Protocols::InteractionModel::Status::PathsExhausted -#define EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH Protocols::InteractionModel::Status::TimedRequestMismatch -#define EMBER_ZCL_STATUS_FAILSAFE_REQUIRED Protocols::InteractionModel::Status::FailsafeRequired -#define EMBER_ZCL_STATUS_INVALID_IN_STATE Protocols::InteractionModel::Status::InvalidInState -#define EMBER_ZCL_STATUS_NO_COMMAND_RESPONSE Protocols::InteractionModel::Status::NoCommandResponse -#define EMBER_ZCL_STATUS_WRITE_IGNORED Protocols::InteractionModel::Status::WriteIgnored // NOT SPEC COMPLIANT FOR TEST ONLY diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index f2526271717af8..0c343185f70576 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -27,7 +27,6 @@ #include // For NULL. #include // For various uint*_t types -#include #include #include // For various types. diff --git a/src/app/util/generic-callbacks.h b/src/app/util/generic-callbacks.h index 4a20138250322e..85e7f147a1dec8 100644 --- a/src/app/util/generic-callbacks.h +++ b/src/app/util/generic-callbacks.h @@ -76,10 +76,10 @@ bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::Cluste * emberAfMainTickCallback. If the application was successfully able to * read the attribute and write it into the passed buffer, it should return a - * value of EMBER_ZCL_STATUS_SUCCESS. Ensure that the size of the externally + * value of InteractionModel::Status::Success. Ensure that the size of the externally * managed attribute value is smaller than what the buffer can hold. In the case * of a buffer overflow throw an appropriate error such as - * EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED. Any other return value indicates the + * InteractionModel::Status::ResourceExhausted. Any other return value indicates the * application was not able to read the attribute. */ chip::Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, @@ -122,7 +122,7 @@ chip::Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(c * Framework and updated occasionally by the application code from within the * emberAfMainTickCallback. If the application was successfully able to - * write the attribute, it returns a value of EMBER_ZCL_STATUS_SUCCESS. Any + * write the attribute, it returns a value of InteractionModel::Status::Success. Any * other return value indicates the application was not able to write the * attribute. */ diff --git a/src/app/util/im-client-callbacks.h b/src/app/util/im-client-callbacks.h index 489224a2685730..3c4bdd6839a328 100644 --- a/src/app/util/im-client-callbacks.h +++ b/src/app/util/im-client-callbacks.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/src/darwin/Framework/CHIP/MTRError.mm b/src/darwin/Framework/CHIP/MTRError.mm index 4050615f2c3adf..c2c02f6a74b207 100644 --- a/src/darwin/Framework/CHIP/MTRError.mm +++ b/src/darwin/Framework/CHIP/MTRError.mm @@ -21,7 +21,6 @@ #import "MTRError_Internal.h" #import -#import #import #import diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm index a96af0ad7e0fea..ce847748cdfdc7 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm @@ -19,7 +19,7 @@ #include #include #include -#include + #include #include #include diff --git a/src/protocols/interaction_model/StatusCode.h b/src/protocols/interaction_model/StatusCode.h index f5426834a39393..b004b4e04a9057 100644 --- a/src/protocols/interaction_model/StatusCode.h +++ b/src/protocols/interaction_model/StatusCode.h @@ -37,10 +37,7 @@ namespace chip { namespace Protocols { namespace InteractionModel { -// This table comes from the IM's "Status Code Table" section from the Interaction Model spec. -// TODO: This needs to go back to being an enum class. -// https://github.com/project-chip/connectedhomeip/issues/32025 -enum Status : uint8_t +enum class Status : uint8_t { #define CHIP_IM_STATUS_CODE(name, spec_name, value) name = value, #include @@ -105,7 +102,8 @@ class ClusterStatusCode template static ClusterStatusCode ClusterSpecificFailure(T cluster_specific_code) { - static_assert(std::numeric_limits::max() <= std::numeric_limits::max(), "Type used must fit in uint8_t"); + static_assert(std::numeric_limits>::max() <= std::numeric_limits::max(), + "Type used must fit in uint8_t"); return ClusterStatusCode(Status::Failure, chip::to_underlying(cluster_specific_code)); } @@ -121,7 +119,8 @@ class ClusterStatusCode template static ClusterStatusCode ClusterSpecificSuccess(T cluster_specific_code) { - static_assert(std::numeric_limits::max() <= std::numeric_limits::max(), "Type used must fit in uint8_t"); + static_assert(std::numeric_limits>::max() <= std::numeric_limits::max(), + "Type used must fit in uint8_t"); return ClusterStatusCode(Status::Success, chip::to_underlying(cluster_specific_code)); }