Skip to content

Commit

Permalink
fix build error when use no-logging (#30119)
Browse files Browse the repository at this point in the history
Co-authored-by: weicheng <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 15, 2023
1 parent 6e89f8a commit 90649a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
14 changes: 5 additions & 9 deletions examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 4 additions & 7 deletions examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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.
Expand Down
16 changes: 6 additions & 10 deletions examples/lighting-app/asr/src/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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)
{
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 90649a4

Please sign in to comment.