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

  1. /* asdtr.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asdtr(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 data terminal ready signal on the rs-232 interface.
  13. *  "option" = ON to assert DTR, OFF to deassert DTR
  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     ""
  31. *  12-30-85     _asdtr() now returns previous value.
  32. */
  33. #include <stdio.h>
  34. #include "gf.h"
  35. #include "asiports.h"
  36.  
  37. int GF_CONV asdtr(port,option)
  38. int port,option;
  39. {
  40.         struct PORT_TABLE *p;
  41.  
  42.         if((p=_aschkcnl(port))==NULL)
  43.                 return(_aserror);
  44.         if(option==OFF||option==ON)
  45.                 return(_asdtr(p->base_8250,option));
  46.         else
  47.                 return(ASINVPAR);
  48. }
  49.  
  50.