22 lines
		
	
	
		
			380 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			380 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef SERIAL_H
 | |
| #define SERIAL_H
 | |
| #include <termios.h>
 | |
| #include <fcntl.h>
 | |
| #include <unistd.h>
 | |
| #include <iostream>
 | |
| 
 | |
| #define BAUDRATE B38400
 | |
| #define DEVICE "/dev/ttyUSB0"
 | |
| 
 | |
| 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();
 | |
| 
 | |
| 
 | |
| #endif // SERIAL_H
 | 
