Skip to content

Dante383/csv2xdl

Repository files navigation

CSV to TunerPro XDL

THIS WILL MOST LIKELY NOT WORK FOR YOU OUT OF THE BOX

Unless you have the exact same very specific log format (unix timestamp, data as hex), this repository serves as a reference only.

This is basically a dirty hack made for single use, but if it spares anybody browsing old forum threads and staring at hex diffs, it fulfilled its purpose.

What I did / How does this work

  1. I grabbed an ADX that matched my log payload (included - dmg210_simk43_v5.2.adx). This most likely doesn't matter at all, I thought the log frame size might matter, but relative offset of the next frame is contained within each frames prefix.

  2. I recorded a very short, template log - bench_sniff1.xdl. This one does matter, but you should be good just using mine

  3. I estabilished that the header ends at 0x5F, which is where frames start. I didn't concern myself with contents of the header, since converted files work just fine without changing anything

  4. I copy first 0x5F bytes of the bench_sniff1.xdl into each new XDL file. The ADX file I'm using only has a single source of frames (1 command - 1 response), it might get more complicated if you have more.

  5. I start writing converted frames

XDL format

Based on the bench_sniff1.xdl

First 0x5F bytes - header, contents unknown (didn't matter, works fine).

Then log frames:

  • 4 bytes - relative offset of the next frame, LSB. On the last frame, this will point to the end of the file

  • 4 bytes - relative timestamp in miliseconds, LSB

  • 4 bytes - unknown. I hardcode it to 0x0000, works fine.

  • log data (command response)

What's in the box?

  • dmg210_simk43_v5.2.adx - definition file that the example logs and XDL template are based on

  • bench_sniff1.xdl - short log used as a template, I copy first 0x5F bytes into each new XDL

  • example_log.csv - example of the log format I used this with. First column is unix timestamp (int), second is data in hex (like 0xC0 0xFF 0xEE)

  • example_log.xdl - example_log.csv converted into XDL

Usage

In case you missed the header, this is not a plug&play solution, merely a XDL reference

python3 [input_filename.csv] [output_filename.xdl]

About

Convert CSV files into TunerPro XDL logs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages