[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: luars232 maximum com port number?
- From: Thomas Buergel <Thomas.Buergel@...>
- Date: Tue, 16 Oct 2012 13:35:44 +0000
> I am seeing hints that luars232 on windows works on COM9 but not on COM10.
Not sure which library you are referring to (this one [1]?)
A Lua-only implementation can be found here [2]. It only works on Win32, but deals with COM port numbers larger than 10.
That source offers the trick to accessing COMn (where n > 9):
local port = t.port
..
local portNum = port:match("^COM([0-9]+)")
if portNum+0 >= 10 then port = "\\\\.\\"..port end
This is fully documented on MSDN [3], so if your luars232 doesn't do the same thing, it could presumably be easily added (though a quick peek at [4] shows it already implements it in fix_device_name()).
HTH,
Tom
[1] https://github.com/ynezz/librs232/blob/master/bindings/lua/luars232.c
[2] http://lua-users.org/wiki/SerialCommunication
[3] http://support.microsoft.com/kb/115831
[4] https://github.com/ynezz/librs232/blob/master/src/rs232_windows.c