With serial drivers one always worries about overruns and framing errors. These are usually the reason for lost data. Probably also the reason sysread is choking. I would expect to see some error handling in your read loop but I don't see any. Something like: (From the manual)
($BlockingFlags, $InBytes, $OutBytes, $LatchErrorFlags) = $PortObj->i +s_status || warn "could not get port status\n"; $ClearedErrorFlags = $PortObj->reset_error; # The API resets errors when reading status, $LatchErrorFlags # is all $ErrorFlags since they were last explicitly cleared if ($BlockingFlags) { warn "Port is blocked"; } if ($BlockingFlags & BM_fCtsHold) { warn "Waiting for CTS"; } if ($LatchErrorFlags & CE_FRAME) { warn "Framing Error"; }
Does your device implement rts/cts flow control? Does the serial cable contain the rts/cts lines. Do any adapters omit those lines?
In reply to Re: Win32:SerialPort not reading all characters
by starbolin
in thread Win32:SerialPort not reading all characters
by sxmwb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |