Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 086714dfbd09785e3e4ab623756681639cce79d6
Ticket: 656112ffffffffffffffffffffffffffffffffff
fconfigure -ttycontrol -mode problem
User & Date: schroedter on 2002-12-19 20:53:08
Changes

  1. icomment:
    Logged In: YES 
    user_id=99573
    
    Donal, I hope you agree that I assigned this bug to me.
    
    A call to "fconfigure $serial -ttycontrol {RTS 0} -mode
    4800,n,8,2" results in two calls to SerialSetOptionProc(),
    one with the "-ttycontrol" and the other with the "-mode"
    option. Therefore it's not possible for the serial driver to
    know that both options are set together in one "fconfigure"
    call.
    
    The problem is a result of using the Win-API BuildCommDCB(),
    which implicitly resets the handshake parameters.
    
    The patch is obvious: Setting "-mode" should only set the
    BAUD,PARITY,DATA;STOP parameters, but not touch handshake.
    This would make "-mode" behave more compatible to the Unix
    version.
    
    The patch would have two side effects (incompatibilities):
    
    (1). Currently there is an undocumented feature that Windows
    style mode strings are allowed for "fconfigure -mode" (see
    below). A patch would in future ignore all handshake
    settings via Windows style mode strings.
    
    (2). For Windows/Tcl <= 8.3 "-mode" resets handshake. That
    means the serial port never stalls completely. If now
    "-mode" doesn't touch handshake, then the same script may
    block for Tcl 8.4 if handshake is the system default.
    On one hand this is an incompatibility for 8.3 ==> 8.4, but
    on the  other hand this is the Unix behaviour.
    
    A solution for (2) could be to reset handshake at opening
    the com-port, or even to setup a complete default baud rate,
    e.g. 2400,n,8,1.
    
    The question is: Should this be done or will we live with (2).
    Are there other drawbacks of resetting handshake at open
    (e.g. for standard channels ?) ?
    
    Mode strings: 
    Windows 98(SE):
    C:\>mode /?
    Serieller Anschluss:     MODE COMm[:] [BAUD=b] [PARITY=p]
    [DATA=d] [STOP=s]
                                    [RETRY=r]
    
    Windows 2000:
    C:\>mode /?
    Serieller Anschluss:    MODE COMm[:] [BAUD=b] [PARITY=p]
    [DATA=d] [STOP=s]
    [to=on|off] [xon=on|off] [odsr=on|off]
    [octs=on|off] [dtr=on|off|hs]
    [rts=on|off|hs|tg] [idsr=on|off]
    
    
    
  2. login: "schroedter"
  3. mimetype: "text/plain"
  4. subsystem changed to: "27. Channel Types"
  5. username: "schroedter"