Skip to content
Tcl Source Code Artifact [2a6bcb24ea]
Login

Artifact [2a6bcb24ea]

Artifact 2a6bcb24ea4cd427b247f78e5016142d50f4647b:

Ticket change [2a6bcb24ea] - New ticket [08872796bc8e58be|08872796bc] <i>win: serial port read works only once</i>. by fenugrec on 2015-01-28 15:47:39.
D 2015-01-28T15:47:39.261
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment \sI'm\shaving\sa\sstrange\sproblem\sreading\sa\sserial\sport\son\swinXP.\sIn\sshort,\sI\scan\sonly\sperform\sone\s"read",\sall\sthe\sfollowing\sattempts\sfail.\sHere's\san\sexample,\swith\sTX\sand\sRX\sshorted\sto\secho\severything\sback\s:\r\n>\s*****\r\n>\s(tuner-ctl)\s306\s%\scatch\s{set\scurchan\s[open\s$curport\sr+\s]}\r\n>\s0\r\n>\s(tuner-ctl)\s307\s%\schan\sconfigure\s$curchan\s-buffering\snone\s-translation\sbinary\s-mode\s9600,n,8,1\s-handshake\snone\s-timeout\s100\r\n>\s(tuner-ctl)\s308\s%\sputs\s-nonewline\s$curchan\s\\x55\r\n>\s(tuner-ctl)\s309\s%\sread\s$curchan\r\n>\sU\r\n>\s(tuner-ctl)\s310\s%\sputs\s-nonewline\s$curchan\s\\x55\r\n>\s(tuner-ctl)\s311\s%\sread\s$curchan\r\n>\s(tuner-ctl)\s312\s%\sclose\s$curchan\r\n\s>\s*****\r\n\sIf\sI\sclose+open\sthe\ssame\sport\sright\safter,\sI\swill\sget\sthe\ssame\sresult\s:\sfirst\sread\sworks\sregardless,\ssecond\sread\sgives\snothing!\r\n\r\n\sHere's\swhat\sI\stried\s:\r\n\s-\sdifferent\sserial\sports\s(USB->FTDI\sadapter,\scom0com\ssoftware\svirtual\sport);\seither\sconfigured/wired\sas\ssimple\sloopback\sdevices\sor\sconnected\swith\sa\sknown-good,\sresponding\sdevice.\s(I\ssee\sthe\sresponses\scome\sin\son\sthe\sRXD\sline\swith\sa\sscope)\r\n\s-\svarious\scombinations\sof\sblocking\s=\s1,\s=0,\sbuffering\s=\sfull\s(and\scalling\s"flush\s$curchan"\swhen\srequired)\r\n\s-\ssending\sa\slonger\sstring\swith\sputs\s:\sif\sI\sdo,\sthe\sfirst\sread\swill\scorrectly\sgive\sback\sthe\sentire\sstring\secho.\sSecond\sread\sstill\sfails.\r\n\s-\s[eof\s$curchan]\s==1,\sand\s[chan\spending\sinput\s$curchan]\s==0\sbefore\sthe\ssecond\sread.\sSo\sthe\sdata\sis\sgetting\slost\ssomewhere\sbefore\sthe\ssecond\sread\sis\scalled\s?\r\n-\s"set\serrorInfo"\safter\severy\scommand\sshows\snothing\s(no\serrors)\r\n\r\nOther\sterminal\ssoftware\s(realterm,\setc)\sworks\sfine\sof\scourse.\r\n\r\nI\scan\srun\sollydbg\sfor\ssimple\sdebugging\sif\sneeded.
J foundin 8.6.3.1
J is_private 0
J login fenugrec
J priority 5\sMedium
J private_contact 5aa950fce2ca1705453aec59adc8d0c3c9186502
J resolution None
J severity Important
J status Open
J submitter fenugrec
J subsystem 24.\sChannel\sCommands
J title win:\sserial\sport\sread\sworks\sonly\sonce
J type Bug
K 08872796bc8e58be82094bdfe6cc54207afe3580
U fenugrec
Z ac4314eb7c9fcd06a372e7c4bc132eaf