I have an application which writes some bytes to a serial port. When I do cat /dev/ttyS0
to see what is being transferred, I find that the data is corrupted by the cat
command. Is there any other way to see what is being sent on the serial port?
Does anyone know why cat
changes the data?
Edit: There is another application on the other side and I want to intercept the data in order to check its content but the application must continue to work.
Best Answer
It's not corrupted. What's happening is that the
cat
command is getting some of the bytes, and your application is getting some of them. So when you runcat
, any bytes read by it are missed by the app, and bothcat
and the app will see (different) partial streams that appear corrupted.