Reading/Parsing a .ddd (digital tachograph) file to XML in C#

Ege Bayrak picture Ege Bayrak · Jun 26, 2015 · Viewed 11k times · Source

I'm fairly new to C# by the way and need to convert .ddd (digital tachograph output file extension) to .xml.

As a first step I should read the file, so I'm looking at examples. Every source of information I find are using .txt based examples on reading a file. The file type in my example, .ddd, is nowhere near that.

I'm thinking about binary read but not sure about that either. What is the correct way for this?

Answer

jugglingcats picture jugglingcats · Oct 9, 2017

Very late answer but this library is in C# and supports most parts of the digital tachograph spec.

https://github.com/jugglingcats/tachograph-reader

This library provides two classes that can read driver and vehicle card binary files and write to an XmlWriter. The XML is well structured and provides a clear representation of the content of the binary file for subsequent processing. Note that the code does not check the digital signatures in the file.

From the readme:

Usage is quite simple. There is a main class DataFileReader and two subclasses: VehicleUnitDataFile and DriverCardDataFile. You can create an instance of one of the sublasses using the following methods:

DataFile vudf=VehicleUnitDataFile.Create();
DataFile dcdf=DriverCardDataFile.Create();

Once you have a reader instance you can give it a binary file to read and an XML Writer:

vudf.Process("file.ddd", writer);

Most of the sections/features of both data file formats are catered for. It's possible to modify the data file formats using DriverCardData.config and VehicleUnitData.config. These are two XML files defining the structure of the data with features specific to the standard (such as cyclic buffer support).