pull admin plugin out of core proto

This commit is contained in:
Kevin Hester 2021-02-25 20:35:51 +08:00
parent 3d5fe922a6
commit 75ae9929a2
5 changed files with 90 additions and 67 deletions

1
admin.options Normal file
View file

@ -0,0 +1 @@
*AdminMessage.variant anonymous_oneof:true

45
admin.proto Normal file
View file

@ -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;
}
}

View file

@ -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 @@
<a name="admin.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## admin.proto
<a name=".AdminMessage"></a>
### 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 &#34;primary channel&#34;. 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 |
<a name="apponly.proto"></a>
<p align="right"><a href="#top">Top</a></p>
@ -207,28 +249,6 @@ To generate Nanopb c code:
Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb 0.4.0
<a name=".AdminMessage"></a>
### 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 &#34;primary channel&#34;. 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 |
<a name=".Channel"></a>
### Channel

View file

@ -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

View file

@ -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;
}
}