From 5c1062ea839f97cfc6d33d428a89d1702c39bd93 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 11 Mar 2021 17:50:36 +0800 Subject: [PATCH] don't lose region info for 1.1 nodes that update --- deviceonly.proto | 19 +++++++++++++++++-- docs/docs.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/deviceonly.proto b/deviceonly.proto index 78d65e4..a107c5b 100644 --- a/deviceonly.proto +++ b/deviceonly.proto @@ -5,9 +5,24 @@ option optimize_for = LITE_RUNTIME; import "mesh.proto"; import "channel.proto"; +import "radioconfig.proto"; option java_outer_classname = "DeviceOnly"; +/* This is a stub version of the old 1.1 representation of RadioConfig. But only keeping the region info. The device firmware uses +this stub while migrating old nodes to the new preferences system. +*/ +message LegacyRadioConfig { + message LegacyPreferences { + /* + * The region code for my radio (US, CN, EU433, etc...) + */ + RegionCode region = 15; + } + + LegacyPreferences preferences = 1; +} + /* * This message is never sent over the wire, but it is used for serializing DB * state to flash in the device code @@ -22,8 +37,8 @@ message DeviceState { */ reserved 12; - // Moved to its own file - // RadioConfig radio = 1; + // Moved to its own file, but we keep this here so we can automatically migrate old radio.region settings + LegacyRadioConfig legacyRadio = 1; /* * Read only settings/info about this node diff --git a/docs/docs.md b/docs/docs.md index e1093da..c88ecdb 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -20,6 +20,8 @@ - [deviceonly.proto](#deviceonly.proto) - [ChannelFile](#.ChannelFile) - [DeviceState](#.DeviceState) + - [LegacyRadioConfig](#.LegacyRadioConfig) + - [LegacyRadioConfig.LegacyPreferences](#.LegacyRadioConfig.LegacyPreferences) - [environmental_measurement.proto](#environmental_measurement.proto) - [EnvironmentalMeasurement](#.EnvironmentalMeasurement) @@ -319,6 +321,7 @@ the receive queue and use the preferences store for the other stuff | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| legacyRadio | [LegacyRadioConfig](#LegacyRadioConfig) | | Moved to its own file, but we keep this here so we can automatically migrate old radio.region settings | | my_node | [MyNodeInfo](#MyNodeInfo) | | Read only settings/info about this node | | owner | [User](#User) | | My owner info | | node_db | [NodeInfo](#NodeInfo) | repeated | | @@ -332,6 +335,37 @@ the receive queue and use the preferences store for the other stuff + + + +### LegacyRadioConfig +This is a stub version of the old 1.1 representation of RadioConfig. But only keeping the region info. The device firmware uses +this stub while migrating old nodes to the new preferences system. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| preferences | [LegacyRadioConfig.LegacyPreferences](#LegacyRadioConfig.LegacyPreferences) | | | + + + + + + + + +### LegacyRadioConfig.LegacyPreferences + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| region | [RegionCode](#RegionCode) | | The region code for my radio (US, CN, EU433, etc...) | + + + + +