Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-12-11
21:37 • Closed ticket [2417238fff]: Avoid double-open of serial ports on Windows plu... artifact: 3d0f58b1b1 user: ferrieux
21:37 • Ticket [2417238fff]: 4 changes artifact: d8ddd8b7e7 user: ferrieux
21:26 • Ticket [2417238fff]: 1 change artifact: 146b48934e user: schroedter
21:21 • Add attachment no_double_serial_open.patch to ticket [2417238fffffffff|... artifact: 4857483e0b user: schroedter
21:21 • Ticket [2417238fff] Avoid double-open of serial ports on Windows status stil... artifact: f0b6131ab4 user: schroedter
14:21 • New ticket [2417238fff]. artifact: 43b3045ead user: schroedter

Avoid double-open of serial ports on Windows

Closed / Duplicate2417238fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-12-11 14:21:21
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+]
schroedterplain2008-12-11 21:21:21
File Added - 304908: no_double_serial_open.patch
schroedter Ticket [2417238fff]: 1 change [History diff]2008-12-11 21:26:55
ferrieuxplain2008-12-11 21:37:40
Oh please don't duplicate ! Please post this comment and patch to the initial entry...
ferrieux Closed ticket [2417238fff]. [History diff]2008-12-11 21:37:41
Log in (anonymous is fine) to add a comment.

Attachments: