Re: Serial ports
- From: Måns Rullgård <mans@xxxxxxxxx>
- Date: Mon, 29 Dec 2008 12:25:15 +0000
Marco Trapanese <marcotrapaneseNOSPAM@xxxxxxxxx> writes:
Mark Hobley ha scritto:
Most PCs support more than one serial port at controller level. It
is probable that your computer has more than one serial port
connector on the motherboard, even though only one is connected to
the outer case. Even if there is only one connector on the
motherboard, the controller chip is designed for more than one.
You're right, but the control panel of Windows XP tells me I have only
COM1 (the one connected to the outer case). So I assume my motherboard
has only one serial.
What Windows shows doesn't mean much. Plug and unplug a USB-serial
converter a few times on a Windows machine and watch the number of
listed COM ports grow. Only COM1 being displayed is probably a result
of the vendor removing the unconnected COM2-4 from the configuration.
You could either ask a question during installation, as to which
ports to use with this application, or you could examine the line
statuses to determine which ports have devices attached.
I'm sorry if I compare Windows and Linux, but I need to rewrite
software from there. In my applications I have a combo box which shows
the available serial ports. For example I can add 4 USB-RS232
converter and obviously Windows (and therefore my application) will
show up them.
USB serial adapters usually show up as ttyUSBn (n=0,1...) in Linux.
Some USB devices get ttyACMn names.
I want to do the same thing in Linux, no matter what the user know
about the system. He want to see which are the available serial ports.
The simplest and most robust thing to do is to use /dev/ttyS0 as
default, and provide a free-form entry for an override. Don't bother
trying to enumerate the actual ports. Someone could be using some
exotic hardware with a completely different name for the devices.
--
Måns Rullgård
mans@xxxxxxxxx
.
- Follow-Ups:
- Re: Serial ports
- From: Paul Taylor
- Re: Serial ports
- References:
- Serial ports
- From: Marco Trapanese
- Re: Serial ports
- From: Mark Hobley
- Re: Serial ports
- From: Marco Trapanese
- Serial ports
- Prev by Date: Re: Serial ports
- Next by Date: Re: Serial ports
- Previous by thread: Re: Serial ports
- Next by thread: Re: Serial ports
- Index(es):
Relevant Pages
|