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,24 @@
{
"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": 1,
"21": 3,
"1": 1,
"66": 24079,
"241": 24602,
"78": "__bigint:0"
}
}
],
"ack_record_count": 1
}
@@ -0,0 +1 @@
08010000016B40D8EA30010000000000000000000000000000000105021503010101425E0F01F10000601A014E000000000000000001
@@ -0,0 +1,22 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:05:36.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": {
"__event": 1,
"21": 3,
"1": 1,
"66": 24080
}
}
],
"ack_record_count": 1
}
@@ -0,0 +1 @@
08010000016B40D9AD80010000000000000000000000000000000103021503010101425E10000001
@@ -0,0 +1,35 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:01:01.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": {
"__event": 1,
"1": 0
}
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:01:19.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": {
"__event": 1,
"1": 1
}
}
],
"ack_record_count": 2
}
+1
View File
@@ -0,0 +1 @@
08020000016B40D57B480100000000000000000000000000000001010101000000000000016B40D5C19801000000000000000000000000000000010101010100000002
@@ -0,0 +1,19 @@
{
"positions": [
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:46.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 0,
"attributes": {
"__event": 0
}
}
],
"ack_record_count": 1
}
+1
View File
@@ -0,0 +1 @@
08010000016B40D8EA300000000000000000000000000000000000000000000001
@@ -0,0 +1,125 @@
{
"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": 1, "1": 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": 1, "1": 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": 1, "1": 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": 1, "1": 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": 1, "1": 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": 1, "1": 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": 1, "1": 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": 1, "1": 7 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:54.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": { "__event": 1, "1": 8 }
},
{
"device_id": "FIXTURE",
"timestamp": "2019-06-10T10:04:55.000Z",
"latitude": 0,
"longitude": 0,
"altitude": 0,
"angle": 0,
"speed": 0,
"satellites": 0,
"priority": 1,
"attributes": { "__event": 1, "1": 9 }
}
],
"ack_record_count": 10
}
@@ -0,0 +1 @@
080A0000016B40D8EA300100000000000000000000000000000001010101000000000000016B40D8EE180100000000000000000000000000000001010101010000000000016B40D8F2000100000000000000000000000000000001010101020000000000016B40D8F5E80100000000000000000000000000000001010101030000000000016B40D8F9D00100000000000000000000000000000001010101040000000000016B40D8FDB80100000000000000000000000000000001010101050000000000016B40D901A00100000000000000000000000000000001010101060000000000016B40D905880100000000000000000000000000000001010101070000000000016B40D909700100000000000000000000000000000001010101080000000000016B40D90D580100000000000000000000000000000001010101090000000A