Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message protobuf #497

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
4 changes: 2 additions & 2 deletions meshtastic/deviceonly.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -254,4 +254,4 @@ message OEMStore {
* A Preset LocalModuleConfig to apply during factory reset
*/
LocalModuleConfig oem_local_module_config = 8;
}
}
6 changes: 6 additions & 0 deletions meshtastic/message.options
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions meshtastic/message.proto
Original file line number Diff line number Diff line change
@@ -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;
thebentern marked this conversation as resolved.
Show resolved Hide resolved

/*
* The time this message was received using UNIX epoch time.
*/
ndnestor marked this conversation as resolved.
Show resolved Hide resolved
fixed32 rx_time = 5;

/*
* Whether we have received an ack for this message.
* NOTE: Not yet implemented.
*/
bool rx_ack = 6;
}