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_SETMODEMCTRL (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSDEVIOCTL
 
USHORT DosDevIOCtl(pfCommErr, pbCtrlSignals, 0x0046, 0x0001, hDevice)
PUSHORT pfCommErr;      /* pointer to variable for error value       */
PBYTE pbCtrlSignals;    /* pointer to structure with control signals */
HFILE hDevice;          /* device handle                             */
 
The ASYNC_SETMODEMCTRL function sets the modem-control signals. This
function turns on or off the data-terminal-ready (DTR) and ready-to-transmit
(RTS) signals (initially, the DTR and RTS signals are turned off).
 
Parameter      Description
────────────────────────────────────────────────────────────────────────────
 
pfCommErr      Points to the variable that receives the communication status
               of the device. This variable can be a combination of the
               following values:
 
               Value                Meaning
               ─────────────────────────────────────────────────────────────
               RX_QUE_OVERRUN       Receive queue overrun. There is no room
                                    in the device driver receive queue to
                                    put a character read in from the receive
                                    hardware.
 
               RX_HARDWARE_OVERRUN  Receive hardware overrun. A character
                                    arrived before the previous character
                                    was completely read. The previous
                                    character is lost.
 
               PARITY_ERROR         The hardware detected a parity error.
 
               FRAMING_ERROR        The hardware detected a framing error.
 
               The function sets the variable to zero if it encounters an
               error.
 
pbCtrlSignals  Points to the MODEMSTATUS structure that contains the
               settings for the modem-control signals.
 
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
the specified signal settings are invalid. When an error occurs, the signal
settings remain unchanged.
 
Comments
 
This function must not be used to enable or disable the DTR or RTS signal if
the signal is being used for input handshaking or toggling on transmit. Any
attempt to do so will cause a "general failure" error.
 
Although the function copies the communication error status to the variable
pointed to by the pfCommErr parameter, it does not clear the error.
 
If the serial device is opened after having been closed, the DTR and RTS
signals are set to the values specified by the DTR control mode and the RTS
control mode, respectively. For a full description, see the
ASYNC_SETDCBINFO function (0x0001,0x0053).
 
After a serial device has been closed, the device driver turns off the DTR
and RTS signals, but only after the device has transmitted all data and has
waited for at least as long as it would take to transmit 10 additional
characters.
 
See Also
 
DosOpen, ASYNC_GETMODEMINPUT, ASYNC_GETMODEMOUTPUT, MODEMSTATUS
 
                                      ♦