Functions to control your serial port’s RTS and DTR on Linux

If you need a way to set the Request-To-Send (RTS) and Data-Terminal-Ready (DTR) signals on a serial port there is a great code snippet on the LinuxQuestions forum┬áby Heiko Noordhof. It provides four straightforward and easy-to-use functions…

int openserial(char *devicename);
void closeserial(void);
int setDTR(unsigned short level);
int setRTS(unsigned short level);

Leave a Reply

Your email address will not be published. Required fields are marked *