ASYNC_SETLINECTRL

From EDM2
(Redirected from ASYNC SETLINECTRL (42h))
Jump to: navigation, search

This function sets the line characteristics (data bits, parity, stop bits).

Category
IOCTL_ASYNC (01h)
Function
ASYNC_SETLINECTRL (42h)

Parameter Packet Format

Field Length C Datatype
Data Bits BYTE UCHAR
Parity BYTE UCHAR
Stop Bits BYTE UCHAR
Data Bits
Has the following value and meaning:
00h-04h Reserved
05h 5 data bits
06h 6 data bits
07h 7 data bits (initial value)
08h 8 data bits
09h-FFh Reserved
Parity
Has the following value and meaning:
00h No parity
01h Odd parity
02h Even parity (initial value)
03h Mark parity (parity bit always 1)
04h Space parity (parity bit always 0)
05h-FFh Reserved
Stop Bits
Has the following value and meaning:
00h 1 stop bit (initial value)
01h 1.5 stop bits (valid with 5-bit WORD length only)
02h 2 stop bits (not valid with 5-bit WORD length)
03h-FFh Reserved

Data Packet Format

None. Packet pointer must be NULL.

Returns

If the call is made with invalid Parameter Packet values or an invalid Data Packet pointer, a general failure error is reported and the line characteristics are not changed for any parameters that were valid.

Remarks

If a general failure error is not returned, the physical device driver sets the line characteristics as defined. An OPEN request packet does not cause the physical device driver to change the line characteristics from its previous values.

If the WORD length is less than 8 bits, the appropriate high-order bits for received data are set to 0 when placed in the receive queue and operated on by the physical device driver (for example, XON/XOFF checking, null stripping). This only applies to data that is received after the command is operated on by the physical device driver. Data already in the physical device driver receive queue is not affected in any way by a change in the WORD length.

If the WORD length is less than 8 bits, the physical device driver does not automatically truncate control/transmit data that is passed by the application. No error is reported by the device driver if transmit or control data given to it has high-order bits of non-zero value.

For example, if the physical device driver is told that the WORD length is 7 bits and the XOFF character is 80h, then a physical device driver that has Automatic Transmit Flow Control enabled is not able to recognize the XOFF character. If the error substitution character is set to 80h by the application, with a WORD length of 7 currently active, the device driver still places an 80h in the receive queue. It is the responsibility of the application to maintain consistency between the requested WORD length for the COM device and the requests that the application makes of the physical device driver.