Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame] | 1 | #ifndef BBB_CAPE_SRC_BBB_UART_READER_H_ |
2 | #define BBB_CAPE_SRC_BBB_UART_READER_H_ | ||||
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 3 | |
Brian Silverman | 1662a0e | 2013-12-19 17:50:01 -0800 | [diff] [blame] | 4 | #include <stdint.h> |
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame] | 5 | #include <string.h> |
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 6 | |
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame] | 7 | #include "bbb/packet_finder.h" |
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 8 | |
9 | namespace bbb { | ||||
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 10 | |
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame] | 11 | class UartReader : public PacketFinder { |
Brian Silverman | ffeef3f | 2013-12-22 14:06:23 -0800 | [diff] [blame^] | 12 | public: |
Brian Silverman | f6b6884 | 2013-12-20 12:34:58 -0800 | [diff] [blame] | 13 | UartReader(int32_t baud_rate); |
Brian Silverman | ffeef3f | 2013-12-22 14:06:23 -0800 | [diff] [blame^] | 14 | virtual ~UartReader(); |
15 | |||||
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame] | 16 | int ReadBytes(AlignedChar *dest, size_t max_bytes); |
Brian Silverman | ffeef3f | 2013-12-22 14:06:23 -0800 | [diff] [blame^] | 17 | |
18 | private: | ||||
19 | const int fd_; | ||||
Brian Silverman | 1662a0e | 2013-12-19 17:50:01 -0800 | [diff] [blame] | 20 | }; |
21 | |||||
Brian Silverman | ffeef3f | 2013-12-22 14:06:23 -0800 | [diff] [blame^] | 22 | } // namespace bbb |
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 23 | |
24 | #endif |