Skip to content

Commit 67f2ae5

Browse files
[App] Removing af-enums.h (#32110)
* Purge EMBER_ZCL_STATUS * Add to_underlying in examples * fix CI * Fix CI and comments
1 parent b6f13d2 commit 67f2ae5

File tree

87 files changed

+262
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+262
-337
lines changed

.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ jobs:
119119
--known-failure app/reporting/tests/MockReportScheduler.h \
120120
--known-failure app/server/AppDelegate.h \
121121
--known-failure app/TestEventTriggerDelegate.h \
122-
--known-failure app/util/af-enums.h \
123122
--known-failure app/util/af.h \
124123
--known-failure app/util/af-types.h \
125124
--known-failure app/util/attribute-metadata.h \

examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app/clusters/operational-state-server/operational-state-server.h>
23-
#include <app/util/af-enums.h>
23+
2424
#include <protocols/interaction_model/StatusCode.h>
2525

2626
namespace chip {

examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app/clusters/operational-state-server/operational-state-server.h>
23-
#include <app/util/af-enums.h>
23+
2424
#include <protocols/interaction_model/StatusCode.h>
2525

2626
namespace chip {

examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app/clusters/operational-state-server/operational-state-server.h>
23-
#include <app/util/af-enums.h>
23+
2424
#include <protocols/interaction_model/StatusCode.h>
2525

2626
namespace chip {

examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
#include <app-common/zap-generated/cluster-objects.h>
1919
#include <app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h>
20-
#include <app/util/af-enums.h>
2120

2221
using namespace chip;
2322

examples/all-clusters-app/asr/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void AppTask::OnOffUpdateClusterState(void)
272272

273273
if (status != Status::Success)
274274
{
275-
ASR_LOG("ERR: updating on/off %x", status);
275+
ASR_LOG("ERR: updating on/off %x", to_underlying(status));
276276
}
277277
}
278278

examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
413413

414414
if (status != Protocols::InteractionModel::Status::Success)
415415
{
416-
P6_LOG("ERR: updating on/off %x", status);
416+
P6_LOG("ERR: updating on/off %x", to_underlying(status));
417417
}
418418
}
419419

examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
5858
Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
5959
if (status != Protocols::InteractionModel::Status::Success)
6060
{
61-
LOG_ERR("Updating feature map %x", status);
61+
LOG_ERR("Updating feature map %x", to_underlying(status));
6262
}
6363
}

examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
5858
Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
5959
if (status != Protocols::InteractionModel::Status::Success)
6060
{
61-
LOG_ERR("Updating feature map %x", status);
61+
LOG_ERR("Updating feature map %x", to_underlying(status));
6262
}
6363
}

examples/all-clusters-minimal-app/asr/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void AppTask::OnOffUpdateClusterState(void)
225225

226226
if (status != Protocols::InteractionModel::Status::Success)
227227
{
228-
ASR_LOG("ERR: updating on/off %x", status);
228+
ASR_LOG("ERR: updating on/off %x", to_underlying(status));
229229
}
230230
}
231231

examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
410410

411411
if (status != Protocols::InteractionModel::Status::Success)
412412
{
413-
P6_LOG("ERR: updating on/off %x", status);
413+
P6_LOG("ERR: updating on/off %x", to_underlying(status));
414414
}
415415
}
416416

examples/bridge-app/telink/src/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,12 @@ void AppTask::UpdateClusterState(void)
597597

598598
if (status != Protocols::InteractionModel::Status::Success)
599599
{
600-
LOG_ERR("Update OnOff fail: %x", status);
600+
LOG_ERR("Update OnOff fail: %x", to_underlying(status));
601601
}
602602
uint8_t setLevel = sAppTask.mPwmRgbBlueLed.GetLevel();
603603
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel);
604604
if (status != Protocols::InteractionModel::Status::Success)
605605
{
606-
LOG_ERR("Update CurrentLevel fail: %x", status);
606+
LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status));
607607
}
608608
}

examples/chef/common/chef-rvc-operational-state-delegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app/clusters/operational-state-server/operational-state-server.h>
23-
#include <app/util/af-enums.h>
23+
2424
#include <protocols/interaction_model/StatusCode.h>
2525

2626
namespace chip {

examples/common/imgui_ui/windows/light.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void Light::UpdateState()
7676

7777
if (status != chip::Protocols::InteractionModel::Status::Success)
7878
{
79-
ChipLogError(AppServer, "Failed to set on/off value: %d", status);
79+
ChipLogError(AppServer, "Failed to set on/off value: %d", chip::to_underlying(status));
8080
}
8181

8282
mTargetLightIsOn.ClearValue();

examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
895895
Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
896896
if (status != Protocols::InteractionModel::Status::Success)
897897
{
898-
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
898+
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
899899
}
900900
logBooleanStateEvent(newValue);
901901
}

examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
792792

793793
if (status != Protocols::InteractionModel::Status::Success)
794794
{
795-
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
795+
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
796796
}
797797
logBooleanStateEvent(newValue);
798798
}

examples/contact-sensor-app/telink/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
9898
Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
9999
if (status != Protocols::InteractionModel::Status::Success)
100100
{
101-
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
101+
ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
102102
}
103103
}
104104

examples/darwin-framework-tool/commands/common/MTRError.mm

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#import <Matter/Matter.h>
2121

2222
#import <app/MessageDef/StatusIB.h>
23-
#import <app/util/af-enums.h>
2423
#import <inet/InetError.h>
2524
#import <lib/support/TypeTraits.h>
2625

examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app/clusters/operational-state-server/operational-state-server.h>
23-
#include <app/util/af-enums.h>
23+
2424
#include <protocols/interaction_model/StatusCode.h>
2525

2626
namespace chip {

examples/light-switch-app/qpg/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void AppTask::UpdateClusterState(void)
500500
501501
if (status != Protocols::InteractionModel::Status::Success)
502502
{
503-
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
503+
ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
504504
}
505505
*/
506506
}

examples/lighting-app/asr/src/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bool IsLightOn()
8888

8989
if (status != Protocols::InteractionModel::Status::Success)
9090
{
91-
ASR_LOG("Error Read OnOff Attribute 0x%02x\n", status);
91+
ASR_LOG("Error Read OnOff Attribute 0x%02x\n", to_underlying(status));
9292
}
9393

9494
return on != false;
@@ -103,7 +103,7 @@ uint8_t GetLightLevel()
103103

104104
if (status != Protocols::InteractionModel::Status::Success)
105105
{
106-
ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", status);
106+
ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", to_underlying(status));
107107
return -1;
108108
}
109109

examples/lighting-app/esp32/main/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ void AppTask::UpdateClusterState()
193193

194194
if (status != Protocols::InteractionModel::Status::Success)
195195
{
196-
ESP_LOGE(TAG, "Updating on/off cluster failed: %x", status);
196+
ESP_LOGE(TAG, "Updating on/off cluster failed: %x", to_underlying(status));
197197
}
198198

199199
ESP_LOGI(TAG, "Writing to Current Level cluster");
200200
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, AppLED.GetLevel());
201201

202202
if (status != Protocols::InteractionModel::Status::Success)
203203
{
204-
ESP_LOGE(TAG, "Updating level cluster failed: %x", status);
204+
ESP_LOGE(TAG, "Updating level cluster failed: %x", to_underlying(status));
205205
}
206206
}

examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool LightingManager::IsLightOn(void)
5454

5555
if (status != Protocols::InteractionModel::Status::Success)
5656
{
57-
printf("Error ReadServerAttribute 0x%02x\n", status);
57+
printf("Error ReadServerAttribute 0x%02x\n", to_underlying(status));
5858
}
5959

6060
return on != false;
@@ -103,7 +103,7 @@ void LightingManager::WriteClusterState(uint8_t value)
103103

104104
if (status != Protocols::InteractionModel::Status::Success)
105105
{
106-
printf("Error WriteServerAttribute 0x%02x\n", status);
106+
printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status));
107107
}
108108
}
109109

@@ -113,6 +113,6 @@ void LightingManager::WriteClusterLevel(uint8_t value)
113113

114114
if (status != Protocols::InteractionModel::Status::Success)
115115
{
116-
printf("Error WriteServerAttribute 0x%02x\n", status);
116+
printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status));
117117
}
118118
}

examples/lighting-app/infineon/psoc6/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ void AppTask::UpdateClusterState(intptr_t context)
558558
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
559559
if (status != Protocols::InteractionModel::Status::Success)
560560
{
561-
P6_LOG("ERR: updating on/off %x", status);
561+
P6_LOG("ERR: updating on/off %x", to_underlying(status));
562562
}
563563
}
564564
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR

examples/lighting-app/mbed/main/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void AppTask::UpdateClusterState()
465465
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff);
466466
if (status != Protocols::InteractionModel::Status::Success)
467467
{
468-
ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", status);
468+
ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", to_underlying(status));
469469
}
470470

471471
uint8_t level = LightingMgr().GetLevel();
@@ -474,6 +474,6 @@ void AppTask::UpdateClusterState()
474474

475475
if (status != Protocols::InteractionModel::Status::Success)
476476
{
477-
ChipLogError(NotSpecified, "Updating level cluster failed: %x", status);
477+
ChipLogError(NotSpecified, "Updating level cluster failed: %x", to_underlying(status));
478478
}
479479
}

examples/lighting-app/nrfconnect/main/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,15 @@ void AppTask::UpdateClusterState()
694694

695695
if (status != Protocols::InteractionModel::Status::Success)
696696
{
697-
LOG_ERR("Updating on/off cluster failed: %x", status);
697+
LOG_ERR("Updating on/off cluster failed: %x", to_underlying(status));
698698
}
699699

700700
// write the current level
701701
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, mPWMDevice.GetLevel());
702702

703703
if (status != Protocols::InteractionModel::Status::Success)
704704
{
705-
LOG_ERR("Updating level cluster failed: %x", status);
705+
LOG_ERR("Updating level cluster failed: %x", to_underlying(status));
706706
}
707707
});
708708
}

examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
958958
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
959959
if (status != Protocols::InteractionModel::Status::Success)
960960
{
961-
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
961+
ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
962962
}
963963
}
964964

examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
856856
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
857857
if (status != Protocols::InteractionModel::Status::Success)
858858
{
859-
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
859+
ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
860860
}
861861
}
862862

examples/lighting-app/qpg/src/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,14 @@ void AppTask::UpdateClusterState(void)
647647

648648
if (status != Protocols::InteractionModel::Status::Success)
649649
{
650-
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
650+
ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
651651
}
652652

653653
// Write new level value
654654
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel());
655655
if (status != Protocols::InteractionModel::Status::Success)
656656
{
657-
ChipLogError(NotSpecified, "ERR: updating level %x", status);
657+
ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status));
658658
}
659659
});
660660
}

examples/lighting-app/silabs/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,6 @@ void AppTask::UpdateClusterState(intptr_t context)
250250

251251
if (status != Protocols::InteractionModel::Status::Success)
252252
{
253-
SILABS_LOG("ERR: updating on/off %x", status);
253+
SILABS_LOG("ERR: updating on/off %x", to_underlying(status));
254254
}
255255
}

examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,14 @@ void AppTask::UpdateClusterState(void)
448448
Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
449449
if (status != Protocols::InteractionModel::Status::Success)
450450
{
451-
ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
451+
ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
452452
}
453453

454454
// Write new level value
455455
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel());
456456
if (status != Protocols::InteractionModel::Status::Success)
457457
{
458-
ChipLogError(NotSpecified, "ERR: updating level %x", status);
458+
ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status));
459459
}
460460
}
461461

examples/lighting-app/telink/src/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ void AppTask::UpdateClusterState(void)
242242
status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);
243243
if (status != Protocols::InteractionModel::Status::Success)
244244
{
245-
LOG_ERR("Update OnOff fail: %x", status);
245+
LOG_ERR("Update OnOff fail: %x", to_underlying(status));
246246
}
247247

248248
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel);
249249
if (status != Protocols::InteractionModel::Status::Success)
250250
{
251-
LOG_ERR("Update CurrentLevel fail: %x", status);
251+
LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status));
252252
}
253253
}
254254

examples/lighting-app/tizen/src/DBusInterface.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void DBusInterface::InitOnOff()
207207
bool isOn = false;
208208
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
209209
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
210-
ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
210+
ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status)));
211211
light_app_on_off_set_on_off(mIfaceOnOff, isOn);
212212
}
213213

@@ -217,14 +217,14 @@ void DBusInterface::InitColor()
217217
uint8_t value = 0;
218218
auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value);
219219
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
220-
ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", status));
220+
ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status)));
221221
light_app_color_control_set_color_mode(mIfaceColorControl, value);
222222
}
223223
{
224224
uint16_t value = 0;
225225
auto status = Clusters::ColorControl::Attributes::ColorTemperatureMireds::Get(mEndpointId, &value);
226226
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
227-
ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", status));
227+
ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", to_underlying(status)));
228228
light_app_color_control_set_color_temperature_mireds(mIfaceColorControl, value);
229229
}
230230
}

examples/lighting-app/tizen/src/LedManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void LedManager::InitOnOff()
6363
bool isOn = false;
6464
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
6565
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
66-
ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
66+
ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status)));
6767
SetOnOff(isOn);
6868
}
6969

0 commit comments

Comments
 (0)