diff --git a/CHANGELOG.md b/CHANGELOG.md index 900285ca..1323a162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Refactored and greatly improved CW decoder. - Added NAVTEX decoder and background service. - Added LW/MW band and NAVTEX frequencies to the bandplan. +- Added MQTT reports for APRS, AIS, HFDL, VDL2, ACARS, DSC. - [jketterl] Added MQTT reporting. - [jketterl] Improved PlutoSDR source. diff --git a/debian/changelog b/debian/changelog index eb6c9bc7..179d0b16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ openwebrx (1.2.55) bullseye jammy; urgency=low * Refactored and greatly improved CW decoder. * Added NAVTEX decoder and background service. * Added LW/MW band and NAVTEX frequencies to the bandplan. + * Added MQTT reports for APRS, AIS, HFDL, VDL2, ACARS, DSC. * [jketterl] Added MQTT reporting. * [jketterl] Improved PlutoSDR source. diff --git a/owrx/aircraft.py b/owrx/aircraft.py index fcb6b0c6..e48a2a0f 100644 --- a/owrx/aircraft.py +++ b/owrx/aircraft.py @@ -3,6 +3,7 @@ from owrx.color import ColorCache from owrx.map import Map, LatLngLocation from owrx.aprs import getSymbolData from owrx.config import Config +from owrx.reporting import ReportingEngine from datetime import datetime, timedelta import threading import pickle @@ -323,6 +324,8 @@ class AircraftParser(TextParser): for key in ["aircraft", "origin", "destination"]: if key in out: out[key] = self.reDots.sub("\\1", out[key]) + # Report message + ReportingEngine.getSharedInstance().spot(out) # Update aircraft database with the new data AircraftManager.getSharedInstance().update(out) # Do not return anything when in service mode diff --git a/owrx/marine.py b/owrx/marine.py index 0c517c76..e0613627 100644 --- a/owrx/marine.py +++ b/owrx/marine.py @@ -1,6 +1,7 @@ from owrx.toolbox import TextParser from owrx.color import ColorCache from owrx.config import Config +from owrx.reporting import ReportingEngine import json import logging @@ -22,24 +23,22 @@ class DscParser(TextParser): super().__init__(filePrefix="DSC", service=service) def parse(self, msg: bytes): - # Do not parse in service mode - #if self.service: - # return None # Expect JSON data in text form out = json.loads(msg) # Filter out errors pm = Config.get() if "data" in out and not pm["dsc_show_errors"]: return {} - # Add frequency + # Add mode and frequency + out["mode"] = "DSC" if self.frequency != 0: out["frequency"] = self.frequency - # When in interactive mode, add mode name and color to identify sender - if not self.service: - out["mode"] = "DSC" - if "src" in out: - out["color"] = self.colors.getColor(out["src"]) + # Report message + ReportingEngine.getSharedInstance().spot(out) # Log received messages for debugging logger.debug("{0}".format(out)) + # When in interactive mode, add color to identify sender + if not self.service and "src" in out: + out["color"] = self.colors.getColor(out["src"]) # Done return out