From cda01bf489e753c154b94494f0e10fa13c791ef3 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Fri, 29 Mar 2024 20:03:56 +1300 Subject: [PATCH] add command line arg to collect all map reports --- src/mqtt.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mqtt.js b/src/mqtt.js index 3bc5108..6825132 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -46,6 +46,11 @@ const optionsList = [ type: Boolean, description: "This option will save all received waypoints to the database.", }, + { + name: "collect-map-reports", + type: Boolean, + description: "This option will save all received map reports to the database.", + }, { name: "decryption-keys", type: String, @@ -91,6 +96,7 @@ const mqttPassword = options["mqtt-password"] ?? "large4cats"; const collectServiceEnvelopes = options["collect-service-envelopes"] ?? false; const collectTextMessages = options["collect-text-messages"] ?? false; const collectWaypoints = options["collect-waypoints"] ?? true; +const collectMapReports = options["collect-map-reports"] ?? false; const decryptionKeys = options["decryption-keys"] ?? [ "1PG7OiApB1nwvP+rz05pAQ==", // add default "AQ==" decryption key ]; @@ -548,6 +554,10 @@ client.on("message", async (topic, message) => { else if(portnum === 73) { + if(!collectMapReports){ + return; + } + const mapReport = MapReport.decode(envelope.packet.decoded.payload); if(logKnownPacketTypes) {