Skip to content

Commit 034a181

Browse files
committed
Direct neighbor for clarity
1 parent 06cf134 commit 034a181

File tree

3 files changed

+239
-4
lines changed

3 files changed

+239
-4
lines changed
+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
syntax = "proto3";
2+
3+
package meshtastic;
4+
5+
import "channel.proto";
6+
import "localonly.proto";
7+
import "mesh.proto";
8+
import "telemetry.proto";
9+
import "config.proto";
10+
import "nanopb.proto";
11+
12+
option csharp_namespace = "Meshtastic.Protobufs";
13+
option go_package = "github.com/meshtastic/go/generated";
14+
option java_outer_classname = "DeviceOnly";
15+
option java_package = "com.geeksville.mesh";
16+
option swift_prefix = "";
17+
option (nanopb_fileopt).include = "<vector>";
18+
19+
20+
/*
21+
* Position with static location information only for NodeDBLite
22+
*/
23+
message PositionLite {
24+
/*
25+
* The new preferred location encoding, multiply by 1e-7 to get degrees
26+
* in floating point
27+
*/
28+
sfixed32 latitude_i = 1;
29+
30+
/*
31+
* TODO: REPLACE
32+
*/
33+
sfixed32 longitude_i = 2;
34+
35+
/*
36+
* In meters above MSL (but see issue #359)
37+
*/
38+
int32 altitude = 3;
39+
40+
/*
41+
* This is usually not sent over the mesh (to save space), but it is sent
42+
* from the phone so that the local device can set its RTC If it is sent over
43+
* the mesh (because there are devices on the mesh without GPS), it will only
44+
* be sent by devices which has a hardware GPS clock.
45+
* seconds since 1970
46+
*/
47+
fixed32 time = 4;
48+
49+
/*
50+
* TODO: REPLACE
51+
*/
52+
Position.LocSource location_source = 5;
53+
}
54+
55+
message UserLite {
56+
/*
57+
* This is the addr of the radio.
58+
*/
59+
bytes macaddr = 1 [deprecated = true];
60+
61+
/*
62+
* A full name for this user, i.e. "Kevin Hester"
63+
*/
64+
string long_name = 2;
65+
66+
/*
67+
* A VERY short name, ideally two characters.
68+
* Suitable for a tiny OLED screen
69+
*/
70+
string short_name = 3;
71+
72+
/*
73+
* TBEAM, HELTEC, etc...
74+
* Starting in 1.2.11 moved to hw_model enum in the NodeInfo object.
75+
* Apps will still need the string here for older builds
76+
* (so OTA update can find the right image), but if the enum is available it will be used instead.
77+
*/
78+
HardwareModel hw_model = 4;
79+
80+
/*
81+
* In some regions Ham radio operators have different bandwidth limitations than others.
82+
* If this user is a licensed operator, set this flag.
83+
* Also, "long_name" should be their licence number.
84+
*/
85+
bool is_licensed = 5;
86+
87+
/*
88+
* Indicates that the user's role in the mesh
89+
*/
90+
Config.DeviceConfig.Role role = 6;
91+
92+
/*
93+
* The public key of the user's device.
94+
* This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
95+
*/
96+
bytes public_key = 7;
97+
}
98+
99+
message NodeInfoLite {
100+
/*
101+
* The node number
102+
*/
103+
uint32 num = 1;
104+
105+
/*
106+
* The user info for this node
107+
*/
108+
UserLite user = 2;
109+
110+
/*
111+
* 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.
112+
* Position.time now indicates the last time we received a POSITION from that node.
113+
*/
114+
PositionLite position = 3;
115+
116+
/*
117+
* Returns the Signal-to-noise ratio (SNR) of the last received message,
118+
* as measured by the receiver. Return SNR of the last received message in dB
119+
*/
120+
float snr = 4;
121+
122+
/*
123+
* Set to indicate the last time we received a packet from this node
124+
*/
125+
fixed32 last_heard = 5;
126+
/*
127+
* The latest device metrics for the node.
128+
*/
129+
DeviceMetrics device_metrics = 6;
130+
131+
/*
132+
* local channel index we heard that node on. Only populated if its not the default channel.
133+
*/
134+
uint32 channel = 7;
135+
136+
/*
137+
* True if we witnessed the node over MQTT instead of LoRA transport
138+
*/
139+
bool via_mqtt = 8;
140+
141+
/*
142+
* Number of hops away from us this node is (0 if direct neighbor)
143+
*/
144+
optional uint32 hops_away = 9;
145+
146+
/*
147+
* True if node is in our favorites list
148+
* Persists between NodeDB internal clean ups
149+
*/
150+
bool is_favorite = 10;
151+
}
152+
153+
/*
154+
* This message is never sent over the wire, but it is used for serializing DB
155+
* state to flash in the device code
156+
* FIXME, since we write this each time we enter deep sleep (and have infinite
157+
* flash) it would be better to use some sort of append only data structure for
158+
* the receive queue and use the preferences store for the other stuff
159+
*/
160+
message DeviceState {
161+
/*
162+
* Read only settings/info about this node
163+
*/
164+
MyNodeInfo my_node = 2;
165+
166+
/*
167+
* My owner info
168+
*/
169+
User owner = 3;
170+
171+
/*
172+
* Received packets saved for delivery to the phone
173+
*/
174+
repeated MeshPacket receive_queue = 5;
175+
176+
/*
177+
* A version integer used to invalidate old save files when we make
178+
* incompatible changes This integer is set at build time and is private to
179+
* NodeDB.cpp in the device code.
180+
*/
181+
uint32 version = 8;
182+
183+
/*
184+
* We keep the last received text message (only) stored in the device flash,
185+
* so we can show it on the screen.
186+
* Might be null
187+
*/
188+
MeshPacket rx_text_message = 7;
189+
190+
/*
191+
* Used only during development.
192+
* Indicates developer is testing and changes should never be saved to flash.
193+
* Deprecated in 2.3.1
194+
*/
195+
bool no_save = 9 [deprecated = true];
196+
197+
/*
198+
* Some GPS receivers seem to have bogus settings from the factory, so we always do one factory reset.
199+
*/
200+
bool did_gps_reset = 11;
201+
202+
/*
203+
* We keep the last received waypoint stored in the device flash,
204+
* so we can show it on the screen.
205+
* Might be null
206+
*/
207+
MeshPacket rx_waypoint = 12;
208+
209+
/*
210+
* The mesh's nodes with their available gpio pins for RemoteHardware module
211+
*/
212+
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13;
213+
214+
/*
215+
* New lite version of NodeDB to decrease memory footprint
216+
*/
217+
repeated NodeInfoLite node_db_lite = 14 [(nanopb).callback_datatype = "std::vector<meshtastic_NodeInfoLite>"];
218+
}
219+
220+
/*
221+
* The on-disk saved channels
222+
*/
223+
message ChannelFile {
224+
/*
225+
* The channels our node knows about
226+
*/
227+
repeated Channel channels = 1;
228+
229+
/*
230+
* A version integer used to invalidate old save files when we make
231+
* incompatible changes This integer is set at build time and is private to
232+
* NodeDB.cpp in the device code.
233+
*/
234+
uint32 version = 2;
235+
}

meshtastic/deviceonly.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ message NodeInfoLite {
138138
bool via_mqtt = 8;
139139

140140
/*
141-
* Number of hops away from us this node is (0 if adjacent)
141+
* Number of hops away from us this node is (0 if direct neighbor)
142142
*/
143143
optional uint32 hops_away = 9;
144144

meshtastic/mesh.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ message MeshPacket {
11771177
float rx_snr = 8;
11781178

11791179
/*
1180-
* If unset treated as zero (no forwarding, send to adjacent nodes only)
1180+
* If unset treated as zero (no forwarding, send to direct neighbor nodes only)
11811181
* if 1, allow hopping through one node, etc...
11821182
* For our usecase real world topologies probably have a max of about 3.
11831183
* This field is normally placed into a few of bits in the header.
@@ -1317,7 +1317,7 @@ message NodeInfo {
13171317
/*
13181318
* TODO: REMOVE/INTEGRATE
13191319
* Not currently used (till full DSR deployment?) Our current preferred node node for routing - might be the same as num if
1320-
* we are adjacent Or zero if we don't yet know a route to this node.
1320+
* we are direct neighbor or zero if we don't yet know a route to this node.
13211321
* fixed32 next_hop = 5;
13221322
*/
13231323

@@ -1341,7 +1341,7 @@ message NodeInfo {
13411341
bool via_mqtt = 8;
13421342

13431343
/*
1344-
* Number of hops away from us this node is (0 if adjacent)
1344+
* Number of hops away from us this node is (0 if direct neighbor)
13451345
*/
13461346
optional uint32 hops_away = 9;
13471347

0 commit comments

Comments
 (0)