Skip to content

Commit 041ba33

Browse files
[Silabs] feature/DIC feature support for thermostat app and window app (#29084)
* feature/DIC feature support for thermostat app and window app * Restyled by whitespace * Restyled by clang-format * addressed review comments * Restyled by clang-format * addressed review comments * addressed review comments --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent ef5040a commit 041ba33

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

examples/thermostat/silabs/src/ZclCallbacks.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include <app/ConcreteAttributePath.h>
2929
#include <lib/support/logging/CHIPLogging.h>
3030

31+
#ifdef DIC_ENABLE
32+
#include "dic_control.h"
33+
#endif // DIC_ENABLE
34+
3135
using namespace ::chip;
3236
using namespace ::chip::app::Clusters;
3337

@@ -46,5 +50,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
4650
else if (clusterId == Thermostat::Id)
4751
{
4852
TempMgr().AttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size);
53+
#ifdef DIC_ENABLE
54+
dic::control::AttributeHandler(attributePath.mEndpointId, attributeId);
55+
#endif // DIC_ENABLE
4956
}
5057
}

examples/window-app/silabs/src/WindowManager.cpp

+22-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ using namespace ::chip::DeviceLayer::Silabs;
5656
#define APP_STATE_LED 0
5757
#define APP_ACTION_LED 1
5858

59+
#ifdef DIC_ENABLE
60+
#define DECIMAL 10
61+
#define MSG_SIZE 6
62+
#include "dic.h"
63+
#endif // DIC_ENABLE
64+
5965
using namespace ::chip::Credentials;
6066
using namespace ::chip::DeviceLayer;
6167
using namespace chip::app::Clusters::WindowCovering;
@@ -502,10 +508,25 @@ void WindowManager::Cover::CallbackPositionSet(intptr_t arg)
502508
position.SetNonNull(data->percent100ths);
503509

504510
if (data->isTilt)
511+
{
505512
TiltPositionSet(data->mEndpointId, position);
513+
#ifdef DIC_ENABLE
514+
uint16_t value = data->percent100ths;
515+
char buffer[MSG_SIZE];
516+
itoa(value, buffer, DECIMAL);
517+
dic_sendmsg("tilt/position set", (const char *) (buffer));
518+
#endif // DIC_ENABLE
519+
}
506520
else
521+
{
507522
LiftPositionSet(data->mEndpointId, position);
508-
523+
#ifdef DIC_ENABLE
524+
uint16_t value = data->percent100ths;
525+
char buffer[MSG_SIZE];
526+
itoa(value, buffer, DECIMAL);
527+
dic_sendmsg("lift/position set", (const char *) (buffer));
528+
#endif // DIC_ENABLE
529+
}
509530
chip::Platform::Delete(data);
510531
}
511532

0 commit comments

Comments
 (0)