add command line arg to collect all map reports

This commit is contained in:
liamcottle
2024-03-29 20:03:56 +13:00
parent 99f1682b80
commit cda01bf489

View File

@ -46,6 +46,11 @@ const optionsList = [
type: Boolean, type: Boolean,
description: "This option will save all received waypoints to the database.", 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", name: "decryption-keys",
type: String, type: String,
@ -91,6 +96,7 @@ const mqttPassword = options["mqtt-password"] ?? "large4cats";
const collectServiceEnvelopes = options["collect-service-envelopes"] ?? false; const collectServiceEnvelopes = options["collect-service-envelopes"] ?? false;
const collectTextMessages = options["collect-text-messages"] ?? false; const collectTextMessages = options["collect-text-messages"] ?? false;
const collectWaypoints = options["collect-waypoints"] ?? true; const collectWaypoints = options["collect-waypoints"] ?? true;
const collectMapReports = options["collect-map-reports"] ?? false;
const decryptionKeys = options["decryption-keys"] ?? [ const decryptionKeys = options["decryption-keys"] ?? [
"1PG7OiApB1nwvP+rz05pAQ==", // add default "AQ==" decryption key "1PG7OiApB1nwvP+rz05pAQ==", // add default "AQ==" decryption key
]; ];
@ -548,6 +554,10 @@ client.on("message", async (topic, message) => {
else if(portnum === 73) { else if(portnum === 73) {
if(!collectMapReports){
return;
}
const mapReport = MapReport.decode(envelope.packet.decoded.payload); const mapReport = MapReport.decode(envelope.packet.decoded.payload);
if(logKnownPacketTypes) { if(logKnownPacketTypes) {