Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASR] fix build error when use no-logging #30119

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading