On Thursday 13 February 2014 19:39, in comp.os.linux.embedded, "Les Cargill"
<
lcarg...@comcast.com> wrote:
> I'm porting some code from one Linux to another. It uses serial ports.
>
> As opened, the serial port converts 0x0d characters to 0x0a characters.
>
> I have done some googling to find which *opts() functions control
> setting the file referred to by the handle for the serial port
> to be a pure, binary file. I see the one that turns off this conversion,
> but I want all characters to be received completely untrammelled.
>
> I also need to use fopen()... fclose(), so ORed together last-argument
> things in open() are out.
I'm afraid that if you need such tight control of the serial-port data, you
are probably going to have to work with low-level file I/O, at least a bit.
Specifically, you are going to need the fd of your FILE * file (use POSIX
fileno(3) to retrieve), and either the termios(3) tcgetattr()/tcsetattr()
calls, or the ioctl(2) tty calls. You want to change the line conditioning
of your serial port from COOKED or CBREAK mode to RAW mode.
> What's a good website that shows *all* the serial port options for Linux?
Sorry, I can't help you there. I don't know of any website that shows all
the serial port options for Linux.
However, the tty_ioctl(4), ioctl(2), and termios(3) manpages should help
you.
HTH
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request