[fpc-pascal] How to detect serial/usb-serial ports.

P. vanderWal p.wal1 at quicknet.nl
Thu Jul 28 16:20:35 CEST 2011


----- Original Message ----- 
From: "Mark Morgan Lloyd" <markMLl.fpc-pascal at telemetry.co.uk>
To: <fpc-pascal at lists.freepascal.org>
Sent: Wednesday, July 27, 2011 10:36 PM
Subject: Re: [fpc-pascal] How to detect serial/usb-serial ports.


> P.vanderWal wrote:
>> Debian and Ubuntu
>>
>> grtjs Piet
>>
>> ----- Original Message ----- From: "Felipe Monteiro de Carvalho" 
>> <felipemonteiro.carvalho at gmail.com>
>> To: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
>> Sent: Wednesday, July 27, 2011 10:39 AM
>> Subject: Re: [fpc-pascal] How to detect serial/usb-serial ports.
>>
>>
>>> For which operating system?
>
> I'd expect (recent versions of) those to only create devices that were 
> known to exist. I detect what's available by looking for up to 12 
> /dev/ttyS*, 8 /dev/ttyUSB* and 4 /dev/ttyI*, then later checking that they 
> can actually be opened (bearing in mind that this might glitch a control 
> line).
>
> It's worth noting that a few weeks ago I was updating the standard 
> serial.pp unit and noticed that Solaris designated serial ports as 
> /dev/ttya and /dev/ttyb.
>
> Windows of course is \COM1, or strictly \\.\COM1 etc.; I note Fabio's test 
> but in the past have used the registry to find e.g. named ports simulated 
> by an AVR box.
>
> -- 
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
>
> [Opinions above are the author's, not those of his employers or 
> colleagues]
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

I'll use Mark's method of com-port detection in my program under linux and
GetComPorts under Windows. In a few days time I'll let you know the result.
Mark thank for the suggestions.

grtjs Piet 




More information about the fpc-pascal mailing list