On Tue Jan 10 22:49:40 2012, Bbirthisel@aol.com wrote:
Hi,
Show quoted text> It looks like the current definition of the DCB structure sort of
> provides for a couple speeds above 115200 - but they are not the
> "standard" speeds:
>
>
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214%
> 28v=vs.85%29.aspx
>
> Specifically: CBR_128000 and CBR_256000. But I'm not convinced you're
> interested in non-standard speeds. It also looks, from the
> Requirements,
> like XP is the last version to natively use the DCB interface -
> although
> later OS versions probably support it via emulation.
True, I'd need more common baudrates such as 230400, 460800 and 921600.
I have taken a look at the specs on MSDN you provided. The "BaudRate"
member doesn't necessarily require one of the defined CBR_xxx indexes:
"BaudRate
The baud rate at which the communications device operates. This
member can be an actual baud rate value, or one of the following indexes."
A colleague of mine has suggested me to add the last three lines below
in the CommPort.pm file:
[code]
# first check for programmable baud
$hr = \%{$self->{"_L_BAUD"}};
if ($CP_MaxBaud & BAUD_USER) {
$fmask = $CP_SettableBaud;
${$hr}{110} = CBR_110 if ($fmask & BAUD_110);
${$hr}{300} = CBR_300 if ($fmask & BAUD_300);
${$hr}{600} = CBR_600 if ($fmask & BAUD_600);
${$hr}{1200} = CBR_1200 if ($fmask & BAUD_1200);
${$hr}{2400} = CBR_2400 if ($fmask & BAUD_2400);
${$hr}{4800} = CBR_4800 if ($fmask & BAUD_4800);
${$hr}{9600} = CBR_9600 if ($fmask & BAUD_9600);
${$hr}{14400} = CBR_14400 if ($fmask & BAUD_14400);
${$hr}{19200} = CBR_19200 if ($fmask & BAUD_19200);
${$hr}{38400} = CBR_38400 if ($fmask & BAUD_38400);
${$hr}{56000} = CBR_56000 if ($fmask & BAUD_56K);
${$hr}{57600} = CBR_57600 if ($fmask & BAUD_57600);
${$hr}{115200} = CBR_115200 if ($fmask & BAUD_115200);
${$hr}{128000} = CBR_128000 if ($fmask & BAUD_128K);
${$hr}{256000} = CBR_256000 if (0); # reserved ??
${$hr}{230400} = 230400 if ($fmask & BAUD_USER);
${$hr}{460800} = 460800 if ($fmask & BAUD_USER);
${$hr}{921600} = 921600 if ($fmask & BAUD_USER);
}
[/code]
where the added baudrates are directly defined instead of using the
CBR_xxx indexes. With these modifications I have successfully opened and
used a COM port at 230400 and 460800 speeds on an FTDI USB-to-Serial
adapter, I haven't tried with the 921600 one. I don't know if my
colleague's implementation is clean and/or correct, though.
Regarding the API support in Windows, ActivePerl lists your
Win32-SerialPort library as compatible with 32-bits Windowses only, and
due to tests failing under Windows 7 the library has been set as
incompatible and not available anymore with the latest ActivePerl version:
http://code.activestate.com/ppm/Win32-SerialPort/
I have tried the library under both 32bit versions of XP and 7 and at
least with the previous ActivePerl version it works on both systems.
Regards,
Daniel Beorchia