@@ -61,9 +61,9 @@ struct ActionStructStorage : public Structs::ActionStruct::Type
61
61
endpointListID = aEpListID;
62
62
supportedCommands = aCommands;
63
63
state = aActionState;
64
- MutableCharSpan mActionName (mBuffer );
65
- CopyCharSpanToMutableCharSpanWithTruncation (aActionName, mActionName );
66
- name = mActionName ;
64
+ MutableCharSpan actionName (mBuffer );
65
+ CopyCharSpanToMutableCharSpanWithTruncation (aActionName, actionName );
66
+ name = actionName ;
67
67
}
68
68
69
69
private:
@@ -100,9 +100,9 @@ struct EndpointListStorage : public Structs::EndpointListStruct::Type
100
100
mEpList [index ] = aEndpointList[index ];
101
101
}
102
102
endpoints = DataModel::List<const EndpointId>(Span (mEpList , epListSize));
103
- MutableCharSpan mEpListName (mBuffer );
104
- CopyCharSpanToMutableCharSpanWithTruncation (aEpListName, mEpListName );
105
- name = mEpListName ;
103
+ MutableCharSpan epListName (mBuffer );
104
+ CopyCharSpanToMutableCharSpanWithTruncation (aEpListName, epListName );
105
+ name = epListName ;
106
106
}
107
107
108
108
private:
@@ -122,13 +122,13 @@ class ActionsServer : public AttributeAccessInterface, public CommandHandlerInte
122
122
123
123
/* *
124
124
* @brief
125
- * Called when the state of action is changed.
125
+ * Called when the state of an action is changed.
126
126
*/
127
127
void OnStateChanged (EndpointId aEndpoint, uint16_t aActionId, uint32_t aInvokeId, ActionStateEnum aActionState);
128
128
129
129
/* *
130
130
* @brief
131
- * Called when the action is failed. .
131
+ * Called when an action fails .
132
132
*/
133
133
void OnActionFailed (EndpointId aEndpoint, uint16_t aActionId, uint32_t aInvokeId, ActionStateEnum aActionState,
134
134
ActionErrorEnum aActionError);
@@ -178,7 +178,7 @@ class ActionsServer : public AttributeAccessInterface, public CommandHandlerInte
178
178
MatterReportingAttributeChangeCallback (aEndpointId, Id, aAttributeId);
179
179
}
180
180
// Cannot use CommandHandlerInterface::HandleCommand directly because we need to do the HaveActionWithId() check before
181
- // sending a command.
181
+ // handling a command.
182
182
template <typename RequestT, typename FuncT>
183
183
void HandleCommand (HandlerContext & handlerContext, FuncT func);
184
184
@@ -211,13 +211,14 @@ class Delegate
211
211
* @param index The index of the action to be returned. It is assumed that actions are indexable from 0 and with no gaps.
212
212
* @param action A reference to the ActionStructStorage which should be initialized via copy/assignments or calling Set().
213
213
* @return Returns a CHIP_NO_ERROR if there was no error and the action was returned successfully.
214
- * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is past the end of the list of actionList .
214
+ * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is past the end of the list of actions .
215
215
*/
216
216
virtual CHIP_ERROR ReadActionAtIndex (uint16_t index, ActionStructStorage & action) = 0;
217
217
218
218
/* *
219
219
* Get the EndpointList at the Nth index from list of endpointList.
220
- * @param index The index of the endpointList to be returned. It is assumed that actions are indexable from 0 and with no gaps.
220
+ * @param index The index of the endpointList to be returned. It is assumed that endpoint lists are indexable from 0 and with no
221
+ * gaps.
221
222
* @param action A reference to the EndpointListStorage which should be initialized via copy/assignments or calling Set().
222
223
* @return Returns a CHIP_NO_ERROR if there was no error and the epList was returned successfully.
223
224
* CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is past the end of the list of endpointLists.
@@ -233,132 +234,100 @@ class Delegate
233
234
234
235
/* *
235
236
* On receipt of each and every command,
236
- * if the InvokeID data field is provided by the client when invoking a command, the server SHALL generate a StateChanged event
237
- * when the action changes to a new state or an ActionFailed event when execution of the action fails.
238
- *
239
- * If the command refers to an action which currently is not in a state where the command applies, a response SHALL be
240
- * generated with the Status::InvalidCommand.
237
+ * the server shall generate a either StateChanged or ActionFailed event.
238
+ * If the command is not supproted by the action, Status::InvalidCommand shall be reported.
241
239
*/
242
240
243
241
/* *
244
- * When an InstantAction command is received, an action (state change) on the involved endpoints shall trigger,
245
- * in a "fire and forget" manner. Afterwards, the action’s state SHALL be Inactive.
246
- *
242
+ * @brief Delegate should implement a handler to InstantAction.
247
243
* @param actionId The actionId of an action.
248
- * It should report Status::Success if successful and may report other Status codes if it fails
244
+ * It should report Status::Success if successful and may report other Status codes if it fails.
249
245
*/
250
246
virtual Protocols::InteractionModel::Status HandleInstantAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
251
247
252
248
/* *
253
- * When an InstantActionWithTransition command is received, an action (state change) on the involved endpoints shall trigger,
254
- * with a specified time to transition from the current state to the new state. During the transition, the action’s state SHALL
255
- * be Active. Afterwards, the action’s state SHALL be Inactive.
256
- *
249
+ * @brief Delegate should implement a handler to InstantActionWithTransition.
257
250
* @param actionId The actionId of an action.
258
251
* @param transitionTime The time for transition from the current state to the new state.
259
- * It should report Status::Success if successful and may report other Status codes if it fails
252
+ * It should report Status::Success if successful and may report other Status codes if it fails.
260
253
*/
261
254
virtual Protocols::InteractionModel::Status HandleInstantActionWithTransition (uint16_t actionId, uint16_t transitionTime,
262
255
Optional<uint32_t > invokeId) = 0;
263
256
264
257
/* *
265
- * When a StartAction command is received, the commencement of an action on the involved endpoints shall trigger. Afterwards,
266
- * the action’s state SHALL be Inactive.
267
- *
258
+ * @brief Delegate should implement a handler to StartAction.
268
259
* @param actionId The actionId of an action.
269
- * It should report Status::Success if successful and may report other Status codes if it fails
260
+ * It should report Status::Success if successful and may report other Status codes if it fails.
270
261
*/
271
262
virtual Protocols::InteractionModel::Status HandleStartAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
272
263
273
264
/* *
274
- * When a StartActionWithDuration command is received, the commencement of an action on the involved endpoints shall trigger,
275
- * and SHALL change the action’s state to Active. After the specified Duration, the action will stop, and the action’s state
276
- * SHALL change to Inactive.
277
- *
265
+ * @brief Delegate should implement a handler to StartActionWithDuration.
278
266
* @param actionId The actionId of an action.
279
267
* @param duration The time for which an action shall be in start state.
280
- * It should report Status::Success if successful and may report other Status codes if it fails
268
+ * It should report Status::Success if successful and may report other Status codes if it fails.
281
269
*/
282
270
virtual Protocols::InteractionModel::Status HandleStartActionWithDuration (uint16_t actionId, uint32_t duration,
283
271
Optional<uint32_t > invokeId) = 0;
284
272
285
273
/* *
286
- * When a StopAction command is received, the ongoing action on the involved endpoints shall stop. Afterwards, the action’s
287
- * state SHALL be Inactive.
288
- *
274
+ * @brief Delegate should implement a handler to StopAction.
289
275
* @param actionId The actionId of an action.
290
- * It should report Status::Success if successful and may report other Status codes if it fails
276
+ * It should report Status::Success if successful and may report other Status codes if it fails.
291
277
*/
292
278
virtual Protocols::InteractionModel::Status HandleStopAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
293
279
294
280
/* *
295
- * When a PauseAction command is received, the ongoing action on the involved endpoints shall pause and SHALL change the
296
- * action’s state to Paused.
297
- *
281
+ * @brief Delegate should implement a handler to PauseAction.
298
282
* @param actionId The actionId of an action.
299
- * It should report Status::Success if successful and may report other Status codes if it fails
283
+ * It should report Status::Success if successful and may report other Status codes if it fails.
300
284
*/
301
285
virtual Protocols::InteractionModel::Status HandlePauseAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
302
286
303
287
/* *
304
- * When a PauseActionWithDuration command is received, pauses an ongoing action, and SHALL change the action’s state to Paused.
305
- * After the specified Duration, the ongoing action will be automatically resumed. which SHALL change the action’s state to
306
- * Active.
307
- *
288
+ * @brief Delegate should implement a handler to PauseActionWithDuration.
308
289
* @param actionId The actionId of an action.
309
290
* @param duration The time for which an action shall be in pause state.
310
- * It should report Status::Success if successful and may report other Status codes if it fails
291
+ * It should report Status::Success if successful and may report other Status codes if it fails.
311
292
*/
312
293
virtual Protocols::InteractionModel::Status HandlePauseActionWithDuration (uint16_t actionId, uint32_t duration,
313
294
Optional<uint32_t > invokeId) = 0;
314
295
315
296
/* *
316
- * When a ResumeAction command is received, the previously paused action shall resume and SHALL change the action’s state to
317
- * Active.
318
- *
297
+ * @brief Delegate should implement a handler to ResumeAction.
319
298
* @param actionId The actionId of an action.
320
- * It should report Status::Success if successful and may report other Status codes if it fails
299
+ * It should report Status::Success if successful and may report other Status codes if it fails.
321
300
*/
322
301
virtual Protocols::InteractionModel::Status HandleResumeAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
323
302
324
303
/* *
325
- * When an EnableAction command is received, it enables a certain action or automation. Afterwards, the action’s state SHALL be
326
- * Active.
327
- *
304
+ * @brief Delegate should implement a handler to EnableAction.
328
305
* @param actionId The actionId of an action.
329
- * It should report Status::Success if successful and may report other Status codes if it fails
306
+ * It should report Status::Success if successful and may report other Status codes if it fails.
330
307
*/
331
308
virtual Protocols::InteractionModel::Status HandleEnableAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
332
309
333
310
/* *
334
- * When an EnableActionWithDuration command is received, it enables a certain action or automation, and SHALL change the
335
- * action’s state to be Active. After the specified Duration, the action or automation will stop, and the action’s state SHALL
336
- * change to Disabled.
337
- *
311
+ * @brief Delegate should implement a handler to EnableActionWithDuration.
338
312
* @param actionId The actionId of an action.
339
313
* @param duration The time for which an action shall be in active state.
340
- * It should report Status::Success if successful and may report other Status codes if it fails
314
+ * It should report Status::Success if successful and may report other Status codes if it fails.
341
315
*/
342
316
virtual Protocols::InteractionModel::Status HandleEnableActionWithDuration (uint16_t actionId, uint32_t duration,
343
317
Optional<uint32_t > invokeId) = 0;
344
318
345
319
/* *
346
- * When a DisableAction command is received, it disables a certain action or automation, and SHALL change the action’s state to
347
- * Inactive.
348
- *
320
+ * @brief Delegate should implement a handler to DisableAction.
349
321
* @param actionId The actionId of an action.
350
- * It should report Status::Success if successful and may report other Status codes if it fails
322
+ * It should report Status::Success if successful and may report other Status codes if it fails.
351
323
*/
352
324
virtual Protocols::InteractionModel::Status HandleDisableAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
353
325
354
326
/* *
355
- * When a DisableActionWithDuration command is received, it disables a certain action or automation, and SHALL change the
356
- * action’s state to Disabled. After the specified Duration, the action or automation will re-start, and the action’s state
357
- * SHALL change to either Inactive or Active, depending on the actions.
358
- *
327
+ * @brief Delegate should implement a handler to DisableActionWithDuration.
359
328
* @param actionId The actionId of an action.
360
329
* @param duration The time for which an action shall be in disable state.
361
- * It should report Status::Success if successful and may report other Status codes if it fails
330
+ * It should report Status::Success if successful and may report other Status codes if it fails.
362
331
*/
363
332
virtual Protocols::InteractionModel::Status HandleDisableActionWithDuration (uint16_t actionId, uint32_t duration,
364
333
Optional<uint32_t > invokeId) = 0;
0 commit comments