Home/Support/Support Forum/TCP/Serial Transfer example - Adding Characters
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

TCP/Serial Transfer example - Adding Characters

0 votes
Hi,

I've noticed that when I send a 0x0A character to the digi device via a TCP socket connection, it for some reason sends the following out of the serial port "0x0D 0x0A". It adds a carriage return whenever a new line character is received.

I need to send raw binary data through the Digi module and corrupts my data packets. How could I disable this functionality?

Thanks a lot!
asked Oct 24, 2013 in NET+OS by kamaz187 New to the Community (10 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Hello

Start by calling tcgetattr() (Described in the API reference guide). It fill sin a pointer to a termios_p structure. One of the fields therein is entitled c_oflag. One of the c_oflag bits is ONLCR. See if this is set on by default. On (I believe means "Newlines in data stream become CR-NL"). Try anding the bit mask such that the ONLCR is set off (0). This use tcsetattr() (also described in the API reference guide) to set the serial port such that ONLCR is shut off. That might help.
answered Oct 24, 2013 by dakotas_dad Veteran of the Digi Community (694 points)
Thanks! this has cleared the problem. This feature is ON by default in the TCP-Serial tunnel demo applicaiton
...