Skip to content
Tcl Source Code View Ticket
Login

View Ticket

The 'read' command alternately returns a single character or

Closed / Fixed218817ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:05:55
OriginalBugID: 2217 Bug
Version: 8.1.1
SubmitDate: '1999-06-15'
LastModified: '1999-07-08'
Severity: CRIT
Status: Released
Submitter: techsupp
ChangedBy: redman
RelatedBugIDs: 1980
OS: Windows 95
Machine: X86
FixedDate: '1999-07-08'
FixedInVersion: 8.2b1
ClosedDate: '2000-10-25'


Name:
David Graczyk

ReproducibleScript:
I have only tested this from the Windows platform.

    With a modem connected to Comm Port 1 on my PC, the following test
    script (serial.tcl) produced the results that follow:

    # Open and configure the serial comm port
    set fileID [open COM1: r+]
    fconfigure $fileID -blocking 0 -buffering line -mode 9600,n,8,1 -translation {crlf cr} -eofchar {}

    for {set i 1} {$i < 22} {incr i} {
    # Send "AT" command
    puts $fileID AT
    # Wait 2 seconds for "OK" response
    after 2000
    # Display loop iteration and comm port buffer contents
    puts "$i [read $fileID 80]"
    }

    close $fileID

    % source serial.tcl
    1
    2 A
    3
    4 T
    5
    6
    7
    8
    9
    10

    11
    12 O
    13
    14 K
    15
    16
    17
    18

    19
    20 A
    21
    %

    It seems that nothing was read on the odd numbered lines (loop
    iterations),
    the "cr" character was read on lines 6,8 & 16 and the "lf" character
    was
    read lines on 10 & 18.  Line 19 begins a repeat of the characters from
    line
    1 to 18.

    The results of running the script on version 8.0.5 look like this:

    16 AT
    OK

    17 AT
    OK

    18 AT
    OK

    19 AT
    OK

    20 AT
    OK

    21 AT
    OK

    22 AT
    OK

    23 AT
    OK

    %

    (The first 15 iterations scrolled off the screen.)

DesiredBehavior:
See 6.



New implementation sent in for review.

-- 06/29/1999 redman

New implementation from Rolf Schroedter was applied and appears to be working properly.

-- 07/08/1999 redman
welch Closed ticket [218817ffff]. [History diff]2000-10-26 08:29:17
dgp Ticket [218817ffff]: 3 changes [History diff]2001-04-23 02:50:07
Log in (anonymous is fine) to add a comment.