ASYNC SETBAUDRATE: Difference between revisions
mNo edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:ASYNC_SETBAUDRATE}} | |||
This function sets the bit rate. | This function sets the bit rate. | ||
; Category: IOCTL_ASYNC (01h) | ; Category: IOCTL_ASYNC (01h) | ||
Line 4: | Line 5: | ||
==Parameter Packet Format== | ==Parameter Packet Format== | ||
{|class="wikitable" | |||
!Field||Length||C Datatype | |||
|- | |||
|Bit Rate||WORD||USHORT | |||
|} | |||
;Bit Rate | ;Bit Rate | ||
The Bit Rate field is a binary integer representing the actual bit rate (bits-per-second) that the physical driver uses to set the bit rate of the COM device. For bit rates up to 19200 bps, the physical device driver sets the rate only if the hardware can support the rate within .01% margin of error. The exceptions are for 110 and 2000 bps, which can have an error of up to .026% and .69%, respectively. In all other cases, if the requested rate cannot be achieved by the hardware within .01% tolerance, the IOCtl fails with an ERROR_INVALID_PARAMETER return code | The Bit Rate field is a binary integer representing the actual bit rate (bits-per-second) that the physical driver uses to set the bit rate of the COM device. For bit rates up to 19200 bps, the physical device driver sets the rate only if the hardware can support the rate within .01% margin of error. The exceptions are for 110 and 2000 bps, which can have an error of up to .026% and .69%, respectively. In all other cases, if the requested rate cannot be achieved by the hardware within .01% tolerance, the IOCtl fails with an ERROR_INVALID_PARAMETER return code. | ||
For bit rates beyond 19200 bps, the physical device driver does not check the .01% margin of error. It is the user's responsibility to maintain the bit rate tolerance. After calling Function 41h to set a bit rate higher than 19200 bps, the user calls "Function 61h - Query Bit Rate" to check the actual bit rate set on a COM port. | |||
*110 | The recommended bit rate values are: | ||
*150 | *110 | ||
*300 | *150 | ||
*600 | *300 | ||
*1200 | *600 | ||
*1800 | *1200 | ||
*2000 | *1800 | ||
*2400 | *2000 | ||
*3600 | *2400 | ||
*4800 | *3600 | ||
*7200 | *4800 | ||
*9600 | *7200 | ||
*19200 | *9600 | ||
*38400 | *19200 | ||
*38400 | |||
*57600 | *57600 | ||
Line 41: | Line 43: | ||
The COM device hardware determines which bit rates can be supported on a given system. The range of bit rates supported by Function 41h is 2 bps to 19200 bps for COM ports on conventional serial devices. For COM ports on enhanced serial devices, the range is 10 bps to 57600 bps. A call with a value beyond this range fails with the ERROR_INVALID_PARAMETER return code. | The COM device hardware determines which bit rates can be supported on a given system. The range of bit rates supported by Function 41h is 2 bps to 19200 bps for COM ports on conventional serial devices. For COM ports on enhanced serial devices, the range is 10 bps to 57600 bps. A call with a value beyond this range fails with the ERROR_INVALID_PARAMETER return code. | ||
[[Category:IOCtl | [[Category:IOCtl Function]] | ||
Latest revision as of 18:48, 22 October 2021
This function sets the bit rate.
- Category
- IOCTL_ASYNC (01h)
- Function
- ASYNC_SETBAUDRATE (41h)
Parameter Packet Format
Field | Length | C Datatype |
---|---|---|
Bit Rate | WORD | USHORT |
- Bit Rate
The Bit Rate field is a binary integer representing the actual bit rate (bits-per-second) that the physical driver uses to set the bit rate of the COM device. For bit rates up to 19200 bps, the physical device driver sets the rate only if the hardware can support the rate within .01% margin of error. The exceptions are for 110 and 2000 bps, which can have an error of up to .026% and .69%, respectively. In all other cases, if the requested rate cannot be achieved by the hardware within .01% tolerance, the IOCtl fails with an ERROR_INVALID_PARAMETER return code.
For bit rates beyond 19200 bps, the physical device driver does not check the .01% margin of error. It is the user's responsibility to maintain the bit rate tolerance. After calling Function 41h to set a bit rate higher than 19200 bps, the user calls "Function 61h - Query Bit Rate" to check the actual bit rate set on a COM port.
The recommended bit rate values are:
- 110
- 150
- 300
- 600
- 1200
- 1800
- 2000
- 2400
- 3600
- 4800
- 7200
- 9600
- 19200
- 38400
- 57600
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.
Remarks
If a general failure error is not returned, the physical device driver performs the action described in the Bit Rate field. An OPEN request packet does not cause the physical device driver to change the bit rate from its previous value. The initial value is 1200 bps.
The COM device hardware determines which bit rates can be supported on a given system. The range of bit rates supported by Function 41h is 2 bps to 19200 bps for COM ports on conventional serial devices. For COM ports on enhanced serial devices, the range is 10 bps to 57600 bps. A call with a value beyond this range fails with the ERROR_INVALID_PARAMETER return code.