ioctl12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
ASYNC_GETCOMMSTATUS (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSDEVIOCTL
 
USHORT DosDevIOCtl(pbStatus, 0L, 0x0064, 0x0001, hDevice)
PBYTE pbStatus;    /* pointer to variable for status */
HFILE hDevice;     /* device handle                  */
 
The ASYNC_GETCOMMSTATUS  function retrieves the communication status of the
specified device.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pbStatus   Points to the variable that receives the communication status.
           This variable can be a combination of the following values:
 
           Value                      Meaning
           ─────────────────────────────────────────────────────────────────
           TX_WAITING_FOR_CTS         Transmission is waiting for the
                                      clear-to-send (CTS) signal to be
                                      turned on. For a full description, see
                                      the ASYNC_SETDCBINFO function (0x0001,
                                      0x0053).
 
           TX_WAITING_FOR_DSR         Transmission is waiting for the
                                      data-set-ready (DSR) signal to be
                                      turned on. For a full description, see
                                      the ASYNC_SETDCBINFO function (0x0001,
                                      0x0053).
 
           TX_WAITING_FOR_DCD         Transmission is waiting for the
                                      data-carrier-detected (DCD) signal to
                                      be turned on. For a full description,
                                      see the ASYNC_SETDCBINFO function
                                      (0x0001, 0x0053).
 
           TX_WAITING_FOR_XON         Transmission is waiting because the
                                      XOFF character is received. For a full
                                      description, see the following
                                      "Comments" section.
 
           TX_WAITING_TO_SEND_XON     Transmission is waiting because the
                                      XOFF character is transmitted. For a
                                      full description, see the following
                                      "Comments" section.
 
           TX_WAITING_WHILE_BREAK_ON  Transmission is waiting because a
                                      break is being transmitted. For a full
                                      description, see the ASYNC_SETBREAKON
                                      function (0x0001, 0x004B).
 
           TX_WAITING_TO_SEND_IMM     Character is waiting to transmit
                                      immediately. For a full description,
                                      see the ASYNC_TRANSMITIMM function
                                      (0x0001, 0x0044).
 
           RX_WAITING_FOR_DSR         Receive state is waiting for the
                                      data-set-ready (DSR) signal to be
                                      turned on. For a full description, see
                                      the ASYNC_SETDCBINFO function (0x0001,
                                      0x0053).
 
hDevice    Identifies the serial device that receives the device-control
           function. The handle must have been created previously by using
           the DosOpen function.
 
Return Value
 
The return value is zero if the function is successful or an error value if
an error occurs.
 
Comments
 
Transmit status indicates why transmission is not occurring, regardless of
whether or not there is data to transmit. However, the device driver must be
enabled for the given condition (for example, enabled for output handshaking
for the modem-control signal) for the status to reflect that the device
driver is waiting for the given condition to transmit.
 
For example, TX_WAITING_FOR_CTS means that the device driver puts receive
characters in the device-driver receive queue, the device driver is not
waiting to transmit a character immediately, and characters from the
device-driver transmit queue are not transmitted because the clear-to-send
(CTS) signal for output handshaking is used and CTS does not have the proper
value.
 
The communication status can include TX_WAITING_TO_SEND_XON if the device
driver is enabled for automatic transmit flow control (XON/XOFF) or if the
ASYNC_STOPTRANSMIT function (0x0001, 0x0047) has been used to tell the
device driver to function as if an XOFF character is received. The
ASYNC_TRANSMITIMM function (0x0001, 0x0044) can still be used to transmit
characters immediately. The device driver can still automatically transmit
XON and XOFF characters due to automatic receive flow control (XON/XOFF)
when the device driver is in this state.
 
The communication status can include TX_WAITING_FOR_XON if the device driver
is enabled for automatic receive flow control. When in this state, the
ASYNC_TRANSMITIMM function (0x0001, 0x0044) can still be used to transmit
characters immediately, and the device driver can still automatically
transmit XON characters.
 
See Also
 
DosOpen, ASYNC_GETCOMMEVENT, ASYNC_GETLINESTATUS, ASYNC_SETDCBINFO,
ASYNC_STARTTRANSMIT, ASYNC_STOPTRANSMIT, ASYNC_TRANSMITIMM