serial getc(0x0A) will add 0x0D0A when putc

05 Oct 2010 . Edited: 05 Oct 2010

My program reads serial from one port by using getc() from a byte stream and putc() to other serail port.  When getc() get 0x0A from byte stream , it will automatic add 0x0D infont of 0x0A when I use putc to printout.

How I can stop the automatic add 0x0D when it get 0x0A?

06 Oct 2010

Are you sure it's doing that? Usually one needs to configure the terminal to interpret LF (0xA) as newline, maybe that's what you did?

07 Oct 2010

I use my linux terminal with sniffer the serial port

jpnevulator --ascii  --timing-print --tty /dev/ttyACM0:SB9600d --read

and it add 0X0D when it get 0x0A

but thank to your advice. I have to use minicom -s to set my /dev/ttyACM0 first before I call jpnevulator again. Then, problem is solved.