Skip to content

Commit 7b62f99

Browse files
committed
Fix build errors
1 parent c9201c7 commit 7b62f99

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
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: 15 additions & 4 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
@@ -74,19 +75,19 @@ void OvenManager::Init()
7475

7576
// Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
7677
{
77-
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0);
78+
Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint, 0);
7879
VerifyOrReturn(tcStatus == Status::Success,
7980
ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed"));
8081

81-
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0);
82+
tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint, 0);
8283
VerifyOrReturn(tcStatus == Status::Success,
8384
ChipLogError(AppServer, "Endpoint2 MinTemperature init failed"));
8485

85-
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000);
86+
tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint, 30000);
8687
VerifyOrReturn(tcStatus == Status::Success,
8788
ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed"));
8889

89-
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500);
90+
tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint, 500);
9091
VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed"));
9192
}
9293

@@ -188,6 +189,16 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
188189
// Update CookSurface states accordingly
189190
mCookSurfaceEndpoint1.SetOnOffState(*value);
190191
mCookSurfaceEndpoint2.SetOnOffState(*value);
192+
193+
// Trigger binding for CookTop OnOff changes
194+
{
195+
OnOffBindingContext * context = Platform::New<OnOffBindingContext>();
196+
197+
context->localEndpointId = kCookTopEndpoint;
198+
context->commandId = *value ? Clusters::OnOff::Commands::On::Id : Clusters::OnOff::Commands::Off::Id;
199+
200+
CookTopOnOffBindingTrigger(context);
201+
}
191202
break;
192203
case kCookSurfaceEndpoint1:
193204
case kCookSurfaceEndpoint2:

0 commit comments

Comments
 (0)