feat: implement mqtt ingestion, parsing, and archive pipeline
This commit is contained in:
24
backend/app/mqtt/parsers/mixed.py
Normal file
24
backend/app/mqtt/parsers/mixed.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from app.mqtt.parsers.nmea import parse_nmea_sentences
|
||||
from app.mqtt.parsers.rtcm import summarize_rtcm_types
|
||||
|
||||
|
||||
def parse_mixed_payload(payload: bytes) -> list[dict[str, Any]]:
|
||||
events = parse_nmea_sentences(payload)
|
||||
|
||||
rtcm_types = summarize_rtcm_types(payload)
|
||||
if rtcm_types:
|
||||
events.append(
|
||||
{
|
||||
"event_type": "rtcm_summary",
|
||||
"payload": {
|
||||
"rtcm_message_count": sum(rtcm_types.values()),
|
||||
"rtcm_types": rtcm_types,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return events
|
||||
Reference in New Issue
Block a user