Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 1 | #ifndef AOS_EVENTS_PONG_LIB_H_ |
| 2 | #define AOS_EVENTS_PONG_LIB_H_ |
| 3 | |
| 4 | #include "aos/events/event_loop.h" |
| 5 | #include "aos/events/pong_generated.h" |
| 6 | #include "aos/events/ping_generated.h" |
| 7 | |
| 8 | namespace aos { |
| 9 | |
| 10 | // Class which replies to a Ping message with a Pong message immediately. |
| 11 | class Pong { |
| 12 | public: |
| 13 | Pong(EventLoop *event_loop); |
| 14 | |
| 15 | private: |
| 16 | EventLoop *event_loop_; |
| 17 | aos::Sender<examples::Pong> sender_; |
Sarah Newman | 2f98cf0 | 2022-04-01 16:42:00 -0700 | [diff] [blame^] | 18 | int32_t last_value_ = 0; |
| 19 | int32_t last_send_time_ = 0; |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | } // namespace aos |
| 23 | |
| 24 | #endif // AOS_EVENTS_PONG_LIB_H_ |