Aircotec protocol description

As there is no publicly available source of Aircotec protocol, I tried to decipher some parts of it. I have updated this document with information I received from Aircotec.

Tracklog transfer - MXP protocol

Aircotec communicates on 57600 or 9600 with 8N1 COM port settings. There are currently 3 protocols supported - TNC, PWC and MXP. I decided to use the MXP protocol, because it supports interval of 1 second and it seems to be somewhat simpler than TNC.

The MXP is an ASCII, line-oriented protocol. Lines are separated by a CR/LF (0x0D 0x0A) characters. Two different line types are sent - header, which is the first line that is sent upon transfer, followed by several point data lines.

Header format

The line looks like this:
@xc24051C0F05070428111536011E6D011**7D
Let's break it up into the parts:
@TTVVVVSSSSFFYYMMDDhhmmssGGPPPPIIB**CC
TT (char): Type of GPS. 'xc' for XC trainer, 'tn' for Top-navigator.
VVVV (hexadecimal): Version. In this case: 2.4-05 for XC trainer, v.2405 for TN.
SSSS (hexadecimal): Serial number.
FF (hexadecimal): Flight number mod 256.
YYMMDDhhmmss (decimal): Time of the first point in tracklog (UTC).
GG: Geodetic datum, always 1 means WGS-84.
PPPP (hexadecimal): Count of points that will be sent following header.
II (hexadecimal): Interval in seconds between points. It was chosen by the user when sending the tracklog on the device.
CC (hexadecimal): Control code. XOR of all characters before the control code.
B (*|0|1|2): Type of height that will be sent:

Point format

The header is followed by several (exactly 'PPPP') lines. Each line looks like this:
002D002D0312909F0514D302870C
Which means:
ppppttttFFllllllooooooaaaaCC
All fields are in hexadecimal format.
pppp: Line number, starts from 0, is incremented with each line.
tttt: Number of seconds elapsed from the beginning of tracklog. 'TTTT'+'tttt' is the time of the point.
FF: Flags. Bit-wise OR of following values:
For XC: 0x01 - the GPS had sattelite signal, 0x02 - 3D fix, 0x80 - Mark
For TN: 0x01 - GPSspeed/course valid, 0x02 - always 0, 0x80 - Mark
llllll: Latitude. Divide the number by 24000.0 to get degrees. (2's complement format for negative numbers).
oooooo: Longitude, same format as latitude.
aaaa: Altitude in meters. (2's complement format for negative numbers).
CC: Control code. XOR of all characters before the Control code.
When both GPS and baro height are sent, the aaaa becomes aaaabbbb instead with GPS height first and baro height second.