Implement Phase 1 tasks 1.5-1.7 + 1.9 (Codec 8/8E/16 parsers + fixture suite)

- Codec 8 parser (1-byte IO IDs, no NX/Generation Type)
- Codec 8 Extended parser (2-byte IO IDs + variable-length NX section)
- Codec 16 parser (mixed widths + Generation Type, supports IO IDs > 255)
- Shared GPS element / timestamp helpers in gps-element.ts
- Fixture loader with bigint/Buffer sentinel encoding and auto-discovery
- 12 fixture pairs across codec8/8E/16 (canonical doc + synthetic edge cases)
- Cross-checked Codec 8 against Traccar's TeltonikaProtocolDecoder (no discrepancies)

26 new tests. Total 62 passing across 10 test files.
typecheck/lint/test/build all clean.
This commit is contained in:
2026-04-30 16:15:27 +02:00
parent 1e9219d14a
commit 381287bacc
34 changed files with 1672 additions and 1 deletions
@@ -0,0 +1,43 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-07-10T12:06:54.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 0,
"attributes": {
"__event": 11,
"__generation_type": 5,
"1": 0,
"3": 0,
"11": 39,
"66": 22074
}
},
{
"device_id": "FIXTURE",
"timestamp": "2019-07-10T12:06:55.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 0,
"attributes": {
"__event": 11,
"__generation_type": 5,
"1": 0,
"3": 0,
"11": 38,
"66": 22074
}
}
],
"ack_record_count": 2
}
+1
View File
@@ -0,0 +1 @@
10020000016BDBC7833000000000000000000000000000000000000B05040200010000030002000B00270042563A00000000016BDBC7871800000000000000000000000000000000000B05040200010000030002000B00260042563A000002
@@ -0,0 +1,61 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:46.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 0, "240": 0 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:47.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 1, "240": 1 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:48.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 2, "240": 2 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:49.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 3, "240": 3 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:50.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 4, "240": 4 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:51.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 5, "240": 5 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:52.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 6, "240": 6 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:53.000Z",
"latitude": 0, "longitude": 0, "altitude": 0, "angle": 0, "speed": 0, "satellites": 0,
"priority": 1,
"attributes": { "__event": 10, "__generation_type": 7, "240": 7 }
}
],
"ack_record_count": 8
}
@@ -0,0 +1 @@
10080000016B40D8EA3001000000000000000000000000000000000A00010100F0000000000000016B40D8EE1801000000000000000000000000000000000A01010100F0010000000000016B40D8F20001000000000000000000000000000000000A02010100F0020000000000016B40D8F5E801000000000000000000000000000000000A03010100F0030000000000016B40D8F9D001000000000000000000000000000000000A04010100F0040000000000016B40D8FDB801000000000000000000000000000000000A05010100F0050000000000016B40D901A001000000000000000000000000000000000A06010100F0060000000000016B40D9058801000000000000000000000000000000000A07010100F00700000008
@@ -0,0 +1,21 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:46.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": {
"__event": 1024,
"__generation_type": 5,
"1024": 255
}
}
],
"ack_record_count": 1
}
+1
View File
@@ -0,0 +1 @@
10010000016B40D8EA300100000000000000000000000000000004000501010400FF00000001