This commit is contained in:
IMback
2017-11-03 19:02:24 +01:00
commit da117507f2
5 changed files with 914 additions and 0 deletions

20
serial_io.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef SERIAL_H
#define SERIAL_H
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#define BAUDRATE B38400
void sWrite(int port, char string[], size_t length);
void sWrite(int port, const char string[], size_t length);
ssize_t sRead(int port, void *buf, size_t count);
int serialport_init(const char* device, int baud = BAUDRATE);
#endif // SERIAL_H