0
votes

I'm trying to reverse the protocol used by an early nineties logic analyzer an its PC software. The device is connected via RS-232 (propietary wiring) and communicates with a DOS program, successfully running on DOSBOX.

I'm able to control the device with the original software but it would be useful to autimathe the downloading of data from the analyzer using a custom program but to do so I need to know what is going on the serial port.

Ineed to know what mode is the serial port set, while I know for sure the datarate is either 1200 or 9600 bps (configurable on the device) I don't know the flow control (I guess it is RTS/CTS).
I also need to tap into the conversation between the prgram and the device without disturbing their communication.
Reading the serial port with another program (cutecom/minicom) prevents the emulator from receiving the data from the hardware.

So, summing up, what I need to know is:

  • What configuration is set on /dev/ttyS0 (via IOCTL calls, i think)
  • What goes on between program and device.

I was thinking in programming a library which acts as a proxy for the standard c library (via LD_PRELOAD) but there must be an easier way to do this.

2

2 Answers

0
votes

You can use slsnif (Serial Line SNIFfer).

http://linux.die.net/man/1/slsnif

Here's a link to the sourceforge project so you can download it. I don't believe it comes with any modern distributions but I could be wrong so check your distro's software repository first.

http://sourceforge.net/projects/slsnif/

0
votes

I use ttyrpld for tty sniffing. I ported it to PPC and run it on 2.6.32. It logs all of the tty traffic on the board to files, one per tty. Works well.