Bo Berglund wrote:
Is there a way that one can use to list the actual serial ports
available on a system that will work on both Windows and Linux?
That is, is there a class/method or such already coded to give me a
list of com ports when called?

The com ports are differently named in Windows and Linux, but it
should be possible to get a list of ports actually available.
But not using a listing of dev with ttys in the name, because I have
found that in my test Linux systems there are always 4 of these even
though there is only hardware for a single port...


I haven't found a very good way for Linux. I modified the SynaSer Linux code for the GetSerialPortNames function in the code on this page:
  http://www.turbocontrol.com/simpleserial.htm

Here is what I scan on Linux:
    ScanForPorts( '/dev/ttyS*');
    ScanForPorts( '/dev/ttyUSB*');
    ScanForPorts( '/dev/ttyAM*'); // for ARM board


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to