From 4ca582891470932241fa78c7ac4b86acd8c64e74 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 11 Feb 2020 12:06:00 -0800 Subject: [PATCH] update protobufs --- TODO.md | 1 + app/src/main/proto/mesh.options | 4 +-- app/src/main/proto/mesh.proto | 53 ++++++++++++++++++++------------- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/TODO.md b/TODO.md index 49a8b8310..36c184005 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ MVP features required for first public alpha * do setOwner every time we connect to the radio, use our settings +* include a background behind our cloud graphics, so redraws work properly * send location data for devices that don't have a GPS - https://developer.android.com/training/location/change-location-settings * make nodeinfo card not look like ass * when a text arrives, move that node info card to the bottom on the window - put the text to the left of the card. with a small arrow/distance/shortname diff --git a/app/src/main/proto/mesh.options b/app/src/main/proto/mesh.options index a35911a95..f27659858 100644 --- a/app/src/main/proto/mesh.options +++ b/app/src/main/proto/mesh.options @@ -14,8 +14,8 @@ # FIXME, max out based on total SubPacket size And do fragmentation and reassembly (for larger payloads) at the Android layer, not the esp32 layer. *Data.payload max_size:200 -# 256 bit psk key -*RadioConfig.psk max_size:32 +# 128 bit psk key (we don't use 256 bit yet because we want to keep our QR code small) +*ChannelSettings.psk max_size:16 fixed_length:true # MyMessage.name max_size:40 # or fixed_length or fixed_count, or max_count diff --git a/app/src/main/proto/mesh.proto b/app/src/main/proto/mesh.proto index fd4a13647..3eca3e800 100644 --- a/app/src/main/proto/mesh.proto +++ b/app/src/main/proto/mesh.proto @@ -145,18 +145,13 @@ message MeshPacket { uint64 rx_time = 4; } -// Full settings (center freq, spread factor, pre-shared secret key etc...) needed to configure a radio -message RadioConfig { +// Full settings (center freq, spread factor, pre-shared secret key etc...) needed to configure a radio for speaking on a particlar channel +// This information can be encoded as a QRcode/url so that other users can configure their radio to join the same channel. +message ChannelSettings { + int32 tx_power = 1; - // We should send our position this often (but only if it has changed significantly) - uint32 position_broadcast_msec = 1; - - // If we haven't broadcasted anything in a while, we should send our position (and User?) at least this often. - uint32 min_broadcast_msec = 2; - - int32 tx_power = 3; - - float center_freq = 4; + // FIXME - change this to an integer for easier user comprehension and smaller bitsize + uint32 channel_num = 2; enum ModemConfig { // Note: these mappings must match ModemConfigChoice in the device code. @@ -168,20 +163,36 @@ message RadioConfig { /// This value replaces bandwidth/spread_factor/coding_rate. If you'd like to experiment with other options /// add them to MeshRadio.cpp in the device code. - ModemConfig modem_config = 5; + ModemConfig modem_config = 3; // uint32 bandwidth = 5; // int32 spread_factor = 6; // int32 coding_rate = 7; - /// A simple preshared key for now for crypto. At first I'm using 256 bit (32 byte) block for the Speck crypto - /// but for beta we'll want something more carefully thought through. - bytes psk = 8; + /// A simple preshared key for now for crypto. At first I'm using 128 bit (16 byte) block for the Speck crypto + /// but for beta we'll want something more carefully thought through. I want to keep the QR code small + bytes psk = 4; +} - // If true, radio should not try to be smart about what packets to queue to the phone - bool keep_all_packets = 100; +// The entire set of user settable/readable settings for our radio device. Includes both the current channel settings +// and any preferences the user has set for behavior of their node +message RadioConfig { - // If true, we will try to capture all the packets sent on the mesh, not just the ones destined to our node. - bool promiscuous_mode = 101; + message UserPreferences { + // We should send our position this often (but only if it has changed significantly) + uint32 position_broadcast_msec = 1; + + // If we haven't broadcasted anything in a while, we should send our position (and User?) at least this often. + uint32 min_broadcast_msec = 2; + + // If true, radio should not try to be smart about what packets to queue to the phone + bool keep_all_packets = 100; + + // If true, we will try to capture all the packets sent on the mesh, not just the ones destined to our node. + bool promiscuous_mode = 101; + } + + UserPreferences preferences = 1; + ChannelSettings channel_settings = 2; } /** @@ -273,10 +284,10 @@ message DeviceState { /// We bump up the integer values in this enum to indicate minimum levels of encodings for saved files /// if your file is below the Minimum you should discard it. - Minimum = 4; + Minimum = 5; /// The current value we are using for saved files - Current = 4; + Current = 5; }; Version version = 6;