home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / ASIBREAK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.2 KB  |  51 lines

  1. /* asibreak.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asibreak( port,len )
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  int len;             - Duration in increments of 55 ms. 1..255
  10. *
  11. * DESCRIPTION
  12. *  Send a break signal for predetermined period.  A "break signal" is
  13. *  defined as a constant spacing condition on the line for the duration
  14. *  of this period.
  15. *
  16. * SIDE EFFECTS
  17. *  none
  18. *
  19. * RETURNS
  20. *
  21. *       Value           Meaning
  22. *     -------          --------
  23. *       ASSUCCESS       break sent (no error)
  24. *       ASINVPORT       Requested port is out of range
  25. *       ASNOTSETUP      Requested port not setup with asifirst()
  26. * ASINVPAR      If len > 255.
  27. *
  28. * MODIFICATIONS
  29. *  11-01-85  Modified for release 2.0
  30. */
  31. #include <stdio.h>
  32. #include "gf.h"
  33. #include "asiports.h"
  34.  
  35. int GF_CONV asibreak(port,len)
  36. int port,len;
  37. {
  38.         struct PORT_TABLE *p;
  39.  
  40.         if (len>255)
  41.                 return ASINVPAR;
  42.         if((p=_aschkcnl(port))==NULL)
  43.                 return(_aserror);
  44.         _asibreak(p->base_8250,ON);
  45.         timer(len);
  46.         _asibreak(p->base_8250,OFF);
  47.         return(ASSUCCESS);
  48. }
  49.  
  50.  
  51.