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"
@@ -55,20 +55,17 @@ void OvenManager::Init()
5555
5656 // Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure)
5757 {
58- Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
59- VerifyOrReturn (tcStatus == Status::Success,
60- ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
58+ Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
59+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 TemperatureSetpoint init failed" ));
6160
62- tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
63- VerifyOrReturn (tcStatus == Status::Success,
64- ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
61+ tcStatus = TemperatureControl::Attributes::MinTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 0 );
62+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MinTemperature init failed" ));
6563
66- tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
67- VerifyOrReturn (tcStatus == Status::Success,
68- ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
64+ tcStatus = TemperatureControl::Attributes::MaxTemperature::Set (kTemperatureControlledCabinetEndpoint2 , 30000 );
65+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 MaxTemperature init failed" ));
6966
70- tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
71- VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
67+ tcStatus = TemperatureControl::Attributes::Step::Set (kTemperatureControlledCabinetEndpoint2 , 500 );
68+ VerifyOrReturn (tcStatus == Status::Success, ChipLogError (AppServer, " Endpoint2 Step init failed" ));
7269 }
7370
7471 // Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints
@@ -175,10 +172,11 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId
175172 return ;
176173}
177174
178- void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value, uint16_t size)
175+ void OvenManager::OvenModeAttributeChangeHandler (chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value,
176+ uint16_t size)
179177{
180178 VerifyOrReturn (endpointId == kTemperatureControlledCabinetEndpoint2 ,
181- ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
179+ ChipLogError (AppServer, " Command received over Unsupported Endpoint" ));
182180 // TODO: Update the LCD with the new Oven Mode
183181 return ;
184182}
@@ -211,9 +209,9 @@ bool OvenManager::InitiateAction(int32_t aActor, Action_t aAction, uint8_t * aVa
211209 mState = new_state;
212210
213211 AppEvent event;
214- event.Type = AppEvent::kEventType_Oven ;
215- event.OvenEvent .Context = this ;
216- event.Handler = ActuatorMovementHandler;
212+ event.Type = AppEvent::kEventType_Oven ;
213+ event.OvenEvent .Context = this ;
214+ event.Handler = ActuatorMovementHandler;
217215 AppTask::GetAppTask ().PostEvent (&event);
218216 }
219217
@@ -297,10 +295,10 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
297295
298296 // Read Current Oven Mode
299297 uint8_t currentMode;
300- Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
298+ Status attrStatus = OvenMode::Attributes::CurrentMode::Get (endpointId, ¤tMode);
301299 if (attrStatus != Status::Success)
302300 {
303- ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
301+ ChipLogError (AppServer, " OvenManager: Failed to read CurrentMode" );
304302 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
305303 response.statusText .SetValue (CharSpan::fromCharString (" Read CurrentMode failed" ));
306304 return ;
@@ -326,7 +324,7 @@ void OvenManager::ProcessOvenModeChange(chip::EndpointId endpointId, uint8_t new
326324 Status writeStatus = OvenMode::Attributes::CurrentMode::Set (endpointId, newMode);
327325 if (writeStatus != Status::Success)
328326 {
329- ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
327+ ChipLogError (AppServer, " OvenManager: Failed to write CurrentMode" );
330328 response.status = to_underlying (ModeBase::StatusCode::kGenericFailure );
331329 response.statusText .SetValue (CharSpan::fromCharString (" Write CurrentMode failed" ));
332330 return ;
0 commit comments