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

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Wed Jul 27 22:36:31 CEST 2011

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]

More information about the fpc-pascal mailing list