Hi Wim,
In a message dated 2/25/2008 4:55:46 AM Eastern Standard Time,
bug-Win32-SerialPort@rt.cpan.org writes:
Show quoted text> Mon Feb 25 04:55:28 2008: Request 33559 was acted upon.
> Transaction: Ticket created by wsvries@xs4all.nl
> Queue: Win32-SerialPort
> Subject: block length error
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: wsvries@xs4all.nl
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=33559 >
>
>
> Hi,
> WinXP, SP2, Perl v5.8.8,Win32-serialport 0.19
> (Have seen the same problem as I have raised once on mailing lists but
> there was no answer.)
I don't recall seeing it. But it may have come at avery busy time.
Show quoted text> I try to get some bytes from an USB device (COM7).
> I got the following error:
> "invalid COMMPROP block length= 66 "
> so I changed the lines (line 661 in commport.pm).
> Original is 64 , I made it 66
> if (($CP_Length > 66) and ($self->{"_TYPE"} == PST_RS232)) {
> carp "invalid COMMPROP block length= $CP_Length";
> undef $self;
> return;
This is a leftover error message from the early days of Windows 95. I left
the message even though I didn't expect to see it again after developers learned
how to write drivers for the W95++ driver model. One of the factors in that
driver setup was a device-specific length for the data structure passed to the
API. Essentially, all "regular" RS-232 devices used a 64 byte long structure.
Modems used a longer one (that varied with the feature set - but the perl
module can interpret the proper length for that type by reading the API and
extracting the length).
Developers who had only used MS-DOS (or Windows 3.x) drivers had an initial
learning curve for the much more complicated (but also more robust) serial
drivers. So I saw several of these errors in the early days (and they were all
flawed drivers or similar issues). I suspect that may me at work here as well if
it only happens on COM7 (or other ports above 4). Are there any special
features associated with this USB device?. If the COMMPROP structure is really 66
bytes, it is not a PST_RS232 no matter what it reports.
Show quoted text> Now it works, but sometimes WinXP goes completely down. Can that be caused
> by the change I made?
> Thanks,
> Wim de Vries
One of the things that distinguishes Win32API::Commport from most other perl
modules is its extensive use of (nearly) raw API calls and packed data
structures (via the Win32::API module). Plus the fact it is talking to a real
hardware driver using those calls. It is the latter factor that explains the crash.
Since the serial driver handles hardware interrupts and device buffers, it runs
with Operating System privileges rather than just User privileges. So issuing
an API call with a different length than the OS expects can cause very odd
results.
Is there some way to test the devices with one of the "traditional" serial
ports? Or is there something about the devices that prevents that sort of test?
-bill
**************
Ideas to please picky eaters. Watch video on AOL Living.
(
http://living.aol.com/video/how-to-please-your-picky-eater/rachel-campos-duffy/2050827?NCID=aolcmp00300000002598)