blob: 04a155435161e24b27ebb881ad532ce71f271918 [file] [log] [blame]
Brian Silvermanbfbbe872019-02-10 18:00:57 -08001#ifndef Y2019_JEVOIS_UART_H_
2#define Y2019_JEVOIS_UART_H_
3
4#include "aos/containers/sized_array.h"
5#include "third_party/optional/tl/optional.hpp"
6#include "y2019/jevois/structures.h"
7
8// This file manages serializing and deserializing the various structures for
9// transport via UART.
10
11namespace frc971 {
12namespace jevois {
13
14constexpr size_t uart_max_size() {
15 // TODO(Brian): Make this real.
16 return 10;
17}
18using UartBuffer = aos::SizedArray<char, uart_max_size()>;
19
20UartBuffer UartPackToTeensy(const Frame &message);
21tl::optional<CameraCalibration> UartUnpackToCamera(const UartBuffer &message);
22
23} // namespace jevois
24} // namespace frc971
25
26#endif // Y2019_JEVOIS_UART_H_