N900 GPS Reverse Engineering
acquire packets like:
strace -p $(pidof location-daemon) -e read=6 2>&1|grep '| 000'
Packet Graph
| 00000 00 92 01 00 00 00 00 xx 05 00 00 00 09 03 00 10 S------------------- T4 DL S------------------- | 00010 07 da 07 15 00 xx xx 00 xx xx 00 00 09 02 00 1c S------------- TL TS -- S---------------- | 00020 xx xx xx xx xx xx xx xx 00 00 xx xx 00 00 08 8b DL--- DL--- TS S---- S---- ^eph^ | 00030 xx 00 xx xx xx xx xx xx 09 04 00 14 62 7e xx xx S- DL TS--- DL MS S---------- track SS--- | 00040 xx xx 00 xx xx xx 00 xx 00 xx 00 00 09 05 00 74 DL--- S- TL S- DS S- DS S------------- DL | 00050 09 00 00 00 00 02 xx xx 00 xx xx xx xx xx 00 00 DL S---------- T4--- MS S- TS--- I TS MI S---- | 00060 00 04 xx xx xx xx xx xx xx xx 00 00 00 xx xx xx S- T4 T3 TS S- TL TS MS TS MD S------- T4 TS--- | 00070 00 xx xx xx xx xx 00 00 00 xx xx xx 00 03 xx xx S- TS--- I TS MS S-------- T3 MS MS S- DL TS MS | 00080 xx xx 00 00 00 xx xx xx 00 xx xx xx xx xx 00 00 TS MD S------- T3 TS MS S- TS--- MS TS MI S---- | 00090 00 xx xx xx 00 03 xx xx xx xx 00 00 00 xx xx xx S- TS------ S- DL TS MD TS MS S------- TS SS+TS | 000a0 00 xx xx xx xx xx 00 00 00 xx xx xx 00 xx xx xx S- TL TS MS TS MD S-------- TS------ S- TL TS MI | 000b0 xx xx 00 00 00 xx xx xx 00 xx xx xx xx xx 00 00 TS--- S------- TS--- MS S- TS--- MI TS MS S---- | 000c0 09 08 00 0c xx xx xx xx xx xx xx xx DL----------------------------------
Key
- S = Static, unchanging normally
- MS = Mostly static, varying in value normally slightly
- SS = Sometimes static, completely different values sometimes
- I = Incrementing
- MI = Incrementing, but not every packet
- D = Decrementing
- MD = Decrementing, but not every packet
- TS = Time-sensitive; changes over (short) durations of time
- TL = Time-sensitive, longer duration
- T3 = "
- T4 = ", overnight
- DS = Distance-sensitive; changes over at least 30m distance
- DL = Distance-sensitive, like across the world
Packet Analysis
- ??? = mode: The mode of the fix
- ??? = fields: A bitfield representing which items of this tuple contain valid data
- 10,11 = time year
- 12 = time month
- 13 = time day
- 15 = time hour
- 16 = time minute
- 18,19 = time seconds and milliseconds (in milliseconds)
- ??? = ept: Time accuracy
- 20,21,22(,23?) = latitude / 360 * 256*256*256(*256?)
- 24,25,26(,27?) = longitude / 360 * 256*256*256(*256?)
- 28 =
- 2b,2c = 0590-12a9 (hex)
- 2e,2f = eph (cm)
- ??? = altitude: Fix altitude in meters
- 30 =
- (34?,)35 = (double epv: Vertical position accuracy) * 2
- 3c,3d = track: Direction of motion in hundredths of a degree
- 3e,3f = epd: Track accuracy (in hundredths?)
- 42,43 = speed, in centimetres per second
- 44,45 = eps: speed accuracy, in centimetres per second
- ??? = climb: Current rate of climb in m/s
- ??? = epc: Climb accuracy