blob: 9ce3712a2c43fa42b879792ea942dac0b63794c4 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#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
10namespace aos {
11const size_t kLineLength = 21;
12
13struct 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};
26static_assert(shm_ok<DriverStationDisplay>::value,
27 "DriverStationDisplay will go through shared memory");
28} // namespace aos
29
30#endif
31