Code: Select all
General Packet Structure (12 bytes/96 bits)
16 0x23,0x23 Sync
8 [byte] Packet type (sequential enum value)
8 [byte] Packet ID (sequentially numbered)
24 [ushort+byte] Date/Time (see below)
16 [ushort] Miliseconds (includes seconds.. eg 42.186 = 42186)
8 [byte] Data Length (byte length)
? [byte array] Payload
8 [byte] Checksum (A) - Fletcher Algorithm, which is used in the TCP standard (RFC 1145).
8 [byte] Checksum (B) Everything except sync bytes are checksummed
{0} System Health Packet (10 bytes/80 bits)
8 [sbyte] MCU Temperature (no decimal value)
8 [sbyte] Board Temperature (no decimal value)
8 [sbyte] Outside Temperature (no decimal value)
8 [sbyte] Battery Temperature (no decimal value)
16 [ushort] Current consumption (mAh)
16 [ushort] Current usage (mA * 10)
16 [ushort] Battery voltage (v * 1000)
{1} GPS Data Packet (20 bytes/160 bits)
16 [ushort] Altitude (m)
32 [uint] Latitude (see below)
32 [unit] Longitude (see below)
16 [ushort] Ground Speed (m/h)
8 [byte] satellite count
8 [byte] Fix Type (enum flags)
16 [ushort] PDOP (*100)
16 [ushort] HDOP (*100)
16 [ushort] VDOP (*100)
Date/Time is:
5 bits Day
4 Bits Month
4 bits Year (double digit format)
5 bits Hour (24hr)
6 bits Minute
WGS84 Coordinates (32 bit)
First bit is Cardinal, 1-N, 0-S / 1-E, 0-W
ddd * 1,000,000
mm * 10,000
ssss