blob: a717c33992b118891c2d03521dd46d9d7989c84b [file] [log] [blame]
Daniel Pettia4fe7bc2013-12-22 12:57:50 -08001#ifndef BBB_CAPE_SRC_BBB_UART_READER_H_
2#define BBB_CAPE_SRC_BBB_UART_READER_H_
Daniel Petti059be422013-12-14 19:47:42 -08003
Brian Silverman1662a0e2013-12-19 17:50:01 -08004#include <stdint.h>
Daniel Pettia4fe7bc2013-12-22 12:57:50 -08005#include <string.h>
Daniel Petti059be422013-12-14 19:47:42 -08006
Daniel Pettia4fe7bc2013-12-22 12:57:50 -08007#include "bbb/packet_finder.h"
Daniel Petti059be422013-12-14 19:47:42 -08008
9namespace bbb {
Daniel Petti059be422013-12-14 19:47:42 -080010
Daniel Pettia4fe7bc2013-12-22 12:57:50 -080011class UartReader : public PacketFinder {
12 int fd_;
13
14public:
Brian Silvermanf6b68842013-12-20 12:34:58 -080015 UartReader(int32_t baud_rate);
16 ~UartReader();
Daniel Pettia4fe7bc2013-12-22 12:57:50 -080017 int ReadBytes(AlignedChar *dest, size_t max_bytes);
Brian Silverman1662a0e2013-12-19 17:50:01 -080018};
19
Daniel Pettia4fe7bc2013-12-22 12:57:50 -080020} // namespace bbb
Daniel Petti059be422013-12-14 19:47:42 -080021
22#endif