From 75ae9929a22a0cfa65059f30b27485f2ae8f3a63 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 25 Feb 2021 20:35:51 +0800 Subject: [PATCH] pull admin plugin out of core proto --- admin.options | 1 + admin.proto | 45 +++++++++++++++++++++++++++++++++++ docs/docs.md | 66 +++++++++++++++++++++++++++++++++------------------ mesh.options | 7 +----- mesh.proto | 38 ----------------------------- 5 files changed, 90 insertions(+), 67 deletions(-) create mode 100644 admin.options create mode 100644 admin.proto diff --git a/admin.options b/admin.options new file mode 100644 index 0000000..7f0f5d7 --- /dev/null +++ b/admin.options @@ -0,0 +1 @@ +*AdminMessage.variant anonymous_oneof:true \ No newline at end of file diff --git a/admin.proto b/admin.proto new file mode 100644 index 0000000..961dea5 --- /dev/null +++ b/admin.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +option java_package = "com.geeksville.mesh"; +option java_outer_classname = "Admin"; +option optimize_for = LITE_RUNTIME; + +import "mesh.proto"; + +/* This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations. This message +is used to do settings operations to both remote AND local nodes. + +(Prior to 1.2 these operations were done via special ToRadio operations) + +FIXME - move the radioconfig/user/channel READ operations into AdminMessage as well +*/ +message AdminMessage { + + oneof variant { + + /* + * set the radio provisioning for this node + */ + RadioConfig set_radio = 1; + + /* + * Set the owner for this node + */ + User set_owner = 2; + + /* + * Set channels (using the new API). A special channel is the "primary channel". The other records are secondary channels. + * Note: only one channel can be marked as primary. If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically */ + Channel set_channel = 3; + + /* + * Send the current RadioConfig in the response for this message + */ + bool get_radio = 4; + + /* + * Send the specified channel in the response for this message + */ + uint32 get_channel = 5; + } + } \ No newline at end of file diff --git a/docs/docs.md b/docs/docs.md index bb89635..96e7dc2 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -3,6 +3,9 @@ ## Table of Contents +- [admin.proto](#admin.proto) + - [AdminMessage](#.AdminMessage) + - [apponly.proto](#apponly.proto) - [ChannelSet](#.ChannelSet) - [ServiceEnvelope](#.ServiceEnvelope) @@ -14,7 +17,6 @@ - [EnvironmentalMeasurement](#.EnvironmentalMeasurement) - [mesh.proto](#mesh.proto) - - [AdminMessage](#.AdminMessage) - [Channel](#.Channel) - [ChannelSettings](#.ChannelSettings) - [Data](#.Data) @@ -55,6 +57,46 @@ + +

Top

+ +## admin.proto + + + + + +### AdminMessage +This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations. This message +is used to do settings operations to both remote AND local nodes. + +(Prior to 1.2 these operations were done via special ToRadio operations) + +FIXME - move the radioconfig/user/channel READ operations into AdminMessage as well + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| set_radio | [RadioConfig](#RadioConfig) | | set the radio provisioning for this node | +| set_owner | [User](#User) | | Set the owner for this node | +| set_channel | [Channel](#Channel) | | Set channels (using the new API). A special channel is the "primary channel". The other records are secondary channels. Note: only one channel can be marked as primary. If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically | +| get_radio | [bool](#bool) | | Send the current RadioConfig in the response for this message | +| get_channel | [uint32](#uint32) | | Send the specified channel in the response for this message | + + + + + + + + + + + + + + +

Top

@@ -207,28 +249,6 @@ To generate Nanopb c code: Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb 0.4.0 - - -### AdminMessage -This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations. This message -is used to do settings operations to both remote AND local nodes. - -(Prior to 1.2 these operations were done via special ToRadio operations) - -FIXME - move the radioconfig/user/channel READ operations into AdminMessage as well - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| set_radio | [RadioConfig](#RadioConfig) | | set the radio provisioning for this node | -| set_owner | [User](#User) | | Set the owner for this node | -| set_channel | [Channel](#Channel) | | Set channels (using the new API). A special channel is the "primary channel". The other records are secondary channels. Note: only one channel can be marked as primary. If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically | - - - - - - ### Channel diff --git a/mesh.options b/mesh.options index f780a95..cb5c1d2 100644 --- a/mesh.options +++ b/mesh.options @@ -12,7 +12,6 @@ # FIXME, max out based on total Data size And do fragmentation and reassembly (for larger payloads) at the Android layer, not the esp32 layer. # note: this payload length is ONLY the bytes that are sent inside of the radiohead packet. The 16 byte header is outside of this envelope *Data.payload max_size:237 -*Data.payloadVariant anonymous_oneof:true *UserPreferences.wifi_ssid max_size:33 *UserPreferences.wifi_password max_size:64 @@ -33,14 +32,12 @@ *MyNodeInfo.hw_model max_size:16 *MyNodeInfo.region max_size:12 -*DebugString.message max_size:256 - # Note: the actual limit (because of header bytes) on the size of encrypted payloads is 251 bytes, but I use 256 # here because we might need to fill with zeros for padding to encryption block size (16 bytes per block) *MeshPacket.encrypted max_size:256 *MeshPacket.payloadVariant anonymous_oneof:true *MeshPacket.hop_limit int_size:8 -*MeshPacket.channel_index int_size:8 +*MeshPacket.channel int_size:8 *ToRadio.payloadVariant anonymous_oneof:true @@ -48,8 +45,6 @@ *Routing.variant anonymous_oneof:true -*AdminMessage.variant anonymous_oneof:true - # Max of three ignored nodes for our testing *UserPreferences.ignore_incoming max_count:3 diff --git a/mesh.proto b/mesh.proto index 094da89..8c9099f 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1337,41 +1337,3 @@ message ToRadio { uint32 want_config_id = 100; } } - -/* This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations. This message -is used to do settings operations to both remote AND local nodes. - -(Prior to 1.2 these operations were done via special ToRadio operations) - -FIXME - move the radioconfig/user/channel READ operations into AdminMessage as well -*/ -message AdminMessage { - - oneof variant { - - /* - * set the radio provisioning for this node - */ - RadioConfig set_radio = 1; - - /* - * Set the owner for this node - */ - User set_owner = 2; - - /* - * Set channels (using the new API). A special channel is the "primary channel". The other records are secondary channels. - * Note: only one channel can be marked as primary. If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically */ - Channel set_channel = 3; - - /* - * Send the current RadioConfig in the response for this message - */ - bool get_radio = 4; - - /* - * Send the specified channel in the response for this message - */ - uint32 get_channel = 5; - } -} \ No newline at end of file