forked from meshtastic/protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mesh.proto
1339 lines (1119 loc) · 35.7 KB
/
mesh.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
option java_package = "com.geeksville.mesh";
option optimize_for = LITE_RUNTIME;
option go_package = "github.com/meshtastic/gomeshproto";
import "portnums.proto";
import "telemetry.proto";
option java_outer_classname = "MeshProtos";
/*
* a gps position
*/
message Position {
/*
* The new preferred location encoding, divide by 1e-7 to get degrees
* in floating point
*/
sfixed32 latitude_i = 1;
/*
* TODO: REPLACE
*/
sfixed32 longitude_i = 2;
/*
* In meters above MSL (but see issue #359)
*/
int32 altitude = 3;
/*
* This is usually not sent over the mesh (to save space), but it is sent
* from the phone so that the local device can set its RTC If it is sent over
* the mesh (because there are devices on the mesh without GPS), it will only
* be sent by devices which has a hardware GPS clock.
* seconds since 1970
*/
fixed32 time = 9;
/*
* Precision positioning elements - optional and usually not included
* ------------------------------------------------------------------
* TODO: REMOVE/INTEGRATE
*/
/*
* How the location was acquired: manual, onboard GPS, external (EUD) GPS
*/
enum LocSource {
/*
* TODO: REPLACE
*/
LOCSRC_UNSPECIFIED = 0;
/*
* TODO: REPLACE
*/
LOCSRC_MANUAL_ENTRY = 1;
/*
* TODO: REPLACE
*/
LOCSRC_GPS_INTERNAL = 2;
/*
* TODO: REPLACE
*/
LOCSRC_GPS_EXTERNAL = 3;
/*
* More location sources can be added here when available:
* GSM, radio beacons (BLE etc), location fingerprinting etc
* TODO: REMOVE/INTEGRATE
*/
}
/*
* TODO: REPLACE
*/
LocSource location_source = 10;
/*
* How the altitude was acquired: manual, GPS int/ext, etc
* Default: same as location_source if present
*/
enum AltSource {
/*
* TODO: REPLACE
*/
ALTSRC_UNSPECIFIED = 0;
/*
* TODO: REPLACE
*/
ALTSRC_MANUAL_ENTRY = 1;
/*
* TODO: REPLACE
*/
ALTSRC_GPS_INTERNAL = 2;
/*
* TODO: REPLACE
*/
ALTSRC_GPS_EXTERNAL = 3;
/*
* TODO: REPLACE
*/
ALTSRC_BAROMETRIC = 4;
}
/*
* TODO: REPLACE
*/
AltSource altitude_source = 11;
/*
* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds
*/
fixed32 pos_timestamp = 12;
/*
* Pos. timestamp milliseconds adjustment (rarely available or required)
*/
int32 pos_time_millis = 13;
/*
* HAE altitude in meters - can be used instead of MSL altitude
*/
sint32 altitude_hae = 14;
/*
* Geoidal separation in meters
*/
sint32 alt_geoid_sep = 15;
/*
* Horizontal, Vertical and Position Dilution of Precision, in 1/100 units
* - PDOP is sufficient for most cases
* - for higher precision scenarios, HDOP and VDOP can be used instead,
* in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2))
* TODO: REMOVE/INTEGRATE
*/
uint32 PDOP = 16;
/*
* TODO: REPLACE
*/
uint32 HDOP = 17;
/*
* TODO: REPLACE
*/
uint32 VDOP = 18;
/*
* GPS accuracy (a hardware specific constant) in mm
* multiplied with DOP to calculate positional accuracy
* Default: "'bout three meters-ish" :)
*/
uint32 gps_accuracy = 19;
/*
* Ground speed in m/s and True North TRACK in 1/100 degrees
* Clarification of terms:
* - "track" is the direction of motion (measured in horizontal plane)
* - "heading" is where the fuselage points (measured in horizontal plane)
* - "yaw" indicates a relative rotation about the vertical axis
* TODO: REMOVE/INTEGRATE
*/
uint32 ground_speed = 20;
/*
* TODO: REPLACE
*/
uint32 ground_track = 21;
/*
* GPS fix quality (from NMEA GxGGA statement or similar)
*/
uint32 fix_quality = 22;
/*
* GPS fix type 2D/3D (from NMEA GxGSA statement)
*/
uint32 fix_type = 23;
/*
* GPS "Satellites in View" number
*/
uint32 sats_in_view = 24;
/*
* Sensor ID - in case multiple positioning sensors are being used
*/
uint32 sensor_id = 25;
/*
* Estimated/expected time (in seconds) until next update:
* - if we update at fixed intervals of X seconds, use X
* - if we update at dynamic intervals (based on relative movement etc),
* but "AT LEAST every Y seconds", use Y
*/
uint32 pos_next_update = 40;
/*
* A sequence number, incremented with each Position message to help
* detect lost updates if needed
*/
uint32 pos_seq_number = 41;
/*
* END precision positioning elements
* TODO: REMOVE/INTEGRATE
*/
}
/*
* Note: these enum names must EXACTLY match the string used in the device
* bin/build-all.sh script.
* Because they will be used to find firmware filenames in the android app for OTA updates.
* To match the old style filenames, _ is converted to -, p is converted to .
*/
enum HardwareModel {
/*
* TODO: REPLACE
*/
UNSET = 0;
/*
* TODO: REPLACE
*/
TLORA_V2 = 1;
/*
* TODO: REPLACE
*/
TLORA_V1 = 2;
/*
* TODO: REPLACE
*/
TLORA_V2_1_1p6 = 3;
/*
* TODO: REPLACE
*/
TBEAM = 4;
/*
* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
* (see HELTEC_V2 for the new version).
*/
HELTEC_V2_0 = 5;
/*
* TODO: REPLACE
*/
TBEAM0p7 = 6;
/*
* TODO: REPLACE
*/
T_ECHO = 7;
/*
* TODO: REPLACE
*/
TLORA_V1_1p3 = 8;
/*
* TODO: REPLACE
*/
RAK4631 = 9;
/*
* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37.
* Sadly they did not update anything on the silkscreen to identify this board
*/
HELTEC_V2_1 = 10;
/*
* Ancient heltec WiFi_Lora_32 board
*/
HELTEC_V1 = 11;
/*
* Less common/prototype boards listed here (needs one more byte over the air)
*/
LORA_RELAY_V1 = 32;
/*
* TODO: REPLACE
*/
NRF52840DK = 33;
/*
* TODO: REPLACE
*/
PPR = 34;
/*
* TODO: REPLACE
*/
GENIEBLOCKS = 35;
/*
* TODO: REPLACE
*/
NRF52_UNKNOWN = 36;
/*
* TODO: REPLACE
*/
PORTDUINO = 37;
/*
* The simulator built into the android app
*/
ANDROID_SIM = 38;
/*
* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics
*/
DIY_V1 = 39;
/*
* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/
*/
RAK11200 = 40;
/*
* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano
*/
NANO_G1 = 41;
/*
* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/
*/
NRF52840_PCA10059 = 42;
/*
* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3
*/
DR_DEV = 43;
/*
* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
*/
PRIVATE_HW = 255;
}
/*
* Broadcast when a newly powered mesh node wants to find a node num it can use
* Sent from the phone over bluetooth to set the user id for the owner of this node.
* Also sent from nodes to each other when a new node signs on (so all clients can have this info)
* The algorithm is as follows:
* when a node starts up, it broadcasts their user and the normal flow is for all
* other nodes to reply with their User as well (so the new node can build its nodedb)
* If a node ever receives a User (not just the first broadcast) message where
* the sender node number equals our node number, that indicates a collision has
* occurred and the following steps should happen:
* If the receiving node (that was already in the mesh)'s macaddr is LOWER than the
* new User who just tried to sign in: it gets to keep its nodenum.
* We send a broadcast message of OUR User (we use a broadcast so that the other node can
* receive our message, considering we have the same id - it also serves to let
* observers correct their nodedb) - this case is rare so it should be okay.
* If any node receives a User where the macaddr is GTE than their local macaddr,
* they have been vetoed and should pick a new random nodenum (filtering against
* whatever it knows about the nodedb) and rebroadcast their User.
* A few nodenums are reserved and will never be requested:
* 0xff - broadcast
* 0 through 3 - for future use
*/
message User {
/*
* A globally unique ID string for this user.
* In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>.
* Note: app developers are encouraged to also use the following standard
* node IDs "^all" (for broadcast), "^local" (for the locally connected node)
*/
string id = 1;
/*
* A full name for this user, i.e. "Kevin Hester"
*/
string long_name = 2;
/*
* A VERY short name, ideally two characters.
* Suitable for a tiny OLED screen
*/
string short_name = 3;
/*
* This is the addr of the radio.
* Not populated by the phone, but added by the esp32 when broadcasting
*/
bytes macaddr = 4;
/*
* TBEAM, HELTEC, etc...
* Starting in 1.2.11 moved to hw_model enum in the NodeInfo object.
* Apps will still need the string here for older builds
* (so OTA update can find the right image), but if the enum is available it will be used instead.
*/
HardwareModel hw_model = 6;
/*
* In some regions Ham radio operators have different bandwidth limitations than others.
* If this user is a licensed operator, set this flag.
* Also, "long_name" should be their licence number.
*/
bool is_licensed = 7;
/*
* Transmit power at antenna connector, in decibel-milliwatt
* An optional self-reported value useful in network planning, discovery
* and positioning - along with ant_gain_dbi and ant_azimuth below
*/
uint32 tx_power_dbm = 10;
/*
* Antenna gain (applicable to both Tx and Rx), in decibel-isotropic
*/
uint32 ant_gain_dbi = 11;
/*
* Directional antenna true azimuth *if applicable*, in degrees (0-360)
* Only applicable in case of stationary nodes with a directional antenna
* Zero = not applicable (mobile or omni) or not specified
* (use a value of 360 to indicate an antenna azimuth of zero degrees)
*/
uint32 ant_azimuth = 12;
}
/*
* A message used in our Dynamic Source Routing protocol (RFC 4728 based)
*/
message RouteDiscovery {
/*
* The list of nodenums this packet has visited so far
*/
repeated fixed32 route = 2;
}
/*
* A Routing control Data packet handled by the routing module
*/
message Routing {
/*
* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide
* details on the type of failure).
*/
enum Error {
/*
* This message is not a failure
*/
NONE = 0;
/*
* Our node doesn't have a route to the requested destination anymore.
*/
NO_ROUTE = 1;
/*
* We received a nak while trying to forward on your behalf
*/
GOT_NAK = 2;
/*
* TODO: REPLACE
*/
TIMEOUT = 3;
/*
* No suitable interface could be found for delivering this packet
*/
NO_INTERFACE = 4;
/*
* We reached the max retransmission count (typically for naive flood routing)
*/
MAX_RETRANSMIT = 5;
/*
* No suitable channel was found for sending this packet (i.e. was requested channel index disabled?)
*/
NO_CHANNEL = 6;
/*
* The packet was too big for sending (exceeds interface MTU after encoding)
*/
TOO_LARGE = 7;
/*
* The request had want_response set, the request reached the destination node, but no service on that node wants to send a response
* (possibly due to bad channel permissions)
*/
NO_RESPONSE = 8;
/*
* The application layer service on the remote node received your request, but considered your request somehow invalid
*/
BAD_REQUEST = 32;
/*
* The application layer service on the remote node received your request, but considered your request not authorized
* (i.e you did not send the request on the required bound channel)
*/
NOT_AUTHORIZED = 33;
}
oneof variant {
/*
* A route request going from the requester
*/
RouteDiscovery route_request = 1;
/*
* A route reply
*/
RouteDiscovery route_reply = 2;
/*
* A failure in delivering a message (usually used for routing control messages, but might be provided
* in addition to ack.fail_id to provide details on the type of failure).
*/
Error error_reason = 3;
}
}
/*
* (Formerly called SubPacket)
* The payload portion fo a packet, this is the actual bytes that are sent
* inside a radio packet (because from/to are broken out by the comms library)
*/
message Data {
/*
* Formerly named typ and of type Type
*/
PortNum portnum = 1;
oneof payloadVariant {
/*
* TODO: REPLACE
*/
bytes payload = 2;
/*
* TODO: REPLACE
*/
bytes payload_compressed = 10;
}
/*
* Not normally used, but for testing a sender can request that recipient
* responds in kind (i.e. if it received a position, it should unicast back it's position).
* Note: that if you set this on a broadcast you will receive many replies.
*/
bool want_response = 3;
/*
* The address of the destination node.
* This field is is filled in by the mesh radio device software, application
* layer software should never need it.
* RouteDiscovery messages _must_ populate this.
* Other message types might need to if they are doing multihop routing.
*/
fixed32 dest = 4;
/*
* The address of the original sender for this message.
* This field should _only_ be populated for reliable multihop packets (to keep
* packets small).
*/
fixed32 source = 5;
/*
* Only used in routing or response messages.
* Indicates the original message ID that this message is reporting failure on. (formerly called original_id)
*/
fixed32 request_id = 6;
/*
* If set, this message is intened to be a reply to a previously sent message with the defined id.
*/
fixed32 reply_id = 7;
/*
* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving
* a message a heart or poop emoji.
*/
fixed32 emoji = 8;
/*
* Location structure
*/
Location location = 9;
}
/*
* Location of a waypoint to associate with a message
*/
message Location {
/*
* Id of the location
*/
uint32 id = 1;
/*
* latitude_i
*/
sfixed32 latitude_i = 2;
/*
* longitude_i
*/
sfixed32 longitude_i = 3;
/*
* Time the location is to expire (epoch)
*/
uint32 expire = 4;
/*
* If true, only allow the original sender to update the location.
*/
bool locked = 5;
}
/*
* A packet envelope sent/received over the mesh
* only payloadVariant is sent in the payload portion of the LORA packet.
* The other fields are either not sent at all, or sent in the special 16 byte LORA header.
*/
message MeshPacket {
/*
* The priority of this message for sending.
* Higher priorities are sent first (when managing the transmit queue).
* This field is never sent over the air, it is only used internally inside of a local device node.
* API clients (either on the local node or connected directly to the node)
* can set this parameter if necessary.
* (values must be <= 127 to keep protobuf field to one byte in size.
* Detailed background on this field:
* I noticed a funny side effect of lora being so slow: Usually when making
* a protocol there isn’t much need to use message priority to change the order
* of transmission (because interfaces are fairly fast).
* But for lora where packets can take a few seconds each, it is very important
* to make sure that critical packets are sent ASAP.
* In the case of meshtastic that means we want to send protocol acks as soon as possible
* (to prevent unneeded retransmissions), we want routing messages to be sent next,
* then messages marked as reliable and finally ‘background’ packets like periodic position updates.
* So I bit the bullet and implemented a new (internal - not sent over the air)
* field in MeshPacket called ‘priority’.
* And the transmission queue in the router object is now a priority queue.
*/
enum Priority {
/*
* Treated as Priority.DEFAULT
*/
UNSET = 0;
/*
* TODO: REPLACE
*/
MIN = 1;
/*
* Background position updates are sent with very low priority -
* if the link is super congested they might not go out at all
*/
BACKGROUND = 10;
/*
* This priority is used for most messages that don't have a priority set
*/
DEFAULT = 64;
/*
* If priority is unset but the message is marked as want_ack,
* assume it is important and use a slightly higher priority
*/
RELIABLE = 70;
/*
* Ack/naks are sent with very high priority to ensure that retransmission
* stops as soon as possible
*/
ACK = 120;
/*
* TODO: REPLACE
*/
MAX = 127;
}
/*
* Identify if this is a delayed packet
*/
enum Delayed {
/*
* If unset, the message is being sent in real time.
*/
NO_DELAY = 0;
/*
* The message is delayed and was originally a broadcast
*/
DELAYED_BROADCAST = 1;
/*
* The message is delayed and was originally a direct message
*/
DELAYED_DIRECT = 2;
}
/*
* The sending node number.
* Note: Our crypto implementation uses this field as well.
* See [crypto](/docs/developers/firmware/encryption) for details.
* FIXME - really should be fixed32 instead, this encoding only hurts the ble link though.
*/
fixed32 from = 1;
/*
* The (immediatSee Priority description for more details.y should be fixed32 instead, this encoding only
* hurts the ble link though.
*/
fixed32 to = 2;
/*
* (Usually) If set, this indicates the index in the secondary_channels table that this packet was sent/received on.
* If unset, packet was on the primary channel.
* A particular node might know only a subset of channels in use on the mesh.
* Therefore channel_index is inherently a local concept and meaningless to send between nodes.
* Very briefly, while sending and receiving deep inside the device Router code, this field instead
* contains the 'channel hash' instead of the index.
* This 'trick' is only used while the payloadVariant is an 'encrypted'.
*/
uint32 channel = 3;
/*
* Internally to the mesh radios we will route SubPackets encrypted per [this](docs/developers/firmware/encryption).
* However, when a particular node has the correct
* key to decode a particular packet, it will decode the payload into a SubPacket protobuf structure.
* Software outside of the device nodes will never encounter a packet where
* "decoded" is not populated (i.e. any encryption/decryption happens before reaching the applications)
* The numeric IDs for these fields were selected to keep backwards compatibility with old applications.
*/
oneof payloadVariant {
/*
* TODO: REPLACE
*/
Data decoded = 4;
/*
* TODO: REPLACE
*/
bytes encrypted = 5;
}
/*
* A unique ID for this packet.
* Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space).
* Otherwise a unique ID for this packet, useful for flooding algorithms.
* ID only needs to be unique on a _per sender_ basis, and it only
* needs to be unique for a few minutes (long enough to last for the length of
* any ACK or the completion of a mesh broadcast flood).
* Note: Our crypto implementation uses this id as well.
* See [crypto](/docs/developers/firmware/encryption) for details.
* FIXME - really should be fixed32 instead, this encoding only
* hurts the ble link though.
*/
fixed32 id = 6;
/*
* 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 = 7;
/*
* *Never* sent over the radio links.
* Set during reception to indicate the SNR of this packet.
* Used to collect statistics on current link quality.
*/
float rx_snr = 8;
/*
* If unset treated as zero (no forwarding, send to adjacent nodes only)
* if 1, allow hopping through one node, etc...
* For our usecase real world topologies probably have a max of about 3.
* This field is normally placed into a few of bits in the header.
*/
uint32 hop_limit = 10;
/*
* This packet is being sent as a reliable message, we would prefer it to arrive at the destination.
* We would like to receive a ack packet in response.
* Broadcasts messages treat this flag specially: Since acks for broadcasts would
* rapidly flood the channel, the normal ack behavior is suppressed.
* Instead, the original sender listens to see if at least one node is rebroadcasting this packet (because naive flooding algorithm).
* If it hears that the odds (given typical LoRa topologies) the odds are very high that every node should eventually receive the message.
* So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender.
* If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic.
* Note: This flag is normally sent in a flag bit in the header when sent over the wire
*/
bool want_ack = 11;
/*
* The priority of this message for sending.
* See MeshPacket.Priority description for more details.
*/
Priority priority = 12;
/*
* rssi of received packet. Only sent to phone for dispay purposes.
*/
int32 rx_rssi = 13;
/*
* Describe if this message is delayed
*/
Delayed delayed = 15;
}
/*
* Shared constants between device and phone
*/
enum Constants {
/*
* First enum must be zero, and we are just using this enum to
* pass int constants between two very different environments
*/
Unused = 0;
/*
* From mesh.options
* note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
* outside of this envelope
*/
DATA_PAYLOAD_LEN = 237;
}
/*
* The bluetooth to device link:
* Old BTLE protocol docs from TODO, merge in above and make real docs...
* use protocol buffers, and NanoPB
* messages from device to phone:
* POSITION_UPDATE (..., time)
* TEXT_RECEIVED(from, text, time)
* OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications)
* messages from phone to device:
* SET_MYID(id, human readable long, human readable short) (send down the unique ID
* string used for this node, a human readable string shown for that id, and a very
* short human readable string suitable for oled screen) SEND_OPAQUE(dest, payload)
* (for signal messages or other applications) SEND_TEXT(dest, text) Get all
* nodes() (returns list of nodes, with full info, last time seen, loc, battery
* level etc) SET_CONFIG (switches device to a new set of radio params and
* preshared key, drops all existing nodes, force our node to rejoin this new group)
* Full information about a node on the mesh
*/
message NodeInfo {
/*
* The node number
*/
uint32 num = 1;
/*
* The user info for this node
*/
User user = 2;
/*
* 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.
* Position.time now indicates the last time we received a POSITION from that node.
*/
Position position = 3;
/*
* Returns the Signal-to-noise ratio (SNR) of the last received message,
* as measured by the receiver. Return SNR of the last received message in dB
*/
float snr = 4;
/*
* TODO: REMOVE/INTEGRATE
* Returns the last measured frequency error.
* The LoRa receiver estimates the frequency offset between the receiver
* center frequency and that of the received LoRa signal. This function
* returns the estimates offset (in Hz) of the last received message.
* Caution: this measurement is not absolute, but is measured relative to the
* local receiver's oscillator. Apparent errors may be due to the
* transmitter, the receiver or both. \return The estimated center frequency
* offset in Hz of the last received message.
* int32 frequency_error = 6;
* enum RouteState {
* Invalid = 0;
* Discovering = 1;
* Valid = 2;
* }
* Not needed?
* RouteState route = 4;
*/
/*
* TODO: REMOVE/INTEGRATE
* Not currently used (till full DSR deployment?) Our current preferred node node for routing - might be the same as num if
* we are adjacent Or zero if we don't yet know a route to this node.
* fixed32 next_hop = 5;
*/
/*
* Set to indicate the last time we received a packet from this node
*/
fixed32 last_heard = 5;
/*
* The latest device metrics for the node.
*/
DeviceMetrics device_metrics = 6;
}
/*
* Error codes for critical errors
* The device might report these fault codes on the screen.
* If you encounter a fault code, please post on the meshtastic.discourse.group
* and we'll try to help.
*/
enum CriticalErrorCode {
/*
* TODO: REPLACE
*/
None = 0;
/*
* A software bug was detected while trying to send lora
*/
TxWatchdog = 1;
/*
* A software bug was detected on entry to sleep
*/
SleepEnterWait = 2;
/*
* No Lora radio hardware could be found
*/
NoRadio = 3;
/*
* Not normally used
*/
Unspecified = 4;
/*
* We failed while configuring a UBlox GPS
*/
UBloxInitFailed = 5;
/*
* This board was expected to have a power management chip and it is missing or broken
*/
NoAXP192 = 6;
/*
* The channel tried to set a radio setting which is not supported by this chipset,
* radio comms settings are now undefined.
*/
InvalidRadioSetting = 7;
/*
* Radio transmit hardware failure. We sent data to the radio chip, but it didn't
* reply with an interrupt.