Is there any C++ example which i can read up on?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
Very few computers have RS-422 ports, is that a typo of RS-232 ("plain old serial port")?
Anyway, Linux uses device drivers to make various hardware devices available as files that you can open. These files are usually located in the
/dev/
directory. You can probably inspect the kernel's boot up messages (run thedmesg
command) to see which device name is associated with the serial port in question, and thenopen()
it.You probably need to use the open(2), close(2), read(2), write(2), ioctl(2), fcntl(2) system calls.
Serial ports are quite complex things. read about their ioctl commands and termios
Read a good book about linux programming (or about advanced unix programming). Serial ports, and tty (including pseudo-ttys) are complex!