MyoLinux
serial.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 #ifndef MYOLINUX_SERIAL_H
7 #define MYOLINUX_SERIAL_H
8 
9 #include "myolinux.h"
10 #include "buffer.h"
11 
12 #include <string>
13 #include <vector>
14 
15 namespace MYOLINUX_NAMESPACE {
16 
19 class Serial {
20 public:
21  Serial(const std::string &, const int);
22 
23  Buffer read(const std::size_t);
24  std::size_t write(const Buffer &);
25 
26 private:
27  int fd;
28 };
29 
30 }
31 
32 #endif // MYOLINUX_SERIAL_H
std::vector< unsigned char > Buffer
Buffer used for packing and unpacking packets.
Definition: buffer.h:16
Class for communication over the serial port.
Definition: serial.h:19