Difference between revisions of "ASYNC SETLINECTRL"

From EDM2
Jump to: navigation, search
(Created page with "This function sets the line characteristics (data bits, parity, stop bits). ; Category:IOCTL_ASYNC (01h) ; Function:ASYNC_SETLINECTRL (42h) ==Parameter Packet Format== <pr...")
(No difference)

Revision as of 21:25, 26 March 2020

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 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.