diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp index fc17db7d72d346..dd10c597c5f5c1 100644 --- a/examples/chef/esp32/main/main.cpp +++ b/examples/chef/esp32/main/main.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp b/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp index c417fb7942340d..d0c99e5f3453b1 100644 --- a/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp +++ b/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 484a7eea763083..2d80cda46605a5 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -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); } diff --git a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp index 3a319ab5d494f2..f820ab88b582a5 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index ee45c0e4b0c33c..0cbca3e70e1ee9 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index e9cd6afbf3126e..9ca45c3b55041d 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -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); } diff --git a/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp index ad1fe5ccf9c1bf..f1adbc7d52c804 100644 --- a/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp +++ b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp @@ -18,7 +18,6 @@ #include #include -#include #include using namespace chip; diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index 2ef01bebcdaf76..6613d4bb3df5a0 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/app/clusters/thermostat-client/thermostat-client.cpp b/src/app/clusters/thermostat-client/thermostat-client.cpp index de7afc6267c544..bdd4b1a1f8394d 100644 --- a/src/app/clusters/thermostat-client/thermostat-client.cpp +++ b/src/app/clusters/thermostat-client/thermostat-client.cpp @@ -18,7 +18,6 @@ #include #include -#include #include using namespace chip; diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 47e7a0fd5b3cda..2d9585023a2a5b 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -17,7 +17,6 @@ #include -#include #include #include diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index f3d8fe2afc2af2..b9f9a4b0f37499 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/util/af-event.h b/src/app/util/af-event.h deleted file mode 100644 index cb2ca9dc22707a..00000000000000 --- a/src/app/util/af-event.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#define MAX_TIMER_UNITS_HOST 0x7fff -#define MAX_TIMER_MILLISECONDS_HOST (MAX_TIMER_UNITS_HOST * MILLISECOND_TICKS_PER_MINUTE) - -/** @brief Complete events with a control and a handler procedure. - * - * An application typically creates an array of events - * along with their handlers. - * The main loop passes the array to ::emberRunEvents() to call - * the handlers of any events whose time has arrived. - */ -typedef struct EmberEventData EmberEventData; - -/** @brief Sets this ::EmberEventControl as inactive (no pending event). - */ -void emberEventControlSetInactive(EmberEventControl * control); - -/** @brief Returns true is ::EmberEventControl is active. - */ -bool emberEventControlGetActive(EmberEventControl * control); - -/** @brief Sets this ::EmberEventControl to run as soon as possible. - */ -void emberEventControlSetActive(EmberEventControl * control); diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 70880f4e1f1653..ced52bb9241a06 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -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. */ diff --git a/src/app/util/af.h b/src/app/util/af.h index 22016cddf77d2e..a91990408f7272 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -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 */ // @{ diff --git a/src/app/util/types_stub.h b/src/app/util/types_stub.h index c642da3343c7be..8544c2c6a07f27 100644 --- a/src/app/util/types_stub.h +++ b/src/app/util/types_stub.h @@ -45,25 +45,6 @@ enum EMBER_MULTICAST_BINDING = 3, }; -/** - * @brief Either marks an event as inactive or specifies the units for the - * event execution time. - */ -#ifdef DOXYGEN_SHOULD_SKIP_THIS -enum EmberEventUnits -#else -typedef uint8_t EmberEventUnits; -enum -#endif -{ - /** The event is not scheduled to run. */ - EMBER_EVENT_INACTIVE = 0, - /** The execution time is in approximate milliseconds. */ - EMBER_EVENT_MS_TIME, - /** The event is scheduled to run at the earliest opportunity. */ - EMBER_EVENT_ZERO_DELAY -}; - /** * @brief Size of EUI64 (an IEEE address) in bytes (8). */ @@ -201,14 +182,10 @@ typedef void (*TimerCallback)(chip::EndpointId); /** @brief The control structure for events. * - * It holds the event status (one of the @e EMBER_EVENT_ values) - * and the callback and it's parameters + * It holds the callback and its parameters. */ typedef struct { - /** The event's status, either inactive or the units for timeToExecute. */ - EmberEventUnits status; - /* Callback information */ TimerCallback callback; chip::EndpointId endpoint; diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index fef5b493482841..a00fbb003dd39f 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include