[system api] LINUX APP 으로 RS232 RTS 신호핸들링 : 예제
RTS 신호 핸들링하는 예제코드를 정리한다.RTS 신호 핸들링#include #include #include #include main() { int fd, sercmd, serstat; sercmd = TIOCM_RTS; fd = open("/dev/ttyS0", O_RDONLY); // Open the serial port. printf("Setting the RTS pin.n"); ioctl(fd, TIOCMBIS, &sercmd); // Set the RTS pin. // Read the RTS pin status. ioctl(fd, TIOCMGET, &serstat); if (serstat & TIOCM_RTS) printf("RTS pin is set.n"); else printf("RTS pi..