diff --git a/admin.options b/admin.options index 7f0f5d7..8f8a1c2 100644 --- a/admin.options +++ b/admin.options @@ -1 +1,7 @@ -*AdminMessage.variant anonymous_oneof:true \ No newline at end of file +*AdminMessage.variant anonymous_oneof:true + +*AdminMessage.set_canned_message_plugin_part1 max_size:200 +*AdminMessage.set_canned_message_plugin_part2 max_size:200 +*AdminMessage.set_canned_message_plugin_part3 max_size:200 +*AdminMessage.set_canned_message_plugin_part4 max_size:200 +*AdminMessage.set_canned_message_plugin_part5 max_size:200 diff --git a/admin.proto b/admin.proto index 0b85324..89cb957 100644 --- a/admin.proto +++ b/admin.proto @@ -4,6 +4,7 @@ option java_package = "com.geeksville.mesh"; option optimize_for = LITE_RUNTIME; option go_package = "github.com/meshtastic/gomeshproto"; +import "cannedmessages.proto"; import "channel.proto"; import "mesh.proto"; import "radioconfig.proto"; @@ -76,5 +77,61 @@ message AdminMessage { * Tell the node to reboot in this many seconds (or <0 to cancel reboot) */ int32 reboot_seconds = 35; + + /* + * Get the Canned Message Plugin message part1 in the response to this message. + */ + bool get_canned_message_plugin_part1_request = 36; + CannedMessagePluginMessagePart1 get_canned_message_plugin_part1_response = 37; + + /* + * Get the Canned Message Plugin message part2 in the response to this message. + */ + bool get_canned_message_plugin_part2_request = 38; + CannedMessagePluginMessagePart2 get_canned_message_plugin_part2_response = 39; + + /* + * Get the Canned Message Plugin message part3 in the response to this message. + */ + bool get_canned_message_plugin_part3_request = 40; + CannedMessagePluginMessagePart3 get_canned_message_plugin_part3_response = 41; + + /* + * Get the Canned Message Plugin message part4 in the response to this message. + */ + bool get_canned_message_plugin_part4_request = 42; + CannedMessagePluginMessagePart4 get_canned_message_plugin_part4_response = 43; + + /* + * Get the Canned Message Plugin message part5 in the response to this message. + */ + bool get_canned_message_plugin_part5_request = 44; + CannedMessagePluginMessagePart5 get_canned_message_plugin_part5_response = 45; + + /* + * Set the canned message plugin part 1 text. + */ + CannedMessagePluginMessagePart1 set_canned_message_plugin_part1 = 46; + + /* + * Set the canned message plugin part 2 text. + */ + CannedMessagePluginMessagePart2 set_canned_message_plugin_part2 = 47; + + /* + * Set the canned message plugin part 3 text. + */ + CannedMessagePluginMessagePart3 set_canned_message_plugin_part3 = 48; + + /* + * Set the canned message plugin part 4 text. + */ + CannedMessagePluginMessagePart4 set_canned_message_plugin_part4 = 49; + + /* + * Set the canned message plugin part 5 text. + */ + CannedMessagePluginMessagePart5 set_canned_message_plugin_part5 = 50; + } -} +} // AdminMessage diff --git a/cannedmessages.options b/cannedmessages.options new file mode 100644 index 0000000..d06a327 --- /dev/null +++ b/cannedmessages.options @@ -0,0 +1,5 @@ +*CannedMessagePluginMessagePart1.text max_size:200 +*CannedMessagePluginMessagePart2.text max_size:200 +*CannedMessagePluginMessagePart3.text max_size:200 +*CannedMessagePluginMessagePart4.text max_size:200 +*CannedMessagePluginMessagePart5.text max_size:200 diff --git a/cannedmessages.proto b/cannedmessages.proto new file mode 100644 index 0000000..8a249da --- /dev/null +++ b/cannedmessages.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; +/* + * Meshtastic protobufs + * + * For more information on protobufs (and tools to use them with the language of your choice) see + * https://developers.google.com/protocol-buffers/docs/proto3 + * + * We are not placing any of these defs inside a package, because if you do the + * resulting nanopb version is super verbose package mesh. + * + * Protobuf build instructions: + * + * To build java classes for reading writing: + * protoc -I=. --java_out /tmp mesh.proto + * + * To generate Nanopb c code: + * /home/kevinh/packages/nanopb-0.4.0-linux-x86/generator-bin/protoc --nanopb_out=/tmp -I=app/src/main/proto mesh.proto + * + * Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb 0.4.0 + */ + +option java_package = "com.geeksville.mesh"; +option java_outer_classname = "CannedMessageConfigProtos"; +option optimize_for = LITE_RUNTIME; +option go_package = "github.com/meshtastic/gomeshproto"; + +/* + * Canned message plugin part 1 + */ +message CannedMessagePluginMessagePart1 { + /* + * Predefined messages for canned message plugin separated by '|' characters. + * This is part 1. + */ + string text = 1; +} + +/* + * Canned message plugin part 2 + */ +message CannedMessagePluginMessagePart2 { + /* + * Predefined messages for canned message plugin separated by '|' characters. + * This is part 2. + */ + string text = 1; +} + +/* + * Canned message plugin part 3 + */ +message CannedMessagePluginMessagePart3 { + /* + * Predefined messages for canned message plugin separated by '|' characters. + * This is part 3. + */ + string text = 1; +} + +/* + * Canned message plugin part 4 + */ +message CannedMessagePluginMessagePart4 { + /* + * Predefined messages for canned message plugin separated by '|' characters. + * This is part 4. + */ + string text = 1; +} + +/* + * Canned message plugin part 5 + */ +message CannedMessagePluginMessagePart5 { + /* + * Predefined messages for canned message plugin separated by '|' characters. + * This is part 5. + */ + string text = 1; +} + diff --git a/deviceonly.options b/deviceonly.options index 9e04083..321174a 100644 --- a/deviceonly.options +++ b/deviceonly.options @@ -7,5 +7,11 @@ # FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in RAM *DeviceState.receive_queue max_count:1 +*DeviceState.canned_message_plugin_message_part1 max_size:200 +*DeviceState.canned_message_plugin_message_part2 max_size:200 +*DeviceState.canned_message_plugin_message_part3 max_size:200 +*DeviceState.canned_message_plugin_message_part4 max_size:200 +*DeviceState.canned_message_plugin_message_part5 max_size:200 + *ChannelFile.channels max_count:8 diff --git a/deviceonly.proto b/deviceonly.proto index 0d3110a..7a68534 100644 --- a/deviceonly.proto +++ b/deviceonly.proto @@ -87,6 +87,32 @@ message DeviceState { * Some GPSes seem to have bogus settings from the factory, so we always do one factory reset. */ bool did_gps_reset = 11; + + /* + * Canned Message Plugin message part1. + */ + string canned_message_plugin_message_part1 = 13; + + /* + * Canned Message Plugin message part2. + */ + string canned_message_plugin_message_part2 = 14; + + /* + * Canned Message Plugin message part3. + */ + string canned_message_plugin_message_part3 = 15; + + /* + * Canned Message Plugin message part4. + */ + string canned_message_plugin_message_part4 = 16; + + /* + * Canned Message Plugin message part5. + */ + string canned_message_plugin_message_part5 = 17; + } /* diff --git a/radioconfig.options b/radioconfig.options index c56c4d3..ef3ca1f 100644 --- a/radioconfig.options +++ b/radioconfig.options @@ -10,4 +10,3 @@ *UserPreferences.mqtt_password max_size:32 *UserPreferences.canned_message_plugin_allow_input_source max_size:16 -*UserPreferences.canned_message_plugin_messages max_size:200 diff --git a/radioconfig.proto b/radioconfig.proto index 8dc9cf9..199519a 100644 --- a/radioconfig.proto +++ b/radioconfig.proto @@ -586,13 +586,13 @@ message RadioConfig { /* * If non-zero, the device will fully power off this many seconds after external power is removed. - * + * */ uint32 on_battery_shutdown_after_secs = 153; /* * Overrides HOPS_RELIABLE and sets the maximum number of hops. This can't be greater than 7. - * + * */ uint32 hop_limit = 154; @@ -602,7 +602,7 @@ message RadioConfig { * If using the default server, this will only be honoured if set, otherwise the device will use the default username */ string mqtt_username = 155; - + /* * MQTT password to use (most useful for a custom MQTT server). * If using a custom server, this will be honoured even if empty. @@ -669,8 +669,11 @@ message RadioConfig { /* * Predefined messages for CannedMessagePlugin separated by '|' characters. + * Note: Split out the messages out to their own messages because we want to store 1,000 characters. + * and the entire message must fit within 256 bytes. + * Not sure if we should deprecate this or just remove it since we're in dev phase. */ - string canned_message_plugin_messages = 172; + string canned_message_plugin_messages = 172 [deprecated = true]; /* * CannedMessagePlugin also sends a bell character with the messages. @@ -678,6 +681,7 @@ message RadioConfig { */ bool canned_message_plugin_send_bell = 173; } - UserPreferences preferences = 1; -} + +} // RadioConfig +