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_SETLINECTRL (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSDEVIOCTL
 
USHORT DosDevIOCtl(0L, pbLineCtrl, 0x0042, 0x0001, hDevice)
PBYTE pbLineCtrl;    /* pointer to structure with line settings */
HFILE hDevice;       /* device handle                           */
 
The ASYNC_SETLINECTRL function sets the line characteristics (stop bits,
parity, and data bits) for the specified serial device.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pbLineCtrl  Points to the LINECONTROL structure that contains the settings
            for the number of data bits, parity, and number of stop bits.
 
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
any of the specified line characteristics is out of range. When an error
occurs, line characteristics remain unchanged.
 
Comments
 
When a device is first opened, the initial line characteristics are 7 data
bits, even parity, and 1 stop bit. After line characteristics are changed,
they remain changed until the function is used again, even if the device is
closed and reopened.
 
If the number of data bits is less than 8, the device driver fills with
zeros the unused high-order bits of each character it receives from the
device; the device driver ignores the unused high-order bits of characters
it receives from the program. Therefore, if the number of data bits is 7 but
the XOFF character is 0x80, the device driver does not recognize the XOFF
character even when automatic-transmission control is enabled. If the error
substitution character is 0x80, the device driver still places 0x80 in the
receive queue. Programs must see that these characters match the specified
data size. Any characters that were in the receive queue before the function
is called remain unchanged.
 
See Also
 
DosOpen, ASYNC_GETLINECTRL, LINECONTROL
 
                                      ♦