Skip to content Skip to sidebar Skip to footer

Send Byte Array On Serial Port Out Put Stream

when I want to send byte array on serial port stream with java,on destination device I receive different result !!! byte[] sendingPack = new byte[7]; sendingPack[0] = 0x6E;

Solution 1:

The terminal is probably in text reading mode and not in binary read mode.

The 0x0A which is inserted after every 0x0D you send is a carriage return conversion.

The terminal converts "\r" to "\r\n". It adds a line feed char to every carriage return.

The terminal converts every 0D to 0D 0A.

This same feature can be found in the ftp protocol. You tell your client how to transfer files: in text or binary mode.

Post a Comment for "Send Byte Array On Serial Port Out Put Stream"