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"
@@ -59,20 +59,17 @@ void OvenManager::Init()
5959
6060 // Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
6161 {
62- Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
63- VerifyOrReturn (tcStatus == Status::Success,
64- ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
62+ Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
63+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
6564
66- tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
67- VerifyOrReturn (tcStatus == Status::Success,
68- ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
65+ tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
66+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
6967
70- tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
71- VerifyOrReturn (tcStatus == Status::Success,
72- ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
68+ tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
69+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
7370
74- tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
75- VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
71+ tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
72+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
7673 }
7774
7875 // Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -181,10 +178,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
181178 return ;
182179}
183180
184- void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
181+ void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
182+ uint16_t size)
185183{
186184 VerifyOrReturn (endpointId == kTemperatureControlledCabinetEndpoint2 ,
187- ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
185+ ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
188186 // TODO: Update the LCD with the new Oven Mode
189187 return ;
190188}
@@ -217,9 +215,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
217215 mState = new_state;
218216
219217 AppEvent event;
220- event.Type = AppEvent::kEventType_Oven ;
221- event.OvenEvent .Context = this ;
222- event.Handler = ActuatorMovementHandler;
218+ event.Type = AppEvent::kEventType_Oven ;
219+ event.OvenEvent .Context = this ;
220+ event.Handler = ActuatorMovementHandler;
223221 AppTask::GetAppTask ().PostEvent (&event);
224222 }
225223
@@ -303,10 +301,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
303301
304302 // Read Current Oven Mode
305303 uint8_t currentMode;
306- Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
304+ Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
307305 if (attrStatus != Status::Success)
308306 {
309- ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
307+ ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
310308 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
311309 response.statusText .SetValue (CharSpan::fromCharString (" Read CurrentMode failed" ));
312310 return ;
@@ -332,7 +330,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
332330 Status writeStatus = OvenMode::Attributes::CurrentMode::Set (endpointId, newMode);
333331 if (writeStatus != Status::Success)
334332 {
335- ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
333+ ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
336334 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
337335 response.statusText .SetValue (CharSpan::fromCharString (" Write CurrentMode failed" ));
338336 return ;
0 commit comments