home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / 3b1 / 4209 / phfix.c
Encoding:
C/C++ Source or Header  |  1993-01-08  |  1.1 KB  |  39 lines

  1. /*    Sample program for bashing the OBM into tone dial and
  2.     setting PIOCOVSPD to permit talking to certain modems
  3.     (particularly telebits).
  4.     The documentation mentions 2.3% speed change for PIOCOVSPD.
  5.     That's all I know.
  6.  
  7.     You are free to do whatever you wish with this code, but
  8.     please leave this comment in.
  9.  
  10.     Chris Lewis, clewis@ecicrl.uucp, Jan 2 1991.
  11.  */
  12. #include <stdio.h>
  13. #include <fcntl.h>
  14. #include <sys/phone.h>
  15.  
  16. main(argc, argv)
  17. int argc; char **argv; {
  18.     int f;
  19.     struct updata upd;
  20.     f = open("/dev/ph1", O_RDWR | O_NDELAY, 0);
  21.     if (f < 0) {
  22.     perror("/dev/ph1");
  23.     exit(1);
  24.     }
  25.     ioctl(f, PIOCGETP, &upd);    /* retrieve Phone parameters */
  26.     upd.c_lineparam &= ~PULSE;    /* reverse the sense to set to pulse dial */
  27.     upd.c_lineparam |= DTMF;    /* reverse the sense to set to pulse dial */
  28.  
  29. #ifdef    NEVER
  30.     upd.c_feedback |= SPEAKERON;
  31.     upd.c_feedback |= LOUDSPK;
  32.     ioctl(f, PIOCDISC, &upd);    /* apply PIOCOVSPD for talking to some modems*/
  33. #endif
  34.  
  35.     ioctl(f, PIOCOVSPD, &upd);    /* apply PIOCOVSPD for talking to some modems,
  36.                    eg: Telebits */
  37.     ioctl(f, PIOCSETP, &upd);    /* set phone parameters */
  38. }
  39.