@@ -138,28 +138,18 @@ class ActionsServer : public AttributeAccessInterface, public CommandHandlerInte
138
138
CHIP_ERROR Read (const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override ;
139
139
140
140
/* *
141
- * Update an existing action in the action list for the given endpoint.
142
- * If the action with the given actionID doesn't exist, returns CHIP_ERROR_NOT_FOUND.
141
+ * A notification from an application to the sever that an ActionList is modified..
143
142
*
144
143
* @param aEndpoint The endpoint ID where the action should be updated
145
- * @param aAction The action structure containing the updated action details
146
- * @return CHIP_ERROR_INCORRECT_STATE if delegate is null
147
- * CHIP_ERROR_NOT_FOUND if action doesn't exist
148
- * CHIP_NO_ERROR if successful
149
144
*/
150
- CHIP_ERROR ModifyActionList (EndpointId aEndpoint, const ActionStructStorage & aAction );
145
+ void ActionListModified (EndpointId aEndpoint);
151
146
152
147
/* *
153
- * Update an existing endpoint list for the given endpoint.
154
- * If the endpoint list with the given ID doesn't exist, returns CHIP_ERROR_NOT_FOUND.
148
+ * A notification from an application to the sever that an EndpointList is modified..
155
149
*
156
- * @param aEndpoint The endpoint ID where the endpoint list should be updated
157
- * @param aEpList The endpoint list structure containing the updated list details
158
- * @return CHIP_ERROR_INCORRECT_STATE if delegate is null
159
- * CHIP_ERROR_NOT_FOUND if endpoint list doesn't exist
160
- * CHIP_NO_ERROR if successful
150
+ * @param aEndpoint The endpoint ID where the action should be updated
161
151
*/
162
- CHIP_ERROR ModifyEndpointList (EndpointId aEndpoint, const EndpointListStorage & aEpList );
152
+ void EndpointListModified (EndpointId aEndpoint);
163
153
164
154
private:
165
155
static ActionsServer sInstance ;
@@ -170,7 +160,7 @@ class ActionsServer : public AttributeAccessInterface, public CommandHandlerInte
170
160
const AttributeValueEncoder::ListEncodeHelper & aEncoder);
171
161
CHIP_ERROR ReadEndpointListAttribute (const ConcreteReadAttributePath & aPath,
172
162
const AttributeValueEncoder::ListEncodeHelper & aEncoder);
173
- bool HaveActionWithId (EndpointId aEndpointId, uint16_t aActionId);
163
+ bool HaveActionWithId (EndpointId aEndpointId, uint16_t aActionId, uint16_t & aActionIndex );
174
164
175
165
// TODO: We should move to non-global dirty marker.
176
166
void MarkDirty (EndpointId aEndpointId, AttributeId aAttributeId)
@@ -227,26 +217,26 @@ class Delegate
227
217
228
218
/* *
229
219
* Check whether there is an action with the given actionId in the list of actions.
230
- * @param actionId The action ID to search for.
220
+ * @param aActionId The action ID to search for.
221
+ * @param aActionIndex A reference to the index at which an action with matching aActionId.
231
222
* @return Returns a true if matching action is found otherwise false.
232
223
*/
233
- virtual bool HaveActionWithId (uint16_t actionId ) = 0;
224
+ virtual bool HaveActionWithId (uint16_t aActionId, uint16_t & aActionIndex ) = 0;
234
225
235
226
/* *
236
- * On receipt of each and every command,
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.
227
+ * The implementations of the Handle* command callbacks below are expected to call OnStateChanged or
228
+ * OnActionFailed as needed to generate the events required by the spec.
239
229
*/
240
230
241
231
/* *
242
- * @brief Delegate should implement a handler to InstantAction.
232
+ * @brief Callback that will be called to handle an InstantAction command .
243
233
* @param actionId The actionId of an action.
244
234
* It should report Status::Success if successful and may report other Status codes if it fails.
245
235
*/
246
236
virtual Protocols::InteractionModel::Status HandleInstantAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
247
237
248
238
/* *
249
- * @brief Delegate should implement a handler to InstantActionWithTransition.
239
+ * @brief Callback that will be called to handle an InstantActionWithTransition command .
250
240
* @param actionId The actionId of an action.
251
241
* @param transitionTime The time for transition from the current state to the new state.
252
242
* It should report Status::Success if successful and may report other Status codes if it fails.
@@ -255,14 +245,14 @@ class Delegate
255
245
Optional<uint32_t > invokeId) = 0;
256
246
257
247
/* *
258
- * @brief Delegate should implement a handler to StartAction.
248
+ * @brief Callback that will be called to handle a StartAction command .
259
249
* @param actionId The actionId of an action.
260
250
* It should report Status::Success if successful and may report other Status codes if it fails.
261
251
*/
262
252
virtual Protocols::InteractionModel::Status HandleStartAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
263
253
264
254
/* *
265
- * @brief Delegate should implement a handler to StartActionWithDuration.
255
+ * @brief Callback that will be called to handle a StartActionWithDuration command .
266
256
* @param actionId The actionId of an action.
267
257
* @param duration The time for which an action shall be in start state.
268
258
* It should report Status::Success if successful and may report other Status codes if it fails.
@@ -271,21 +261,21 @@ class Delegate
271
261
Optional<uint32_t > invokeId) = 0;
272
262
273
263
/* *
274
- * @brief Delegate should implement a handler to StopAction.
264
+ * @brief Callback that will be called to handle a StopAction command .
275
265
* @param actionId The actionId of an action.
276
266
* It should report Status::Success if successful and may report other Status codes if it fails.
277
267
*/
278
268
virtual Protocols::InteractionModel::Status HandleStopAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
279
269
280
270
/* *
281
- * @brief Delegate should implement a handler to PauseAction.
271
+ * @brief Callback that will be called to handle a PauseAction command .
282
272
* @param actionId The actionId of an action.
283
273
* It should report Status::Success if successful and may report other Status codes if it fails.
284
274
*/
285
275
virtual Protocols::InteractionModel::Status HandlePauseAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
286
276
287
277
/* *
288
- * @brief Delegate should implement a handler to PauseActionWithDuration.
278
+ * @brief Callback that will be called to handle a PauseActionWithDuration command .
289
279
* @param actionId The actionId of an action.
290
280
* @param duration The time for which an action shall be in pause state.
291
281
* It should report Status::Success if successful and may report other Status codes if it fails.
@@ -294,21 +284,21 @@ class Delegate
294
284
Optional<uint32_t > invokeId) = 0;
295
285
296
286
/* *
297
- * @brief Delegate should implement a handler to ResumeAction.
287
+ * @brief Callback that will be called to handle a ResumeAction command .
298
288
* @param actionId The actionId of an action.
299
289
* It should report Status::Success if successful and may report other Status codes if it fails.
300
290
*/
301
291
virtual Protocols::InteractionModel::Status HandleResumeAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
302
292
303
293
/* *
304
- * @brief Delegate should implement a handler to EnableAction.
294
+ * @brief Callback that will be called to handle an EnableAction command .
305
295
* @param actionId The actionId of an action.
306
296
* It should report Status::Success if successful and may report other Status codes if it fails.
307
297
*/
308
298
virtual Protocols::InteractionModel::Status HandleEnableAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
309
299
310
300
/* *
311
- * @brief Delegate should implement a handler to EnableActionWithDuration.
301
+ * @brief Callback that will be called to handle an EnableActionWithDuration command .
312
302
* @param actionId The actionId of an action.
313
303
* @param duration The time for which an action shall be in active state.
314
304
* It should report Status::Success if successful and may report other Status codes if it fails.
@@ -317,14 +307,14 @@ class Delegate
317
307
Optional<uint32_t > invokeId) = 0;
318
308
319
309
/* *
320
- * @brief Delegate should implement a handler to DisableAction.
310
+ * @brief Callback that will be called to handle a DisableAction command .
321
311
* @param actionId The actionId of an action.
322
312
* It should report Status::Success if successful and may report other Status codes if it fails.
323
313
*/
324
314
virtual Protocols::InteractionModel::Status HandleDisableAction (uint16_t actionId, Optional<uint32_t > invokeId) = 0;
325
315
326
316
/* *
327
- * @brief Delegate should implement a handler to DisableActionWithDuration.
317
+ * @brief Callback that will be called to handle a DisableActionWithDuration command .
328
318
* @param actionId The actionId of an action.
329
319
* @param duration The time for which an action shall be in disable state.
330
320
* It should report Status::Success if successful and may report other Status codes if it fails.
0 commit comments