|
2015-01-29
| ||
| 18:40 | • Closed ticket [08872796bc]: win: serial port read works only once plus 7 oth... artifact: 149a228a4c user: dgp | |
| 18:39 | Fix [08872796bc] check-in: 938d402c18 user: dgp tags: trunk | |
| 18:36 | Test for bug [08872796bc]. check-in: 38a021fa60 user: dgp tags: trunk | |
| 18:35 | • Ticket [08872796bc] win: serial port read works only once status still Open ... artifact: ecd77fa66e user: dgp | |
| 18:34 | Test for bug [08872796bc]. check-in: ff27c03a64 user: dgp tags: core-8-5-branch | |
|
2015-01-28
| ||
| 15:47 | • New ticket [08872796bc] win: serial port read works only once. artifact: 2a6bcb24ea user: fenugrec | |
win: serial port read works only once
Closed / Fixed08872796bc8e58be82094bdfe6cc54207afe3580Created 12 years agoUpdated 12 years ago
Descriptionplain2015-01-28 15:47:39
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.
Referenced by3
938d402c18Fix [08872796bc] check-in2015-01-29 18:39:1138a021fa60Test for bug [08872796bc]. check-in2015-01-29 18:36:45ff27c03a64Test for bug [08872796bc]. check-in2015-01-29 18:34:50
dgpplain2015-01-29 18:35:00
See new test io-73.4 on 8.5 and trunk to demo the trouble. [gets] was properly fixed to operated after EOF everywhere, but the [read] fix only got done right on the 8.5 branch, not the trunk.
dgpplain2015-01-29 18:40:31
fixed on trunk for 8.6.4.
Log in (anonymous is fine) to add a comment.