diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 9c700dbb..1c875d6c 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -161,7 +161,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. @@ -254,4 +254,4 @@ message OEMStore { * A Preset LocalModuleConfig to apply during factory reset */ LocalModuleConfig oem_local_module_config = 8; -} +} \ No newline at end of file diff --git a/meshtastic/message.options b/meshtastic/message.options new file mode 100644 index 00000000..9935221c --- /dev/null +++ b/meshtastic/message.options @@ -0,0 +1,6 @@ +# 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 +*Message.category int_size:8 \ No newline at end of file diff --git a/meshtastic/message.proto b/meshtastic/message.proto new file mode 100644 index 00000000..4b499c2c --- /dev/null +++ b/meshtastic/message.proto @@ -0,0 +1,42 @@ +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 number. + */ + fixed32 from = 1; + + /* + * Whether the message is from this device. + */ + bool from_self = 2; + + /* + * The text of the message. + */ + 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 using UNIX epoch time. + */ + fixed32 rx_time = 5; + + /* + * Whether we have received an ack for this message. + * NOTE: Not yet implemented. + */ + bool rx_ack = 6; +} \ No newline at end of file