Link layer header type for serial/UART communication
I'm planning to use Wireshark for logging serial/UART communication. This communication may be multiple kinds of proprietary protocols, none of which are related to TCP/IP. They're all raw data. The main benefit of using Wireshark is the ability to write our own dissector to quickly anlyze the protocols in use.
I create the .pcap files manually. It's not a matter of logging serial ports - I fully control them and generate the log file. The problem I've stumbled upon is choosing the the link layer header type for serial communication. I went through the list at http://www.tcpdump.org/linktypes.html and none of these seem to fit my case. There's few related to serial communication, but they're either related to some specific product/vendor (like DLT_RTAC_SERIAL
) or related to PPP.
Is there really no link layer type that could be used for logging simple serial/COM port/UART communication? Or maybe there's one that's close enough that'd require little work (i.e. writing some dummy headers) to adapt to such use case?
What kind of data frames (= sequence of bytes as a unit) are we talking about here? Or are these individual octets?
Individual octets would be easier for me to log, but I assume it'd involve huge overhead - each single byte log entry having a separate header in the file. As I've said, I fully control all the communication aspects (it's an embedded system) and I can attempt to dissect the data into actual frames based on various factors, e.g. change of direction in which the data is currently sent (data transmission is always half-duplex) or when one end stops transmitting data and X time elapses (meaning no more data will be sent/received).