Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 43b3045eada3e7bb4b1994f837d2b47baa791045
Ticket: 2417238fffffffffffffffffffffffffffffffff
Avoid double-open of serial ports on Windows
User & Date: schroedter on 2008-12-11 14:21:21
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    This patch refers to ID: 2413550
    --------------------------------------------
    
    The following patch performes a "name hint" to detect native Windows serial port name by one of the following patterns (case-insensitive). Pattern matching is checked quite restrictive, because *all open-filenames* need to pass this test.
    
    COM[1-9]:?
    \\.\COM[0-9]+
    //./COM[0-9]+
    
    For all filenames not matching the patterns above, the original behavior open-close-reopen is preserved, thus supporting (virtual) comports of any other name:
    1. Open channel with NON-OVERLAPPED flag
    2. Detect serial port by checking GetCommState() result
    3. Reopen the serial port with OVERLAPPED flag
    This behavior can be enforced even for native Windows serial ports e.g. with 
    
    [open /com1 r+]
    
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "schroedter"
  10. subsystem changed to: "27. Channel Types"
  11. title changed to: "Avoid double-open of serial ports on Windows"
  12. type changed to: "Patch"