Skip to content

Commit

Permalink
Merge pull request #553 from meshtastic/2.5
Browse files Browse the repository at this point in the history
2.5
  • Loading branch information
thebentern authored Aug 17, 2024
2 parents 8da680b + 59d035a commit fe44964
Show file tree
Hide file tree
Showing 12 changed files with 309 additions and 56 deletions.
2 changes: 2 additions & 0 deletions meshtastic/admin.options
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*AdminMessage.payload_variant anonymous_oneof:true

*AdminMessage.session_passkey max_size:8

*AdminMessage.set_canned_message_module_messages max_size:201
*AdminMessage.get_canned_message_module_messages_response max_size:201
*AdminMessage.delete_file_request max_size:201
Expand Down
19 changes: 19 additions & 0 deletions meshtastic/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ option swift_prefix = "";
* (Prior to 1.2 these operations were done via special ToRadio operations)
*/
message AdminMessage {

/*
* The node generates this key and sends it with any get_x_response packets.
* The client MUST include the same key with any set_x commands. Key expires after 300 seconds.
* Prevents replay attacks for admin messages.
*/
bytes session_passkey = 101;

/*
* TODO: REPLACE
*/
Expand Down Expand Up @@ -58,6 +66,11 @@ message AdminMessage {
* TODO: REPLACE
*/
BLUETOOTH_CONFIG = 6;

/*
* TODO: REPLACE
*/
SECURITY_CONFIG = 7;
}

/*
Expand Down Expand Up @@ -305,6 +318,12 @@ message AdminMessage {
*/
bool remove_fixed_position = 42;

/*
* Set time only on the node
* Convenience method to set the time on the node (as Net quality) without any other position data
*/
fixed32 set_time_only = 43;

/*
* Begins an edit transaction for config, module config, owner, and channel settings changes
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
Expand Down
4 changes: 4 additions & 0 deletions meshtastic/config.options
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
*LoRaConfig.channel_num int_size:16

*PowerConfig.device_battery_ina_address int_size:8

*SecurityConfig.public_key max_size:32
*SecurityConfig.private_key max_size:32
*SecurityConfig.admin_key max_size:32
70 changes: 65 additions & 5 deletions meshtastic/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ message Config {

/*
* Disabling this will disable the SerialConsole by not initilizing the StreamAPI
* Moved to SecurityConfig
*/
bool serial_enabled = 2;
bool serial_enabled = 2[deprecated = true];

/*
* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
* Set this to true to leave the debug log outputting even when API is active.
* Moved to SecurityConfig
*/
bool debug_log_enabled = 3;
bool debug_log_enabled = 3[deprecated = true];

/*
* For boards without a hard wired button, this is the pin number that will be used
Expand Down Expand Up @@ -175,8 +177,9 @@ message Config {
/*
* If true, device is considered to be "managed" by a mesh administrator
* Clients should then limit available configuration and administrative options inside the user interface
* Moved to SecurityConfig
*/
bool is_managed = 9;
bool is_managed = 9[deprecated = true];

/*
* Disables the triple-press of user button to enable or disable GPS
Expand Down Expand Up @@ -825,8 +828,9 @@ message Config {

/*
* Very Long Range - Slow
* Deprecated in 2.5: Works only with txco and is unusably slow
*/
VERY_LONG_SLOW = 2;
VERY_LONG_SLOW = 2 [deprecated = true];

/*
* Medium Range - Slow
Expand All @@ -852,6 +856,13 @@ message Config {
* Long Range - Moderately Fast
*/
LONG_MODERATE = 7;

/*
* Short Range - Turbo
* This is the fastest preset and the only one with 500kHz bandwidth.
* It is not legal to use in all regions due to this wider bandwidth.
*/
SHORT_TURBO = 8;
}

/*
Expand Down Expand Up @@ -1006,8 +1017,56 @@ message Config {

/*
* Enables device (serial style logs) over Bluetooth
* Moved to SecurityConfig
*/
bool device_logging_enabled = 4[deprecated = true];
}

message SecurityConfig {

/*
* The public key of the user's device.
* Sent out to other nodes on the mesh to allow them to compute a shared secret key.
*/
bytes public_key = 1;

/*
* The private key of the device.
* Used to create a shared key with a remote device.
*/
bytes private_key = 2;

/*
* The public key authorized to send admin messages to this node.
*/
bytes admin_key = 3;

/*
* If true, device is considered to be "managed" by a mesh administrator via admin messages
* Device is managed by a mesh administrator.
*/
bool is_managed = 4;

/*
* Serial Console over the Stream API."
*/
bool serial_enabled = 5;

/*
* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
* Output live debug logging over serial.
*/
bool debug_log_api_enabled = 6;

/*
* Enables device (serial style logs) over Bluetooth
*/
bool bluetooth_logging_enabled = 7;

/*
* Allow incoming device control over the insecure legacy admin channel.
*/
bool device_logging_enabled = 4;
bool admin_channel_enabled = 8;
}

/*
Expand All @@ -1021,5 +1080,6 @@ message Config {
DisplayConfig display = 5;
LoRaConfig lora = 6;
BluetoothConfig bluetooth = 7;
SecurityConfig security = 8;
}
}
5 changes: 5 additions & 0 deletions meshtastic/deviceonly.options
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@

*NodeInfoLite.channel int_size:8
*NodeInfoLite.hops_away int_size:8

*UserLite.long_name max_size:40
*UserLite.short_name max_size:5
*UserLite.public_key max_size:32 # public key
*UserLite.macaddr max_size:6 fixed_length:true
47 changes: 46 additions & 1 deletion meshtastic/deviceonly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "meshtastic/channel.proto";
import "meshtastic/localonly.proto";
import "meshtastic/mesh.proto";
import "meshtastic/telemetry.proto";
import "meshtastic/config.proto";
import "nanopb.proto";

option csharp_namespace = "Meshtastic.Protobufs";
Expand Down Expand Up @@ -51,6 +52,50 @@ message PositionLite {
Position.LocSource location_source = 5;
}

message UserLite {
/*
* This is the addr of the radio.
*/
bytes macaddr = 1 [deprecated = true];

/*
* A full name for this user, i.e. "Kevin Hester"
*/
string long_name = 2;

/*
* A VERY short name, ideally two characters.
* Suitable for a tiny OLED screen
*/
string short_name = 3;

/*
* TBEAM, HELTEC, etc...
* Starting in 1.2.11 moved to hw_model enum in the NodeInfo object.
* Apps will still need the string here for older builds
* (so OTA update can find the right image), but if the enum is available it will be used instead.
*/
HardwareModel hw_model = 4;

/*
* In some regions Ham radio operators have different bandwidth limitations than others.
* If this user is a licensed operator, set this flag.
* Also, "long_name" should be their licence number.
*/
bool is_licensed = 5;

/*
* Indicates that the user's role in the mesh
*/
Config.DeviceConfig.Role role = 6;

/*
* The public key of the user's device.
* This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
*/
bytes public_key = 7;
}

message NodeInfoLite {
/*
* The node number
Expand All @@ -60,7 +105,7 @@ message NodeInfoLite {
/*
* The user info for this node
*/
User user = 2;
UserLite user = 2;

/*
* This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true.
Expand Down
5 changes: 5 additions & 0 deletions meshtastic/localonly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ message LocalConfig {
* NodeDB.cpp in the device code.
*/
uint32 version = 8;

/*
* The part of the config that is specific to Security settings
*/
Config.SecurityConfig security = 9;
}

message LocalModuleConfig {
Expand Down
3 changes: 3 additions & 0 deletions meshtastic/mesh.options
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

*macaddr max_size:6 fixed_length:true # macaddrs
*id max_size:16 # node id strings
*public_key max_size:32 # public key

*User.long_name max_size:40
*User.short_name max_size:5
Expand Down Expand Up @@ -45,6 +46,8 @@

*FileInfo.file_name max_size:228

*ClientNotification.message max_size:400

# MyMessage.name max_size:40
# or fixed_length or fixed_count, or max_count

Expand Down
Loading

0 comments on commit fe44964

Please sign in to comment.