Skip to content

Commit

Permalink
fix build error when use no-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
asriot committed Oct 31, 2023
1 parent 1890490 commit c86f024
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
13 changes: 5 additions & 8 deletions examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
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,9 @@ 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));
ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2,
ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId));

switch (attributeId)
{
Expand Down Expand Up @@ -188,8 +186,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 +256,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
10 changes: 4 additions & 6 deletions examples/all-clusters-minimal-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 @@ -149,9 +147,9 @@ 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));
ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2,
ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId));

switch (attributeId)
{
Expand Down Expand Up @@ -189,8 +187,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
14 changes: 6 additions & 8 deletions examples/lighting-app/asr/src/DeviceCallbacks.cpp
100644 → 100755
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,9 @@ 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));
ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2,
ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId));

lightLED.Set(*value);

Expand All @@ -182,9 +180,9 @@ 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));
ChipLogError(DeviceLayer, "Unhandled Attribute ID: '0x%04lx", attributeId));
VerifyOrExit(endpointId == 1 || endpointId == 2,
ChipLogError(DeviceLayer, TAG, "Unexpected EndPoint ID: `0x%02x'", endpointId));
ChipLogError(DeviceLayer, "Unexpected EndPoint ID: `0x%02x'", endpointId));

if (size == 1)
{
Expand Down Expand Up @@ -232,8 +230,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 c86f024

Please sign in to comment.