@@ -117,40 +117,40 @@ void SmokeCoAlarmManager::EndSelfTestingEventHandler(AppEvent * aEvent)
117
117
SILABS_LOG (" End self-testing!" );
118
118
}
119
119
120
- bool emberAfHandleEventTrigger (uint64_t eventTrigger)
120
+ CHIP_ERROR SmokeCoAlarmManager::HandleEventTrigger (uint64_t eventTrigger)
121
121
{
122
122
SmokeCOTrigger trigger = static_cast <SmokeCOTrigger>(eventTrigger);
123
123
124
124
switch (trigger)
125
125
{
126
126
case SmokeCOTrigger::kForceSmokeCritical :
127
127
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force smoke (critical)" );
128
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kCritical ), true );
128
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kCritical ), CHIP_NO_ERROR );
129
129
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
130
130
break ;
131
131
case SmokeCOTrigger::kForceSmokeWarning :
132
132
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force smoke (warning)" );
133
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kWarning ), true );
133
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kWarning ), CHIP_NO_ERROR );
134
134
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
135
135
break ;
136
136
case SmokeCOTrigger::kForceSmokeInterconnect :
137
137
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force smoke interconnect (warning)" );
138
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectSmokeAlarm (1 , AlarmStateEnum::kWarning ), true );
138
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectSmokeAlarm (1 , AlarmStateEnum::kWarning ), CHIP_NO_ERROR );
139
139
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
140
140
break ;
141
141
case SmokeCOTrigger::kForceCOCritical :
142
142
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force CO (critical)" );
143
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kCritical ), true );
143
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kCritical ), CHIP_NO_ERROR );
144
144
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
145
145
break ;
146
146
case SmokeCOTrigger::kForceCOWarning :
147
147
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force CO (warning)" );
148
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kWarning ), true );
148
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kWarning ), CHIP_NO_ERROR );
149
149
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
150
150
break ;
151
151
case SmokeCOTrigger::kForceCOInterconnect :
152
152
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force CO (warning)" );
153
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectCOAlarm (1 , AlarmStateEnum::kWarning ), true );
153
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectCOAlarm (1 , AlarmStateEnum::kWarning ), CHIP_NO_ERROR );
154
154
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
155
155
break ;
156
156
case SmokeCOTrigger::kForceSmokeContaminationHigh :
@@ -171,22 +171,22 @@ bool emberAfHandleEventTrigger(uint64_t eventTrigger)
171
171
break ;
172
172
case SmokeCOTrigger::kForceMalfunction :
173
173
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force malfunction" );
174
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetHardwareFaultAlert (1 , true ), true );
174
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetHardwareFaultAlert (1 , true ), CHIP_NO_ERROR );
175
175
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
176
176
break ;
177
177
case SmokeCOTrigger::kForceLowBatteryWarning :
178
178
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force low battery (warning)" );
179
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kWarning ), true );
179
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kWarning ), CHIP_NO_ERROR );
180
180
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
181
181
break ;
182
182
case SmokeCOTrigger::kForceLowBatteryCritical :
183
183
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force low battery (critical)" );
184
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kCritical ), true );
184
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kCritical ), CHIP_NO_ERROR );
185
185
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
186
186
break ;
187
187
case SmokeCOTrigger::kForceEndOfLife :
188
188
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Force end-of-life" );
189
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetEndOfServiceAlert (1 , EndOfServiceEnum::kExpired ), true );
189
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetEndOfServiceAlert (1 , EndOfServiceEnum::kExpired ), CHIP_NO_ERROR );
190
190
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
191
191
break ;
192
192
case SmokeCOTrigger::kForceSilence :
@@ -195,32 +195,32 @@ bool emberAfHandleEventTrigger(uint64_t eventTrigger)
195
195
break ;
196
196
case SmokeCOTrigger::kClearSmoke :
197
197
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear smoke" );
198
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kNormal ), true );
198
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetSmokeState (1 , AlarmStateEnum::kNormal ), CHIP_NO_ERROR );
199
199
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
200
200
break ;
201
201
case SmokeCOTrigger::kClearCO :
202
202
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear CO" );
203
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kNormal ), true );
203
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetCOState (1 , AlarmStateEnum::kNormal ), CHIP_NO_ERROR );
204
204
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
205
205
break ;
206
206
case SmokeCOTrigger::kClearSmokeInterconnect :
207
207
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear smoke interconnect" );
208
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectSmokeAlarm (1 , AlarmStateEnum::kNormal ), true );
208
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectSmokeAlarm (1 , AlarmStateEnum::kNormal ), CHIP_NO_ERROR );
209
209
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
210
210
break ;
211
211
case SmokeCOTrigger::kClearCOInterconnect :
212
212
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear CO interconnect" );
213
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectCOAlarm (1 , AlarmStateEnum::kNormal ), true );
213
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetInterconnectCOAlarm (1 , AlarmStateEnum::kNormal ), CHIP_NO_ERROR );
214
214
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
215
215
break ;
216
216
case SmokeCOTrigger::kClearMalfunction :
217
217
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear malfunction" );
218
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetHardwareFaultAlert (1 , false ), true );
218
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetHardwareFaultAlert (1 , false ), CHIP_NO_ERROR );
219
219
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
220
220
break ;
221
221
case SmokeCOTrigger::kClearEndOfLife :
222
222
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear end-of-life" );
223
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetEndOfServiceAlert (1 , EndOfServiceEnum::kNormal ), true );
223
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetEndOfServiceAlert (1 , EndOfServiceEnum::kNormal ), CHIP_NO_ERROR );
224
224
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
225
225
break ;
226
226
case SmokeCOTrigger::kClearSilence :
@@ -229,7 +229,7 @@ bool emberAfHandleEventTrigger(uint64_t eventTrigger)
229
229
break ;
230
230
case SmokeCOTrigger::kClearBatteryLevelLow :
231
231
ChipLogProgress (Support, " [Smoke-CO-Alarm-Test-Event] => Clear low battery" );
232
- VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kNormal ), true );
232
+ VerifyOrReturnValue (SmokeCoAlarmServer::Instance ().SetBatteryAlert (1 , AlarmStateEnum::kNormal ), CHIP_NO_ERROR );
233
233
SmokeCoAlarmServer::Instance ().SetExpressedStateByPriority (1 , sPriorityOrder );
234
234
break ;
235
235
case SmokeCOTrigger::kClearContamination :
@@ -242,8 +242,8 @@ bool emberAfHandleEventTrigger(uint64_t eventTrigger)
242
242
break ;
243
243
default :
244
244
245
- return false ;
245
+ return CHIP_ERROR_INVALID_ARGUMENT ;
246
246
}
247
247
248
- return true ;
248
+ return CHIP_NO_ERROR ;
249
249
}
0 commit comments