From 9bba787443a4221e2b58a37502dc39c25a6e175c Mon Sep 17 00:00:00 2001 From: weicheng Date: Fri, 3 Nov 2023 14:03:07 +0800 Subject: [PATCH] fix build error when use no-logging (#30119) Co-authored-by: weicheng --- .../all-clusters-app/asr/src/DeviceCallbacks.cpp | 14 +++++--------- .../asr/src/DeviceCallbacks.cpp | 11 ++++------- .../lighting-app/asr/src/DeviceCallbacks.cpp | 16 ++++++---------- 3 files changed, 15 insertions(+), 26 deletions(-) mode change 100755 => 100644 examples/all-clusters-app/asr/src/DeviceCallbacks.cpp mode change 100755 => 100644 examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp diff --git a/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp b/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp old mode 100755 new mode 100644 index 859e3fb1043430..cc48488fd7e3ca --- a/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp @@ -44,8 +44,6 @@ #include "route_hook/asr_route_hook.h" #endif -static const char * TAG = "app-devicecallbacks"; - using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::System; @@ -151,9 +149,8 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event void DeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == chip::app::Clusters::OnOff::Attributes::OnOff::Id, - ChipLogError(DeviceLayer, TAG, "Unhandled Attribute ID: '0x%04x", attributeId)); - VerifyOrExit(endpointId == 1 || endpointId == 2, - ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1 || endpointId == 2, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); switch (attributeId) { @@ -188,8 +185,7 @@ void DeviceCallbacks::OnLevelPostAttributeChangeCallback(EndpointId endpointId, case chip::app::Clusters::LevelControl::Attributes::CurrentLevel::Id: { if (size == 1) { - uint8_t tmp = *value; - ChipLogProgress(Zcl, "New level: %u ", tmp); + ChipLogProgress(Zcl, "New level: %u ", *value); } else { @@ -259,8 +255,8 @@ void IdentifyTimerHandler(Layer * systemLayer, void * appState) void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == chip::app::Clusters::Identify::Attributes::IdentifyTime::Id, - ChipLogError(DeviceLayer, "[%s] Unhandled Attribute ID: '0x%04lx", TAG, attributeId)); - VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "[%s] Unexpected EndPoint ID: `0x%02x'", TAG, endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); // timerCount represents the number of callback executions before we stop the timer. // value is expressed in seconds and the timer is fired every 250ms, so just multiply value by 4. diff --git a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp old mode 100755 new mode 100644 index a7be66c3fbef2c..89266592872d3e --- a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp +++ b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp @@ -43,8 +43,6 @@ #include "route_hook/asr_route_hook.h" #endif -static const char * TAG = "app-devicecallbacks"; - using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::System; @@ -149,9 +147,8 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event void DeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == chip::app::Clusters::OnOff::Attributes::OnOff::Id, - ChipLogError(DeviceLayer, TAG, "Unhandled Attribute ID: '0x%04x", attributeId)); - VerifyOrExit(endpointId == 1 || endpointId == 2, - ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1 || endpointId == 2, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); switch (attributeId) { @@ -189,8 +186,8 @@ void IdentifyTimerHandler(Layer * systemLayer, void * appState, CHIP_ERROR error void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == chip::app::Clusters::Identify::Attributes::IdentifyTime::Id, - ChipLogError(DeviceLayer, "[%s] Unhandled Attribute ID: '0x%04lx", TAG, attributeId)); - VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "[%s] Unexpected EndPoint ID: `0x%02x'", TAG, endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); // timerCount represents the number of callback executions before we stop the timer. // value is expressed in seconds and the timer is fired every 250ms, so just multiply value by 4. diff --git a/examples/lighting-app/asr/src/DeviceCallbacks.cpp b/examples/lighting-app/asr/src/DeviceCallbacks.cpp index 92c962f75702db..f486aba1f5d9e0 100644 --- a/examples/lighting-app/asr/src/DeviceCallbacks.cpp +++ b/examples/lighting-app/asr/src/DeviceCallbacks.cpp @@ -43,8 +43,6 @@ #include "route_hook/asr_route_hook.h" #endif -static const char * TAG = "app-devicecallbacks"; - using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::System; @@ -168,9 +166,8 @@ extern LEDWidget lightLED; void DeviceCallbacks::OnOnOffPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == app::Clusters::OnOff::Attributes::OnOff::Id, - ChipLogError(DeviceLayer, TAG, "Unhandled Attribute ID: '0x%04x", attributeId)); - VerifyOrExit(endpointId == 1 || endpointId == 2, - ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1 || endpointId == 2, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); lightLED.Set(*value); @@ -182,9 +179,8 @@ void DeviceCallbacks::OnLevelPostAttributeChangeCallback(EndpointId endpointId, uint8_t * value) { VerifyOrExit(attributeId == app::Clusters::LevelControl::Attributes::CurrentLevel::Id, - ChipLogError(DeviceLayer, TAG, "Unhandled Attribute ID: '0x%04x", attributeId)); - VerifyOrExit(endpointId == 1 || endpointId == 2, - ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1 || endpointId == 2, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); if (size == 1) { @@ -232,8 +228,8 @@ void DeviceCallbacks::OnColorPostAttributeChangeCallback(EndpointId endpointId, void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) { VerifyOrExit(attributeId == app::Clusters::Identify::Attributes::IdentifyTime::Id, - ChipLogError(DeviceLayer, "[%s] Unhandled Attribute ID: '0x%04lx", TAG, attributeId)); - VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "[%s] Unexpected EndPoint ID: `0x%02x'", TAG, endpointId)); + ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId)); + VerifyOrExit(endpointId == 1, ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId)); // timerCount represents the number of callback executions before we stop the timer. // value is expressed in seconds and the timer is fired every 250ms, so just multiply value by 4.