You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POSIX serial port interface with optional XON/XOFF transmission flow control support.
Example
Check out the included example.c or compile it using the included Makefile.
The example application allows you to list available serial ports, or connect
to one and print all received data.
API
The API is pretty much self-explanatory. Take a look at src/serial.h for more
informations, the file contains much more documentation and explanations.
// Configuration//#define XONXOFF#defineXON 0x11 //!< XON flow control character
#defineXOFF 0x13 //!< XOFF flow control character
#defineSEARCH "tty"
//#define TRY_TO_OPEN_PORTS#defineTIMEOUT 2
// SetupintserialOpen(constchar*port, unsigned intbaud);
voidserialClose(intfd);
char**getSerialPorts(void);
// Raw, non-blocking I/Ounsigned intserialReadRaw(intfd, char*data, intlength);
unsigned intserialWriteRaw(intfd, constchar*data, intlength);
voidserialWaitUntilSent(intfd);
// Blocking I/OintserialHasChar(intfd);
voidserialReadChar(intfd, char*c);
voidserialWriteChar(intfd, charc);
voidserialWriteString(intfd, constchar*s);
About
C serial port lib with XON/XOFF transmission flow control support