2

Previously I was using CBR_9600 when communicating with 9600 baud devices. But there does not seem to be a CBR_28800 setting. Is it possible to set the baud rate using the DCB structure of 28800?

Mike
  • 47,263
  • 29
  • 113
  • 177

3 Answers3

3

According to MSDN, the baud rate can either be one of the defined constants (such as CBR_9600, CBR_38400, etc) or any integer value. The constants are just defined to the values, so it's not really an enumeration at all. From the link:

The baud rate at which the communications device operates. This member can be an actual baud rate value, or one of the following indexes.

Ben Gartner
  • 14,413
  • 10
  • 36
  • 34
  • 2
    +1, but you meant "... or the baud rate value", not "... or one of the defined constants" :-) – hjhill Jan 13 '10 at 17:10
2

Yes. CBR_9600 is just equal to 9600. It should be possible to plug in 28800 and it will just work.

Pavel Radzivilovsky
  • 18,794
  • 5
  • 57
  • 67
1

Note that if you use rates other then the "standard" rates, the actual rate may differ from the target rate. In the hardware a "baud rate divisor" register divides down a master clock to achieve the desired baud rate, so a finite number of discrete values are available. However the resolution available at low rates is high; the increments get larger at low divisor values.

This can be a problem if communicating with devices that use different UART hardware and clocking than the PC, because the resultant rate differences can in extreme cases be beyond specified tolerances.

Clifford
  • 88,407
  • 13
  • 85
  • 165