collect extra map report data

This commit is contained in:
liamcottle
2024-03-31 23:59:55 +13:00
parent 16da561470
commit 7acd0f36db
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,7 @@
-- AlterTable
ALTER TABLE `nodes` ADD COLUMN `firmware_version` VARCHAR(191) NULL,
ADD COLUMN `has_default_channel` BOOLEAN NULL,
ADD COLUMN `modem_preset` INTEGER NULL,
ADD COLUMN `num_online_local_nodes` INTEGER NULL,
ADD COLUMN `position_precision` INTEGER NULL,
ADD COLUMN `region` INTEGER NULL;

View File

@ -22,6 +22,13 @@ model Node {
role Int role Int
is_licensed Boolean? is_licensed Boolean?
firmware_version String?
region Int?
modem_preset Int?
has_default_channel Boolean?
position_precision Int?
num_online_local_nodes Int?
latitude Int? latitude Int?
longitude Int? longitude Int?
altitude Int? altitude Int?

View File

@ -630,6 +630,12 @@ client.on("message", async (topic, message) => {
latitude: mapReport.latitudeI, latitude: mapReport.latitudeI,
longitude: mapReport.longitudeI, longitude: mapReport.longitudeI,
altitude: mapReport.altitude !== 0 ? mapReport.altitude : null, altitude: mapReport.altitude !== 0 ? mapReport.altitude : null,
firmware_version: mapReport.firmwareVersion,
region: mapReport.region,
modem_preset: mapReport.modemPreset,
has_default_channel: mapReport.hasDefaultChannel,
position_precision: mapReport.positionPrecision,
num_online_local_nodes: mapReport.numOnlineLocalNodes,
}; };
await prisma.node.upsert({ await prisma.node.upsert({