I'm going to be writing a program in C which is going to open a connection over serial port, and "listen" for incoming commands, then it will take some action and report back a status.
The connection is going to be over RS232 (Serial port) and I'm trying to understand how to know which port to open.
When using windows, if I hook up my usb-serial device I see "Prolific USB-to-Serial Comm Port (COM4)" show up in the device manager... but on the Linux side I don't see any changes in the /sys/class/tty
or /dev
area, I see ttyS0
through ttyS7
present all the time (I'm assuming the S
stands for serial based on what I've read).
So how do I know which one to connect to?
EDIT
While I'm developing this on a OpenSUSE 12.1 box (3.1 kernel), the final program will be run on uCLinux on a board running a 2.4Linux kernel, so I'm looking for pure C solutions which will work on older kernels
FYI: the /sys
file system as noted in the answer to this post didn't exist until the 2.6 kernel and my constraints force me to stick to things available in the 2.4 kernel.