using "read" with binary data and a serial port

Posted by on 2013-04-26 07:52

I am using ActiveState TCL 8.5.13 for controlling equipment via a serial port.

I have the serial port configured for binary data. I am in non blocking mode and using fileevent to run the read script when the channel becomes readable.

Everything works fine except for when the last byte of the received data is 0x0d, read drops the byte. If there is a 0x0d in the middle of the received data, it is read.

I have used a serial port sniffer to determine that the 0x0d is sent to the PC but read drops it.

Has anyone had issues with this?