Skip to content

Commit 029bdb4

Browse files
committed
Fix build errors
1 parent c9201c7 commit 029bdb4

File tree

3 files changed

+15
-29
lines changed

3 files changed

+15
-29
lines changed

examples/oven-app/silabs/BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ silabs_executable("oven_app") {
113113
"src/OvenManager.cpp",
114114
]
115115

116-
deps = [ ":sdk" ]
116+
deps = [
117+
":sdk",
118+
"${chip_root}/src/app/clusters/bindings:binding-manager",
119+
]
117120

118121
if (wifi_soc) {
119122
deps += [ "${examples_plat_dir}:siwx917-common" ]

examples/oven-app/silabs/include/OvenManager.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@ class OvenManager
126126
void ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t newMode,
127127
chip::app::Clusters::ModeBase::Commands::ChangeToModeResponse::Type & response);
128128

129-
/**
130-
* @brief Handles oven mode attribute changes.
131-
*
132-
* @param endpointId The ID of the endpoint.
133-
* @param attributeId The ID of the attribute.
134-
* @param value Pointer to the new value.
135-
* @param size Size of the new value.
136-
*/
137-
void OvenModeAttributeChangeHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size);
138-
139129
/**
140130
* @brief Checks if a transition between two oven modes is blocked.
141131
*

examples/oven-app/silabs/src/OvenManager.cpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include <app-common/zap-generated/attributes/Accessors.h>
4141
#include <platform/CHIPDeviceLayer.h>
42+
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
4243

4344
#define MAX_TEMPERATURE 30000
4445
#define MIN_TEMPERATURE 0
@@ -72,24 +73,6 @@ void OvenManager::Init()
7273

7374
VerifyOrReturn(mCookTopEndpoint.Init() == CHIP_NO_ERROR, ChipLogError(AppServer, "CookTopEndpoint Init failed"));
7475

75-
// Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
76-
{
77-
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
78-
VerifyOrReturn(tcStatus == Status::Success,
79-
ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
80-
81-
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
82-
VerifyOrReturn(tcStatus == Status::Success,
83-
ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
84-
85-
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
86-
VerifyOrReturn(tcStatus == Status::Success,
87-
ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
88-
89-
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
90-
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
91-
}
92-
9376
// Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
9477
TemperatureControl::SetInstance(&mTemperatureControlDelegate);
9578

@@ -188,6 +171,16 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
188171
// Update CookSurface states accordingly
189172
mCookSurfaceEndpoint1.SetOnOffState(*value);
190173
mCookSurfaceEndpoint2.SetOnOffState(*value);
174+
175+
// Trigger binding for CookTop OnOff changes
176+
{
177+
OnOffBindingContext * context = Platform::New<OnOffBindingContext>();
178+
179+
context->localEndpointId = kCookTopEndpoint;
180+
context->commandId = *value ? Clusters::OnOff::Commands::On::Id : Clusters::OnOff::Commands::Off::Id;
181+
182+
CookTopOnOffBindingTrigger(context);
183+
}
191184
break;
192185
case kCookSurfaceEndpoint1:
193186
case kCookSurfaceEndpoint2:

0 commit comments

Comments
 (0)