chiark / gitweb /
found program for making tcflow serial ioctl; not really parport but hey
authorian <ian>
Sun, 1 May 2005 20:27:29 +0000 (20:27 +0000)
committerian <ian>
Sun, 1 May 2005 20:27:29 +0000 (20:27 +0000)
parport/serial-tcflow.c [new file with mode: 0644]

diff --git a/parport/serial-tcflow.c b/parport/serial-tcflow.c
new file mode 100644 (file)
index 0000000..83b2946
--- /dev/null
@@ -0,0 +1,20 @@
+#include <termios.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+int main(int argc, const char *const *argv) {
+  int op, r;
+  
+  switch (argv[1][0]) {
+  case 'N': op= TCOOFF; break;
+  case 'Y': op= TCOON;  break;
+  case 'n': op= TCIOFF; break;
+  case 'y': op= TCION;  break;
+  default: abort();
+  }
+  r= tcflow(3,op);
+  fprintf(stderr,"r=%d e=%s\n",r,strerror(errno));
+  return 0;
+}