Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fc668c390fbea5c9287dc12f86b7307973088ea4
Ticket: 656112ffffffffffffffffffffffffffffffffff
fconfigure -ttycontrol -mode problem
User & Date: dkf on 2016-07-10 08:14:16
Changes

  1. assignee changed to: "aku"
  2. closedate changed to: "2457579.84324782"
  3. closer changed to: "dkf"
  4. comment changed to:
    The order of the arguments for the fconfigure command affects the outcome of the operation on WIndows 98.
    
    I am using ActiveTcl 8.4.1 on both Linux and Windows 98 Second Edition
    to run a program I wrote which uses the serial port.
    
    My program communicates with the peripheral device ok on Linux but not Windows and I've traced the problem to fconfigure's new -ttycontrol option.
    
    Using a simple line monitor, I can see that the RTS line
    is not being held low on Windows when I execute this command:
    
                    if { [catch {fconfigure $Sid \
                            -buffering none \
                            -translation binary \
                            -ttycontrol {DTR 1 RTS 0} \
                            -mode 4800,$parity,8,2 -blocking 1}] } \
                            {
                            set code -1
                            }
    
    The RTS line is held low on Red Hat Linux 7.3.
    
    I consulted with Rolf Schroedter, who responded:
    
    "...Yes I see the problem. In Windows the -mode "string" interpretation resets all TTY states to their default values.
    A simple workaround for you is to set the baud rate first and only then the
    -ttycontrol. The following should work:
    
            fconfigure $Sid -buffering none -translation binary  -blocking 1 \
                    -mode 4800,$parity,8,2 -ttycontrol {DTR 1 RTS 0}
    
    Or even
            fconfigure $Sid -buffering none -translation binary  -blocking 1
            fconfigure $id  -mode 4800,$parity,8,2
            fconfigure $id -ttycontrol {DTR 1 RTS 0}
    
    I'll have a look whether there is a way to correct this for future Tcl versions. On the other hand setting -mode is an elementary thing which reconfigures the UART hardware and should not be done during communication.  Thank you for pointing out the problem."
    
  5. icomment:
    Win98 not supported. If the problem still exists with one of the versions of Windows built on the NT kernel, maybe we can reexamine?
    
  6. login: "dkf"
  7. mimetype: "text/x-fossil-wiki"
  8. resolution changed to: "Out of Date"
  9. severity changed to: "Minor"
  10. status changed to: "Closed"