brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame^] | 1 | #ifndef AOS_ATOM_CODE_MESSAGES_DRIVER_STATION_DISPLAY_H_ |
| 2 | #define AOS_ATOM_CODE_MESSAGES_DRIVER_STATION_DISPLAY_H_ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <string.h> |
| 6 | |
| 7 | #include "aos/aos_core.h" |
| 8 | #include "aos/common/type_traits.h" |
| 9 | |
| 10 | namespace aos { |
| 11 | const size_t kLineLength = 21; |
| 12 | |
| 13 | struct DriverStationDisplay { |
| 14 | static void Send(int line, const char *fmt, ...) |
| 15 | __attribute__((format(printf, 2, 3))); |
| 16 | static const DriverStationDisplay *GetNext(); // returns NULL if there are no more |
| 17 | static void Free(const DriverStationDisplay *msg); |
| 18 | |
| 19 | uint8_t line; |
| 20 | char data[kLineLength + 1]; |
| 21 | |
| 22 | private: |
| 23 | static void GetQueue(); |
| 24 | static aos_queue *queue; |
| 25 | }; |
| 26 | static_assert(shm_ok<DriverStationDisplay>::value, |
| 27 | "DriverStationDisplay will go through shared memory"); |
| 28 | } // namespace aos |
| 29 | |
| 30 | #endif |
| 31 | |