Skip to content

Commit

Permalink
[App] Removing af-enums.h (project-chip#32110)
Browse files Browse the repository at this point in the history
* Purge EMBER_ZCL_STATUS

* Add to_underlying in examples

* fix CI

* Fix CI and comments
  • Loading branch information
jepenven-silabs authored and raul-marquez-csa committed Feb 16, 2024
1 parent 09895d0 commit de9af26
Show file tree
Hide file tree
Showing 87 changed files with 262 additions and 337 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/util/af-enums.h>

#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/util/af-enums.h>

#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/util/af-enums.h>

#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h>
#include <app/util/af-enums.h>

using namespace chip;

Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/asr/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/asr/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion examples/chef/common/chef-rvc-operational-state-delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/util/af-enums.h>

#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
2 changes: 1 addition & 1 deletion examples/common/imgui_ui/windows/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/contact-sensor-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/darwin-framework-tool/commands/common/MTRError.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#import <Matter/Matter.h>

#import <app/MessageDef/StatusIB.h>
#import <app/util/af-enums.h>
#import <inet/InetError.h>
#import <lib/support/TypeTraits.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/util/af-enums.h>

#include <protocols/interaction_model/StatusCode.h>

namespace chip {
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
*/
}
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/asr/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ 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");
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, AppLED.GetLevel());

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}

Expand All @@ -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));
}
}
2 changes: 1 addition & 1 deletion examples/lighting-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));
}
}
4 changes: 2 additions & 2 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,15 @@ 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
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, mPWMDevice.GetLevel());

if (status != Protocols::InteractionModel::Status::Success)
{
LOG_ERR("Updating level cluster failed: %x", status);
LOG_ERR("Updating level cluster failed: %x", to_underlying(status));
}
});
}
2 changes: 1 addition & 1 deletion examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
4 changes: 2 additions & 2 deletions examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
6 changes: 3 additions & 3 deletions examples/lighting-app/tizen/src/DBusInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/src/LedManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading

0 comments on commit de9af26

Please sign in to comment.