forked from meshtastic/protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.proto
More file actions
750 lines (620 loc) · 15.8 KB
/
admin.proto
File metadata and controls
750 lines (620 loc) · 15.8 KB
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
syntax = "proto3";
package meshtastic;
/* trunk-ignore(buf-lint/COMPILE) */
import "meshtastic/channel.proto";
import "meshtastic/config.proto";
import "meshtastic/connection_status.proto";
import "meshtastic/device_ui.proto";
import "meshtastic/mesh.proto";
import "meshtastic/module_config.proto";
option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
option java_outer_classname = "AdminProtos";
option java_package = "org.meshtastic.proto";
option swift_prefix = "";
/*
* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
* This message is used to do settings operations to both remote AND local nodes.
* (Prior to 1.2 these operations were done via special ToRadio operations)
*/
message AdminMessage {
/*
* The node generates this key and sends it with any get_x_response packets.
* The client MUST include the same key with any set_x commands. Key expires after 300 seconds.
* Prevents replay attacks for admin messages.
*/
bytes session_passkey = 101;
/*
* TODO: REPLACE
*/
enum ConfigType {
/*
* TODO: REPLACE
*/
DEVICE_CONFIG = 0;
/*
* TODO: REPLACE
*/
POSITION_CONFIG = 1;
/*
* TODO: REPLACE
*/
POWER_CONFIG = 2;
/*
* TODO: REPLACE
*/
NETWORK_CONFIG = 3;
/*
* TODO: REPLACE
*/
DISPLAY_CONFIG = 4;
/*
* TODO: REPLACE
*/
LORA_CONFIG = 5;
/*
* TODO: REPLACE
*/
BLUETOOTH_CONFIG = 6;
/*
* TODO: REPLACE
*/
SECURITY_CONFIG = 7;
/*
* Session key config
*/
SESSIONKEY_CONFIG = 8;
/*
* device-ui config
*/
DEVICEUI_CONFIG = 9;
}
/*
* TODO: REPLACE
*/
enum ModuleConfigType {
/*
* TODO: REPLACE
*/
MQTT_CONFIG = 0;
/*
* TODO: REPLACE
*/
SERIAL_CONFIG = 1;
/*
* TODO: REPLACE
*/
EXTNOTIF_CONFIG = 2;
/*
* TODO: REPLACE
*/
STOREFORWARD_CONFIG = 3;
/*
* TODO: REPLACE
*/
RANGETEST_CONFIG = 4;
/*
* TODO: REPLACE
*/
TELEMETRY_CONFIG = 5;
/*
* TODO: REPLACE
*/
CANNEDMSG_CONFIG = 6;
/*
* TODO: REPLACE
*/
AUDIO_CONFIG = 7;
/*
* TODO: REPLACE
*/
REMOTEHARDWARE_CONFIG = 8;
/*
* TODO: REPLACE
*/
NEIGHBORINFO_CONFIG = 9;
/*
* TODO: REPLACE
*/
AMBIENTLIGHTING_CONFIG = 10;
/*
* TODO: REPLACE
*/
DETECTIONSENSOR_CONFIG = 11;
/*
* TODO: REPLACE
*/
PAXCOUNTER_CONFIG = 12;
/*
* TODO: REPLACE
*/
STATUSMESSAGE_CONFIG = 13;
/*
* Traffic management module config
*/
TRAFFICMANAGEMENT_CONFIG = 14;
/*
* TAK module config
*/
TAK_CONFIG = 15;
}
enum BackupLocation {
/*
* Backup to the internal flash
*/
FLASH = 0;
/*
* Backup to the SD card
*/
SD = 1;
}
/*
* Input event message to be sent to the node.
*/
message InputEvent {
/*
* The input event code
*/
uint32 event_code = 1;
/*
* Keyboard character code
*/
uint32 kb_char = 2;
/*
* The touch X coordinate
*/
uint32 touch_x = 3;
/*
* The touch Y coordinate
*/
uint32 touch_y = 4;
}
/*
* User is requesting an over the air update.
* Node will reboot into the OTA loader
*/
message OTAEvent {
/*
* Tell the node to reboot into OTA mode for firmware update via BLE or WiFi (ESP32 only for now)
*/
OTAMode reboot_ota_mode = 1;
/*
* A 32 byte hash of the OTA firmware.
* Used to verify the integrity of the firmware before applying an update.
*/
bytes ota_hash = 2;
}
/*
* TODO: REPLACE
*/
oneof payload_variant {
/*
* Send the specified channel in the response to this message
* NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
*/
uint32 get_channel_request = 1;
/*
* TODO: REPLACE
*/
Channel get_channel_response = 2;
/*
* Send the current owner data in the response to this message.
*/
bool get_owner_request = 3;
/*
* TODO: REPLACE
*/
User get_owner_response = 4;
/*
* Ask for the following config data to be sent
*/
ConfigType get_config_request = 5;
/*
* Send the current Config in the response to this message.
*/
Config get_config_response = 6;
/*
* Ask for the following config data to be sent
*/
ModuleConfigType get_module_config_request = 7;
/*
* Send the current Config in the response to this message.
*/
ModuleConfig get_module_config_response = 8;
/*
* Get the Canned Message Module messages in the response to this message.
*/
bool get_canned_message_module_messages_request = 10;
/*
* Get the Canned Message Module messages in the response to this message.
*/
string get_canned_message_module_messages_response = 11;
/*
* Request the node to send device metadata (firmware, protobuf version, etc)
*/
bool get_device_metadata_request = 12;
/*
* Device metadata response
*/
DeviceMetadata get_device_metadata_response = 13;
/*
* Get the Ringtone in the response to this message.
*/
bool get_ringtone_request = 14;
/*
* Get the Ringtone in the response to this message.
*/
string get_ringtone_response = 15;
/*
* Request the node to send it's connection status
*/
bool get_device_connection_status_request = 16;
/*
* Device connection status response
*/
DeviceConnectionStatus get_device_connection_status_response = 17;
/*
* Setup a node for licensed amateur (ham) radio operation
*/
HamParameters set_ham_mode = 18;
/*
* Get the mesh's nodes with their available gpio pins for RemoteHardware module use
*/
bool get_node_remote_hardware_pins_request = 19;
/*
* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
*/
NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response = 20;
/*
* Enter (UF2) DFU mode
* Only implemented on NRF52 currently
*/
bool enter_dfu_mode_request = 21;
/*
* Delete the file by the specified path from the device
*/
string delete_file_request = 22;
/*
* Set zero and offset for scale chips
*/
uint32 set_scale = 23;
/*
* Backup the node's preferences
*/
BackupLocation backup_preferences = 24;
/*
* Restore the node's preferences
*/
BackupLocation restore_preferences = 25;
/*
* Remove backups of the node's preferences
*/
BackupLocation remove_backup_preferences = 26;
/*
* Send an input event to the node.
* This is used to trigger physical input events like button presses, touch events, etc.
*/
InputEvent send_input_event = 27;
/*
* Set the owner for this node
*/
User set_owner = 32;
/*
* Set channels (using the new API).
* A special channel is the "primary channel".
* The other records are secondary channels.
* Note: only one channel can be marked as primary.
* If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
*/
Channel set_channel = 33;
/*
* Set the current Config
*/
Config set_config = 34;
/*
* Set the current Config
*/
ModuleConfig set_module_config = 35;
/*
* Set the Canned Message Module messages text.
*/
string set_canned_message_module_messages = 36;
/*
* Set the ringtone for ExternalNotification.
*/
string set_ringtone_message = 37;
/*
* Remove the node by the specified node-num from the NodeDB on the device
*/
uint32 remove_by_nodenum = 38;
/*
* Set specified node-num to be favorited on the NodeDB on the device
*/
uint32 set_favorite_node = 39;
/*
* Set specified node-num to be un-favorited on the NodeDB on the device
*/
uint32 remove_favorite_node = 40;
/*
* Set fixed position data on the node and then set the position.fixed_position = true
*/
Position set_fixed_position = 41;
/*
* Clear fixed position coordinates and then set position.fixed_position = false
*/
bool remove_fixed_position = 42;
/*
* Set time only on the node
* Convenience method to set the time on the node (as Net quality) without any other position data
*/
fixed32 set_time_only = 43;
/*
* Tell the node to send the stored ui data.
*/
bool get_ui_config_request = 44;
/*
* Reply stored device ui data.
*/
DeviceUIConfig get_ui_config_response = 45;
/*
* Tell the node to store UI data persistently.
*/
DeviceUIConfig store_ui_config = 46;
/*
* Set specified node-num to be ignored on the NodeDB on the device
*/
uint32 set_ignored_node = 47;
/*
* Set specified node-num to be un-ignored on the NodeDB on the device
*/
uint32 remove_ignored_node = 48;
/*
* Set specified node-num to be muted
*/
uint32 toggle_muted_node = 49;
/*
* Begins an edit transaction for config, module config, owner, and channel settings changes
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
*/
bool begin_edit_settings = 64;
/*
* Commits an open transaction for any edits made to config, module config, owner, and channel settings
*/
bool commit_edit_settings = 65;
/*
* Add a contact (User) to the nodedb
*/
SharedContact add_contact = 66;
/*
* Initiate or respond to a key verification request
*/
KeyVerificationAdmin key_verification = 67;
/*
* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared.
*/
int32 factory_reset_device = 94;
/*
* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
* Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth.
* Deprecated in favor of reboot_ota_mode in 2.7.17
*/
int32 reboot_ota_seconds = 95 [deprecated = true];
/*
* This message is only supported for the simulator Portduino build.
* If received the simulator will exit successfully.
*/
bool exit_simulator = 96;
/*
* Tell the node to reboot in this many seconds (or <0 to cancel reboot)
*/
int32 reboot_seconds = 97;
/*
* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
*/
int32 shutdown_seconds = 98;
/*
* Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
*/
int32 factory_reset_config = 99;
/*
* Tell the node to reset the nodedb.
* When true, favorites are preserved through reset.
*/
bool nodedb_reset = 100;
/*
* Tell the node to reset into the OTA Loader
*/
OTAEvent ota_request = 102;
/*
* Parameters and sensor configuration
*/
SensorConfig sensor_config = 103;
}
}
/*
* Firmware update mode for OTA updates
*/
enum OTAMode {
/*
* Do not reboot into OTA mode
*/
NO_REBOOT_OTA = 0;
/*
* Reboot into OTA mode for BLE firmware update
*/
OTA_BLE = 1;
/*
* Reboot into OTA mode for WiFi firmware update
*/
OTA_WIFI = 2;
}
/*
* Parameters for setting up Meshtastic for ameteur radio usage
*/
message HamParameters {
/*
* Amateur radio call sign, eg. KD2ABC
*/
string call_sign = 1;
/*
* Transmit power in dBm at the LoRA transceiver, not including any amplification
*/
int32 tx_power = 2;
/*
* The selected frequency of LoRA operation
* Please respect your local laws, regulations, and band plans.
* Ensure your radio is capable of operating of the selected frequency before setting this.
*/
float frequency = 3;
/*
* Optional short name of user
*/
string short_name = 4;
}
/*
* Response envelope for node_remote_hardware_pins
*/
message NodeRemoteHardwarePinsResponse {
/*
* Nodes and their respective remote hardware GPIO pins
*/
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 1;
}
message SharedContact {
/*
* The node number of the contact
*/
uint32 node_num = 1;
/*
* The User of the contact
*/
User user = 2;
/*
* Add this contact to the blocked / ignored list
*/
bool should_ignore = 3;
/*
* Set the IS_KEY_MANUALLY_VERIFIED bit
*/
bool manually_verified = 4;
}
/*
* This message is used by a client to initiate or complete a key verification
*/
message KeyVerificationAdmin {
/*
* Three stages of this request.
*/
enum MessageType {
/*
* This is the first stage, where a client initiates
*/
INITIATE_VERIFICATION = 0;
/*
* After the nonce has been returned over the mesh, the client prompts for the security number
* And uses this message to provide it to the node.
*/
PROVIDE_SECURITY_NUMBER = 1;
/*
* Once the user has compared the verification message, this message notifies the node.
*/
DO_VERIFY = 2;
/*
* This is the cancel path, can be taken at any point
*/
DO_NOT_VERIFY = 3;
}
MessageType message_type = 1;
/*
* The nodenum we're requesting
*/
uint32 remote_nodenum = 2;
/*
* The nonce is used to track the connection
*/
uint64 nonce = 3;
/*
* The 4 digit code generated by the remote node, and communicated outside the mesh
*/
optional uint32 security_number = 4;
}
message SensorConfig {
/*
* SCD4X CO2 Sensor configuration
*/
SCD4X_config scd4x_config = 1;
/*
* SEN5X PM Sensor configuration
*/
SEN5X_config sen5x_config = 2;
/*
* SCD30 CO2 Sensor configuration
*/
SCD30_config scd30_config = 3;
}
message SCD4X_config {
/*
* Set Automatic self-calibration enabled
*/
optional bool set_asc = 1;
/*
* Recalibration target CO2 concentration in ppm (FRC or ASC)
*/
optional uint32 set_target_co2_conc = 2;
/*
* Reference temperature in degC
*/
optional float set_temperature = 3;
/*
* Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure)
*/
optional uint32 set_altitude = 4;
/*
* Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude)
*/
optional uint32 set_ambient_pressure = 5;
/*
* Perform a factory reset of the sensor
*/
optional bool factory_reset = 6;
/*
* Power mode for sensor (true for low power, false for normal)
*/
optional bool set_power_mode = 7;
}
message SEN5X_config {
/*
* Reference temperature in degC
*/
optional float set_temperature = 1;
/*
* One-shot mode (true for low power - one-shot mode, false for normal - continuous mode)
*/
optional bool set_one_shot_mode = 2;
}
message SCD30_config {
/*
* Set Automatic self-calibration enabled
*/
optional bool set_asc = 1;
/*
* Recalibration target CO2 concentration in ppm (FRC or ASC)
*/
optional uint32 set_target_co2_conc = 2;
/*
* Reference temperature in degC
*/
optional float set_temperature = 3;
/*
* Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure)
*/
optional uint32 set_altitude = 4;
/*
* Power mode for sensor (true for low power, false for normal)
*/
optional uint32 set_measurement_interval = 5;
/*
* Perform a factory reset of the sensor
*/
optional bool soft_reset = 6;
}