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 / ASRTS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.4 KB  |  53 lines

  1. /* asrts.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asrts(port, option)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  int option;          - ON (1) or OFF (0)
  10. *
  11. * DESCRIPTION
  12. *  set the state of the request to send signal on the rs-232 interface.
  13. *  "option" = ON to assert RTS, OFF (0) to deassert RTS.
  14. *
  15. * SIDE EFFECTS
  16. *  none.
  17. *
  18. * RETURNS
  19. *
  20. *    Previous value of RTS (ON or OFF) or one of the following
  21. *    error returns:
  22. *
  23. *       Value           Meaning
  24. *     -------          --------
  25. *       ASINVPORT       Requested port is out of range
  26. *       ASNOTSETUP      Requested port not setup with asifirst()
  27. *       ASINVPAR        Invalid parameter
  28. *
  29. * MODIFICATIONS
  30. *  10-29-85     David Nienhiser
  31. *  12-30-85     _asrts() now returns previous value
  32. *  David Nienhiser   20-FEB-1987  10:04:55.90
  33. *       Modified to pass pointer to structure to _asrts() so RTS status
  34. *       in the structure can be updated.
  35. */
  36. #include <stdio.h>
  37. #include "gf.h"
  38. #include "asiports.h"
  39.  
  40. int GF_CONV asrts(port,option)
  41. int port,option;
  42. {
  43.         struct PORT_TABLE *p;
  44.  
  45.         if((p=_aschkcnl(port))==NULL)
  46.                 return(_aserror);
  47.         if(option==OFF||option==ON) {
  48.                 return(_asrts(p->base_8250,option,p));
  49.         } else
  50.                 return(ASINVPAR);
  51. }
  52.  
  53.