From 58b9e2bc77b6bab57f0ae708926a686b78a3fdc0 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Mon, 25 Mar 2024 22:27:26 -0400 Subject: [PATCH 1/8] Remove rx_text_message from deviceonly protobuf --- meshtastic/deviceonly.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 4f6b9a98..c2b48804 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -49,7 +49,7 @@ message DeviceState { * so we can show it on the screen. * Might be null */ - MeshPacket rx_text_message = 7; + //MeshPacket rx_text_message = 7; /* * Used only during development. From a991fb00771a3a967aa9906e6c243dca39d5b507 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Thu, 2 May 2024 22:44:47 -0400 Subject: [PATCH 2/8] Remove commented rx_text_message code --- meshtastic/deviceonly.proto | 7 ------- 1 file changed, 7 deletions(-) diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index c2b48804..9f0c89d3 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -44,13 +44,6 @@ message DeviceState { */ uint32 version = 8; - /* - * We keep the last received text message (only) stored in the device flash, - * so we can show it on the screen. - * Might be null - */ - //MeshPacket rx_text_message = 7; - /* * Used only during development. * Indicates developer is testing and changes should never be saved to flash. From 215189803519cbecb469ddbdb7415e3936324338 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Thu, 2 May 2024 22:45:03 -0400 Subject: [PATCH 3/8] Add message.proto --- meshtastic/message.options | 5 +++++ meshtastic/message.proto | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 meshtastic/message.options create mode 100644 meshtastic/message.proto diff --git a/meshtastic/message.options b/meshtastic/message.options new file mode 100644 index 00000000..9b7dba38 --- /dev/null +++ b/meshtastic/message.options @@ -0,0 +1,5 @@ +# options for nanopb +# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options + +*Message.sender_short_name max_size:5 +*Message.content max_size:237 diff --git a/meshtastic/message.proto b/meshtastic/message.proto new file mode 100644 index 00000000..3e1a92eb --- /dev/null +++ b/meshtastic/message.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package meshtastic; + +message Message { + /* + * The sending node's short name. + */ + string sender_short_name = 1; + + /* + * Whether the message is from this device. + */ + bool from_self = 2; + + // TODO: Comment + string content = 3; + + /* + * Values 1 through 7 indicate what secondary channel index this message was sent on. + * Value 0 indicates that this message was sent on the primary channel. Value 8 + * indicates that this message was sent as a direct message. + */ + uint32 category = 4; + + /* + * The time this message was received by the esp32 (secs since 1970). + * Note: this field is _never_ sent on the radio link itself (to save space) Times + * are typically not sent over the mesh, but they will be added to any Packet + * (chain of SubPacket) sent to the phone (so the phone can know exact time of reception) + */ + fixed32 rx_time = 5; + + // TODO: Write comment + bool rx_ack = 6; +} From 4e8c27b3ee4988522f9f818e62ef89916485470e Mon Sep 17 00:00:00 2001 From: ndnestor Date: Thu, 9 May 2024 23:01:28 -0400 Subject: [PATCH 4/8] Add descriptive comment to Message protobuf message --- meshtastic/message.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meshtastic/message.proto b/meshtastic/message.proto index 3e1a92eb..f8c72033 100644 --- a/meshtastic/message.proto +++ b/meshtastic/message.proto @@ -2,6 +2,10 @@ syntax = "proto3"; package meshtastic; +/* + * Representation of a received or sent message to be stored long-term to create a + * message history + */ message Message { /* * The sending node's short name. @@ -33,4 +37,4 @@ message Message { // TODO: Write comment bool rx_ack = 6; -} +} \ No newline at end of file From e8a3b0437a146744db512c685b5cfcda0b090065 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Sat, 11 May 2024 17:10:10 -0400 Subject: [PATCH 5/8] Fully comment message.proto and limit category int size --- meshtastic/message.options | 1 + meshtastic/message.proto | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meshtastic/message.options b/meshtastic/message.options index 9b7dba38..9935221c 100644 --- a/meshtastic/message.options +++ b/meshtastic/message.options @@ -3,3 +3,4 @@ *Message.sender_short_name max_size:5 *Message.content max_size:237 +*Message.category int_size:8 \ No newline at end of file diff --git a/meshtastic/message.proto b/meshtastic/message.proto index f8c72033..112aa4e3 100644 --- a/meshtastic/message.proto +++ b/meshtastic/message.proto @@ -17,7 +17,9 @@ message Message { */ bool from_self = 2; - // TODO: Comment + /* + * The text of the message. + */ string content = 3; /* @@ -35,6 +37,9 @@ message Message { */ fixed32 rx_time = 5; - // TODO: Write comment + /* + * Whether we have received an ack for this message. + * NOTE: Not yet implemented. + */ bool rx_ack = 6; } \ No newline at end of file From 78274aa1c8df5dac9361f4d1ef715b98dad9ec7c Mon Sep 17 00:00:00 2001 From: ndnestor Date: Sat, 11 May 2024 17:18:43 -0400 Subject: [PATCH 6/8] Revert deleting rx_text_message from deviceonly.proto --- meshtastic/deviceonly.proto | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 99a57582..6b8adb49 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -157,6 +157,13 @@ message DeviceState { */ uint32 version = 8; + /* + * We keep the last received text message (only) stored in the device flash, + * so we can show it on the screen. + * Might be null + */ + MeshPacket rx_text_message = 7; + /* * Used only during development. * Indicates developer is testing and changes should never be saved to flash. @@ -248,4 +255,4 @@ message OEMStore { * A Preset LocalModuleConfig to apply during factory reset */ LocalModuleConfig oem_local_module_config = 8; -} +} \ No newline at end of file From e912cf8d1cb0ba1b0cb726d22ceb919dc140e741 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Sat, 11 May 2024 21:53:00 -0400 Subject: [PATCH 7/8] Recontextualized rx_time description for message.proto --- meshtastic/message.proto | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/meshtastic/message.proto b/meshtastic/message.proto index 112aa4e3..f795c10c 100644 --- a/meshtastic/message.proto +++ b/meshtastic/message.proto @@ -30,10 +30,7 @@ message Message { uint32 category = 4; /* - * The time this message was received by the esp32 (secs since 1970). - * Note: this field is _never_ sent on the radio link itself (to save space) Times - * are typically not sent over the mesh, but they will be added to any Packet - * (chain of SubPacket) sent to the phone (so the phone can know exact time of reception) + * The time this message was received using UNIX epoch time. */ fixed32 rx_time = 5; From 06d8e4695ddd817811d2ddd07e09ffc08b6afa11 Mon Sep 17 00:00:00 2001 From: ndnestor Date: Tue, 30 Jul 2024 21:53:25 -0400 Subject: [PATCH 8/8] Save node number instead of node short name in message.proto --- meshtastic/message.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/message.proto b/meshtastic/message.proto index f795c10c..4b499c2c 100644 --- a/meshtastic/message.proto +++ b/meshtastic/message.proto @@ -8,9 +8,9 @@ package meshtastic; */ message Message { /* - * The sending node's short name. + * The sending node number. */ - string sender_short_name = 1; + fixed32 from = 1; /* * Whether the message is from this device.