|
|
1.1 ! root 1: /* ! 2: * hangup.c ! 3: */ ! 4: ! 5: /* hangup is called by sysend() to hangup the modem. Hangup then calls ! 6: * undial() to remove any remote device lock files and to re enable ! 7: * a previously disabled port. Bob H. 11/22/91. ! 8: */ ! 9: ! 10: #include "dcp.h" ! 11: #include "modemcap.h" ! 12: ! 13: hangup (fd) ! 14: int fd; ! 15: { ! 16: if ( (HU == NULL) && (HC == 0) ) { ! 17: printmsg(M_DEBUG,"hangup: (level1) about to drop line."); ! 18: undial(fd); ! 19: return(0); ! 20: } ! 21: ! 22: if (AT != (char *) 0) { ! 23: ! 24: /* guard time for modem. Before sending the +++ to the modem to put ! 25: * it in command mode, there must be some delay between the real data ! 26: * and the AT string for it to work. ! 27: */ ! 28: sleep (3); ! 29: write (fd, AT, strlen (AT)); ! 30: if (AD) ! 31: sleep (AD); ! 32: } ! 33: if (HU) { ! 34: if (CS) { ! 35: write (fd, CS, strlen (CS)); ! 36: } ! 37: write (fd, HU, strlen (HU)); ! 38: if (CE) { ! 39: write (fd, CE, strlen (CE)); ! 40: } ! 41: if (IS) { ! 42: write (fd, IS, strlen (IS)); ! 43: if (ID) ! 44: sleep (ID); ! 45: } ! 46: printmsg(M_DEBUG,"hangup: (level2) about to drop line."); ! 47: undial (fd); ! 48: return (1); ! 49: } ! 50: printmsg(M_DEBUG,"hangup: (level3) about to drop line."); ! 51: undial(fd); ! 52: ttyexit(fd); ! 53: return(1); ! 54: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.