Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 82bbfd4a52a1038dadafa64591954720f601d422
Ticket: 656112ffffffffffffffffffffffffffffffffff
fconfigure -ttycontrol -mode problem
User & Date: parnass on 2002-12-19 03:53:56
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. 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."
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.4.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "parnass"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "fconfigure -ttycontrol -mode problem"
  11. type changed to: "Bug"