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

[Silabs] feature/DIC feature support for thermostat app and window app #29084

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
7 changes: 7 additions & 0 deletions examples/thermostat/silabs/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <app/ConcreteAttributePath.h>
#include <lib/support/logging/CHIPLogging.h>

#ifdef DIC_ENABLE
#include "dic_control.h"
#endif // DIC_ENABLE

using namespace ::chip;
using namespace ::chip::app::Clusters;

Expand All @@ -46,5 +50,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
else if (clusterId == Thermostat::Id)
{
TempMgr().AttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size);
#ifdef DIC_ENABLE
dic::control::AttributeHandler(attributePath.mEndpointId, attributeId);
#endif // DIC_ENABLE
}
}
23 changes: 22 additions & 1 deletion examples/window-app/silabs/src/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ using namespace ::chip::DeviceLayer::Silabs;
#define APP_STATE_LED 0
#define APP_ACTION_LED 1

#ifdef DIC_ENABLE
#define DECIMAL 10
#define MSG_SIZE 6
#include "dic.h"
#endif // DIC_ENABLE

using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;
using namespace chip::app::Clusters::WindowCovering;
Expand Down Expand Up @@ -502,10 +508,25 @@ void WindowManager::Cover::CallbackPositionSet(intptr_t arg)
position.SetNonNull(data->percent100ths);

if (data->isTilt)
{
TiltPositionSet(data->mEndpointId, position);
#ifdef DIC_ENABLE
uint16_t value = data->percent100ths;
char buffer[MSG_SIZE];
itoa(value, buffer, DECIMAL);
Thirsrin marked this conversation as resolved.
Show resolved Hide resolved
dic_sendmsg("tilt/position set", (const char *) (buffer));
#endif // DIC_ENABLE
}
else
{
LiftPositionSet(data->mEndpointId, position);

#ifdef DIC_ENABLE
uint16_t value = data->percent100ths;
char buffer[MSG_SIZE];
itoa(value, buffer, DECIMAL);
dic_sendmsg("lift/position set", (const char *) (buffer));
#endif // DIC_ENABLE
}
chip::Platform::Delete(data);
}

Expand Down