Skip to content

Commit

Permalink
Remove af-event bits that are no longer used. (#25191)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 22, 2023
1 parent 05ad424 commit 1178812
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 309 deletions.
1 change: 0 additions & 1 deletion examples/chef/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app/server/Dnssd.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/ClientMonitoringRegistrationTable.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
Expand Down Expand Up @@ -49,18 +48,10 @@ void ColorControlServer::scheduleTimerCallbackMs(EmberEventControl * control, ui
{
ChipLogError(Zcl, "Color Control Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format());
}
else
{
control->status = EMBER_EVENT_MS_TIME;
}
}

void ColorControlServer::cancelEndpointTimerCallback(EmberEventControl * control)
{
if (control->status != EMBER_EVENT_INACTIVE)
{
control->status = EMBER_EVENT_INACTIVE;
}
DeviceLayer::SystemLayer().CancelTimer(timerCallback, control);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <app-common/zap-generated/callback.h>
#include <app/EventLogging.h>
#include <app/server/Server.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <cinttypes>

Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/EventLogging.h>
#include <app/server/Server.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <app/util/error-mapping.h>
#include <cinttypes>
Expand Down
9 changes: 0 additions & 9 deletions src/app/clusters/on-off-server/on-off-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/data-model/Nullable.h>
#include <app/reporting/reporting.h>
#include <app/util/af-event.h>
#include <app/util/af.h>
#include <app/util/config.h>
#include <app/util/error-mapping.h>
Expand Down Expand Up @@ -73,18 +72,10 @@ void OnOffServer::scheduleTimerCallbackMs(EmberEventControl * control, uint32_t
{
ChipLogError(Zcl, "OnOff Server failed to schedule event: %" CHIP_ERROR_FORMAT, err.Format());
}
else
{
control->status = EMBER_EVENT_MS_TIME;
}
}

void OnOffServer::cancelEndpointTimerCallback(EmberEventControl * control)
{
if (control->status != EMBER_EVENT_INACTIVE)
{
control->status = EMBER_EVENT_INACTIVE;
}
DeviceLayer::SystemLayer().CancelTimer(timerCallback, control);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <app/util/af.h>

#include <app/CommandHandler.h>
#include <app/util/af-event.h>
#include <app/util/attribute-storage.h>

using namespace chip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/ConcreteCommandPath.h>
#include <app/InteractionModelEngine.h>
#include <app/util/af-event.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>

Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/thermostat-client/thermostat-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <app/util/af.h>

#include <app/CommandHandler.h>
#include <app/util/af-event.h>
#include <app/util/attribute-storage.h>

using namespace chip;
Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/thermostat-server/thermostat-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <app/util/af.h>

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

#include <app-common/zap-generated/attributes/Accessors.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/reporting/reporting.h>
#include <app/util/af-event.h>
#include <app/util/af-types.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>
Expand Down
44 changes: 0 additions & 44 deletions src/app/util/af-event.h

This file was deleted.

77 changes: 0 additions & 77 deletions src/app/util/af-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,83 +227,6 @@ struct EmberAfDefinedEndpoint

// Cluster specific types

/**
* @brief This is an enum used to control how the device will poll for a given
* active cluster-related event. When the event is scheduled, the application
* can pass a poll control value which will be stored along with the event.
* The processor is only allowed to poll according to the most restrictive
* value for all active event. For instance, if two events are active, one
* with EMBER_AF_LONG_POLL and the other with EMBER_AF_SHORT_POLL, then the
* processor will short poll until the second event is deactivated.
*/
typedef enum
{
EMBER_AF_LONG_POLL,
EMBER_AF_SHORT_POLL,
} EmberAfEventPollControl;

/**
* @brief This is an enum used to control how the device
* will sleep for a given active cluster related event.
* When the event is scheduled, the scheduling code can
* pass a sleep control value which will be stored along
* with the event. The processor is only allowed to sleep
* according to the most restrictive sleep control value
* for any active event. For instance, if two events
* are active, one with EMBER_AF_OK_TO_HIBERNATE and the
* other with EMBER_AF_OK_TO_NAP, then the processor
* will only be allowed to nap until the second event
* is deactivated.
*/
typedef enum
{
EMBER_AF_OK_TO_SLEEP,
/** deprecated. */
EMBER_AF_OK_TO_HIBERNATE = EMBER_AF_OK_TO_SLEEP,
/** deprecated. */
EMBER_AF_OK_TO_NAP,
EMBER_AF_STAY_AWAKE,
} EmberAfEventSleepControl;

/**
* @brief a structure used to keep track of cluster related events and
* their sleep control values. The cluster code will not know at
* runtime all of the events that it has access to in the event table
* This structure is stored by the application framework in an event
* context table which along with helper functions allows the cluster
* code to schedule and deactivate its associated events.
*/
typedef struct
{
/**
* The endpoint of the associated cluster event.
*/
chip::EndpointId endpoint;
/**
* The cluster id of the associated cluster event.
*/
chip::ClusterId clusterId;
/**
* The server/client identity of the associated cluster event.
*/
bool isClient;
/**
* A poll control value used to control the network polling behavior while
* the event is active.
*/
EmberAfEventPollControl pollControl;
/**
* A sleep control value used to control the processor's sleep
* behavior while the event is active.
*/
EmberAfEventSleepControl sleepControl;
/**
* A pointer to the event control value which is stored in the event table
* and is used to actually schedule the event.
*/
EmberEventControl * eventControl;
} EmberAfEventContext;

/**
* @brief Indicates the absence of a Scene table entry.
*/
Expand Down
136 changes: 0 additions & 136 deletions src/app/util/af.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,142 +357,6 @@ EmberNodeId emberAfGetNodeId(void);

/** @} END Miscellaneous */

/** @name Sleep Control */
//@{

/**
* @brief Friendly define for use in the scheduling or canceling client events
* with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
*/
#define EMBER_AF_CLIENT_CLUSTER_TICK true

/**
* @brief Friendly define for use in the scheduling or canceling server events
* with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
*/
#define EMBER_AF_SERVER_CLUSTER_TICK false

/**
* @brief This function is used to schedule a cluster-related event inside the
* application framework's event mechanism. This function provides a wrapper
* for the Ember stack event mechanism which allows the cluster code to access
* its events by their endpoint, cluster id, and client/server identity. The
* passed poll and sleep controls allow the cluster to indicate whether it
* needs to long or short poll and whether it needs to stay awake or if it can
* sleep.
*
* @param endpoint the endpoint of the event to be scheduled.
* @param clusterId the cluster id of the event to be scheduled.
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled
* is associated with a client cluster or ::EMBER_AF_SERVER_CLUSTER_TICK
* otherwise.
* @param delayMs the number of milliseconds until the event should be called.
* @param pollControl ::EMBER_AF_SHORT_POLL if the cluster needs to short poll
* or ::EMBER_AF_LONG_POLL otherwise.
* @param sleepControl ::EMBER_AF_STAY_AWAKE if the cluster needs to stay awake
* or EMBER_AF_OK_TO_SLEEP otherwise.
*
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
*/
EmberStatus emberAfScheduleTickExtended(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient, uint32_t delayMs,
EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl);

/**
* @brief This function is used to schedule a cluster-related event inside the
* This function is a wrapper for ::emberAfScheduleTickExtended. The cluster
* on the given endpoint will be set to long poll if sleepControl is set to
* ::EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will
* stay awake if sleepControl is ::EMBER_AF_STAY_AWAKE and will sleep
* otherwise.
*
* @param endpoint the endpoint of the event to be scheduled.
* @param clusterId the cluster id of the event to be scheduled.
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled
* is associated with a client cluster or ::EMBER_AF_SERVER_CLUSTER_TICK
* otherwise.
* @param delayMs the number of milliseconds until the event should be called.
* @param sleepControl the priority of the event, what the processor should
* be allowed to do in terms of sleeping while the event is active.
*
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
*/
EmberStatus emberAfScheduleClusterTick(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient, uint32_t delayMs,
EmberAfEventSleepControl sleepControl);

/**
* @brief A function used to schedule a cluster server event. This function
* is a wrapper for ::emberAfScheduleTickExtended.
*
* @param endpoint the endpoint of the event to be scheduled.
* @param clusterId the cluster id of the event to be scheduled.
* @param delayMs the number of milliseconds until the event should be called.
* @param pollControl ::EMBER_AF_SHORT_POLL if the cluster needs to short poll
* or ::EMBER_AF_LONG_POLL otherwise.
* @param sleepControl ::EMBER_AF_STAY_AWAKE if the cluster needs to stay awake
* or EMBER_AF_OK_TO_SLEEP otherwise.
*
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
*/
EmberStatus emberAfScheduleServerTickExtended(chip::EndpointId endpoint, chip::ClusterId clusterId, uint32_t delayMs,
EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl);

/**
* @brief A function used to schedule a cluster server event. This function
* is a wrapper for ::emberAfScheduleServerTickExtended. It indicates that
* the cluster server on the given endpoint can long poll and can sleep.
*
* @param endpoint the endpoint of the event to be scheduled
* @param clusterId the cluster id of the event to be scheduled.
* @param delayMs the number of milliseconds until the event should be called.
*
* @return EMBER_SUCCESS if the event was scheduled or an error otherwise.
*/
EmberStatus emberAfScheduleServerTick(chip::EndpointId endpoint, chip::ClusterId clusterId, uint32_t delayMs);

/**
* @brief A function used to deactivate a cluster-related event. This function
* provides a wrapper for the Ember stack's event mechanism which allows an
* event to be accessed by its endpoint, cluster id, and client/server
* identity.
*
* @param endpoint the endpoint of the event to be deactivated.
* @param clusterId the cluster id of the event to be deactivated.
* @param isClient ::EMBER_AF_CLIENT_CLUSTER_TICK if the event to be
* deactivated is a client cluster ::EMBER_AF_SERVER_CLUSTER_TICK
* otherwise.
*
* @return EMBER_SUCCESS if the event was deactivated or an error otherwise.
*/
EmberStatus emberAfDeactivateClusterTick(chip::EndpointId endpoint, chip::ClusterId clusterId, bool isClient);

/**
* @brief A function used to deactivate a cluster server event. This function
* is a wrapper for ::emberAfDeactivateClusterTick.
*
* @param endpoint the endpoint of the event to be deactivated.
* @param clusterId the cluster id of the event to be deactivated.
*
* @return EMBER_SUCCESS if the event was deactivated or an error otherwise.
*/
EmberStatus emberAfDeactivateServerTick(chip::EndpointId endpoint, chip::ClusterId clusterId);

/**
* @brief Sets the ::EmberEventControl to run "delayMs" milliseconds in the
* future. This function first verifies that the delay is within the
* acceptable range before scheduling the event.
*
* @param control a pointer to the event control.
* @param delayMs the number of milliseconds until the next event.
*
* @return If delayMs is less than or equal to
::EMBER_MAX_EVENT_CONTROL_DELAY_MS, this function will schedule the
event and return ::EMBER_SUCCESS. Otherwise it will return
::EMBER_BAD_ARGUMENT.
*/
EmberStatus emberEventControlSetDelayMS(EmberEventControl * control, uint32_t delayMs);

/** @} END Sleep Control */

/** @name Messaging */
// @{

Expand Down
Loading

0 comments on commit 1178812

Please sign in to comment.