Skip to content

Commit 1024949

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Remove af-event bits that are no longer used. (#25191)
1 parent b01868a commit 1024949

File tree

16 files changed

+1
-309
lines changed

16 files changed

+1
-309
lines changed

examples/chef/esp32/main/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <app-common/zap-generated/callback.h>
4242
#include <app-common/zap-generated/cluster-objects.h>
4343
#include <app/server/Dnssd.h>
44-
#include <app/util/af-event.h>
4544
#include <app/util/af.h>
4645
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4746

src/app/clusters/client-monitoring-server/client-monitoring-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <app/CommandHandler.h>
2626
#include <app/ConcreteAttributePath.h>
2727
#include <app/util/ClientMonitoringRegistrationTable.h>
28-
#include <app/util/af-event.h>
2928
#include <app/util/af.h>
3029
#include <app/util/attribute-storage.h>
3130

src/app/clusters/color-control-server/color-control-server.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <app-common/zap-generated/attributes/Accessors.h>
2020
#include <app/CommandHandler.h>
2121
#include <app/ConcreteCommandPath.h>
22-
#include <app/util/af-event.h>
2322
#include <app/util/af.h>
2423
#include <app/util/attribute-storage.h>
2524
#include <app/util/config.h>
@@ -49,18 +48,10 @@ void ColorControlServer::scheduleTimerCallbackMs(EmberEventControl * control, ui
4948
{
5049
ChipLogError(Zcl, "Color Control Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format());
5150
}
52-
else
53-
{
54-
control->status = EMBER_EVENT_MS_TIME;
55-
}
5651
}
5752

5853
void ColorControlServer::cancelEndpointTimerCallback(EmberEventControl * control)
5954
{
60-
if (control->status != EMBER_EVENT_INACTIVE)
61-
{
62-
control->status = EMBER_EVENT_INACTIVE;
63-
}
6455
DeviceLayer::SystemLayer().CancelTimer(timerCallback, control);
6556
}
6657

src/app/clusters/door-lock-server/door-lock-server-callback.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <app-common/zap-generated/callback.h>
2727
#include <app/EventLogging.h>
2828
#include <app/server/Server.h>
29-
#include <app/util/af-event.h>
3029
#include <app/util/af.h>
3130
#include <cinttypes>
3231

src/app/clusters/door-lock-server/door-lock-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <app-common/zap-generated/ids/Clusters.h>
2828
#include <app/EventLogging.h>
2929
#include <app/server/Server.h>
30-
#include <app/util/af-event.h>
3130
#include <app/util/af.h>
3231
#include <app/util/error-mapping.h>
3332
#include <cinttypes>

src/app/clusters/on-off-server/on-off-server.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <app-common/zap-generated/attributes/Accessors.h>
2121
#include <app/data-model/Nullable.h>
2222
#include <app/reporting/reporting.h>
23-
#include <app/util/af-event.h>
2423
#include <app/util/af.h>
2524
#include <app/util/config.h>
2625
#include <app/util/error-mapping.h>
@@ -73,18 +72,10 @@ void OnOffServer::scheduleTimerCallbackMs(EmberEventControl * control, uint32_t
7372
{
7473
ChipLogError(Zcl, "OnOff Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format());
7574
}
76-
else
77-
{
78-
control->status = EMBER_EVENT_MS_TIME;
79-
}
8075
}
8176

8277
void OnOffServer::cancelEndpointTimerCallback(EmberEventControl * control)
8378
{
84-
if (control->status != EMBER_EVENT_INACTIVE)
85-
{
86-
control->status = EMBER_EVENT_INACTIVE;
87-
}
8879
DeviceLayer::SystemLayer().CancelTimer(timerCallback, control);
8980
}
9081

src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <app/util/af.h>
1919

2020
#include <app/CommandHandler.h>
21-
#include <app/util/af-event.h>
2221
#include <app/util/attribute-storage.h>
2322

2423
using namespace chip;

src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <app/ConcreteAttributePath.h>
2525
#include <app/ConcreteCommandPath.h>
2626
#include <app/InteractionModelEngine.h>
27-
#include <app/util/af-event.h>
2827
#include <app/util/attribute-storage.h>
2928
#include <app/util/config.h>
3029

src/app/clusters/thermostat-client/thermostat-client.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <app/util/af.h>
1919

2020
#include <app/CommandHandler.h>
21-
#include <app/util/af-event.h>
2221
#include <app/util/attribute-storage.h>
2322

2423
using namespace chip;

src/app/clusters/thermostat-server/thermostat-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include <app/util/af.h>
1919

20-
#include <app/util/af-event.h>
2120
#include <app/util/attribute-storage.h>
2221

2322
#include <app-common/zap-generated/attributes/Accessors.h>

src/app/clusters/window-covering-server/window-covering-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app/CommandHandler.h>
2323
#include <app/ConcreteCommandPath.h>
2424
#include <app/reporting/reporting.h>
25-
#include <app/util/af-event.h>
2625
#include <app/util/af-types.h>
2726
#include <app/util/af.h>
2827
#include <app/util/attribute-storage.h>

src/app/util/af-event.h

-44
This file was deleted.

src/app/util/af-types.h

-77
Original file line numberDiff line numberDiff line change
@@ -227,83 +227,6 @@ struct EmberAfDefinedEndpoint
227227

228228
// Cluster specific types
229229

230-
/**
231-
* @brief This is an enum used to control how the device will poll for a given
232-
* active cluster-related event. When the event is scheduled, the application
233-
* can pass a poll control value which will be stored along with the event.
234-
* The processor is only allowed to poll according to the most restrictive
235-
* value for all active event. For instance, if two events are active, one
236-
* with EMBER_AF_LONG_POLL and the other with EMBER_AF_SHORT_POLL, then the
237-
* processor will short poll until the second event is deactivated.
238-
*/
239-
typedef enum
240-
{
241-
EMBER_AF_LONG_POLL,
242-
EMBER_AF_SHORT_POLL,
243-
} EmberAfEventPollControl;
244-
245-
/**
246-
* @brief This is an enum used to control how the device
247-
* will sleep for a given active cluster related event.
248-
* When the event is scheduled, the scheduling code can
249-
* pass a sleep control value which will be stored along
250-
* with the event. The processor is only allowed to sleep
251-
* according to the most restrictive sleep control value
252-
* for any active event. For instance, if two events
253-
* are active, one with EMBER_AF_OK_TO_HIBERNATE and the
254-
* other with EMBER_AF_OK_TO_NAP, then the processor
255-
* will only be allowed to nap until the second event
256-
* is deactivated.
257-
*/
258-
typedef enum
259-
{
260-
EMBER_AF_OK_TO_SLEEP,
261-
/** deprecated. */
262-
EMBER_AF_OK_TO_HIBERNATE = EMBER_AF_OK_TO_SLEEP,
263-
/** deprecated. */
264-
EMBER_AF_OK_TO_NAP,
265-
EMBER_AF_STAY_AWAKE,
266-
} EmberAfEventSleepControl;
267-
268-
/**
269-
* @brief a structure used to keep track of cluster related events and
270-
* their sleep control values. The cluster code will not know at
271-
* runtime all of the events that it has access to in the event table
272-
* This structure is stored by the application framework in an event
273-
* context table which along with helper functions allows the cluster
274-
* code to schedule and deactivate its associated events.
275-
*/
276-
typedef struct
277-
{
278-
/**
279-
* The endpoint of the associated cluster event.
280-
*/
281-
chip::EndpointId endpoint;
282-
/**
283-
* The cluster id of the associated cluster event.
284-
*/
285-
chip::ClusterId clusterId;
286-
/**
287-
* The server/client identity of the associated cluster event.
288-
*/
289-
bool isClient;
290-
/**
291-
* A poll control value used to control the network polling behavior while
292-
* the event is active.
293-
*/
294-
EmberAfEventPollControl pollControl;
295-
/**
296-
* A sleep control value used to control the processor's sleep
297-
* behavior while the event is active.
298-
*/
299-
EmberAfEventSleepControl sleepControl;
300-
/**
301-
* A pointer to the event control value which is stored in the event table
302-
* and is used to actually schedule the event.
303-
*/
304-
EmberEventControl * eventControl;
305-
} EmberAfEventContext;
306-
307230
/**
308231
* @brief Indicates the absence of a Scene table entry.
309232
*/

src/app/util/af.h

-136
Original file line numberDiff line numberDiff line change
@@ -357,142 +357,6 @@ EmberNodeId emberAfGetNodeId(void);
357357

358358
/** @} END Miscellaneous */
359359

360-
/** @name Sleep Control */
361-
//@{
362-
363-
/**
364-
* @brief Friendly define for use in the scheduling or canceling client events
365-
* with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
366-
*/
367-
#define EMBER_AF_CLIENT_CLUSTER_TICK true
368-
369-
/**
370-
* @brief Friendly define for use in the scheduling or canceling server events
371-
* with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
372-
*/
373-
#define EMBER_AF_SERVER_CLUSTER_TICK false
374-
375-
/**
376-
* @brief This function is used to schedule a cluster-related event inside the
377-
* application framework's event mechanism. This function provides a wrapper
378-
* for the Ember stack event mechanism which allows the cluster code to access
379-
* its events by their endpoint, cluster id, and client/server identity. The
380-
* passed poll and sleep controls allow the cluster to indicate whether it
381-
* needs to long or short poll and whether it needs to stay awake or if it can
382-
* sleep.
383-
*
384-
* @param endpoint the endpoint of the event to be scheduled.
385-
* @param clusterId the cluster id of the event to be scheduled.
386-
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled
387-
* is associated with a client cluster or ::EMBER_AF_SERVER_CLUSTER_TICK
388-
* otherwise.
389-
* @param delayMs the number of milliseconds until the event should be called.
390-
* @param pollControl ::EMBER_AF_SHORT_POLL if the cluster needs to short poll
391-
* or ::EMBER_AF_LONG_POLL otherwise.
392-
* @param sleepControl ::EMBER_AF_STAY_AWAKE if the cluster needs to stay awake
393-
* or EMBER_AF_OK_TO_SLEEP otherwise.
394-
*
395-
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
396-
*/
397-
EmberStatus emberAfScheduleTickExtended(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient, uint32_t delayMs,
398-
EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl);
399-
400-
/**
401-
* @brief This function is used to schedule a cluster-related event inside the
402-
* This function is a wrapper for ::emberAfScheduleTickExtended. The cluster
403-
* on the given endpoint will be set to long poll if sleepControl is set to
404-
* ::EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will
405-
* stay awake if sleepControl is ::EMBER_AF_STAY_AWAKE and will sleep
406-
* otherwise.
407-
*
408-
* @param endpoint the endpoint of the event to be scheduled.
409-
* @param clusterId the cluster id of the event to be scheduled.
410-
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled
411-
* is associated with a client cluster or ::EMBER_AF_SERVER_CLUSTER_TICK
412-
* otherwise.
413-
* @param delayMs the number of milliseconds until the event should be called.
414-
* @param sleepControl the priority of the event, what the processor should
415-
* be allowed to do in terms of sleeping while the event is active.
416-
*
417-
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
418-
*/
419-
EmberStatus emberAfScheduleClusterTick(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient, uint32_t delayMs,
420-
EmberAfEventSleepControl sleepControl);
421-
422-
/**
423-
* @brief A function used to schedule a cluster server event. This function
424-
* is a wrapper for ::emberAfScheduleTickExtended.
425-
*
426-
* @param endpoint the endpoint of the event to be scheduled.
427-
* @param clusterId the cluster id of the event to be scheduled.
428-
* @param delayMs the number of milliseconds until the event should be called.
429-
* @param pollControl ::EMBER_AF_SHORT_POLL if the cluster needs to short poll
430-
* or ::EMBER_AF_LONG_POLL otherwise.
431-
* @param sleepControl ::EMBER_AF_STAY_AWAKE if the cluster needs to stay awake
432-
* or EMBER_AF_OK_TO_SLEEP otherwise.
433-
*
434-
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
435-
*/
436-
EmberStatus emberAfScheduleServerTickExtended(chip::EndpointId endpoint, chip::ClusterId clusterId, uint32_t delayMs,
437-
EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl);
438-
439-
/**
440-
* @brief A function used to schedule a cluster server event. This function
441-
* is a wrapper for ::emberAfScheduleServerTickExtended. It indicates that
442-
* the cluster server on the given endpoint can long poll and can sleep.
443-
*
444-
* @param endpoint the endpoint of the event to be scheduled
445-
* @param clusterId the cluster id of the event to be scheduled.
446-
* @param delayMs the number of milliseconds until the event should be called.
447-
*
448-
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
449-
*/
450-
EmberStatus emberAfScheduleServerTick(chip::EndpointId endpoint, chip::ClusterId clusterId, uint32_t delayMs);
451-
452-
/**
453-
* @brief A function used to deactivate a cluster-related event. This function
454-
* provides a wrapper for the Ember stack's event mechanism which allows an
455-
* event to be accessed by its endpoint, cluster id, and client/server
456-
* identity.
457-
*
458-
* @param endpoint the endpoint of the event to be deactivated.
459-
* @param clusterId the cluster id of the event to be deactivated.
460-
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be
461-
* deactivated is a client cluster ::EMBER_AF_SERVER_CLUSTER_TICK
462-
* otherwise.
463-
*
464-
* @return EMBER_SUCCESS if the event was deactivated or an error otherwise.
465-
*/
466-
EmberStatus emberAfDeactivateClusterTick(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient);
467-
468-
/**
469-
* @brief A function used to deactivate a cluster server event. This function
470-
* is a wrapper for ::emberAfDeactivateClusterTick.
471-
*
472-
* @param endpoint the endpoint of the event to be deactivated.
473-
* @param clusterId the cluster id of the event to be deactivated.
474-
*
475-
* @return EMBER_SUCCESS if the event was deactivated or an error otherwise.
476-
*/
477-
EmberStatus emberAfDeactivateServerTick(chip::EndpointId endpoint, chip::ClusterId clusterId);
478-
479-
/**
480-
* @brief Sets the ::EmberEventControl to run "delayMs" milliseconds in the
481-
* future. This function first verifies that the delay is within the
482-
* acceptable range before scheduling the event.
483-
*
484-
* @param control a pointer to the event control.
485-
* @param delayMs the number of milliseconds until the next event.
486-
*
487-
* @return If delayMs is less than or equal to
488-
::EMBER_MAX_EVENT_CONTROL_DELAY_MS, this function will schedule the
489-
event and return ::EMBER_SUCCESS. Otherwise it will return
490-
::EMBER_BAD_ARGUMENT.
491-
*/
492-
EmberStatus emberEventControlSetDelayMS(EmberEventControl * control, uint32_t delayMs);
493-
494-
/** @} END Sleep Control */
495-
496360
/** @name Messaging */
497361
// @{
498362

0 commit comments

Comments
 (0)