Robert Heller
2016-09-05 20:29:45 UTC
I have a piece of software that wants to open a serial port (COM port)
[actually a USB psuedo serial port]. This is a pure Tcl program and I am just
using open, fconfigure, gets, and puts (the device is sending and receiving
lines of ASCII text and converting that to/from binary bit streams over a CAN
bus).
Under MS-Windows sometimes the COM port name is something like COM10, and
MS-Windows has a known problem with that -- the underlying MS-Windows file I/O
system wants to treat "COM10" as a actual file and not a device name, since it
is mode the 4 characters. At least that is what appears to be happening.
*I* don't have a MS-Windows machine myself, but I need to be able to support
people using this software on MS-Windows machines. Is there some Tcl "hack" to
deal with this? I have seen that there are "tricks" involving low-level
MS-Windows I/O hackery for this, but I need a pure Tcl solution. The software
in question is cross platform (it is perfectly happy to open /dev/ttyACM0 or
/dev/ttyACM99, if that happens to be the kernel assigned device name under
Linux, and it will open /dev/cu.<mumble> under MacOSX).
[actually a USB psuedo serial port]. This is a pure Tcl program and I am just
using open, fconfigure, gets, and puts (the device is sending and receiving
lines of ASCII text and converting that to/from binary bit streams over a CAN
bus).
Under MS-Windows sometimes the COM port name is something like COM10, and
MS-Windows has a known problem with that -- the underlying MS-Windows file I/O
system wants to treat "COM10" as a actual file and not a device name, since it
is mode the 4 characters. At least that is what appears to be happening.
*I* don't have a MS-Windows machine myself, but I need to be able to support
people using this software on MS-Windows machines. Is there some Tcl "hack" to
deal with this? I have seen that there are "tricks" involving low-level
MS-Windows I/O hackery for this, but I need a pure Tcl solution. The software
in question is cross platform (it is perfectly happy to open /dev/ttyACM0 or
/dev/ttyACM99, if that happens to be the kernel assigned device name under
Linux, and it will open /dev/cu.<mumble> under MacOSX).
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services