From c909fc794e7c20690a4b08395dc708d04b636a15 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 5 Jan 2006 20:38:27 +0000 Subject: [PATCH] Corrected logic in ptt_linux.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@49 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- ptt_linux.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ptt_linux.c b/ptt_linux.c index f0f0c3a6f..d1dab3ed8 100644 --- a/ptt_linux.c +++ b/ptt_linux.c @@ -7,7 +7,7 @@ int ptt_(int *nport, int *ntx, int *iptt) { static int nopen=0; - int i; + int control = TIOCM_RTS | TIOCM_DTR; int fd; char s[11]; @@ -27,23 +27,15 @@ int ptt_(int *nport, int *ntx, int *iptt) return(0); } - //enable privileges for I/O port controls - if(ioperm(0,0x3ff,1) < 0) { - printf("Cannot set privileges for serial I/O\n"); - return(1); - } - - // ioctl(fd, TIOCMGET, &flags); //get line bits for serial port - if(*ntx && nopen) { - i = TIOCM_RTS + TIOCM_DTR; - ioctl(fd, TIOCMSET, &i); // Set DTR and RTS + // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); + ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS *iptt=1; } else { - i=0; - ioctl(fd, TIOCMSET, &i); + // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); + ioctl(fd, TIOCMBIC, &control); close(fd); *iptt=0; nopen=0;