fix build error when use no-logging (#30119)
Co-authored-by: weicheng <weichengxu@asrmicro.com>
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 859e3fb..cc48488
--- 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::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 @@
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 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 a7be66c..8926659
--- 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::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 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 92c962f..f486aba 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 @@
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 @@
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::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.