|
At some point I wanted to write a proxy server for TomTom's traffic service,
which would understand the traffic information TomTom's servers would send
to my device and store the data. The current and historic data would then be
used to make a prediction of the traffic situation in the near term future
(say an hour from now), which the proxy server would then feed to my TomTom
navigator instead of the current traffic sitution.
(The idea being that while I'm currently not in bad traffic, it's more
relevant to know where the traffic will be bad an hour from now when I
actually get at a place where there is bad traffic, than it is to know there
is no bad traffic at this point in time).
The first step was to decode the data stream and protocol. TomTom uses a
normal HTTP GET request to get the latest traffic data, and the device
either gets a full update, or an incremental update of the traffic data.
The data that it receives is compressed via so called Static Huffman encoding,
a datacompression method where each symbol is transmitted using a
prearranged bit sequence, where different symbols have a different length
sequence: frequent occuring symbols have a short sequence while really rare
symbols have a longer sequence of bits.
After a day or two of looking at the packets in early January 2006, I
figured out most of the Huffman encodings that are used. In addition I
managed to decode the traffic format that was used, and half of the proxy
server got written (the part where the current traffic is stored in a
database). At that time I started my new job, and also bought a phone with
built in bluetooth capability and the project lost relevance for me.
In case someone wants to pick up this project, I've posted the Huffman table
below.
|