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 { |
12 | int fd_; | ||||
13 | |||||
14 | public: | ||||
Brian Silverman | f6b6884 | 2013-12-20 12:34:58 -0800 | [diff] [blame] | 15 | UartReader(int32_t baud_rate); |
16 | ~UartReader(); | ||||
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame^] | 17 | int ReadBytes(AlignedChar *dest, size_t max_bytes); |
Brian Silverman | 1662a0e | 2013-12-19 17:50:01 -0800 | [diff] [blame] | 18 | }; |
19 | |||||
Daniel Petti | a4fe7bc | 2013-12-22 12:57:50 -0800 | [diff] [blame^] | 20 | } // namespace bbb |
Daniel Petti | 059be42 | 2013-12-14 19:47:42 -0800 | [diff] [blame] | 21 | |
22 | #endif |