Overview
| Artifact ID: | 2a6bcb24ea4cd427b247f78e5016142d50f4647b |
|---|---|
| Ticket: | 08872796bc8e58be82094bdfe6cc54207afe3580
win: serial port read works only once |
| User & Date: | fenugrec on 2015-01-28 15:47:39 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I'm having a strange problem reading a serial port on winXP. In short, I can only perform one "read", all the following attempts fail. Here's an example, with TX and RX shorted to echo everything back : > ***** > (tuner-ctl) 306 % catch {set curchan [open $curport r+ ]} > 0 > (tuner-ctl) 307 % chan configure $curchan -buffering none -translation binary -mode 9600,n,8,1 -handshake none -timeout 100 > (tuner-ctl) 308 % puts -nonewline $curchan \x55 > (tuner-ctl) 309 % read $curchan > U > (tuner-ctl) 310 % puts -nonewline $curchan \x55 > (tuner-ctl) 311 % read $curchan > (tuner-ctl) 312 % close $curchan > ***** If I close+open the same port right after, I will get the same result : first read works regardless, second read gives nothing! Here's what I tried : - different serial ports (USB->FTDI adapter, com0com software virtual port); either configured/wired as simple loopback devices or connected with a known-good, responding device. (I see the responses come in on the RXD line with a scope) - various combinations of blocking = 1, =0, buffering = full (and calling "flush $curchan" when required) - sending a longer string with puts : if I do, the first read will correctly give back the entire string echo. Second read still fails. - [eof $curchan] ==1, and [chan pending input $curchan] ==0 before the second read. So the data is getting lost somewhere before the second read is called ? - "set errorInfo" after every command shows nothing (no errors) Other terminal software (realterm, etc) works fine of course. I can run ollydbg for simple debugging if needed. - foundin changed to: "8.6.3.1"
- is_private changed to: "0"
- login: "fenugrec"
- priority changed to: "5 Medium"
- private_contact changed to: "5aa950fce2ca1705453aec59adc8d0c3c9186502"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "fenugrec"
- subsystem changed to: "24. Channel Commands"
- title changed to: "win: serial port read works only once"
- type changed to: "Bug"