2121#include " CookTopEndpoint.h"
2222#include " OvenEndpoint.h"
2323
24- #include < app-common/zap-generated/cluster-objects.h>
2524#include < app-common/zap-generated/attributes/Accessors.h>
25+ #include < app-common/zap-generated/cluster-objects.h>
2626#include < app/clusters/mode-base-server/mode-base-cluster-objects.h>
2727
2828#include " AppConfig.h"
@@ -51,20 +51,17 @@ void OvenManager::Init()
5151
5252 // Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
5353 {
54- Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
55- VerifyOrReturn (tcStatus == Status::Success,
56- ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
54+ Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
55+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
5756
58- tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
59- VerifyOrReturn (tcStatus == Status::Success,
60- ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
57+ tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
58+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
6159
62- tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
63- VerifyOrReturn (tcStatus == Status::Success,
64- ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
60+ tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
61+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
6562
66- tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
67- VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
63+ tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
64+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
6865 }
6966
7067 // Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -140,10 +137,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
140137 return ;
141138}
142139
143- void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
140+ void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
141+ uint16_t size)
144142{
145143 VerifyOrReturn (endpointId == kTemperatureControlledCabinetEndpoint2 ,
146- ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
144+ ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
147145 // TODO: Update the LCD with the new Oven Mode
148146 return ;
149147}
@@ -176,9 +174,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
176174 mState = new_state;
177175
178176 AppEvent event;
179- event.Type = AppEvent::kEventType_Oven ;
180- event.OvenEvent .Context = this ;
181- event.Handler = ActuatorMovementHandler;
177+ event.Type = AppEvent::kEventType_Oven ;
178+ event.OvenEvent .Context = this ;
179+ event.Handler = ActuatorMovementHandler;
182180 AppTask::GetAppTask ().PostEvent (&event);
183181 }
184182
@@ -262,10 +260,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
262260
263261 // Read Current Oven Mode
264262 uint8_t currentMode;
265- Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
263+ Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
266264 if (attrStatus != Status::Success)
267265 {
268- ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
266+ ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
269267 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
270268 response.statusText .SetValue (CharSpan::fromCharString (" Read CurrentMode failed" ));
271269 return ;
@@ -291,7 +289,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
291289 Status writeStatus = OvenMode::Attributes::CurrentMode::Set (endpointId, newMode);
292290 if (writeStatus != Status::Success)
293291 {
294- ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
292+ ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
295293 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
296294 response.statusText .SetValue (CharSpan::fromCharString (" Write CurrentMode failed" ));
297295 return ;
0 commit comments