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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
// This file is @generated by prost-build.
///
/// This information can be encoded as a QRcode/url so that other users can configure
/// their radio to join the same channel.
/// A note about how channel names are shown to users: channelname-X
/// poundsymbol is a prefix used to indicate this is a channel name (idea from @professr).
/// Where X is a letter from A-Z (base 26) representing a hash of the PSK for this
/// channel - so that if the user changes anything about the channel (which does
/// force a new PSK) this letter will also change. Thus preventing user confusion if
/// two friends try to type in a channel name of "BobsChan" and then can't talk
/// because their PSKs will be different.
/// The PSK is hashed into this letter by "0x41 + \[xor all bytes of the psk \] modulo 26"
/// This also allows the option of someday if people have the PSK off (zero), the
/// users COULD type in a channel name and be able to talk.
/// FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
/// FIXME: explain how apps use channels for security.
/// explain how remote settings and remote gpio are managed as an example
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChannelSettings {
///
/// Deprecated in favor of LoraConfig.channel_num
#[deprecated]
#[prost(uint32, tag = "1")]
pub channel_num: u32,
///
/// A simple pre-shared key for now for crypto.
/// Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
/// A special shorthand is used for 1 byte long psks.
/// These psks should be treated as only minimally secure,
/// because they are listed in this source code.
/// Those bytes are mapped using the following scheme:
/// `0` = No crypto
/// `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01}
/// `2` through 10 = The default channel key, except with 1 through 9 added to the last byte.
/// Shown to user as simple1 through 10
#[prost(bytes = "vec", tag = "2")]
pub psk: ::prost::alloc::vec::Vec<u8>,
///
/// A SHORT name that will be packed into the URL.
/// Less than 12 bytes.
/// Something for end users to call the channel
/// If this is the empty string it is assumed that this channel
/// is the special (minimally secure) "Default"channel.
/// In user interfaces it should be rendered as a local language translation of "X".
/// For channel_num hashing empty string will be treated as "X".
/// Where "X" is selected based on the English words listed above for ModemPreset
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
///
/// Used to construct a globally unique channel ID.
/// The full globally unique ID will be: "name.id" where ID is shown as base36.
/// Assuming that the number of meshtastic users is below 20K (true for a long time)
/// the chance of this 64 bit random number colliding with anyone else is super low.
/// And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to
/// try multiple candidate channels.
/// Any time a non wire compatible change is made to a channel, this field should be regenerated.
/// There are a small number of 'special' globally known (and fairly) insecure standard channels.
/// Those channels do not have a numeric id included in the settings, but instead it is pulled from
/// a table of well known IDs.
/// (see Well Known Channels FIXME)
#[prost(fixed32, tag = "4")]
pub id: u32,
///
/// If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe
#[prost(bool, tag = "5")]
pub uplink_enabled: bool,
///
/// If true, messages seen on the internet will be forwarded to the local mesh.
#[prost(bool, tag = "6")]
pub downlink_enabled: bool,
///
/// Per-channel module settings.
#[prost(message, optional, tag = "7")]
pub module_settings: ::core::option::Option<ModuleSettings>,
}
///
/// This message is specifically for modules to store per-channel configuration data.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModuleSettings {
///
/// Bits of precision for the location sent in position packets.
#[prost(uint32, tag = "1")]
pub position_precision: u32,
///
/// Controls whether or not the phone / clients should mute the current channel
/// Useful for noisy public channels you don't necessarily want to disable
#[prost(bool, tag = "2")]
pub is_client_muted: bool,
}
///
/// A pair of a channel number, mode and the (sharable) settings for that channel
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Channel {
///
/// The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1)
/// (Someday - not currently implemented) An index of -1 could be used to mean "set by name",
/// in which case the target node will find and set the channel by settings.name.
#[prost(int32, tag = "1")]
pub index: i32,
///
/// The new settings, or NULL to disable that channel
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<ChannelSettings>,
///
/// TODO: REPLACE
#[prost(enumeration = "channel::Role", tag = "3")]
pub role: i32,
}
/// Nested message and enum types in `Channel`.
pub mod channel {
///
/// How this channel is being used (or not).
/// Note: this field is an enum to give us options for the future.
/// In particular, someday we might make a 'SCANNING' option.
/// SCANNING channels could have different frequencies and the radio would
/// occasionally check that freq to see if anything is being transmitted.
/// For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow
/// cross band routing as needed.
/// If a device has only a single radio (the common case) only one channel can be PRIMARY at a time
/// (but any number of SECONDARY channels can't be sent received on that common frequency)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Role {
///
/// This channel is not in use right now
Disabled = 0,
///
/// This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY
Primary = 1,
///
/// Secondary channels are only used for encryption/decryption/authentication purposes.
/// Their radio settings (freq etc) are ignored, only psk is used.
Secondary = 2,
}
impl Role {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Disabled => "DISABLED",
Self::Primary => "PRIMARY",
Self::Secondary => "SECONDARY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DISABLED" => Some(Self::Disabled),
"PRIMARY" => Some(Self::Primary),
"SECONDARY" => Some(Self::Secondary),
_ => None,
}
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceUiConfig {
///
/// A version integer used to invalidate saved files when we make incompatible changes.
#[prost(uint32, tag = "1")]
pub version: u32,
///
/// TFT display brightness 1..255
#[prost(uint32, tag = "2")]
pub screen_brightness: u32,
///
/// Screen timeout 0..900
#[prost(uint32, tag = "3")]
pub screen_timeout: u32,
///
/// Screen/Settings lock enabled
#[prost(bool, tag = "4")]
pub screen_lock: bool,
#[prost(bool, tag = "5")]
pub settings_lock: bool,
#[prost(uint32, tag = "6")]
pub pin_code: u32,
///
/// Color theme
#[prost(enumeration = "Theme", tag = "7")]
pub theme: i32,
///
/// Audible message, banner and ring tone
#[prost(bool, tag = "8")]
pub alert_enabled: bool,
#[prost(bool, tag = "9")]
pub banner_enabled: bool,
#[prost(uint32, tag = "10")]
pub ring_tone_id: u32,
///
/// Localization
#[prost(enumeration = "Language", tag = "11")]
pub language: i32,
///
/// Node list filter
#[prost(message, optional, tag = "12")]
pub node_filter: ::core::option::Option<NodeFilter>,
///
/// Node list highlightening
#[prost(message, optional, tag = "13")]
pub node_highlight: ::core::option::Option<NodeHighlight>,
///
/// 8 integers for screen calibration data
#[prost(bytes = "vec", tag = "14")]
pub calibration_data: ::prost::alloc::vec::Vec<u8>,
///
/// Map related data
#[prost(message, optional, tag = "15")]
pub map_data: ::core::option::Option<Map>,
///
/// Compass mode
#[prost(enumeration = "CompassMode", tag = "16")]
pub compass_mode: i32,
///
/// RGB color for BaseUI
/// 0xRRGGBB format, e.g. 0xFF0000 for red
#[prost(uint32, tag = "17")]
pub screen_rgb_color: u32,
///
/// Clockface analog style
/// true for analog clockface, false for digital clockface
#[prost(bool, tag = "18")]
pub is_clockface_analog: bool,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeFilter {
///
/// Filter unknown nodes
#[prost(bool, tag = "1")]
pub unknown_switch: bool,
///
/// Filter offline nodes
#[prost(bool, tag = "2")]
pub offline_switch: bool,
///
/// Filter nodes w/o public key
#[prost(bool, tag = "3")]
pub public_key_switch: bool,
///
/// Filter based on hops away
#[prost(int32, tag = "4")]
pub hops_away: i32,
///
/// Filter nodes w/o position
#[prost(bool, tag = "5")]
pub position_switch: bool,
///
/// Filter nodes by matching name string
#[prost(string, tag = "6")]
pub node_name: ::prost::alloc::string::String,
///
/// Filter based on channel
#[prost(int32, tag = "7")]
pub channel: i32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeHighlight {
///
/// Hightlight nodes w/ active chat
#[prost(bool, tag = "1")]
pub chat_switch: bool,
///
/// Highlight nodes w/ position
#[prost(bool, tag = "2")]
pub position_switch: bool,
///
/// Highlight nodes w/ telemetry data
#[prost(bool, tag = "3")]
pub telemetry_switch: bool,
///
/// Highlight nodes w/ iaq data
#[prost(bool, tag = "4")]
pub iaq_switch: bool,
///
/// Highlight nodes by matching name string
#[prost(string, tag = "5")]
pub node_name: ::prost::alloc::string::String,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeoPoint {
///
/// Zoom level
#[prost(int32, tag = "1")]
pub zoom: i32,
///
/// Coordinate: latitude
#[prost(int32, tag = "2")]
pub latitude: i32,
///
/// Coordinate: longitude
#[prost(int32, tag = "3")]
pub longitude: i32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Map {
///
/// Home coordinates
#[prost(message, optional, tag = "1")]
pub home: ::core::option::Option<GeoPoint>,
///
/// Map tile style
#[prost(string, tag = "2")]
pub style: ::prost::alloc::string::String,
///
/// Map scroll follows GPS
#[prost(bool, tag = "3")]
pub follow_gps: bool,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompassMode {
///
/// Compass with dynamic ring and heading
Dynamic = 0,
///
/// Compass with fixed ring and heading
FixedRing = 1,
///
/// Compass with heading and freeze option
FreezeHeading = 2,
}
impl CompassMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Dynamic => "DYNAMIC",
Self::FixedRing => "FIXED_RING",
Self::FreezeHeading => "FREEZE_HEADING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DYNAMIC" => Some(Self::Dynamic),
"FIXED_RING" => Some(Self::FixedRing),
"FREEZE_HEADING" => Some(Self::FreezeHeading),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Theme {
///
/// Dark
Dark = 0,
///
/// Light
Light = 1,
///
/// Red
Red = 2,
}
impl Theme {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Dark => "DARK",
Self::Light => "LIGHT",
Self::Red => "RED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DARK" => Some(Self::Dark),
"LIGHT" => Some(Self::Light),
"RED" => Some(Self::Red),
_ => None,
}
}
}
///
/// Localization
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Language {
///
/// English
English = 0,
///
/// French
French = 1,
///
/// German
German = 2,
///
/// Italian
Italian = 3,
///
/// Portuguese
Portuguese = 4,
///
/// Spanish
Spanish = 5,
///
/// Swedish
Swedish = 6,
///
/// Finnish
Finnish = 7,
///
/// Polish
Polish = 8,
///
/// Turkish
Turkish = 9,
///
/// Serbian
Serbian = 10,
///
/// Russian
Russian = 11,
///
/// Dutch
Dutch = 12,
///
/// Greek
Greek = 13,
///
/// Norwegian
Norwegian = 14,
///
/// Slovenian
Slovenian = 15,
///
/// Ukrainian
Ukrainian = 16,
///
/// Bulgarian
Bulgarian = 17,
///
/// Simplified Chinese (experimental)
SimplifiedChinese = 30,
///
/// Traditional Chinese (experimental)
TraditionalChinese = 31,
}
impl Language {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::English => "ENGLISH",
Self::French => "FRENCH",
Self::German => "GERMAN",
Self::Italian => "ITALIAN",
Self::Portuguese => "PORTUGUESE",
Self::Spanish => "SPANISH",
Self::Swedish => "SWEDISH",
Self::Finnish => "FINNISH",
Self::Polish => "POLISH",
Self::Turkish => "TURKISH",
Self::Serbian => "SERBIAN",
Self::Russian => "RUSSIAN",
Self::Dutch => "DUTCH",
Self::Greek => "GREEK",
Self::Norwegian => "NORWEGIAN",
Self::Slovenian => "SLOVENIAN",
Self::Ukrainian => "UKRAINIAN",
Self::Bulgarian => "BULGARIAN",
Self::SimplifiedChinese => "SIMPLIFIED_CHINESE",
Self::TraditionalChinese => "TRADITIONAL_CHINESE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ENGLISH" => Some(Self::English),
"FRENCH" => Some(Self::French),
"GERMAN" => Some(Self::German),
"ITALIAN" => Some(Self::Italian),
"PORTUGUESE" => Some(Self::Portuguese),
"SPANISH" => Some(Self::Spanish),
"SWEDISH" => Some(Self::Swedish),
"FINNISH" => Some(Self::Finnish),
"POLISH" => Some(Self::Polish),
"TURKISH" => Some(Self::Turkish),
"SERBIAN" => Some(Self::Serbian),
"RUSSIAN" => Some(Self::Russian),
"DUTCH" => Some(Self::Dutch),
"GREEK" => Some(Self::Greek),
"NORWEGIAN" => Some(Self::Norwegian),
"SLOVENIAN" => Some(Self::Slovenian),
"UKRAINIAN" => Some(Self::Ukrainian),
"BULGARIAN" => Some(Self::Bulgarian),
"SIMPLIFIED_CHINESE" => Some(Self::SimplifiedChinese),
"TRADITIONAL_CHINESE" => Some(Self::TraditionalChinese),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Config {
///
/// Payload Variant
#[prost(oneof = "config::PayloadVariant", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
pub payload_variant: ::core::option::Option<config::PayloadVariant>,
}
/// Nested message and enum types in `Config`.
pub mod config {
///
/// Configuration
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceConfig {
///
/// Sets the role of node
#[prost(enumeration = "device_config::Role", tag = "1")]
pub role: i32,
///
/// Disabling this will disable the SerialConsole by not initilizing the StreamAPI
/// Moved to SecurityConfig
#[deprecated]
#[prost(bool, tag = "2")]
pub serial_enabled: bool,
///
/// For boards without a hard wired button, this is the pin number that will be used
/// Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined.
#[prost(uint32, tag = "4")]
pub button_gpio: u32,
///
/// For boards without a PWM buzzer, this is the pin number that will be used
/// Defaults to PIN_BUZZER if defined.
#[prost(uint32, tag = "5")]
pub buzzer_gpio: u32,
///
/// Sets the role of node
#[prost(enumeration = "device_config::RebroadcastMode", tag = "6")]
pub rebroadcast_mode: i32,
///
/// Send our nodeinfo this often
/// Defaults to 900 Seconds (15 minutes)
#[prost(uint32, tag = "7")]
pub node_info_broadcast_secs: u32,
///
/// Treat double tap interrupt on supported accelerometers as a button press if set to true
#[prost(bool, tag = "8")]
pub double_tap_as_button_press: bool,
///
/// If true, device is considered to be "managed" by a mesh administrator
/// Clients should then limit available configuration and administrative options inside the user interface
/// Moved to SecurityConfig
#[deprecated]
#[prost(bool, tag = "9")]
pub is_managed: bool,
///
/// Disables the triple-press of user button to enable or disable GPS
#[prost(bool, tag = "10")]
pub disable_triple_click: bool,
///
/// POSIX Timezone definition string from <https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv.>
#[prost(string, tag = "11")]
pub tzdef: ::prost::alloc::string::String,
///
/// If true, disable the default blinking LED (LED_PIN) behavior on the device
#[prost(bool, tag = "12")]
pub led_heartbeat_disabled: bool,
///
/// Controls buzzer behavior for audio feedback
/// Defaults to ENABLED
#[prost(enumeration = "device_config::BuzzerMode", tag = "13")]
pub buzzer_mode: i32,
}
/// Nested message and enum types in `DeviceConfig`.
pub mod device_config {
///
/// Defines the device's role on the Mesh network
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Role {
///
/// Description: App connected or stand alone messaging device.
/// Technical Details: Default Role
Client = 0,
///
/// Description: Device that does not forward packets from other devices.
ClientMute = 1,
///
/// Description: Infrastructure node for extending network coverage by relaying messages. Visible in Nodes list.
/// Technical Details: Mesh packets will prefer to be routed over this node. This node will not be used by client apps.
/// The wifi radio and the oled screen will be put to sleep.
/// This mode may still potentially have higher power usage due to it's preference in message rebroadcasting on the mesh.
Router = 2,
RouterClient = 3,
///
/// Description: Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in Nodes list.
/// Technical Details: Mesh packets will simply be rebroadcasted over this node. Nodes configured with this role will not originate NodeInfo, Position, Telemetry
/// or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate.
Repeater = 4,
///
/// Description: Broadcasts GPS position packets as priority.
/// Technical Details: Position Mesh packets will be prioritized higher and sent more frequently by default.
/// When used in conjunction with power.is_power_saving = true, nodes will wake up,
/// send position, and then sleep for position.position_broadcast_secs seconds.
Tracker = 5,
///
/// Description: Broadcasts telemetry packets as priority.
/// Technical Details: Telemetry Mesh packets will be prioritized higher and sent more frequently by default.
/// When used in conjunction with power.is_power_saving = true, nodes will wake up,
/// send environment telemetry, and then sleep for telemetry.environment_update_interval seconds.
Sensor = 6,
///
/// Description: Optimized for ATAK system communication and reduces routine broadcasts.
/// Technical Details: Used for nodes dedicated for connection to an ATAK EUD.
/// Turns off many of the routine broadcasts to favor CoT packet stream
/// from the Meshtastic ATAK plugin -> IMeshService -> Node
Tak = 7,
///
/// Description: Device that only broadcasts as needed for stealth or power savings.
/// Technical Details: Used for nodes that "only speak when spoken to"
/// Turns all of the routine broadcasts but allows for ad-hoc communication
/// Still rebroadcasts, but with local only rebroadcast mode (known meshes only)
/// Can be used for clandestine operation or to dramatically reduce airtime / power consumption
ClientHidden = 8,
///
/// Description: Broadcasts location as message to default channel regularly for to assist with device recovery.
/// Technical Details: Used to automatically send a text message to the mesh
/// with the current position of the device on a frequent interval:
/// "I'm lost! Position: lat / long"
LostAndFound = 9,
///
/// Description: Enables automatic TAK PLI broadcasts and reduces routine broadcasts.
/// Technical Details: Turns off many of the routine broadcasts to favor ATAK CoT packet stream
/// and automatic TAK PLI (position location information) broadcasts.
/// Uses position module configuration to determine TAK PLI broadcast interval.
TakTracker = 10,
///
/// Description: Will always rebroadcast packets, but will do so after all other modes.
/// Technical Details: Used for router nodes that are intended to provide additional coverage
/// in areas not already covered by other routers, or to bridge around problematic terrain,
/// but should not be given priority over other routers in order to avoid unnecessaraily
/// consuming hops.
RouterLate = 11,
}
impl Role {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Client => "CLIENT",
Self::ClientMute => "CLIENT_MUTE",
Self::Router => "ROUTER",
Self::RouterClient => "ROUTER_CLIENT",
Self::Repeater => "REPEATER",
Self::Tracker => "TRACKER",
Self::Sensor => "SENSOR",
Self::Tak => "TAK",
Self::ClientHidden => "CLIENT_HIDDEN",
Self::LostAndFound => "LOST_AND_FOUND",
Self::TakTracker => "TAK_TRACKER",
Self::RouterLate => "ROUTER_LATE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CLIENT" => Some(Self::Client),
"CLIENT_MUTE" => Some(Self::ClientMute),
"ROUTER" => Some(Self::Router),
"ROUTER_CLIENT" => Some(Self::RouterClient),
"REPEATER" => Some(Self::Repeater),
"TRACKER" => Some(Self::Tracker),
"SENSOR" => Some(Self::Sensor),
"TAK" => Some(Self::Tak),
"CLIENT_HIDDEN" => Some(Self::ClientHidden),
"LOST_AND_FOUND" => Some(Self::LostAndFound),
"TAK_TRACKER" => Some(Self::TakTracker),
"ROUTER_LATE" => Some(Self::RouterLate),
_ => None,
}
}
}
///
/// Defines the device's behavior for how messages are rebroadcast
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RebroadcastMode {
///
/// Default behavior.
/// Rebroadcast any observed message, if it was on our private channel or from another mesh with the same lora params.
All = 0,
///
/// Same as behavior as ALL but skips packet decoding and simply rebroadcasts them.
/// Only available in Repeater role. Setting this on any other roles will result in ALL behavior.
AllSkipDecoding = 1,
///
/// Ignores observed messages from foreign meshes that are open or those which it cannot decrypt.
/// Only rebroadcasts message on the nodes local primary / secondary channels.
LocalOnly = 2,
///
/// Ignores observed messages from foreign meshes like LOCAL_ONLY,
/// but takes it step further by also ignoring messages from nodenums not in the node's known list (NodeDB)
KnownOnly = 3,
///
/// Only permitted for SENSOR, TRACKER and TAK_TRACKER roles, this will inhibit all rebroadcasts, not unlike CLIENT_MUTE role.
None = 4,
///
/// Ignores packets from non-standard portnums such as: TAK, RangeTest, PaxCounter, etc.
/// Only rebroadcasts packets with standard portnums: NodeInfo, Text, Position, Telemetry, and Routing.
CorePortnumsOnly = 5,
}
impl RebroadcastMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::All => "ALL",
Self::AllSkipDecoding => "ALL_SKIP_DECODING",
Self::LocalOnly => "LOCAL_ONLY",
Self::KnownOnly => "KNOWN_ONLY",
Self::None => "NONE",
Self::CorePortnumsOnly => "CORE_PORTNUMS_ONLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALL" => Some(Self::All),
"ALL_SKIP_DECODING" => Some(Self::AllSkipDecoding),
"LOCAL_ONLY" => Some(Self::LocalOnly),
"KNOWN_ONLY" => Some(Self::KnownOnly),
"NONE" => Some(Self::None),
"CORE_PORTNUMS_ONLY" => Some(Self::CorePortnumsOnly),
_ => None,
}
}
}
///
/// Defines buzzer behavior for audio feedback
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum BuzzerMode {
///
/// Default behavior.
/// Buzzer is enabled for all audio feedback including button presses and alerts.
AllEnabled = 0,
///
/// Disabled.
/// All buzzer audio feedback is disabled.
Disabled = 1,
///
/// Notifications Only.
/// Buzzer is enabled only for notifications and alerts, but not for button presses.
/// External notification config determines the specifics of the notification behavior.
NotificationsOnly = 2,
///
/// Non-notification system buzzer tones only.
/// Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts.
SystemOnly = 3,
///
/// Direct Message notifications only.
/// Buzzer is enabled only for direct messages and alerts, but not for button presses.
/// External notification config determines the specifics of the notification behavior.
DirectMsgOnly = 4,
}
impl BuzzerMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AllEnabled => "ALL_ENABLED",
Self::Disabled => "DISABLED",
Self::NotificationsOnly => "NOTIFICATIONS_ONLY",
Self::SystemOnly => "SYSTEM_ONLY",
Self::DirectMsgOnly => "DIRECT_MSG_ONLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALL_ENABLED" => Some(Self::AllEnabled),
"DISABLED" => Some(Self::Disabled),
"NOTIFICATIONS_ONLY" => Some(Self::NotificationsOnly),
"SYSTEM_ONLY" => Some(Self::SystemOnly),
"DIRECT_MSG_ONLY" => Some(Self::DirectMsgOnly),
_ => None,
}
}
}
}
///
/// Position Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PositionConfig {
///
/// We should send our position this often (but only if it has changed significantly)
/// Defaults to 15 minutes
#[prost(uint32, tag = "1")]
pub position_broadcast_secs: u32,
///
/// Adaptive position braoadcast, which is now the default.
#[prost(bool, tag = "2")]
pub position_broadcast_smart_enabled: bool,
///
/// If set, this node is at a fixed position.
/// We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node.
/// The lat/lon/alt can be set by an internal GPS or with the help of the app.
#[prost(bool, tag = "3")]
pub fixed_position: bool,
///
/// Is GPS enabled for this node?
#[deprecated]
#[prost(bool, tag = "4")]
pub gps_enabled: bool,
///
/// How often should we try to get GPS position (in seconds)
/// or zero for the default of once every 30 seconds
/// or a very large value (maxint) to update only once at boot.
#[prost(uint32, tag = "5")]
pub gps_update_interval: u32,
///
/// Deprecated in favor of using smart / regular broadcast intervals as implicit attempt time
#[deprecated]
#[prost(uint32, tag = "6")]
pub gps_attempt_time: u32,
///
/// Bit field of boolean configuration options for POSITION messages
/// (bitwise OR of PositionFlags)
#[prost(uint32, tag = "7")]
pub position_flags: u32,
///
/// (Re)define GPS_RX_PIN for your board.
#[prost(uint32, tag = "8")]
pub rx_gpio: u32,
///
/// (Re)define GPS_TX_PIN for your board.
#[prost(uint32, tag = "9")]
pub tx_gpio: u32,
///
/// The minimum distance in meters traveled (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled
#[prost(uint32, tag = "10")]
pub broadcast_smart_minimum_distance: u32,
///
/// The minimum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled
#[prost(uint32, tag = "11")]
pub broadcast_smart_minimum_interval_secs: u32,
///
/// (Re)define PIN_GPS_EN for your board.
#[prost(uint32, tag = "12")]
pub gps_en_gpio: u32,
///
/// Set where GPS is enabled, disabled, or not present
#[prost(enumeration = "position_config::GpsMode", tag = "13")]
pub gps_mode: i32,
}
/// Nested message and enum types in `PositionConfig`.
pub mod position_config {
///
/// Bit field of boolean configuration options, indicating which optional
/// fields to include when assembling POSITION messages.
/// Longitude, latitude, altitude, speed, heading, and DOP
/// are always included (also time if GPS-synced)
/// NOTE: the more fields are included, the larger the message will be -
/// leading to longer airtime and a higher risk of packet loss
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PositionFlags {
///
/// Required for compilation
Unset = 0,
///
/// Include an altitude value (if available)
Altitude = 1,
///
/// Altitude value is MSL
AltitudeMsl = 2,
///
/// Include geoidal separation
GeoidalSeparation = 4,
///
/// Include the DOP value ; PDOP used by default, see below
Dop = 8,
///
/// If POS_DOP set, send separate HDOP / VDOP values instead of PDOP
Hvdop = 16,
///
/// Include number of "satellites in view"
Satinview = 32,
///
/// Include a sequence number incremented per packet
SeqNo = 64,
///
/// Include positional timestamp (from GPS solution)
Timestamp = 128,
///
/// Include positional heading
/// Intended for use with vehicle not walking speeds
/// walking speeds are likely to be error prone like the compass
Heading = 256,
///
/// Include positional speed
/// Intended for use with vehicle not walking speeds
/// walking speeds are likely to be error prone like the compass
Speed = 512,
}
impl PositionFlags {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::Altitude => "ALTITUDE",
Self::AltitudeMsl => "ALTITUDE_MSL",
Self::GeoidalSeparation => "GEOIDAL_SEPARATION",
Self::Dop => "DOP",
Self::Hvdop => "HVDOP",
Self::Satinview => "SATINVIEW",
Self::SeqNo => "SEQ_NO",
Self::Timestamp => "TIMESTAMP",
Self::Heading => "HEADING",
Self::Speed => "SPEED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"ALTITUDE" => Some(Self::Altitude),
"ALTITUDE_MSL" => Some(Self::AltitudeMsl),
"GEOIDAL_SEPARATION" => Some(Self::GeoidalSeparation),
"DOP" => Some(Self::Dop),
"HVDOP" => Some(Self::Hvdop),
"SATINVIEW" => Some(Self::Satinview),
"SEQ_NO" => Some(Self::SeqNo),
"TIMESTAMP" => Some(Self::Timestamp),
"HEADING" => Some(Self::Heading),
"SPEED" => Some(Self::Speed),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum GpsMode {
///
/// GPS is present but disabled
Disabled = 0,
///
/// GPS is present and enabled
Enabled = 1,
///
/// GPS is not present on the device
NotPresent = 2,
}
impl GpsMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Disabled => "DISABLED",
Self::Enabled => "ENABLED",
Self::NotPresent => "NOT_PRESENT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DISABLED" => Some(Self::Disabled),
"ENABLED" => Some(Self::Enabled),
"NOT_PRESENT" => Some(Self::NotPresent),
_ => None,
}
}
}
}
///
/// Power Config\
/// See [Power Config](/docs/settings/config/power) for additional power config details.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PowerConfig {
///
/// Description: Will sleep everything as much as possible, for the tracker and sensor role this will also include the lora radio.
/// Don't use this setting if you want to use your device with the phone apps or are using a device without a user button.
/// Technical Details: Works for ESP32 devices and NRF52 devices in the Sensor or Tracker roles
#[prost(bool, tag = "1")]
pub is_power_saving: bool,
///
/// Description: If non-zero, the device will fully power off this many seconds after external power is removed.
#[prost(uint32, tag = "2")]
pub on_battery_shutdown_after_secs: u32,
///
/// Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k)
/// Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation.
/// <https://meshtastic.org/docs/configuration/radio/power/#adc-multiplier-override>
/// Should be set to floating point value between 2 and 6
#[prost(float, tag = "3")]
pub adc_multiplier_override: f32,
///
/// Description: The number of seconds for to wait before turning off BLE in No Bluetooth states
/// Technical Details: ESP32 Only 0 for default of 1 minute
#[prost(uint32, tag = "4")]
pub wait_bluetooth_secs: u32,
///
/// Super Deep Sleep Seconds
/// While in Light Sleep if mesh_sds_timeout_secs is exceeded we will lower into super deep sleep
/// for this value (default 1 year) or a button press
/// 0 for default of one year
#[prost(uint32, tag = "6")]
pub sds_secs: u32,
///
/// Description: In light sleep the CPU is suspended, LoRa radio is on, BLE is off an GPS is on
/// Technical Details: ESP32 Only 0 for default of 300
#[prost(uint32, tag = "7")]
pub ls_secs: u32,
///
/// Description: While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value
/// Technical Details: ESP32 Only 0 for default of 10 seconds
#[prost(uint32, tag = "8")]
pub min_wake_secs: u32,
///
/// I2C address of INA_2XX to use for reading device battery voltage
#[prost(uint32, tag = "9")]
pub device_battery_ina_address: u32,
///
/// If non-zero, we want powermon log outputs. With the particular (bitfield) sources enabled.
/// Note: we picked an ID of 32 so that lower more efficient IDs can be used for more frequently used options.
#[prost(uint64, tag = "32")]
pub powermon_enables: u64,
}
///
/// Network Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetworkConfig {
///
/// Enable WiFi (disables Bluetooth)
#[prost(bool, tag = "1")]
pub wifi_enabled: bool,
///
/// If set, this node will try to join the specified wifi network and
/// acquire an address via DHCP
#[prost(string, tag = "3")]
pub wifi_ssid: ::prost::alloc::string::String,
///
/// If set, will be use to authenticate to the named wifi
#[prost(string, tag = "4")]
pub wifi_psk: ::prost::alloc::string::String,
///
/// NTP server to use if WiFi is conneced, defaults to `meshtastic.pool.ntp.org`
#[prost(string, tag = "5")]
pub ntp_server: ::prost::alloc::string::String,
///
/// Enable Ethernet
#[prost(bool, tag = "6")]
pub eth_enabled: bool,
///
/// acquire an address via DHCP or assign static
#[prost(enumeration = "network_config::AddressMode", tag = "7")]
pub address_mode: i32,
///
/// struct to keep static address
#[prost(message, optional, tag = "8")]
pub ipv4_config: ::core::option::Option<network_config::IpV4Config>,
///
/// rsyslog Server and Port
#[prost(string, tag = "9")]
pub rsyslog_server: ::prost::alloc::string::String,
///
/// Flags for enabling/disabling network protocols
#[prost(uint32, tag = "10")]
pub enabled_protocols: u32,
///
/// Enable/Disable ipv6 support
#[prost(bool, tag = "11")]
pub ipv6_enabled: bool,
}
/// Nested message and enum types in `NetworkConfig`.
pub mod network_config {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IpV4Config {
///
/// Static IP address
#[prost(fixed32, tag = "1")]
pub ip: u32,
///
/// Static gateway address
#[prost(fixed32, tag = "2")]
pub gateway: u32,
///
/// Static subnet mask
#[prost(fixed32, tag = "3")]
pub subnet: u32,
///
/// Static DNS server address
#[prost(fixed32, tag = "4")]
pub dns: u32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AddressMode {
///
/// obtain ip address via DHCP
Dhcp = 0,
///
/// use static ip address
Static = 1,
}
impl AddressMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Dhcp => "DHCP",
Self::Static => "STATIC",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DHCP" => Some(Self::Dhcp),
"STATIC" => Some(Self::Static),
_ => None,
}
}
}
///
/// Available flags auxiliary network protocols
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ProtocolFlags {
///
/// Do not broadcast packets over any network protocol
NoBroadcast = 0,
///
/// Enable broadcasting packets via UDP over the local network
UdpBroadcast = 1,
}
impl ProtocolFlags {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NoBroadcast => "NO_BROADCAST",
Self::UdpBroadcast => "UDP_BROADCAST",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NO_BROADCAST" => Some(Self::NoBroadcast),
"UDP_BROADCAST" => Some(Self::UdpBroadcast),
_ => None,
}
}
}
}
///
/// Display Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisplayConfig {
///
/// Number of seconds the screen stays on after pressing the user button or receiving a message
/// 0 for default of one minute MAXUINT for always on
#[prost(uint32, tag = "1")]
pub screen_on_secs: u32,
///
/// Deprecated in 2.7.4: Unused
/// How the GPS coordinates are formatted on the OLED screen.
#[deprecated]
#[prost(enumeration = "display_config::GpsCoordinateFormat", tag = "2")]
pub gps_format: i32,
///
/// Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds.
/// Potentially useful for devices without user buttons.
#[prost(uint32, tag = "3")]
pub auto_screen_carousel_secs: u32,
///
/// If this is set, the displayed compass will always point north. if unset, the old behaviour
/// (top of display is heading direction) is used.
#[deprecated]
#[prost(bool, tag = "4")]
pub compass_north_top: bool,
///
/// Flip screen vertically, for cases that mount the screen upside down
#[prost(bool, tag = "5")]
pub flip_screen: bool,
///
/// Perferred display units
#[prost(enumeration = "display_config::DisplayUnits", tag = "6")]
pub units: i32,
///
/// Override auto-detect in screen
#[prost(enumeration = "display_config::OledType", tag = "7")]
pub oled: i32,
///
/// Display Mode
#[prost(enumeration = "display_config::DisplayMode", tag = "8")]
pub displaymode: i32,
///
/// Print first line in pseudo-bold? FALSE is original style, TRUE is bold
#[prost(bool, tag = "9")]
pub heading_bold: bool,
///
/// Should we wake the screen up on accelerometer detected motion or tap
#[prost(bool, tag = "10")]
pub wake_on_tap_or_motion: bool,
///
/// Indicates how to rotate or invert the compass output to accurate display on the display.
#[prost(enumeration = "display_config::CompassOrientation", tag = "11")]
pub compass_orientation: i32,
///
/// If false (default), the device will display the time in 24-hour format on screen.
/// If true, the device will display the time in 12-hour format on screen.
#[prost(bool, tag = "12")]
pub use_12h_clock: bool,
}
/// Nested message and enum types in `DisplayConfig`.
pub mod display_config {
///
/// How the GPS coordinates are displayed on the OLED screen.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum GpsCoordinateFormat {
///
/// GPS coordinates are displayed in the normal decimal degrees format:
/// DD.DDDDDD DDD.DDDDDD
Dec = 0,
///
/// GPS coordinates are displayed in the degrees minutes seconds format:
/// DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant
Dms = 1,
///
/// Universal Transverse Mercator format:
/// ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing
Utm = 2,
///
/// Military Grid Reference System format:
/// ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square,
/// E is easting, N is northing
Mgrs = 3,
///
/// Open Location Code (aka Plus Codes).
Olc = 4,
///
/// Ordnance Survey Grid Reference (the National Grid System of the UK).
/// Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square,
/// E is the easting, N is the northing
Osgr = 5,
}
impl GpsCoordinateFormat {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Dec => "DEC",
Self::Dms => "DMS",
Self::Utm => "UTM",
Self::Mgrs => "MGRS",
Self::Olc => "OLC",
Self::Osgr => "OSGR",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEC" => Some(Self::Dec),
"DMS" => Some(Self::Dms),
"UTM" => Some(Self::Utm),
"MGRS" => Some(Self::Mgrs),
"OLC" => Some(Self::Olc),
"OSGR" => Some(Self::Osgr),
_ => None,
}
}
}
///
/// Unit display preference
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DisplayUnits {
///
/// Metric (Default)
Metric = 0,
///
/// Imperial
Imperial = 1,
}
impl DisplayUnits {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Metric => "METRIC",
Self::Imperial => "IMPERIAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"METRIC" => Some(Self::Metric),
"IMPERIAL" => Some(Self::Imperial),
_ => None,
}
}
}
///
/// Override OLED outo detect with this if it fails.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum OledType {
///
/// Default / Autodetect
OledAuto = 0,
///
/// Default / Autodetect
OledSsd1306 = 1,
///
/// Default / Autodetect
OledSh1106 = 2,
///
/// Can not be auto detected but set by proto. Used for 128x64 screens
OledSh1107 = 3,
///
/// Can not be auto detected but set by proto. Used for 128x128 screens
OledSh1107128128 = 4,
}
impl OledType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::OledAuto => "OLED_AUTO",
Self::OledSsd1306 => "OLED_SSD1306",
Self::OledSh1106 => "OLED_SH1106",
Self::OledSh1107 => "OLED_SH1107",
Self::OledSh1107128128 => "OLED_SH1107_128_128",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OLED_AUTO" => Some(Self::OledAuto),
"OLED_SSD1306" => Some(Self::OledSsd1306),
"OLED_SH1106" => Some(Self::OledSh1106),
"OLED_SH1107" => Some(Self::OledSh1107),
"OLED_SH1107_128_128" => Some(Self::OledSh1107128128),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DisplayMode {
///
/// Default. The old style for the 128x64 OLED screen
Default = 0,
///
/// Rearrange display elements to cater for bicolor OLED displays
Twocolor = 1,
///
/// Same as TwoColor, but with inverted top bar. Not so good for Epaper displays
Inverted = 2,
///
/// TFT Full Color Displays (not implemented yet)
Color = 3,
}
impl DisplayMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "DEFAULT",
Self::Twocolor => "TWOCOLOR",
Self::Inverted => "INVERTED",
Self::Color => "COLOR",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"TWOCOLOR" => Some(Self::Twocolor),
"INVERTED" => Some(Self::Inverted),
"COLOR" => Some(Self::Color),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CompassOrientation {
///
/// The compass and the display are in the same orientation.
Degrees0 = 0,
///
/// Rotate the compass by 90 degrees.
Degrees90 = 1,
///
/// Rotate the compass by 180 degrees.
Degrees180 = 2,
///
/// Rotate the compass by 270 degrees.
Degrees270 = 3,
///
/// Don't rotate the compass, but invert the result.
Degrees0Inverted = 4,
///
/// Rotate the compass by 90 degrees and invert.
Degrees90Inverted = 5,
///
/// Rotate the compass by 180 degrees and invert.
Degrees180Inverted = 6,
///
/// Rotate the compass by 270 degrees and invert.
Degrees270Inverted = 7,
}
impl CompassOrientation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Degrees0 => "DEGREES_0",
Self::Degrees90 => "DEGREES_90",
Self::Degrees180 => "DEGREES_180",
Self::Degrees270 => "DEGREES_270",
Self::Degrees0Inverted => "DEGREES_0_INVERTED",
Self::Degrees90Inverted => "DEGREES_90_INVERTED",
Self::Degrees180Inverted => "DEGREES_180_INVERTED",
Self::Degrees270Inverted => "DEGREES_270_INVERTED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEGREES_0" => Some(Self::Degrees0),
"DEGREES_90" => Some(Self::Degrees90),
"DEGREES_180" => Some(Self::Degrees180),
"DEGREES_270" => Some(Self::Degrees270),
"DEGREES_0_INVERTED" => Some(Self::Degrees0Inverted),
"DEGREES_90_INVERTED" => Some(Self::Degrees90Inverted),
"DEGREES_180_INVERTED" => Some(Self::Degrees180Inverted),
"DEGREES_270_INVERTED" => Some(Self::Degrees270Inverted),
_ => None,
}
}
}
}
///
/// Lora Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoRaConfig {
///
/// When enabled, the `modem_preset` fields will be adhered to, else the `bandwidth`/`spread_factor`/`coding_rate`
/// will be taked from their respective manually defined fields
#[prost(bool, tag = "1")]
pub use_preset: bool,
///
/// Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH.
/// As a heuristic: If bandwidth is specified, do not use modem_config.
/// Because protobufs take ZERO space when the value is zero this works out nicely.
/// This value is replaced by bandwidth/spread_factor/coding_rate.
/// If you'd like to experiment with other options add them to MeshRadio.cpp in the device code.
#[prost(enumeration = "lo_ra_config::ModemPreset", tag = "2")]
pub modem_preset: i32,
///
/// Bandwidth in MHz
/// Certain bandwidth numbers are 'special' and will be converted to the
/// appropriate floating point value: 31 -> 31.25MHz
#[prost(uint32, tag = "3")]
pub bandwidth: u32,
///
/// A number from 7 to 12.
/// Indicates number of chirps per symbol as 1<<spread_factor.
#[prost(uint32, tag = "4")]
pub spread_factor: u32,
///
/// The denominator of the coding rate.
/// ie for 4/5, the value is 5. 4/8 the value is 8.
#[prost(uint32, tag = "5")]
pub coding_rate: u32,
///
/// This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
/// A frequency offset that is added to to the calculated band center frequency.
/// Used to correct for crystal calibration errors.
#[prost(float, tag = "6")]
pub frequency_offset: f32,
///
/// The region code for the radio (US, CN, EU433, etc...)
#[prost(enumeration = "lo_ra_config::RegionCode", tag = "7")]
pub region: i32,
///
/// Maximum number of hops. This can't be greater than 7.
/// Default of 3
/// Attempting to set a value > 7 results in the default
#[prost(uint32, tag = "8")]
pub hop_limit: u32,
///
/// Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests.
/// Defaults to false
#[prost(bool, tag = "9")]
pub tx_enabled: bool,
///
/// If zero, then use default max legal continuous power (ie. something that won't
/// burn out the radio hardware)
/// In most cases you should use zero here.
/// Units are in dBm.
#[prost(int32, tag = "10")]
pub tx_power: i32,
///
/// This controls the actual hardware frequency the radio transmits on.
/// Most users should never need to be exposed to this field/concept.
/// A channel number between 1 and NUM_CHANNELS (whatever the max is in the current region).
/// If ZERO then the rule is "use the old channel name hash based
/// algorithm to derive the channel number")
/// If using the hash algorithm the channel number will be: hash(channel_name) %
/// NUM_CHANNELS (Where num channels depends on the regulatory region).
#[prost(uint32, tag = "11")]
pub channel_num: u32,
///
/// If true, duty cycle limits will be exceeded and thus you're possibly not following
/// the local regulations if you're not a HAM.
/// Has no effect if the duty cycle of the used region is 100%.
#[prost(bool, tag = "12")]
pub override_duty_cycle: bool,
///
/// If true, sets RX boosted gain mode on SX126X based radios
#[prost(bool, tag = "13")]
pub sx126x_rx_boosted_gain: bool,
///
/// This parameter is for advanced users and licensed HAM radio operators.
/// Ignore Channel Calculation and use this frequency instead. The frequency_offset
/// will still be applied. This will allow you to use out-of-band frequencies.
/// Please respect your local laws and regulations. If you are a HAM, make sure you
/// enable HAM mode and turn off encryption.
#[prost(float, tag = "14")]
pub override_frequency: f32,
///
/// If true, disable the build-in PA FAN using pin define in RF95_FAN_EN.
#[prost(bool, tag = "15")]
pub pa_fan_disabled: bool,
///
/// For testing it is useful sometimes to force a node to never listen to
/// particular other nodes (simulating radio out of range). All nodenums listed
/// in ignore_incoming will have packets they send dropped on receive (by router.cpp)
#[prost(uint32, repeated, tag = "103")]
pub ignore_incoming: ::prost::alloc::vec::Vec<u32>,
///
/// If true, the device will not process any packets received via LoRa that passed via MQTT anywhere on the path towards it.
#[prost(bool, tag = "104")]
pub ignore_mqtt: bool,
///
/// Sets the ok_to_mqtt bit on outgoing packets
#[prost(bool, tag = "105")]
pub config_ok_to_mqtt: bool,
}
/// Nested message and enum types in `LoRaConfig`.
pub mod lo_ra_config {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RegionCode {
///
/// Region is not set
Unset = 0,
///
/// United States
Us = 1,
///
/// European Union 433mhz
Eu433 = 2,
///
/// European Union 868mhz
Eu868 = 3,
///
/// China
Cn = 4,
///
/// Japan
Jp = 5,
///
/// Australia / New Zealand
Anz = 6,
///
/// Korea
Kr = 7,
///
/// Taiwan
Tw = 8,
///
/// Russia
Ru = 9,
///
/// India
In = 10,
///
/// New Zealand 865mhz
Nz865 = 11,
///
/// Thailand
Th = 12,
///
/// WLAN Band
Lora24 = 13,
///
/// Ukraine 433mhz
Ua433 = 14,
///
/// Ukraine 868mhz
Ua868 = 15,
///
/// Malaysia 433mhz
My433 = 16,
///
/// Malaysia 919mhz
My919 = 17,
///
/// Singapore 923mhz
Sg923 = 18,
///
/// Philippines 433mhz
Ph433 = 19,
///
/// Philippines 868mhz
Ph868 = 20,
///
/// Philippines 915mhz
Ph915 = 21,
///
/// Australia / New Zealand 433MHz
Anz433 = 22,
///
/// Kazakhstan 433MHz
Kz433 = 23,
///
/// Kazakhstan 863MHz
Kz863 = 24,
///
/// Nepal 865MHz
Np865 = 25,
///
/// Brazil 902MHz
Br902 = 26,
}
impl RegionCode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::Us => "US",
Self::Eu433 => "EU_433",
Self::Eu868 => "EU_868",
Self::Cn => "CN",
Self::Jp => "JP",
Self::Anz => "ANZ",
Self::Kr => "KR",
Self::Tw => "TW",
Self::Ru => "RU",
Self::In => "IN",
Self::Nz865 => "NZ_865",
Self::Th => "TH",
Self::Lora24 => "LORA_24",
Self::Ua433 => "UA_433",
Self::Ua868 => "UA_868",
Self::My433 => "MY_433",
Self::My919 => "MY_919",
Self::Sg923 => "SG_923",
Self::Ph433 => "PH_433",
Self::Ph868 => "PH_868",
Self::Ph915 => "PH_915",
Self::Anz433 => "ANZ_433",
Self::Kz433 => "KZ_433",
Self::Kz863 => "KZ_863",
Self::Np865 => "NP_865",
Self::Br902 => "BR_902",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"US" => Some(Self::Us),
"EU_433" => Some(Self::Eu433),
"EU_868" => Some(Self::Eu868),
"CN" => Some(Self::Cn),
"JP" => Some(Self::Jp),
"ANZ" => Some(Self::Anz),
"KR" => Some(Self::Kr),
"TW" => Some(Self::Tw),
"RU" => Some(Self::Ru),
"IN" => Some(Self::In),
"NZ_865" => Some(Self::Nz865),
"TH" => Some(Self::Th),
"LORA_24" => Some(Self::Lora24),
"UA_433" => Some(Self::Ua433),
"UA_868" => Some(Self::Ua868),
"MY_433" => Some(Self::My433),
"MY_919" => Some(Self::My919),
"SG_923" => Some(Self::Sg923),
"PH_433" => Some(Self::Ph433),
"PH_868" => Some(Self::Ph868),
"PH_915" => Some(Self::Ph915),
"ANZ_433" => Some(Self::Anz433),
"KZ_433" => Some(Self::Kz433),
"KZ_863" => Some(Self::Kz863),
"NP_865" => Some(Self::Np865),
"BR_902" => Some(Self::Br902),
_ => None,
}
}
}
///
/// Standard predefined channel settings
/// Note: these mappings must match ModemPreset Choice in the device code.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ModemPreset {
///
/// Long Range - Fast
LongFast = 0,
///
/// Long Range - Slow
LongSlow = 1,
///
/// Very Long Range - Slow
/// Deprecated in 2.5: Works only with txco and is unusably slow
VeryLongSlow = 2,
///
/// Medium Range - Slow
MediumSlow = 3,
///
/// Medium Range - Fast
MediumFast = 4,
///
/// Short Range - Slow
ShortSlow = 5,
///
/// Short Range - Fast
ShortFast = 6,
///
/// Long Range - Moderately Fast
LongModerate = 7,
///
/// Short Range - Turbo
/// This is the fastest preset and the only one with 500kHz bandwidth.
/// It is not legal to use in all regions due to this wider bandwidth.
ShortTurbo = 8,
}
impl ModemPreset {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::LongFast => "LONG_FAST",
Self::LongSlow => "LONG_SLOW",
Self::VeryLongSlow => "VERY_LONG_SLOW",
Self::MediumSlow => "MEDIUM_SLOW",
Self::MediumFast => "MEDIUM_FAST",
Self::ShortSlow => "SHORT_SLOW",
Self::ShortFast => "SHORT_FAST",
Self::LongModerate => "LONG_MODERATE",
Self::ShortTurbo => "SHORT_TURBO",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LONG_FAST" => Some(Self::LongFast),
"LONG_SLOW" => Some(Self::LongSlow),
"VERY_LONG_SLOW" => Some(Self::VeryLongSlow),
"MEDIUM_SLOW" => Some(Self::MediumSlow),
"MEDIUM_FAST" => Some(Self::MediumFast),
"SHORT_SLOW" => Some(Self::ShortSlow),
"SHORT_FAST" => Some(Self::ShortFast),
"LONG_MODERATE" => Some(Self::LongModerate),
"SHORT_TURBO" => Some(Self::ShortTurbo),
_ => None,
}
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BluetoothConfig {
///
/// Enable Bluetooth on the device
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// Determines the pairing strategy for the device
#[prost(enumeration = "bluetooth_config::PairingMode", tag = "2")]
pub mode: i32,
///
/// Specified PIN for PairingMode.FixedPin
#[prost(uint32, tag = "3")]
pub fixed_pin: u32,
}
/// Nested message and enum types in `BluetoothConfig`.
pub mod bluetooth_config {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PairingMode {
///
/// Device generates a random PIN that will be shown on the screen of the device for pairing
RandomPin = 0,
///
/// Device requires a specified fixed PIN for pairing
FixedPin = 1,
///
/// Device requires no PIN for pairing
NoPin = 2,
}
impl PairingMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::RandomPin => "RANDOM_PIN",
Self::FixedPin => "FIXED_PIN",
Self::NoPin => "NO_PIN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RANDOM_PIN" => Some(Self::RandomPin),
"FIXED_PIN" => Some(Self::FixedPin),
"NO_PIN" => Some(Self::NoPin),
_ => None,
}
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SecurityConfig {
///
/// The public key of the user's device.
/// Sent out to other nodes on the mesh to allow them to compute a shared secret key.
#[prost(bytes = "vec", tag = "1")]
pub public_key: ::prost::alloc::vec::Vec<u8>,
///
/// The private key of the device.
/// Used to create a shared key with a remote device.
#[prost(bytes = "vec", tag = "2")]
pub private_key: ::prost::alloc::vec::Vec<u8>,
///
/// The public key authorized to send admin messages to this node.
#[prost(bytes = "vec", repeated, tag = "3")]
pub admin_key: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
///
/// If true, device is considered to be "managed" by a mesh administrator via admin messages
/// Device is managed by a mesh administrator.
#[prost(bool, tag = "4")]
pub is_managed: bool,
///
/// Serial Console over the Stream API."
#[prost(bool, tag = "5")]
pub serial_enabled: bool,
///
/// By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
/// Output live debug logging over serial or bluetooth is set to true.
#[prost(bool, tag = "6")]
pub debug_log_api_enabled: bool,
///
/// Allow incoming device control over the insecure legacy admin channel.
#[prost(bool, tag = "8")]
pub admin_channel_enabled: bool,
}
///
/// Blank config request, strictly for getting the session key
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SessionkeyConfig {}
///
/// Payload Variant
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PayloadVariant {
#[prost(message, tag = "1")]
Device(DeviceConfig),
#[prost(message, tag = "2")]
Position(PositionConfig),
#[prost(message, tag = "3")]
Power(PowerConfig),
#[prost(message, tag = "4")]
Network(NetworkConfig),
#[prost(message, tag = "5")]
Display(DisplayConfig),
#[prost(message, tag = "6")]
Lora(LoRaConfig),
#[prost(message, tag = "7")]
Bluetooth(BluetoothConfig),
#[prost(message, tag = "8")]
Security(SecurityConfig),
#[prost(message, tag = "9")]
Sessionkey(SessionkeyConfig),
#[prost(message, tag = "10")]
DeviceUi(super::DeviceUiConfig),
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceConnectionStatus {
///
/// WiFi Status
#[prost(message, optional, tag = "1")]
pub wifi: ::core::option::Option<WifiConnectionStatus>,
///
/// WiFi Status
#[prost(message, optional, tag = "2")]
pub ethernet: ::core::option::Option<EthernetConnectionStatus>,
///
/// Bluetooth Status
#[prost(message, optional, tag = "3")]
pub bluetooth: ::core::option::Option<BluetoothConnectionStatus>,
///
/// Serial Status
#[prost(message, optional, tag = "4")]
pub serial: ::core::option::Option<SerialConnectionStatus>,
}
///
/// WiFi connection status
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WifiConnectionStatus {
///
/// Connection status
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<NetworkConnectionStatus>,
///
/// WiFi access point SSID
#[prost(string, tag = "2")]
pub ssid: ::prost::alloc::string::String,
///
/// RSSI of wireless connection
#[prost(int32, tag = "3")]
pub rssi: i32,
}
///
/// Ethernet connection status
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EthernetConnectionStatus {
///
/// Connection status
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<NetworkConnectionStatus>,
}
///
/// Ethernet or WiFi connection status
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetworkConnectionStatus {
///
/// IP address of device
#[prost(fixed32, tag = "1")]
pub ip_address: u32,
///
/// Whether the device has an active connection or not
#[prost(bool, tag = "2")]
pub is_connected: bool,
///
/// Whether the device has an active connection to an MQTT broker or not
#[prost(bool, tag = "3")]
pub is_mqtt_connected: bool,
///
/// Whether the device is actively remote syslogging or not
#[prost(bool, tag = "4")]
pub is_syslog_connected: bool,
}
///
/// Bluetooth connection status
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BluetoothConnectionStatus {
///
/// The pairing PIN for bluetooth
#[prost(uint32, tag = "1")]
pub pin: u32,
///
/// RSSI of bluetooth connection
#[prost(int32, tag = "2")]
pub rssi: i32,
///
/// Whether the device has an active connection or not
#[prost(bool, tag = "3")]
pub is_connected: bool,
}
///
/// Serial connection status
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SerialConnectionStatus {
///
/// Serial baud rate
#[prost(uint32, tag = "1")]
pub baud: u32,
///
/// Whether the device has an active connection or not
#[prost(bool, tag = "2")]
pub is_connected: bool,
}
///
/// Module Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModuleConfig {
///
/// TODO: REPLACE
#[prost(
oneof = "module_config::PayloadVariant",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13"
)]
pub payload_variant: ::core::option::Option<module_config::PayloadVariant>,
}
/// Nested message and enum types in `ModuleConfig`.
pub mod module_config {
///
/// MQTT Client Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MqttConfig {
///
/// If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as
/// is_uplink_enabled or is_downlink_enabled.
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// The server to use for our MQTT global message gateway feature.
/// If not set, the default server will be used
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
///
/// MQTT username to use (most useful for a custom MQTT server).
/// If using a custom server, this will be honoured even if empty.
/// If using the default server, this will only be honoured if set, otherwise the device will use the default username
#[prost(string, tag = "3")]
pub username: ::prost::alloc::string::String,
///
/// MQTT password to use (most useful for a custom MQTT server).
/// If using a custom server, this will be honoured even if empty.
/// If using the default server, this will only be honoured if set, otherwise the device will use the default password
#[prost(string, tag = "4")]
pub password: ::prost::alloc::string::String,
///
/// Whether to send encrypted or decrypted packets to MQTT.
/// This parameter is only honoured if you also set server
/// (the default official mqtt.meshtastic.org server can handle encrypted packets)
/// Decrypted packets may be useful for external systems that want to consume meshtastic packets
#[prost(bool, tag = "5")]
pub encryption_enabled: bool,
///
/// Whether to send / consume json packets on MQTT
#[prost(bool, tag = "6")]
pub json_enabled: bool,
///
/// If true, we attempt to establish a secure connection using TLS
#[prost(bool, tag = "7")]
pub tls_enabled: bool,
///
/// The root topic to use for MQTT messages. Default is "msh".
/// This is useful if you want to use a single MQTT server for multiple meshtastic networks and separate them via ACLs
#[prost(string, tag = "8")]
pub root: ::prost::alloc::string::String,
///
/// If true, we can use the connected phone / client to proxy messages to MQTT instead of a direct connection
#[prost(bool, tag = "9")]
pub proxy_to_client_enabled: bool,
///
/// If true, we will periodically report unencrypted information about our node to a map via MQTT
#[prost(bool, tag = "10")]
pub map_reporting_enabled: bool,
///
/// Settings for reporting information about our node to a map via MQTT
#[prost(message, optional, tag = "11")]
pub map_report_settings: ::core::option::Option<MapReportSettings>,
}
///
/// Settings for reporting unencrypted information about our node to a map via MQTT
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MapReportSettings {
///
/// How often we should report our info to the map (in seconds)
#[prost(uint32, tag = "1")]
pub publish_interval_secs: u32,
///
/// Bits of precision for the location sent (default of 32 is full precision).
#[prost(uint32, tag = "2")]
pub position_precision: u32,
///
/// Whether we have opted-in to report our location to the map
#[prost(bool, tag = "3")]
pub should_report_location: bool,
}
///
/// RemoteHardwareModule Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoteHardwareConfig {
///
/// Whether the Module is enabled
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// Whether the Module allows consumers to read / write to pins not defined in available_pins
#[prost(bool, tag = "2")]
pub allow_undefined_pin_access: bool,
///
/// Exposes the available pins to the mesh for reading and writing
#[prost(message, repeated, tag = "3")]
pub available_pins: ::prost::alloc::vec::Vec<super::RemoteHardwarePin>,
}
///
/// NeighborInfoModule Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NeighborInfoConfig {
///
/// Whether the Module is enabled
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// Interval in seconds of how often we should try to send our
/// Neighbor Info (minimum is 14400, i.e., 4 hours)
#[prost(uint32, tag = "2")]
pub update_interval: u32,
///
/// Whether in addition to sending it to MQTT and the PhoneAPI, our NeighborInfo should be transmitted over LoRa.
/// Note that this is not available on a channel with default key and name.
#[prost(bool, tag = "3")]
pub transmit_over_lora: bool,
}
///
/// Detection Sensor Module Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DetectionSensorConfig {
///
/// Whether the Module is enabled
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// Interval in seconds of how often we can send a message to the mesh when a
/// trigger event is detected
#[prost(uint32, tag = "2")]
pub minimum_broadcast_secs: u32,
///
/// Interval in seconds of how often we should send a message to the mesh
/// with the current state regardless of trigger events When set to 0, only
/// trigger events will be broadcasted Works as a sort of status heartbeat
/// for peace of mind
#[prost(uint32, tag = "3")]
pub state_broadcast_secs: u32,
///
/// Send ASCII bell with alert message
/// Useful for triggering ext. notification on bell
#[prost(bool, tag = "4")]
pub send_bell: bool,
///
/// Friendly name used to format message sent to mesh
/// Example: A name "Motion" would result in a message "Motion detected"
/// Maximum length of 20 characters
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
///
/// GPIO pin to monitor for state changes
#[prost(uint32, tag = "6")]
pub monitor_pin: u32,
///
/// The type of trigger event to be used
#[prost(enumeration = "detection_sensor_config::TriggerType", tag = "7")]
pub detection_trigger_type: i32,
///
/// Whether or not use INPUT_PULLUP mode for GPIO pin
/// Only applicable if the board uses pull-up resistors on the pin
#[prost(bool, tag = "8")]
pub use_pullup: bool,
}
/// Nested message and enum types in `DetectionSensorConfig`.
pub mod detection_sensor_config {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TriggerType {
/// Event is triggered if pin is low
LogicLow = 0,
/// Event is triggered if pin is high
LogicHigh = 1,
/// Event is triggered when pin goes high to low
FallingEdge = 2,
/// Event is triggered when pin goes low to high
RisingEdge = 3,
/// Event is triggered on every pin state change, low is considered to be
/// "active"
EitherEdgeActiveLow = 4,
/// Event is triggered on every pin state change, high is considered to be
/// "active"
EitherEdgeActiveHigh = 5,
}
impl TriggerType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::LogicLow => "LOGIC_LOW",
Self::LogicHigh => "LOGIC_HIGH",
Self::FallingEdge => "FALLING_EDGE",
Self::RisingEdge => "RISING_EDGE",
Self::EitherEdgeActiveLow => "EITHER_EDGE_ACTIVE_LOW",
Self::EitherEdgeActiveHigh => "EITHER_EDGE_ACTIVE_HIGH",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LOGIC_LOW" => Some(Self::LogicLow),
"LOGIC_HIGH" => Some(Self::LogicHigh),
"FALLING_EDGE" => Some(Self::FallingEdge),
"RISING_EDGE" => Some(Self::RisingEdge),
"EITHER_EDGE_ACTIVE_LOW" => Some(Self::EitherEdgeActiveLow),
"EITHER_EDGE_ACTIVE_HIGH" => Some(Self::EitherEdgeActiveHigh),
_ => None,
}
}
}
}
///
/// Audio Config for codec2 voice
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AudioConfig {
///
/// Whether Audio is enabled
#[prost(bool, tag = "1")]
pub codec2_enabled: bool,
///
/// PTT Pin
#[prost(uint32, tag = "2")]
pub ptt_pin: u32,
///
/// The audio sample rate to use for codec2
#[prost(enumeration = "audio_config::AudioBaud", tag = "3")]
pub bitrate: i32,
///
/// I2S Word Select
#[prost(uint32, tag = "4")]
pub i2s_ws: u32,
///
/// I2S Data IN
#[prost(uint32, tag = "5")]
pub i2s_sd: u32,
///
/// I2S Data OUT
#[prost(uint32, tag = "6")]
pub i2s_din: u32,
///
/// I2S Clock
#[prost(uint32, tag = "7")]
pub i2s_sck: u32,
}
/// Nested message and enum types in `AudioConfig`.
pub mod audio_config {
///
/// Baudrate for codec2 voice
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AudioBaud {
Codec2Default = 0,
Codec23200 = 1,
Codec22400 = 2,
Codec21600 = 3,
Codec21400 = 4,
Codec21300 = 5,
Codec21200 = 6,
Codec2700 = 7,
Codec2700b = 8,
}
impl AudioBaud {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Codec2Default => "CODEC2_DEFAULT",
Self::Codec23200 => "CODEC2_3200",
Self::Codec22400 => "CODEC2_2400",
Self::Codec21600 => "CODEC2_1600",
Self::Codec21400 => "CODEC2_1400",
Self::Codec21300 => "CODEC2_1300",
Self::Codec21200 => "CODEC2_1200",
Self::Codec2700 => "CODEC2_700",
Self::Codec2700b => "CODEC2_700B",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CODEC2_DEFAULT" => Some(Self::Codec2Default),
"CODEC2_3200" => Some(Self::Codec23200),
"CODEC2_2400" => Some(Self::Codec22400),
"CODEC2_1600" => Some(Self::Codec21600),
"CODEC2_1400" => Some(Self::Codec21400),
"CODEC2_1300" => Some(Self::Codec21300),
"CODEC2_1200" => Some(Self::Codec21200),
"CODEC2_700" => Some(Self::Codec2700),
"CODEC2_700B" => Some(Self::Codec2700b),
_ => None,
}
}
}
}
///
/// Config for the Paxcounter Module
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PaxcounterConfig {
///
/// Enable the Paxcounter Module
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(uint32, tag = "2")]
pub paxcounter_update_interval: u32,
///
/// WiFi RSSI threshold. Defaults to -80
#[prost(int32, tag = "3")]
pub wifi_threshold: i32,
///
/// BLE RSSI threshold. Defaults to -80
#[prost(int32, tag = "4")]
pub ble_threshold: i32,
}
///
/// Serial Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SerialConfig {
///
/// Preferences for the SerialModule
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// TODO: REPLACE
#[prost(bool, tag = "2")]
pub echo: bool,
///
/// RX pin (should match Arduino gpio pin number)
#[prost(uint32, tag = "3")]
pub rxd: u32,
///
/// TX pin (should match Arduino gpio pin number)
#[prost(uint32, tag = "4")]
pub txd: u32,
///
/// Serial baud rate
#[prost(enumeration = "serial_config::SerialBaud", tag = "5")]
pub baud: i32,
///
/// TODO: REPLACE
#[prost(uint32, tag = "6")]
pub timeout: u32,
///
/// Mode for serial module operation
#[prost(enumeration = "serial_config::SerialMode", tag = "7")]
pub mode: i32,
///
/// Overrides the platform's defacto Serial port instance to use with Serial module config settings
/// This is currently only usable in output modes like NMEA / CalTopo and may behave strangely or not work at all in other modes
/// Existing logging over the Serial Console will still be present
#[prost(bool, tag = "8")]
pub override_console_serial_port: bool,
}
/// Nested message and enum types in `SerialConfig`.
pub mod serial_config {
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SerialBaud {
BaudDefault = 0,
Baud110 = 1,
Baud300 = 2,
Baud600 = 3,
Baud1200 = 4,
Baud2400 = 5,
Baud4800 = 6,
Baud9600 = 7,
Baud19200 = 8,
Baud38400 = 9,
Baud57600 = 10,
Baud115200 = 11,
Baud230400 = 12,
Baud460800 = 13,
Baud576000 = 14,
Baud921600 = 15,
}
impl SerialBaud {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::BaudDefault => "BAUD_DEFAULT",
Self::Baud110 => "BAUD_110",
Self::Baud300 => "BAUD_300",
Self::Baud600 => "BAUD_600",
Self::Baud1200 => "BAUD_1200",
Self::Baud2400 => "BAUD_2400",
Self::Baud4800 => "BAUD_4800",
Self::Baud9600 => "BAUD_9600",
Self::Baud19200 => "BAUD_19200",
Self::Baud38400 => "BAUD_38400",
Self::Baud57600 => "BAUD_57600",
Self::Baud115200 => "BAUD_115200",
Self::Baud230400 => "BAUD_230400",
Self::Baud460800 => "BAUD_460800",
Self::Baud576000 => "BAUD_576000",
Self::Baud921600 => "BAUD_921600",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BAUD_DEFAULT" => Some(Self::BaudDefault),
"BAUD_110" => Some(Self::Baud110),
"BAUD_300" => Some(Self::Baud300),
"BAUD_600" => Some(Self::Baud600),
"BAUD_1200" => Some(Self::Baud1200),
"BAUD_2400" => Some(Self::Baud2400),
"BAUD_4800" => Some(Self::Baud4800),
"BAUD_9600" => Some(Self::Baud9600),
"BAUD_19200" => Some(Self::Baud19200),
"BAUD_38400" => Some(Self::Baud38400),
"BAUD_57600" => Some(Self::Baud57600),
"BAUD_115200" => Some(Self::Baud115200),
"BAUD_230400" => Some(Self::Baud230400),
"BAUD_460800" => Some(Self::Baud460800),
"BAUD_576000" => Some(Self::Baud576000),
"BAUD_921600" => Some(Self::Baud921600),
_ => None,
}
}
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SerialMode {
Default = 0,
Simple = 1,
Proto = 2,
Textmsg = 3,
Nmea = 4,
/// NMEA messages specifically tailored for CalTopo
Caltopo = 5,
/// Ecowitt WS85 weather station
Ws85 = 6,
/// VE.Direct is a serial protocol used by Victron Energy products
/// <https://beta.ivc.no/wiki/index.php/Victron_VE_Direct_DIY_Cable>
VeDirect = 7,
/// Used to configure and view some parameters of MeshSolar.
/// <https://heltec.org/project/meshsolar/>
MsConfig = 8,
}
impl SerialMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Default => "DEFAULT",
Self::Simple => "SIMPLE",
Self::Proto => "PROTO",
Self::Textmsg => "TEXTMSG",
Self::Nmea => "NMEA",
Self::Caltopo => "CALTOPO",
Self::Ws85 => "WS85",
Self::VeDirect => "VE_DIRECT",
Self::MsConfig => "MS_CONFIG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT" => Some(Self::Default),
"SIMPLE" => Some(Self::Simple),
"PROTO" => Some(Self::Proto),
"TEXTMSG" => Some(Self::Textmsg),
"NMEA" => Some(Self::Nmea),
"CALTOPO" => Some(Self::Caltopo),
"WS85" => Some(Self::Ws85),
"VE_DIRECT" => Some(Self::VeDirect),
"MS_CONFIG" => Some(Self::MsConfig),
_ => None,
}
}
}
}
///
/// External Notifications Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExternalNotificationConfig {
///
/// Enable the ExternalNotificationModule
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// When using in On/Off mode, keep the output on for this many
/// milliseconds. Default 1000ms (1 second).
#[prost(uint32, tag = "2")]
pub output_ms: u32,
///
/// Define the output pin GPIO setting Defaults to
/// EXT_NOTIFY_OUT if set for the board.
/// In standalone devices this pin should drive the LED to match the UI.
#[prost(uint32, tag = "3")]
pub output: u32,
///
/// Optional: Define a secondary output pin for a vibra motor
/// This is used in standalone devices to match the UI.
#[prost(uint32, tag = "8")]
pub output_vibra: u32,
///
/// Optional: Define a tertiary output pin for an active buzzer
/// This is used in standalone devices to to match the UI.
#[prost(uint32, tag = "9")]
pub output_buzzer: u32,
///
/// IF this is true, the 'output' Pin will be pulled active high, false
/// means active low.
#[prost(bool, tag = "4")]
pub active: bool,
///
/// True: Alert when a text message arrives (output)
#[prost(bool, tag = "5")]
pub alert_message: bool,
///
/// True: Alert when a text message arrives (output_vibra)
#[prost(bool, tag = "10")]
pub alert_message_vibra: bool,
///
/// True: Alert when a text message arrives (output_buzzer)
#[prost(bool, tag = "11")]
pub alert_message_buzzer: bool,
///
/// True: Alert when the bell character is received (output)
#[prost(bool, tag = "6")]
pub alert_bell: bool,
///
/// True: Alert when the bell character is received (output_vibra)
#[prost(bool, tag = "12")]
pub alert_bell_vibra: bool,
///
/// True: Alert when the bell character is received (output_buzzer)
#[prost(bool, tag = "13")]
pub alert_bell_buzzer: bool,
///
/// use a PWM output instead of a simple on/off output. This will ignore
/// the 'output', 'output_ms' and 'active' settings and use the
/// device.buzzer_gpio instead.
#[prost(bool, tag = "7")]
pub use_pwm: bool,
///
/// The notification will toggle with 'output_ms' for this time of seconds.
/// Default is 0 which means don't repeat at all. 60 would mean blink
/// and/or beep for 60 seconds
#[prost(uint32, tag = "14")]
pub nag_timeout: u32,
///
/// When true, enables devices with native I2S audio output to use the RTTTL over speaker like a buzzer
/// T-Watch S3 and T-Deck for example have this capability
#[prost(bool, tag = "15")]
pub use_i2s_as_buzzer: bool,
}
///
/// Store and Forward Module Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StoreForwardConfig {
///
/// Enable the Store and Forward Module
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// TODO: REPLACE
#[prost(bool, tag = "2")]
pub heartbeat: bool,
///
/// TODO: REPLACE
#[prost(uint32, tag = "3")]
pub records: u32,
///
/// TODO: REPLACE
#[prost(uint32, tag = "4")]
pub history_return_max: u32,
///
/// TODO: REPLACE
#[prost(uint32, tag = "5")]
pub history_return_window: u32,
///
/// Set to true to let this node act as a server that stores received messages and resends them upon request.
#[prost(bool, tag = "6")]
pub is_server: bool,
}
///
/// Preferences for the RangeTestModule
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RangeTestConfig {
///
/// Enable the Range Test Module
#[prost(bool, tag = "1")]
pub enabled: bool,
///
/// Send out range test messages from this node
#[prost(uint32, tag = "2")]
pub sender: u32,
///
/// Bool value indicating that this node should save a RangeTest.csv file.
/// ESP32 Only
#[prost(bool, tag = "3")]
pub save: bool,
}
///
/// Configuration for both device and environment metrics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TelemetryConfig {
///
/// Interval in seconds of how often we should try to send our
/// device metrics to the mesh
#[prost(uint32, tag = "1")]
pub device_update_interval: u32,
#[prost(uint32, tag = "2")]
pub environment_update_interval: u32,
///
/// Preferences for the Telemetry Module (Environment)
/// Enable/Disable the telemetry measurement module measurement collection
#[prost(bool, tag = "3")]
pub environment_measurement_enabled: bool,
///
/// Enable/Disable the telemetry measurement module on-device display
#[prost(bool, tag = "4")]
pub environment_screen_enabled: bool,
///
/// We'll always read the sensor in Celsius, but sometimes we might want to
/// display the results in Fahrenheit as a "user preference".
#[prost(bool, tag = "5")]
pub environment_display_fahrenheit: bool,
///
/// Enable/Disable the air quality metrics
#[prost(bool, tag = "6")]
pub air_quality_enabled: bool,
///
/// Interval in seconds of how often we should try to send our
/// air quality metrics to the mesh
#[prost(uint32, tag = "7")]
pub air_quality_interval: u32,
///
/// Enable/disable Power metrics
#[prost(bool, tag = "8")]
pub power_measurement_enabled: bool,
///
/// Interval in seconds of how often we should try to send our
/// power metrics to the mesh
#[prost(uint32, tag = "9")]
pub power_update_interval: u32,
///
/// Enable/Disable the power measurement module on-device display
#[prost(bool, tag = "10")]
pub power_screen_enabled: bool,
///
/// Preferences for the (Health) Telemetry Module
/// Enable/Disable the telemetry measurement module measurement collection
#[prost(bool, tag = "11")]
pub health_measurement_enabled: bool,
///
/// Interval in seconds of how often we should try to send our
/// health metrics to the mesh
#[prost(uint32, tag = "12")]
pub health_update_interval: u32,
///
/// Enable/Disable the health telemetry module on-device display
#[prost(bool, tag = "13")]
pub health_screen_enabled: bool,
}
///
/// Canned Messages Module Config
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CannedMessageConfig {
///
/// Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating.
#[prost(bool, tag = "1")]
pub rotary1_enabled: bool,
///
/// GPIO pin for rotary encoder A port.
#[prost(uint32, tag = "2")]
pub inputbroker_pin_a: u32,
///
/// GPIO pin for rotary encoder B port.
#[prost(uint32, tag = "3")]
pub inputbroker_pin_b: u32,
///
/// GPIO pin for rotary encoder Press port.
#[prost(uint32, tag = "4")]
pub inputbroker_pin_press: u32,
///
/// Generate input event on CW of this kind.
#[prost(enumeration = "canned_message_config::InputEventChar", tag = "5")]
pub inputbroker_event_cw: i32,
///
/// Generate input event on CCW of this kind.
#[prost(enumeration = "canned_message_config::InputEventChar", tag = "6")]
pub inputbroker_event_ccw: i32,
///
/// Generate input event on Press of this kind.
#[prost(enumeration = "canned_message_config::InputEventChar", tag = "7")]
pub inputbroker_event_press: i32,
///
/// Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker.
#[prost(bool, tag = "8")]
pub updown1_enabled: bool,
///
/// Enable/disable CannedMessageModule.
#[deprecated]
#[prost(bool, tag = "9")]
pub enabled: bool,
///
/// Input event origin accepted by the canned message module.
/// Can be e.g. "rotEnc1", "upDownEnc1", "scanAndSelect", "cardkb", "serialkb", or keyword "_any"
#[deprecated]
#[prost(string, tag = "10")]
pub allow_input_source: ::prost::alloc::string::String,
///
/// CannedMessageModule also sends a bell character with the messages.
/// ExternalNotificationModule can benefit from this feature.
#[prost(bool, tag = "11")]
pub send_bell: bool,
}
/// Nested message and enum types in `CannedMessageConfig`.
pub mod canned_message_config {
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InputEventChar {
///
/// TODO: REPLACE
None = 0,
///
/// TODO: REPLACE
Up = 17,
///
/// TODO: REPLACE
Down = 18,
///
/// TODO: REPLACE
Left = 19,
///
/// TODO: REPLACE
Right = 20,
///
/// '\n'
Select = 10,
///
/// TODO: REPLACE
Back = 27,
///
/// TODO: REPLACE
Cancel = 24,
}
impl InputEventChar {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "NONE",
Self::Up => "UP",
Self::Down => "DOWN",
Self::Left => "LEFT",
Self::Right => "RIGHT",
Self::Select => "SELECT",
Self::Back => "BACK",
Self::Cancel => "CANCEL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NONE" => Some(Self::None),
"UP" => Some(Self::Up),
"DOWN" => Some(Self::Down),
"LEFT" => Some(Self::Left),
"RIGHT" => Some(Self::Right),
"SELECT" => Some(Self::Select),
"BACK" => Some(Self::Back),
"CANCEL" => Some(Self::Cancel),
_ => None,
}
}
}
}
///
/// Ambient Lighting Module - Settings for control of onboard LEDs to allow users to adjust the brightness levels and respective color levels.
/// Initially created for the RAK14001 RGB LED module.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AmbientLightingConfig {
///
/// Sets LED to on or off.
#[prost(bool, tag = "1")]
pub led_state: bool,
///
/// Sets the current for the LED output. Default is 10.
#[prost(uint32, tag = "2")]
pub current: u32,
///
/// Sets the red LED level. Values are 0-255.
#[prost(uint32, tag = "3")]
pub red: u32,
///
/// Sets the green LED level. Values are 0-255.
#[prost(uint32, tag = "4")]
pub green: u32,
///
/// Sets the blue LED level. Values are 0-255.
#[prost(uint32, tag = "5")]
pub blue: u32,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// TODO: REPLACE
#[prost(message, tag = "1")]
Mqtt(MqttConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "2")]
Serial(SerialConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "3")]
ExternalNotification(ExternalNotificationConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "4")]
StoreForward(StoreForwardConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "5")]
RangeTest(RangeTestConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "6")]
Telemetry(TelemetryConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "7")]
CannedMessage(CannedMessageConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "8")]
Audio(AudioConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "9")]
RemoteHardware(RemoteHardwareConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "10")]
NeighborInfo(NeighborInfoConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "11")]
AmbientLighting(AmbientLightingConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "12")]
DetectionSensor(DetectionSensorConfig),
///
/// TODO: REPLACE
#[prost(message, tag = "13")]
Paxcounter(PaxcounterConfig),
}
}
///
/// A GPIO pin definition for remote hardware module
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoteHardwarePin {
///
/// GPIO Pin number (must match Arduino)
#[prost(uint32, tag = "1")]
pub gpio_pin: u32,
///
/// Name for the GPIO pin (i.e. Front gate, mailbox, etc)
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
///
/// Type of GPIO access available to consumers on the mesh
#[prost(enumeration = "RemoteHardwarePinType", tag = "3")]
pub r#type: i32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RemoteHardwarePinType {
///
/// Unset/unused
Unknown = 0,
///
/// GPIO pin can be read (if it is high / low)
DigitalRead = 1,
///
/// GPIO pin can be written to (high / low)
DigitalWrite = 2,
}
impl RemoteHardwarePinType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::DigitalRead => "DIGITAL_READ",
Self::DigitalWrite => "DIGITAL_WRITE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"DIGITAL_READ" => Some(Self::DigitalRead),
"DIGITAL_WRITE" => Some(Self::DigitalWrite),
_ => None,
}
}
}
///
/// For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a
/// unique 'portnum' for their application.
/// If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this
/// master table.
/// PortNums should be assigned in the following range:
/// 0-63 Core Meshtastic use, do not use for third party apps
/// 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application
/// 256-511 Use one of these portnums for your private applications that you don't want to register publically
/// All other values are reserved.
/// Note: This was formerly a Type enum named 'typ' with the same id #
/// We have change to this 'portnum' based scheme for specifying app handlers for particular payloads.
/// This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PortNum {
///
/// Deprecated: do not use in new code (formerly called OPAQUE)
/// A message sent from a device outside of the mesh, in a form the mesh does not understand
/// NOTE: This must be 0, because it is documented in IMeshService.aidl to be so
/// ENCODING: binary undefined
UnknownApp = 0,
///
/// A simple UTF-8 text message, which even the little micros in the mesh
/// can understand and show on their screen eventually in some circumstances
/// even signal might send messages in this form (see below)
/// ENCODING: UTF-8 Plaintext (?)
TextMessageApp = 1,
///
/// Reserved for built-in GPIO/example app.
/// See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number
/// ENCODING: Protobuf
RemoteHardwareApp = 2,
///
/// The built-in position messaging app.
/// Payload is a Position message.
/// ENCODING: Protobuf
PositionApp = 3,
///
/// The built-in user info app.
/// Payload is a User message.
/// ENCODING: Protobuf
NodeinfoApp = 4,
///
/// Protocol control packets for mesh protocol use.
/// Payload is a Routing message.
/// ENCODING: Protobuf
RoutingApp = 5,
///
/// Admin control packets.
/// Payload is a AdminMessage message.
/// ENCODING: Protobuf
AdminApp = 6,
///
/// Compressed TEXT_MESSAGE payloads.
/// ENCODING: UTF-8 Plaintext (?) with Unishox2 Compression
/// NOTE: The Device Firmware converts a TEXT_MESSAGE_APP to TEXT_MESSAGE_COMPRESSED_APP if the compressed
/// payload is shorter. There's no need for app developers to do this themselves. Also the firmware will decompress
/// any incoming TEXT_MESSAGE_COMPRESSED_APP payload and convert to TEXT_MESSAGE_APP.
TextMessageCompressedApp = 7,
///
/// Waypoint payloads.
/// Payload is a Waypoint message.
/// ENCODING: Protobuf
WaypointApp = 8,
///
/// Audio Payloads.
/// Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now
/// ENCODING: codec2 audio frames
/// NOTE: audio frames contain a 3 byte header (0xc0 0xde 0xc2) and a one byte marker for the decompressed bitrate.
/// This marker comes from the 'moduleConfig.audio.bitrate' enum minus one.
AudioApp = 9,
///
/// Same as Text Message but originating from Detection Sensor Module.
/// NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
DetectionSensorApp = 10,
///
/// Same as Text Message but used for critical alerts.
AlertApp = 11,
///
/// Module/port for handling key verification requests.
KeyVerificationApp = 12,
///
/// Provides a 'ping' service that replies to any packet it receives.
/// Also serves as a small example module.
/// ENCODING: ASCII Plaintext
ReplyApp = 32,
///
/// Used for the python IP tunnel feature
/// ENCODING: IP Packet. Handled by the python API, firmware ignores this one and pases on.
IpTunnelApp = 33,
///
/// Paxcounter lib included in the firmware
/// ENCODING: protobuf
PaxcounterApp = 34,
///
/// Provides a hardware serial interface to send and receive from the Meshtastic network.
/// Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
/// network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network.
/// Maximum packet size of 240 bytes.
/// Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp.
/// ENCODING: binary undefined
SerialApp = 64,
///
/// STORE_FORWARD_APP (Work in Progress)
/// Maintained by Jm Casler (MC Hamster) : jm@casler.org
/// ENCODING: Protobuf
StoreForwardApp = 65,
///
/// Optional port for messages for the range test module.
/// ENCODING: ASCII Plaintext
/// NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
RangeTestApp = 66,
///
/// Provides a format to send and receive telemetry data from the Meshtastic network.
/// Maintained by Charles Crossan (crossan007) : crossan007@gmail.com
/// ENCODING: Protobuf
TelemetryApp = 67,
///
/// Experimental tools for estimating node position without a GPS
/// Maintained by Github user a-f-G-U-C (a Meshtastic contributor)
/// Project files at <https://github.com/a-f-G-U-C/Meshtastic-ZPS>
/// ENCODING: arrays of int64 fields
ZpsApp = 68,
///
/// Used to let multiple instances of Linux native applications communicate
/// as if they did using their LoRa chip.
/// Maintained by GitHub user GUVWAF.
/// Project files at <https://github.com/GUVWAF/Meshtasticator>
/// ENCODING: Protobuf (?)
SimulatorApp = 69,
///
/// Provides a traceroute functionality to show the route a packet towards
/// a certain destination would take on the mesh. Contains a RouteDiscovery message as payload.
/// ENCODING: Protobuf
TracerouteApp = 70,
///
/// Aggregates edge info for the network by sending out a list of each node's neighbors
/// ENCODING: Protobuf
NeighborinfoApp = 71,
///
/// ATAK Plugin
/// Portnum for payloads from the official Meshtastic ATAK plugin
AtakPlugin = 72,
///
/// Provides unencrypted information about a node for consumption by a map via MQTT
MapReportApp = 73,
///
/// PowerStress based monitoring support (for automated power consumption testing)
PowerstressApp = 74,
///
/// Reticulum Network Stack Tunnel App
/// ENCODING: Fragmented RNS Packet. Handled by Meshtastic RNS interface
ReticulumTunnelApp = 76,
///
/// App for transporting Cayenne Low Power Payload, popular for LoRaWAN sensor nodes. Offers ability to send
/// arbitrary telemetry over meshtastic that is not covered by telemetry.proto
/// ENCODING: CayenneLLP
CayenneApp = 77,
///
/// Private applications should use portnums >= 256.
/// To simplify initial development and testing you can use "PRIVATE_APP"
/// in your code without needing to rebuild protobuf files (via [regen-protos.sh](<https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh>))
PrivateApp = 256,
///
/// ATAK Forwarder Module <https://github.com/paulmandal/atak-forwarder>
/// ENCODING: libcotshrink
AtakForwarder = 257,
///
/// Currently we limit port nums to no higher than this value
Max = 511,
}
impl PortNum {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnknownApp => "UNKNOWN_APP",
Self::TextMessageApp => "TEXT_MESSAGE_APP",
Self::RemoteHardwareApp => "REMOTE_HARDWARE_APP",
Self::PositionApp => "POSITION_APP",
Self::NodeinfoApp => "NODEINFO_APP",
Self::RoutingApp => "ROUTING_APP",
Self::AdminApp => "ADMIN_APP",
Self::TextMessageCompressedApp => "TEXT_MESSAGE_COMPRESSED_APP",
Self::WaypointApp => "WAYPOINT_APP",
Self::AudioApp => "AUDIO_APP",
Self::DetectionSensorApp => "DETECTION_SENSOR_APP",
Self::AlertApp => "ALERT_APP",
Self::KeyVerificationApp => "KEY_VERIFICATION_APP",
Self::ReplyApp => "REPLY_APP",
Self::IpTunnelApp => "IP_TUNNEL_APP",
Self::PaxcounterApp => "PAXCOUNTER_APP",
Self::SerialApp => "SERIAL_APP",
Self::StoreForwardApp => "STORE_FORWARD_APP",
Self::RangeTestApp => "RANGE_TEST_APP",
Self::TelemetryApp => "TELEMETRY_APP",
Self::ZpsApp => "ZPS_APP",
Self::SimulatorApp => "SIMULATOR_APP",
Self::TracerouteApp => "TRACEROUTE_APP",
Self::NeighborinfoApp => "NEIGHBORINFO_APP",
Self::AtakPlugin => "ATAK_PLUGIN",
Self::MapReportApp => "MAP_REPORT_APP",
Self::PowerstressApp => "POWERSTRESS_APP",
Self::ReticulumTunnelApp => "RETICULUM_TUNNEL_APP",
Self::CayenneApp => "CAYENNE_APP",
Self::PrivateApp => "PRIVATE_APP",
Self::AtakForwarder => "ATAK_FORWARDER",
Self::Max => "MAX",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN_APP" => Some(Self::UnknownApp),
"TEXT_MESSAGE_APP" => Some(Self::TextMessageApp),
"REMOTE_HARDWARE_APP" => Some(Self::RemoteHardwareApp),
"POSITION_APP" => Some(Self::PositionApp),
"NODEINFO_APP" => Some(Self::NodeinfoApp),
"ROUTING_APP" => Some(Self::RoutingApp),
"ADMIN_APP" => Some(Self::AdminApp),
"TEXT_MESSAGE_COMPRESSED_APP" => Some(Self::TextMessageCompressedApp),
"WAYPOINT_APP" => Some(Self::WaypointApp),
"AUDIO_APP" => Some(Self::AudioApp),
"DETECTION_SENSOR_APP" => Some(Self::DetectionSensorApp),
"ALERT_APP" => Some(Self::AlertApp),
"KEY_VERIFICATION_APP" => Some(Self::KeyVerificationApp),
"REPLY_APP" => Some(Self::ReplyApp),
"IP_TUNNEL_APP" => Some(Self::IpTunnelApp),
"PAXCOUNTER_APP" => Some(Self::PaxcounterApp),
"SERIAL_APP" => Some(Self::SerialApp),
"STORE_FORWARD_APP" => Some(Self::StoreForwardApp),
"RANGE_TEST_APP" => Some(Self::RangeTestApp),
"TELEMETRY_APP" => Some(Self::TelemetryApp),
"ZPS_APP" => Some(Self::ZpsApp),
"SIMULATOR_APP" => Some(Self::SimulatorApp),
"TRACEROUTE_APP" => Some(Self::TracerouteApp),
"NEIGHBORINFO_APP" => Some(Self::NeighborinfoApp),
"ATAK_PLUGIN" => Some(Self::AtakPlugin),
"MAP_REPORT_APP" => Some(Self::MapReportApp),
"POWERSTRESS_APP" => Some(Self::PowerstressApp),
"RETICULUM_TUNNEL_APP" => Some(Self::ReticulumTunnelApp),
"CAYENNE_APP" => Some(Self::CayenneApp),
"PRIVATE_APP" => Some(Self::PrivateApp),
"ATAK_FORWARDER" => Some(Self::AtakForwarder),
"MAX" => Some(Self::Max),
_ => None,
}
}
}
///
/// Key native device metrics such as battery level
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeviceMetrics {
///
/// 0-100 (>100 means powered)
#[prost(uint32, optional, tag = "1")]
pub battery_level: ::core::option::Option<u32>,
///
/// Voltage measured
#[prost(float, optional, tag = "2")]
pub voltage: ::core::option::Option<f32>,
///
/// Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
#[prost(float, optional, tag = "3")]
pub channel_utilization: ::core::option::Option<f32>,
///
/// Percent of airtime for transmission used within the last hour.
#[prost(float, optional, tag = "4")]
pub air_util_tx: ::core::option::Option<f32>,
///
/// How long the device has been running since the last reboot (in seconds)
#[prost(uint32, optional, tag = "5")]
pub uptime_seconds: ::core::option::Option<u32>,
}
///
/// Weather station or other environmental metrics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct EnvironmentMetrics {
///
/// Temperature measured
#[prost(float, optional, tag = "1")]
pub temperature: ::core::option::Option<f32>,
///
/// Relative humidity percent measured
#[prost(float, optional, tag = "2")]
pub relative_humidity: ::core::option::Option<f32>,
///
/// Barometric pressure in hPA measured
#[prost(float, optional, tag = "3")]
pub barometric_pressure: ::core::option::Option<f32>,
///
/// Gas resistance in MOhm measured
#[prost(float, optional, tag = "4")]
pub gas_resistance: ::core::option::Option<f32>,
///
/// Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
#[prost(float, optional, tag = "5")]
pub voltage: ::core::option::Option<f32>,
///
/// Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
#[prost(float, optional, tag = "6")]
pub current: ::core::option::Option<f32>,
///
/// relative scale IAQ value as measured by Bosch BME680 . value 0-500.
/// Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here.
#[prost(uint32, optional, tag = "7")]
pub iaq: ::core::option::Option<u32>,
///
/// RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm.
#[prost(float, optional, tag = "8")]
pub distance: ::core::option::Option<f32>,
///
/// VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor.
#[prost(float, optional, tag = "9")]
pub lux: ::core::option::Option<f32>,
///
/// VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor.
#[prost(float, optional, tag = "10")]
pub white_lux: ::core::option::Option<f32>,
///
/// Infrared lux
#[prost(float, optional, tag = "11")]
pub ir_lux: ::core::option::Option<f32>,
///
/// Ultraviolet lux
#[prost(float, optional, tag = "12")]
pub uv_lux: ::core::option::Option<f32>,
///
/// Wind direction in degrees
/// 0 degrees = North, 90 = East, etc...
#[prost(uint32, optional, tag = "13")]
pub wind_direction: ::core::option::Option<u32>,
///
/// Wind speed in m/s
#[prost(float, optional, tag = "14")]
pub wind_speed: ::core::option::Option<f32>,
///
/// Weight in KG
#[prost(float, optional, tag = "15")]
pub weight: ::core::option::Option<f32>,
///
/// Wind gust in m/s
#[prost(float, optional, tag = "16")]
pub wind_gust: ::core::option::Option<f32>,
///
/// Wind lull in m/s
#[prost(float, optional, tag = "17")]
pub wind_lull: ::core::option::Option<f32>,
///
/// Radiation in µR/h
#[prost(float, optional, tag = "18")]
pub radiation: ::core::option::Option<f32>,
///
/// Rainfall in the last hour in mm
#[prost(float, optional, tag = "19")]
pub rainfall_1h: ::core::option::Option<f32>,
///
/// Rainfall in the last 24 hours in mm
#[prost(float, optional, tag = "20")]
pub rainfall_24h: ::core::option::Option<f32>,
///
/// Soil moisture measured (% 1-100)
#[prost(uint32, optional, tag = "21")]
pub soil_moisture: ::core::option::Option<u32>,
///
/// Soil temperature measured (*C)
#[prost(float, optional, tag = "22")]
pub soil_temperature: ::core::option::Option<f32>,
}
///
/// Power Metrics (voltage / current / etc)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PowerMetrics {
///
/// Voltage (Ch1)
#[prost(float, optional, tag = "1")]
pub ch1_voltage: ::core::option::Option<f32>,
///
/// Current (Ch1)
#[prost(float, optional, tag = "2")]
pub ch1_current: ::core::option::Option<f32>,
///
/// Voltage (Ch2)
#[prost(float, optional, tag = "3")]
pub ch2_voltage: ::core::option::Option<f32>,
///
/// Current (Ch2)
#[prost(float, optional, tag = "4")]
pub ch2_current: ::core::option::Option<f32>,
///
/// Voltage (Ch3)
#[prost(float, optional, tag = "5")]
pub ch3_voltage: ::core::option::Option<f32>,
///
/// Current (Ch3)
#[prost(float, optional, tag = "6")]
pub ch3_current: ::core::option::Option<f32>,
///
/// Voltage (Ch4)
#[prost(float, optional, tag = "7")]
pub ch4_voltage: ::core::option::Option<f32>,
///
/// Current (Ch4)
#[prost(float, optional, tag = "8")]
pub ch4_current: ::core::option::Option<f32>,
///
/// Voltage (Ch5)
#[prost(float, optional, tag = "9")]
pub ch5_voltage: ::core::option::Option<f32>,
///
/// Current (Ch5)
#[prost(float, optional, tag = "10")]
pub ch5_current: ::core::option::Option<f32>,
///
/// Voltage (Ch6)
#[prost(float, optional, tag = "11")]
pub ch6_voltage: ::core::option::Option<f32>,
///
/// Current (Ch6)
#[prost(float, optional, tag = "12")]
pub ch6_current: ::core::option::Option<f32>,
///
/// Voltage (Ch7)
#[prost(float, optional, tag = "13")]
pub ch7_voltage: ::core::option::Option<f32>,
///
/// Current (Ch7)
#[prost(float, optional, tag = "14")]
pub ch7_current: ::core::option::Option<f32>,
///
/// Voltage (Ch8)
#[prost(float, optional, tag = "15")]
pub ch8_voltage: ::core::option::Option<f32>,
///
/// Current (Ch8)
#[prost(float, optional, tag = "16")]
pub ch8_current: ::core::option::Option<f32>,
}
///
/// Air quality metrics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AirQualityMetrics {
///
/// Concentration Units Standard PM1.0 in ug/m3
#[prost(uint32, optional, tag = "1")]
pub pm10_standard: ::core::option::Option<u32>,
///
/// Concentration Units Standard PM2.5 in ug/m3
#[prost(uint32, optional, tag = "2")]
pub pm25_standard: ::core::option::Option<u32>,
///
/// Concentration Units Standard PM10.0 in ug/m3
#[prost(uint32, optional, tag = "3")]
pub pm100_standard: ::core::option::Option<u32>,
///
/// Concentration Units Environmental PM1.0 in ug/m3
#[prost(uint32, optional, tag = "4")]
pub pm10_environmental: ::core::option::Option<u32>,
///
/// Concentration Units Environmental PM2.5 in ug/m3
#[prost(uint32, optional, tag = "5")]
pub pm25_environmental: ::core::option::Option<u32>,
///
/// Concentration Units Environmental PM10.0 in ug/m3
#[prost(uint32, optional, tag = "6")]
pub pm100_environmental: ::core::option::Option<u32>,
///
/// 0.3um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "7")]
pub particles_03um: ::core::option::Option<u32>,
///
/// 0.5um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "8")]
pub particles_05um: ::core::option::Option<u32>,
///
/// 1.0um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "9")]
pub particles_10um: ::core::option::Option<u32>,
///
/// 2.5um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "10")]
pub particles_25um: ::core::option::Option<u32>,
///
/// 5.0um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "11")]
pub particles_50um: ::core::option::Option<u32>,
///
/// 10.0um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "12")]
pub particles_100um: ::core::option::Option<u32>,
///
/// CO2 concentration in ppm
#[prost(uint32, optional, tag = "13")]
pub co2: ::core::option::Option<u32>,
///
/// CO2 sensor temperature in degC
#[prost(float, optional, tag = "14")]
pub co2_temperature: ::core::option::Option<f32>,
///
/// CO2 sensor relative humidity in %
#[prost(float, optional, tag = "15")]
pub co2_humidity: ::core::option::Option<f32>,
///
/// Formaldehyde sensor formaldehyde concentration in ppb
#[prost(float, optional, tag = "16")]
pub form_formaldehyde: ::core::option::Option<f32>,
///
/// Formaldehyde sensor relative humidity in %RH
#[prost(float, optional, tag = "17")]
pub form_humidity: ::core::option::Option<f32>,
///
/// Formaldehyde sensor temperature in degrees Celsius
#[prost(float, optional, tag = "18")]
pub form_temperature: ::core::option::Option<f32>,
///
/// Concentration Units Standard PM4.0 in ug/m3
#[prost(uint32, optional, tag = "19")]
pub pm40_standard: ::core::option::Option<u32>,
///
/// 4.0um Particle Count in #/0.1l
#[prost(uint32, optional, tag = "20")]
pub particles_40um: ::core::option::Option<u32>,
///
/// PM Sensor Temperature
#[prost(float, optional, tag = "21")]
pub pm_temperature: ::core::option::Option<f32>,
///
/// PM Sensor humidity
#[prost(float, optional, tag = "22")]
pub pm_humidity: ::core::option::Option<f32>,
///
/// PM Sensor VOC Index
#[prost(float, optional, tag = "23")]
pub pm_voc_idx: ::core::option::Option<f32>,
///
/// PM Sensor NOx Index
#[prost(float, optional, tag = "24")]
pub pm_nox_idx: ::core::option::Option<f32>,
///
/// Typical Particle Size in um
#[prost(float, optional, tag = "25")]
pub particles_tps: ::core::option::Option<f32>,
}
///
/// Local device mesh statistics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LocalStats {
///
/// How long the device has been running since the last reboot (in seconds)
#[prost(uint32, tag = "1")]
pub uptime_seconds: u32,
///
/// Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
#[prost(float, tag = "2")]
pub channel_utilization: f32,
///
/// Percent of airtime for transmission used within the last hour.
#[prost(float, tag = "3")]
pub air_util_tx: f32,
///
/// Number of packets sent
#[prost(uint32, tag = "4")]
pub num_packets_tx: u32,
///
/// Number of packets received (both good and bad)
#[prost(uint32, tag = "5")]
pub num_packets_rx: u32,
///
/// Number of packets received that are malformed or violate the protocol
#[prost(uint32, tag = "6")]
pub num_packets_rx_bad: u32,
///
/// Number of nodes online (in the past 2 hours)
#[prost(uint32, tag = "7")]
pub num_online_nodes: u32,
///
/// Number of nodes total
#[prost(uint32, tag = "8")]
pub num_total_nodes: u32,
///
/// Number of received packets that were duplicates (due to multiple nodes relaying).
/// If this number is high, there are nodes in the mesh relaying packets when it's unnecessary, for example due to the ROUTER/REPEATER role.
#[prost(uint32, tag = "9")]
pub num_rx_dupe: u32,
///
/// Number of packets we transmitted that were a relay for others (not originating from ourselves).
#[prost(uint32, tag = "10")]
pub num_tx_relay: u32,
///
/// Number of times we canceled a packet to be relayed, because someone else did it before us.
/// This will always be zero for ROUTERs/REPEATERs. If this number is high, some other node(s) is/are relaying faster than you.
#[prost(uint32, tag = "11")]
pub num_tx_relay_canceled: u32,
///
/// Number of bytes used in the heap
#[prost(uint32, tag = "12")]
pub heap_total_bytes: u32,
///
/// Number of bytes free in the heap
#[prost(uint32, tag = "13")]
pub heap_free_bytes: u32,
}
///
/// Health telemetry metrics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HealthMetrics {
///
/// Heart rate (beats per minute)
#[prost(uint32, optional, tag = "1")]
pub heart_bpm: ::core::option::Option<u32>,
///
/// SpO2 (blood oxygen saturation) level
#[prost(uint32, optional, tag = "2")]
pub sp_o2: ::core::option::Option<u32>,
///
/// Body temperature in degrees Celsius
#[prost(float, optional, tag = "3")]
pub temperature: ::core::option::Option<f32>,
}
///
/// Linux host metrics
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HostMetrics {
///
/// Host system uptime
#[prost(uint32, tag = "1")]
pub uptime_seconds: u32,
///
/// Host system free memory
#[prost(uint64, tag = "2")]
pub freemem_bytes: u64,
///
/// Host system disk space free for /
#[prost(uint64, tag = "3")]
pub diskfree1_bytes: u64,
///
/// Secondary system disk space free
#[prost(uint64, optional, tag = "4")]
pub diskfree2_bytes: ::core::option::Option<u64>,
///
/// Tertiary disk space free
#[prost(uint64, optional, tag = "5")]
pub diskfree3_bytes: ::core::option::Option<u64>,
///
/// Host system one minute load in 1/100ths
#[prost(uint32, tag = "6")]
pub load1: u32,
///
/// Host system five minute load in 1/100ths
#[prost(uint32, tag = "7")]
pub load5: u32,
///
/// Host system fifteen minute load in 1/100ths
#[prost(uint32, tag = "8")]
pub load15: u32,
///
/// Optional User-provided string for arbitrary host system information
/// that doesn't make sense as a dedicated entry.
#[prost(string, optional, tag = "9")]
pub user_string: ::core::option::Option<::prost::alloc::string::String>,
}
///
/// Types of Measurements the telemetry module is equipped to handle
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Telemetry {
///
/// Seconds since 1970 - or 0 for unknown/unset
#[prost(fixed32, tag = "1")]
pub time: u32,
#[prost(oneof = "telemetry::Variant", tags = "2, 3, 4, 5, 6, 7, 8")]
pub variant: ::core::option::Option<telemetry::Variant>,
}
/// Nested message and enum types in `Telemetry`.
pub mod telemetry {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Variant {
///
/// Key native device metrics such as battery level
#[prost(message, tag = "2")]
DeviceMetrics(super::DeviceMetrics),
///
/// Weather station or other environmental metrics
#[prost(message, tag = "3")]
EnvironmentMetrics(super::EnvironmentMetrics),
///
/// Air quality metrics
#[prost(message, tag = "4")]
AirQualityMetrics(super::AirQualityMetrics),
///
/// Power Metrics
#[prost(message, tag = "5")]
PowerMetrics(super::PowerMetrics),
///
/// Local device mesh statistics
#[prost(message, tag = "6")]
LocalStats(super::LocalStats),
///
/// Health telemetry metrics
#[prost(message, tag = "7")]
HealthMetrics(super::HealthMetrics),
///
/// Linux host metrics
#[prost(message, tag = "8")]
HostMetrics(super::HostMetrics),
}
}
///
/// NAU7802 Telemetry configuration, for saving to flash
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Nau7802Config {
///
/// The offset setting for the NAU7802
#[prost(int32, tag = "1")]
pub zero_offset: i32,
///
/// The calibration factor for the NAU7802
#[prost(float, tag = "2")]
pub calibration_factor: f32,
}
///
/// Supported I2C Sensors for telemetry in Meshtastic
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TelemetrySensorType {
///
/// No external telemetry sensor explicitly set
SensorUnset = 0,
///
/// High accuracy temperature, pressure, humidity
Bme280 = 1,
///
/// High accuracy temperature, pressure, humidity, and air resistance
Bme680 = 2,
///
/// Very high accuracy temperature
Mcp9808 = 3,
///
/// Moderate accuracy current and voltage
Ina260 = 4,
///
/// Moderate accuracy current and voltage
Ina219 = 5,
///
/// High accuracy temperature and pressure
Bmp280 = 6,
///
/// High accuracy temperature and humidity
Shtc3 = 7,
///
/// High accuracy pressure
Lps22 = 8,
///
/// 3-Axis magnetic sensor
Qmc6310 = 9,
///
/// 6-Axis inertial measurement sensor
Qmi8658 = 10,
///
/// 3-Axis magnetic sensor
Qmc5883l = 11,
///
/// High accuracy temperature and humidity
Sht31 = 12,
///
/// PM2.5 air quality sensor
Pmsa003i = 13,
///
/// INA3221 3 Channel Voltage / Current Sensor
Ina3221 = 14,
///
/// BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280)
Bmp085 = 15,
///
/// RCWL-9620 Doppler Radar Distance Sensor, used for water level detection
Rcwl9620 = 16,
///
/// Sensirion High accuracy temperature and humidity
Sht4x = 17,
///
/// VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor.
Veml7700 = 18,
///
/// MLX90632 non-contact IR temperature sensor.
Mlx90632 = 19,
///
/// TI OPT3001 Ambient Light Sensor
Opt3001 = 20,
///
/// Lite On LTR-390UV-01 UV Light Sensor
Ltr390uv = 21,
///
/// AMS TSL25911FN RGB Light Sensor
Tsl25911fn = 22,
///
/// AHT10 Integrated temperature and humidity sensor
Aht10 = 23,
///
/// DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction)
DfrobotLark = 24,
///
/// NAU7802 Scale Chip or compatible
Nau7802 = 25,
///
/// BMP3XX High accuracy temperature and pressure
Bmp3xx = 26,
///
/// ICM-20948 9-Axis digital motion processor
Icm20948 = 27,
///
/// MAX17048 1S lipo battery sensor (voltage, state of charge, time to go)
Max17048 = 28,
///
/// Custom I2C sensor implementation based on <https://github.com/meshtastic/i2c-sensor>
CustomSensor = 29,
///
/// MAX30102 Pulse Oximeter and Heart-Rate Sensor
Max30102 = 30,
///
/// MLX90614 non-contact IR temperature sensor
Mlx90614 = 31,
///
/// SCD40/SCD41 CO2, humidity, temperature sensor
Scd4x = 32,
///
/// ClimateGuard RadSens, radiation, Geiger-Muller Tube
Radsens = 33,
///
/// High accuracy current and voltage
Ina226 = 34,
///
/// DFRobot Gravity tipping bucket rain gauge
DfrobotRain = 35,
///
/// Infineon DPS310 High accuracy pressure and temperature
Dps310 = 36,
///
/// RAKWireless RAK12035 Soil Moisture Sensor Module
Rak12035 = 37,
///
/// MAX17261 lipo battery gauge
Max17261 = 38,
///
/// PCT2075 Temperature Sensor
Pct2075 = 39,
///
/// ADS1X15 ADC
Ads1x15 = 40,
///
/// ADS1X15 ADC_ALT
Ads1x15Alt = 41,
///
/// Sensirion SFA30 Formaldehyde sensor
Sfa30 = 42,
///
/// SEN5X PM SENSORS
Sen5x = 43,
///
/// TSL2561 light sensor
Tsl2561 = 44,
}
impl TelemetrySensorType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::SensorUnset => "SENSOR_UNSET",
Self::Bme280 => "BME280",
Self::Bme680 => "BME680",
Self::Mcp9808 => "MCP9808",
Self::Ina260 => "INA260",
Self::Ina219 => "INA219",
Self::Bmp280 => "BMP280",
Self::Shtc3 => "SHTC3",
Self::Lps22 => "LPS22",
Self::Qmc6310 => "QMC6310",
Self::Qmi8658 => "QMI8658",
Self::Qmc5883l => "QMC5883L",
Self::Sht31 => "SHT31",
Self::Pmsa003i => "PMSA003I",
Self::Ina3221 => "INA3221",
Self::Bmp085 => "BMP085",
Self::Rcwl9620 => "RCWL9620",
Self::Sht4x => "SHT4X",
Self::Veml7700 => "VEML7700",
Self::Mlx90632 => "MLX90632",
Self::Opt3001 => "OPT3001",
Self::Ltr390uv => "LTR390UV",
Self::Tsl25911fn => "TSL25911FN",
Self::Aht10 => "AHT10",
Self::DfrobotLark => "DFROBOT_LARK",
Self::Nau7802 => "NAU7802",
Self::Bmp3xx => "BMP3XX",
Self::Icm20948 => "ICM20948",
Self::Max17048 => "MAX17048",
Self::CustomSensor => "CUSTOM_SENSOR",
Self::Max30102 => "MAX30102",
Self::Mlx90614 => "MLX90614",
Self::Scd4x => "SCD4X",
Self::Radsens => "RADSENS",
Self::Ina226 => "INA226",
Self::DfrobotRain => "DFROBOT_RAIN",
Self::Dps310 => "DPS310",
Self::Rak12035 => "RAK12035",
Self::Max17261 => "MAX17261",
Self::Pct2075 => "PCT2075",
Self::Ads1x15 => "ADS1X15",
Self::Ads1x15Alt => "ADS1X15_ALT",
Self::Sfa30 => "SFA30",
Self::Sen5x => "SEN5X",
Self::Tsl2561 => "TSL2561",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SENSOR_UNSET" => Some(Self::SensorUnset),
"BME280" => Some(Self::Bme280),
"BME680" => Some(Self::Bme680),
"MCP9808" => Some(Self::Mcp9808),
"INA260" => Some(Self::Ina260),
"INA219" => Some(Self::Ina219),
"BMP280" => Some(Self::Bmp280),
"SHTC3" => Some(Self::Shtc3),
"LPS22" => Some(Self::Lps22),
"QMC6310" => Some(Self::Qmc6310),
"QMI8658" => Some(Self::Qmi8658),
"QMC5883L" => Some(Self::Qmc5883l),
"SHT31" => Some(Self::Sht31),
"PMSA003I" => Some(Self::Pmsa003i),
"INA3221" => Some(Self::Ina3221),
"BMP085" => Some(Self::Bmp085),
"RCWL9620" => Some(Self::Rcwl9620),
"SHT4X" => Some(Self::Sht4x),
"VEML7700" => Some(Self::Veml7700),
"MLX90632" => Some(Self::Mlx90632),
"OPT3001" => Some(Self::Opt3001),
"LTR390UV" => Some(Self::Ltr390uv),
"TSL25911FN" => Some(Self::Tsl25911fn),
"AHT10" => Some(Self::Aht10),
"DFROBOT_LARK" => Some(Self::DfrobotLark),
"NAU7802" => Some(Self::Nau7802),
"BMP3XX" => Some(Self::Bmp3xx),
"ICM20948" => Some(Self::Icm20948),
"MAX17048" => Some(Self::Max17048),
"CUSTOM_SENSOR" => Some(Self::CustomSensor),
"MAX30102" => Some(Self::Max30102),
"MLX90614" => Some(Self::Mlx90614),
"SCD4X" => Some(Self::Scd4x),
"RADSENS" => Some(Self::Radsens),
"INA226" => Some(Self::Ina226),
"DFROBOT_RAIN" => Some(Self::DfrobotRain),
"DPS310" => Some(Self::Dps310),
"RAK12035" => Some(Self::Rak12035),
"MAX17261" => Some(Self::Max17261),
"PCT2075" => Some(Self::Pct2075),
"ADS1X15" => Some(Self::Ads1x15),
"ADS1X15_ALT" => Some(Self::Ads1x15Alt),
"SFA30" => Some(Self::Sfa30),
"SEN5X" => Some(Self::Sen5x),
"TSL2561" => Some(Self::Tsl2561),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct XModem {
#[prost(enumeration = "x_modem::Control", tag = "1")]
pub control: i32,
#[prost(uint32, tag = "2")]
pub seq: u32,
#[prost(uint32, tag = "3")]
pub crc16: u32,
#[prost(bytes = "vec", tag = "4")]
pub buffer: ::prost::alloc::vec::Vec<u8>,
}
/// Nested message and enum types in `XModem`.
pub mod x_modem {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Control {
Nul = 0,
Soh = 1,
Stx = 2,
Eot = 4,
Ack = 6,
Nak = 21,
Can = 24,
Ctrlz = 26,
}
impl Control {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Nul => "NUL",
Self::Soh => "SOH",
Self::Stx => "STX",
Self::Eot => "EOT",
Self::Ack => "ACK",
Self::Nak => "NAK",
Self::Can => "CAN",
Self::Ctrlz => "CTRLZ",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NUL" => Some(Self::Nul),
"SOH" => Some(Self::Soh),
"STX" => Some(Self::Stx),
"EOT" => Some(Self::Eot),
"ACK" => Some(Self::Ack),
"NAK" => Some(Self::Nak),
"CAN" => Some(Self::Can),
"CTRLZ" => Some(Self::Ctrlz),
_ => None,
}
}
}
}
///
/// A GPS Position
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Position {
///
/// The new preferred location encoding, multiply by 1e-7 to get degrees
/// in floating point
#[prost(sfixed32, optional, tag = "1")]
pub latitude_i: ::core::option::Option<i32>,
///
/// TODO: REPLACE
#[prost(sfixed32, optional, tag = "2")]
pub longitude_i: ::core::option::Option<i32>,
///
/// In meters above MSL (but see issue #359)
#[prost(int32, optional, tag = "3")]
pub altitude: ::core::option::Option<i32>,
///
/// 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 time if it is sent over
/// the mesh (because there are devices on the mesh without GPS or RTC).
/// seconds since 1970
#[prost(fixed32, tag = "4")]
pub time: u32,
///
/// TODO: REPLACE
#[prost(enumeration = "position::LocSource", tag = "5")]
pub location_source: i32,
///
/// TODO: REPLACE
#[prost(enumeration = "position::AltSource", tag = "6")]
pub altitude_source: i32,
///
/// Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds
#[prost(fixed32, tag = "7")]
pub timestamp: u32,
///
/// Pos. timestamp milliseconds adjustment (rarely available or required)
#[prost(int32, tag = "8")]
pub timestamp_millis_adjust: i32,
///
/// HAE altitude in meters - can be used instead of MSL altitude
#[prost(sint32, optional, tag = "9")]
pub altitude_hae: ::core::option::Option<i32>,
///
/// Geoidal separation in meters
#[prost(sint32, optional, tag = "10")]
pub altitude_geoidal_separation: ::core::option::Option<i32>,
///
/// 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
#[prost(uint32, tag = "11")]
pub pdop: u32,
///
/// TODO: REPLACE
#[prost(uint32, tag = "12")]
pub hdop: u32,
///
/// TODO: REPLACE
#[prost(uint32, tag = "13")]
pub vdop: u32,
///
/// GPS accuracy (a hardware specific constant) in mm
/// multiplied with DOP to calculate positional accuracy
/// Default: "'bout three meters-ish" :)
#[prost(uint32, tag = "14")]
pub gps_accuracy: u32,
///
/// 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
#[prost(uint32, optional, tag = "15")]
pub ground_speed: ::core::option::Option<u32>,
///
/// TODO: REPLACE
#[prost(uint32, optional, tag = "16")]
pub ground_track: ::core::option::Option<u32>,
///
/// GPS fix quality (from NMEA GxGGA statement or similar)
#[prost(uint32, tag = "17")]
pub fix_quality: u32,
///
/// GPS fix type 2D/3D (from NMEA GxGSA statement)
#[prost(uint32, tag = "18")]
pub fix_type: u32,
///
/// GPS "Satellites in View" number
#[prost(uint32, tag = "19")]
pub sats_in_view: u32,
///
/// Sensor ID - in case multiple positioning sensors are being used
#[prost(uint32, tag = "20")]
pub sensor_id: u32,
///
/// 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
#[prost(uint32, tag = "21")]
pub next_update: u32,
///
/// A sequence number, incremented with each Position message to help
/// detect lost updates if needed
#[prost(uint32, tag = "22")]
pub seq_number: u32,
///
/// Indicates the bits of precision set by the sending node
#[prost(uint32, tag = "23")]
pub precision_bits: u32,
}
/// Nested message and enum types in `Position`.
pub mod position {
///
/// How the location was acquired: manual, onboard GPS, external (EUD) GPS
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum LocSource {
///
/// TODO: REPLACE
LocUnset = 0,
///
/// TODO: REPLACE
LocManual = 1,
///
/// TODO: REPLACE
LocInternal = 2,
///
/// TODO: REPLACE
LocExternal = 3,
}
impl LocSource {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::LocUnset => "LOC_UNSET",
Self::LocManual => "LOC_MANUAL",
Self::LocInternal => "LOC_INTERNAL",
Self::LocExternal => "LOC_EXTERNAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LOC_UNSET" => Some(Self::LocUnset),
"LOC_MANUAL" => Some(Self::LocManual),
"LOC_INTERNAL" => Some(Self::LocInternal),
"LOC_EXTERNAL" => Some(Self::LocExternal),
_ => None,
}
}
}
///
/// How the altitude was acquired: manual, GPS int/ext, etc
/// Default: same as location_source if present
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AltSource {
///
/// TODO: REPLACE
AltUnset = 0,
///
/// TODO: REPLACE
AltManual = 1,
///
/// TODO: REPLACE
AltInternal = 2,
///
/// TODO: REPLACE
AltExternal = 3,
///
/// TODO: REPLACE
AltBarometric = 4,
}
impl AltSource {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AltUnset => "ALT_UNSET",
Self::AltManual => "ALT_MANUAL",
Self::AltInternal => "ALT_INTERNAL",
Self::AltExternal => "ALT_EXTERNAL",
Self::AltBarometric => "ALT_BAROMETRIC",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALT_UNSET" => Some(Self::AltUnset),
"ALT_MANUAL" => Some(Self::AltManual),
"ALT_INTERNAL" => Some(Self::AltInternal),
"ALT_EXTERNAL" => Some(Self::AltExternal),
"ALT_BAROMETRIC" => Some(Self::AltBarometric),
_ => None,
}
}
}
}
///
/// 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
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct 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)
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
///
/// A full name for this user, i.e. "Kevin Hester"
#[prost(string, tag = "2")]
pub long_name: ::prost::alloc::string::String,
///
/// A VERY short name, ideally two characters.
/// Suitable for a tiny OLED screen
#[prost(string, tag = "3")]
pub short_name: ::prost::alloc::string::String,
///
/// Deprecated in Meshtastic 2.1.x
/// This is the addr of the radio.
/// Not populated by the phone, but added by the esp32 when broadcasting
#[deprecated]
#[prost(bytes = "vec", tag = "4")]
pub macaddr: ::prost::alloc::vec::Vec<u8>,
///
/// 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.
#[prost(enumeration = "HardwareModel", tag = "5")]
pub hw_model: i32,
///
/// 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.
#[prost(bool, tag = "6")]
pub is_licensed: bool,
///
/// Indicates that the user's role in the mesh
#[prost(enumeration = "config::device_config::Role", tag = "7")]
pub role: i32,
///
/// The public key of the user's device.
/// This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
#[prost(bytes = "vec", tag = "8")]
pub public_key: ::prost::alloc::vec::Vec<u8>,
///
/// Whether or not the node can be messaged
#[prost(bool, optional, tag = "9")]
pub is_unmessagable: ::core::option::Option<bool>,
}
///
/// A message used in a traceroute
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RouteDiscovery {
///
/// The list of nodenums this packet has visited so far to the destination.
#[prost(fixed32, repeated, tag = "1")]
pub route: ::prost::alloc::vec::Vec<u32>,
///
/// The list of SNRs (in dB, scaled by 4) in the route towards the destination.
#[prost(int32, repeated, tag = "2")]
pub snr_towards: ::prost::alloc::vec::Vec<i32>,
///
/// The list of nodenums the packet has visited on the way back from the destination.
#[prost(fixed32, repeated, tag = "3")]
pub route_back: ::prost::alloc::vec::Vec<u32>,
///
/// The list of SNRs (in dB, scaled by 4) in the route back from the destination.
#[prost(int32, repeated, tag = "4")]
pub snr_back: ::prost::alloc::vec::Vec<i32>,
}
///
/// A Routing control Data packet handled by the routing module
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Routing {
#[prost(oneof = "routing::Variant", tags = "1, 2, 3")]
pub variant: ::core::option::Option<routing::Variant>,
}
/// Nested message and enum types in `Routing`.
pub mod 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).
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Error {
///
/// This message is not a failure
None = 0,
///
/// Our node doesn't have a route to the requested destination anymore.
NoRoute = 1,
///
/// We received a nak while trying to forward on your behalf
GotNak = 2,
///
/// TODO: REPLACE
Timeout = 3,
///
/// No suitable interface could be found for delivering this packet
NoInterface = 4,
///
/// We reached the max retransmission count (typically for naive flood routing)
MaxRetransmit = 5,
///
/// No suitable channel was found for sending this packet (i.e. was requested channel index disabled?)
NoChannel = 6,
///
/// The packet was too big for sending (exceeds interface MTU after encoding)
TooLarge = 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)
NoResponse = 8,
///
/// Cannot send currently because duty cycle regulations will be violated.
DutyCycleLimit = 9,
///
/// The application layer service on the remote node received your request, but considered your request somehow invalid
BadRequest = 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)
NotAuthorized = 33,
///
/// The client specified a PKI transport, but the node was unable to send the packet using PKI (and did not send the message at all)
PkiFailed = 34,
///
/// The receiving node does not have a Public Key to decode with
PkiUnknownPubkey = 35,
///
/// Admin packet otherwise checks out, but uses a bogus or expired session key
AdminBadSessionKey = 36,
///
/// Admin packet sent using PKC, but not from a public key on the admin key list
AdminPublicKeyUnauthorized = 37,
///
/// Airtime fairness rate limit exceeded for a packet
/// This typically enforced per portnum and is used to prevent a single node from monopolizing airtime
RateLimitExceeded = 38,
}
impl Error {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "NONE",
Self::NoRoute => "NO_ROUTE",
Self::GotNak => "GOT_NAK",
Self::Timeout => "TIMEOUT",
Self::NoInterface => "NO_INTERFACE",
Self::MaxRetransmit => "MAX_RETRANSMIT",
Self::NoChannel => "NO_CHANNEL",
Self::TooLarge => "TOO_LARGE",
Self::NoResponse => "NO_RESPONSE",
Self::DutyCycleLimit => "DUTY_CYCLE_LIMIT",
Self::BadRequest => "BAD_REQUEST",
Self::NotAuthorized => "NOT_AUTHORIZED",
Self::PkiFailed => "PKI_FAILED",
Self::PkiUnknownPubkey => "PKI_UNKNOWN_PUBKEY",
Self::AdminBadSessionKey => "ADMIN_BAD_SESSION_KEY",
Self::AdminPublicKeyUnauthorized => "ADMIN_PUBLIC_KEY_UNAUTHORIZED",
Self::RateLimitExceeded => "RATE_LIMIT_EXCEEDED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NONE" => Some(Self::None),
"NO_ROUTE" => Some(Self::NoRoute),
"GOT_NAK" => Some(Self::GotNak),
"TIMEOUT" => Some(Self::Timeout),
"NO_INTERFACE" => Some(Self::NoInterface),
"MAX_RETRANSMIT" => Some(Self::MaxRetransmit),
"NO_CHANNEL" => Some(Self::NoChannel),
"TOO_LARGE" => Some(Self::TooLarge),
"NO_RESPONSE" => Some(Self::NoResponse),
"DUTY_CYCLE_LIMIT" => Some(Self::DutyCycleLimit),
"BAD_REQUEST" => Some(Self::BadRequest),
"NOT_AUTHORIZED" => Some(Self::NotAuthorized),
"PKI_FAILED" => Some(Self::PkiFailed),
"PKI_UNKNOWN_PUBKEY" => Some(Self::PkiUnknownPubkey),
"ADMIN_BAD_SESSION_KEY" => Some(Self::AdminBadSessionKey),
"ADMIN_PUBLIC_KEY_UNAUTHORIZED" => Some(Self::AdminPublicKeyUnauthorized),
"RATE_LIMIT_EXCEEDED" => Some(Self::RateLimitExceeded),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
///
/// A route request going from the requester
#[prost(message, tag = "1")]
RouteRequest(super::RouteDiscovery),
///
/// A route reply
#[prost(message, tag = "2")]
RouteReply(super::RouteDiscovery),
///
/// 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).
#[prost(enumeration = "Error", tag = "3")]
ErrorReason(i32),
}
}
///
/// (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)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Data {
///
/// Formerly named typ and of type Type
#[prost(enumeration = "PortNum", tag = "1")]
pub portnum: i32,
///
/// TODO: REPLACE
#[prost(bytes = "vec", tag = "2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
///
/// 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.
#[prost(bool, tag = "3")]
pub want_response: bool,
///
/// 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.
#[prost(fixed32, tag = "4")]
pub dest: u32,
///
/// The address of the original sender for this message.
/// This field should _only_ be populated for reliable multihop packets (to keep
/// packets small).
#[prost(fixed32, tag = "5")]
pub source: u32,
///
/// Only used in routing or response messages.
/// Indicates the original message ID that this message is reporting failure on. (formerly called original_id)
#[prost(fixed32, tag = "6")]
pub request_id: u32,
///
/// If set, this message is intened to be a reply to a previously sent message with the defined id.
#[prost(fixed32, tag = "7")]
pub reply_id: u32,
///
/// 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.
#[prost(fixed32, tag = "8")]
pub emoji: u32,
///
/// Bitfield for extra flags. First use is to indicate that user approves the packet being uploaded to MQTT.
#[prost(uint32, optional, tag = "9")]
pub bitfield: ::core::option::Option<u32>,
}
///
/// The actual over-the-mesh message doing KeyVerification
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyVerification {
///
/// random value Selected by the requesting node
#[prost(uint64, tag = "1")]
pub nonce: u64,
///
/// The final authoritative hash, only to be sent by NodeA at the end of the handshake
#[prost(bytes = "vec", tag = "2")]
pub hash1: ::prost::alloc::vec::Vec<u8>,
///
/// The intermediary hash (actually derived from hash1),
/// sent from NodeB to NodeA in response to the initial message.
#[prost(bytes = "vec", tag = "3")]
pub hash2: ::prost::alloc::vec::Vec<u8>,
}
///
/// Waypoint message, used to share arbitrary locations across the mesh
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Waypoint {
///
/// Id of the waypoint
#[prost(uint32, tag = "1")]
pub id: u32,
///
/// latitude_i
#[prost(sfixed32, optional, tag = "2")]
pub latitude_i: ::core::option::Option<i32>,
///
/// longitude_i
#[prost(sfixed32, optional, tag = "3")]
pub longitude_i: ::core::option::Option<i32>,
///
/// Time the waypoint is to expire (epoch)
#[prost(uint32, tag = "4")]
pub expire: u32,
///
/// If greater than zero, treat the value as a nodenum only allowing them to update the waypoint.
/// If zero, the waypoint is open to be edited by any member of the mesh.
#[prost(uint32, tag = "5")]
pub locked_to: u32,
///
/// Name of the waypoint - max 30 chars
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
///
/// Description of the waypoint - max 100 chars
#[prost(string, tag = "7")]
pub description: ::prost::alloc::string::String,
///
/// Designator icon for the waypoint in the form of a unicode emoji
#[prost(fixed32, tag = "8")]
pub icon: u32,
}
///
/// This message will be proxied over the PhoneAPI for the client to deliver to the MQTT server
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MqttClientProxyMessage {
///
/// The MQTT topic this message will be sent /received on
#[prost(string, tag = "1")]
pub topic: ::prost::alloc::string::String,
///
/// Whether the message should be retained (or not)
#[prost(bool, tag = "4")]
pub retained: bool,
///
/// The actual service envelope payload or text for mqtt pub / sub
#[prost(oneof = "mqtt_client_proxy_message::PayloadVariant", tags = "2, 3")]
pub payload_variant: ::core::option::Option<
mqtt_client_proxy_message::PayloadVariant,
>,
}
/// Nested message and enum types in `MqttClientProxyMessage`.
pub mod mqtt_client_proxy_message {
///
/// The actual service envelope payload or text for mqtt pub / sub
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// Bytes
#[prost(bytes, tag = "2")]
Data(::prost::alloc::vec::Vec<u8>),
///
/// Text
#[prost(string, tag = "3")]
Text(::prost::alloc::string::String),
}
}
///
/// A packet envelope sent/received over the mesh
/// only payload_variant 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.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MeshPacket {
///
/// The sending node number.
/// Note: Our crypto implementation uses this field as well.
/// See [crypto](/docs/overview/encryption) for details.
#[prost(fixed32, tag = "1")]
pub from: u32,
///
/// The (immediate) destination for this packet
#[prost(fixed32, tag = "2")]
pub to: u32,
///
/// (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 payload_variant is an 'encrypted'.
#[prost(uint32, tag = "3")]
pub channel: u32,
///
/// 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/overview/encryption) for details.
#[prost(fixed32, tag = "6")]
pub id: u32,
///
/// 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)
#[prost(fixed32, tag = "7")]
pub rx_time: u32,
///
/// *Never* sent over the radio links.
/// Set during reception to indicate the SNR of this packet.
/// Used to collect statistics on current link quality.
#[prost(float, tag = "8")]
pub rx_snr: f32,
///
/// If unset treated as zero (no forwarding, send to direct neighbor 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.
#[prost(uint32, tag = "9")]
pub hop_limit: u32,
///
/// 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
#[prost(bool, tag = "10")]
pub want_ack: bool,
///
/// The priority of this message for sending.
/// See MeshPacket.Priority description for more details.
#[prost(enumeration = "mesh_packet::Priority", tag = "11")]
pub priority: i32,
///
/// rssi of received packet. Only sent to phone for dispay purposes.
#[prost(int32, tag = "12")]
pub rx_rssi: i32,
///
/// Describe if this message is delayed
#[deprecated]
#[prost(enumeration = "mesh_packet::Delayed", tag = "13")]
pub delayed: i32,
///
/// Describes whether this packet passed via MQTT somewhere along the path it currently took.
#[prost(bool, tag = "14")]
pub via_mqtt: bool,
///
/// Hop limit with which the original packet started. Sent via LoRa using three bits in the unencrypted header.
/// When receiving a packet, the difference between hop_start and hop_limit gives how many hops it traveled.
#[prost(uint32, tag = "15")]
pub hop_start: u32,
///
/// Records the public key the packet was encrypted with, if applicable.
#[prost(bytes = "vec", tag = "16")]
pub public_key: ::prost::alloc::vec::Vec<u8>,
///
/// Indicates whether the packet was en/decrypted using PKI
#[prost(bool, tag = "17")]
pub pki_encrypted: bool,
///
/// Last byte of the node number of the node that should be used as the next hop in routing.
/// Set by the firmware internally, clients are not supposed to set this.
#[prost(uint32, tag = "18")]
pub next_hop: u32,
///
/// Last byte of the node number of the node that will relay/relayed this packet.
/// Set by the firmware internally, clients are not supposed to set this.
#[prost(uint32, tag = "19")]
pub relay_node: u32,
///
/// *Never* sent over the radio links.
/// Timestamp after which this packet may be sent.
/// Set by the firmware internally, clients are not supposed to set this.
#[prost(uint32, tag = "20")]
pub tx_after: u32,
///
/// Indicates which transport mechanism this packet arrived over
#[prost(enumeration = "mesh_packet::TransportMechanism", tag = "21")]
pub transport_mechanism: i32,
#[prost(oneof = "mesh_packet::PayloadVariant", tags = "4, 5")]
pub payload_variant: ::core::option::Option<mesh_packet::PayloadVariant>,
}
/// Nested message and enum types in `MeshPacket`.
pub mod mesh_packet {
///
/// 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.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub 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,
///
/// If priority is unset but the packet is a response to a request, we want it to get there relatively quickly.
/// Furthermore, responses stop relaying packets directed to a node early.
Response = 80,
///
/// Higher priority for specific message types (portnums) to distinguish between other reliable packets.
High = 100,
///
/// Higher priority alert message used for critical alerts which take priority over other reliable packets.
Alert = 110,
///
/// Ack/naks are sent with very high priority to ensure that retransmission
/// stops as soon as possible
Ack = 120,
///
/// TODO: REPLACE
Max = 127,
}
impl Priority {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::Min => "MIN",
Self::Background => "BACKGROUND",
Self::Default => "DEFAULT",
Self::Reliable => "RELIABLE",
Self::Response => "RESPONSE",
Self::High => "HIGH",
Self::Alert => "ALERT",
Self::Ack => "ACK",
Self::Max => "MAX",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"MIN" => Some(Self::Min),
"BACKGROUND" => Some(Self::Background),
"DEFAULT" => Some(Self::Default),
"RELIABLE" => Some(Self::Reliable),
"RESPONSE" => Some(Self::Response),
"HIGH" => Some(Self::High),
"ALERT" => Some(Self::Alert),
"ACK" => Some(Self::Ack),
"MAX" => Some(Self::Max),
_ => None,
}
}
}
///
/// Identify if this is a delayed packet
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Delayed {
///
/// If unset, the message is being sent in real time.
NoDelay = 0,
///
/// The message is delayed and was originally a broadcast
Broadcast = 1,
///
/// The message is delayed and was originally a direct message
Direct = 2,
}
impl Delayed {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NoDelay => "NO_DELAY",
Self::Broadcast => "DELAYED_BROADCAST",
Self::Direct => "DELAYED_DIRECT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NO_DELAY" => Some(Self::NoDelay),
"DELAYED_BROADCAST" => Some(Self::Broadcast),
"DELAYED_DIRECT" => Some(Self::Direct),
_ => None,
}
}
}
///
/// Enum to identify which transport mechanism this packet arrived over
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TransportMechanism {
///
/// The default case is that the node generated a packet itself
TransportInternal = 0,
///
/// Arrived via the primary LoRa radio
TransportLora = 1,
///
/// Arrived via a secondary LoRa radio
TransportLoraAlt1 = 2,
///
/// Arrived via a tertiary LoRa radio
TransportLoraAlt2 = 3,
///
/// Arrived via a quaternary LoRa radio
TransportLoraAlt3 = 4,
///
/// Arrived via an MQTT connection
TransportMqtt = 5,
///
/// Arrived via Multicast UDP
TransportMulticastUdp = 6,
///
/// Arrived via API connection
TransportApi = 7,
}
impl TransportMechanism {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::TransportInternal => "TRANSPORT_INTERNAL",
Self::TransportLora => "TRANSPORT_LORA",
Self::TransportLoraAlt1 => "TRANSPORT_LORA_ALT1",
Self::TransportLoraAlt2 => "TRANSPORT_LORA_ALT2",
Self::TransportLoraAlt3 => "TRANSPORT_LORA_ALT3",
Self::TransportMqtt => "TRANSPORT_MQTT",
Self::TransportMulticastUdp => "TRANSPORT_MULTICAST_UDP",
Self::TransportApi => "TRANSPORT_API",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRANSPORT_INTERNAL" => Some(Self::TransportInternal),
"TRANSPORT_LORA" => Some(Self::TransportLora),
"TRANSPORT_LORA_ALT1" => Some(Self::TransportLoraAlt1),
"TRANSPORT_LORA_ALT2" => Some(Self::TransportLoraAlt2),
"TRANSPORT_LORA_ALT3" => Some(Self::TransportLoraAlt3),
"TRANSPORT_MQTT" => Some(Self::TransportMqtt),
"TRANSPORT_MULTICAST_UDP" => Some(Self::TransportMulticastUdp),
"TRANSPORT_API" => Some(Self::TransportApi),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// TODO: REPLACE
#[prost(message, tag = "4")]
Decoded(super::Data),
///
/// TODO: REPLACE
#[prost(bytes, tag = "5")]
Encrypted(::prost::alloc::vec::Vec<u8>),
}
}
///
/// 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
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfo {
///
/// The node number
#[prost(uint32, tag = "1")]
pub num: u32,
///
/// The user info for this node
#[prost(message, optional, tag = "2")]
pub user: ::core::option::Option<User>,
///
/// 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.
#[prost(message, optional, tag = "3")]
pub position: ::core::option::Option<Position>,
///
/// 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
#[prost(float, tag = "4")]
pub snr: f32,
///
/// Set to indicate the last time we received a packet from this node
#[prost(fixed32, tag = "5")]
pub last_heard: u32,
///
/// The latest device metrics for the node.
#[prost(message, optional, tag = "6")]
pub device_metrics: ::core::option::Option<DeviceMetrics>,
///
/// local channel index we heard that node on. Only populated if its not the default channel.
#[prost(uint32, tag = "7")]
pub channel: u32,
///
/// True if we witnessed the node over MQTT instead of LoRA transport
#[prost(bool, tag = "8")]
pub via_mqtt: bool,
///
/// Number of hops away from us this node is (0 if direct neighbor)
#[prost(uint32, optional, tag = "9")]
pub hops_away: ::core::option::Option<u32>,
///
/// True if node is in our favorites list
/// Persists between NodeDB internal clean ups
#[prost(bool, tag = "10")]
pub is_favorite: bool,
///
/// True if node is in our ignored list
/// Persists between NodeDB internal clean ups
#[prost(bool, tag = "11")]
pub is_ignored: bool,
///
/// True if node public key has been verified.
/// Persists between NodeDB internal clean ups
/// LSB 0 of the bitfield
#[prost(bool, tag = "12")]
pub is_key_manually_verified: bool,
}
///
/// Unique local debugging info for this node
/// Note: we don't include position or the user info, because that will come in the
/// Sent to the phone in response to WantNodes.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MyNodeInfo {
///
/// Tells the phone what our node number is, default starting value is
/// lowbyte of macaddr, but it will be fixed if that is already in use
#[prost(uint32, tag = "1")]
pub my_node_num: u32,
///
/// The total number of reboots this node has ever encountered
/// (well - since the last time we discarded preferences)
#[prost(uint32, tag = "8")]
pub reboot_count: u32,
///
/// The minimum app version that can talk to this device.
/// Phone/PC apps should compare this to their build number and if too low tell the user they must update their app
#[prost(uint32, tag = "11")]
pub min_app_version: u32,
///
/// Unique hardware identifier for this device
#[prost(bytes = "vec", tag = "12")]
pub device_id: ::prost::alloc::vec::Vec<u8>,
///
/// The PlatformIO environment used to build this firmware
#[prost(string, tag = "13")]
pub pio_env: ::prost::alloc::string::String,
///
/// The indicator for whether this device is running event firmware and which
#[prost(enumeration = "FirmwareEdition", tag = "14")]
pub firmware_edition: i32,
///
/// The number of nodes in the nodedb.
/// This is used by the phone to know how many NodeInfo packets to expect on want_config
#[prost(uint32, tag = "15")]
pub nodedb_count: u32,
}
///
/// Debug output from the device.
/// To minimize the size of records inside the device code, if a time/source/level is not set
/// on the message it is assumed to be a continuation of the previously sent message.
/// This allows the device code to use fixed maxlen 64 byte strings for messages,
/// and then extend as needed by emitting multiple records.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LogRecord {
///
/// Log levels, chosen to match python logging conventions.
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
///
/// Seconds since 1970 - or 0 for unknown/unset
#[prost(fixed32, tag = "2")]
pub time: u32,
///
/// Usually based on thread name - if known
#[prost(string, tag = "3")]
pub source: ::prost::alloc::string::String,
///
/// Not yet set
#[prost(enumeration = "log_record::Level", tag = "4")]
pub level: i32,
}
/// Nested message and enum types in `LogRecord`.
pub mod log_record {
///
/// Log levels, chosen to match python logging conventions.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Level {
///
/// Log levels, chosen to match python logging conventions.
Unset = 0,
///
/// Log levels, chosen to match python logging conventions.
Critical = 50,
///
/// Log levels, chosen to match python logging conventions.
Error = 40,
///
/// Log levels, chosen to match python logging conventions.
Warning = 30,
///
/// Log levels, chosen to match python logging conventions.
Info = 20,
///
/// Log levels, chosen to match python logging conventions.
Debug = 10,
///
/// Log levels, chosen to match python logging conventions.
Trace = 5,
}
impl Level {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::Critical => "CRITICAL",
Self::Error => "ERROR",
Self::Warning => "WARNING",
Self::Info => "INFO",
Self::Debug => "DEBUG",
Self::Trace => "TRACE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"CRITICAL" => Some(Self::Critical),
"ERROR" => Some(Self::Error),
"WARNING" => Some(Self::Warning),
"INFO" => Some(Self::Info),
"DEBUG" => Some(Self::Debug),
"TRACE" => Some(Self::Trace),
_ => None,
}
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueStatus {
/// Last attempt to queue status, ErrorCode
#[prost(int32, tag = "1")]
pub res: i32,
/// Free entries in the outgoing queue
#[prost(uint32, tag = "2")]
pub free: u32,
/// Maximum entries in the outgoing queue
#[prost(uint32, tag = "3")]
pub maxlen: u32,
/// What was mesh packet id that generated this response?
#[prost(uint32, tag = "4")]
pub mesh_packet_id: u32,
}
///
/// Packets from the radio to the phone will appear on the fromRadio characteristic.
/// It will support READ and NOTIFY. When a new packet arrives the device will BLE notify?
/// It will sit in that descriptor until consumed by the phone,
/// at which point the next item in the FIFO will be populated.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FromRadio {
///
/// The packet id, used to allow the phone to request missing read packets from the FIFO,
/// see our bluetooth docs
#[prost(uint32, tag = "1")]
pub id: u32,
///
/// Log levels, chosen to match python logging conventions.
#[prost(
oneof = "from_radio::PayloadVariant",
tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17"
)]
pub payload_variant: ::core::option::Option<from_radio::PayloadVariant>,
}
/// Nested message and enum types in `FromRadio`.
pub mod from_radio {
///
/// Log levels, chosen to match python logging conventions.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// Log levels, chosen to match python logging conventions.
#[prost(message, tag = "2")]
Packet(super::MeshPacket),
///
/// Tells the phone what our node number is, can be -1 if we've not yet joined a mesh.
/// NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps.
#[prost(message, tag = "3")]
MyInfo(super::MyNodeInfo),
///
/// One packet is sent for each node in the on radio DB
/// starts over with the first node in our DB
#[prost(message, tag = "4")]
NodeInfo(super::NodeInfo),
///
/// Include a part of the config (was: RadioConfig radio)
#[prost(message, tag = "5")]
Config(super::Config),
///
/// Set to send debug console output over our protobuf stream
#[prost(message, tag = "6")]
LogRecord(super::LogRecord),
///
/// Sent as true once the device has finished sending all of the responses to want_config
/// recipient should check if this ID matches our original request nonce, if
/// not, it means your config responses haven't started yet.
/// NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps.
#[prost(uint32, tag = "7")]
ConfigCompleteId(u32),
///
/// Sent to tell clients the radio has just rebooted.
/// Set to true if present.
/// Not used on all transports, currently just used for the serial console.
/// NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps.
#[prost(bool, tag = "8")]
Rebooted(bool),
///
/// Include module config
#[prost(message, tag = "9")]
ModuleConfig(super::ModuleConfig),
///
/// One packet is sent for each channel
#[prost(message, tag = "10")]
Channel(super::Channel),
///
/// Queue status info
#[prost(message, tag = "11")]
QueueStatus(super::QueueStatus),
///
/// File Transfer Chunk
#[prost(message, tag = "12")]
XmodemPacket(super::XModem),
///
/// Device metadata message
#[prost(message, tag = "13")]
Metadata(super::DeviceMetadata),
///
/// MQTT Client Proxy Message (device sending to client / phone for publishing to MQTT)
#[prost(message, tag = "14")]
MqttClientProxyMessage(super::MqttClientProxyMessage),
///
/// File system manifest messages
#[prost(message, tag = "15")]
FileInfo(super::FileInfo),
///
/// Notification message to the client
#[prost(message, tag = "16")]
ClientNotification(super::ClientNotification),
///
/// Persistent data for device-ui
#[prost(message, tag = "17")]
DeviceuiConfig(super::DeviceUiConfig),
}
}
///
/// A notification message from the device to the client
/// To be used for important messages that should to be displayed to the user
/// in the form of push notifications or validation messages when saving
/// invalid configuration.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClientNotification {
///
/// The id of the packet we're notifying in response to
#[prost(uint32, optional, tag = "1")]
pub reply_id: ::core::option::Option<u32>,
///
/// Seconds since 1970 - or 0 for unknown/unset
#[prost(fixed32, tag = "2")]
pub time: u32,
///
/// The level type of notification
#[prost(enumeration = "log_record::Level", tag = "3")]
pub level: i32,
///
/// The message body of the notification
#[prost(string, tag = "4")]
pub message: ::prost::alloc::string::String,
#[prost(oneof = "client_notification::PayloadVariant", tags = "11, 12, 13, 14, 15")]
pub payload_variant: ::core::option::Option<client_notification::PayloadVariant>,
}
/// Nested message and enum types in `ClientNotification`.
pub mod client_notification {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PayloadVariant {
#[prost(message, tag = "11")]
KeyVerificationNumberInform(super::KeyVerificationNumberInform),
#[prost(message, tag = "12")]
KeyVerificationNumberRequest(super::KeyVerificationNumberRequest),
#[prost(message, tag = "13")]
KeyVerificationFinal(super::KeyVerificationFinal),
#[prost(message, tag = "14")]
DuplicatedPublicKey(super::DuplicatedPublicKey),
#[prost(message, tag = "15")]
LowEntropyKey(super::LowEntropyKey),
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyVerificationNumberInform {
#[prost(uint64, tag = "1")]
pub nonce: u64,
#[prost(string, tag = "2")]
pub remote_longname: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub security_number: u32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyVerificationNumberRequest {
#[prost(uint64, tag = "1")]
pub nonce: u64,
#[prost(string, tag = "2")]
pub remote_longname: ::prost::alloc::string::String,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyVerificationFinal {
#[prost(uint64, tag = "1")]
pub nonce: u64,
#[prost(string, tag = "2")]
pub remote_longname: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub is_sender: bool,
#[prost(string, tag = "4")]
pub verification_characters: ::prost::alloc::string::String,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DuplicatedPublicKey {}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LowEntropyKey {}
///
/// Individual File info for the device
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FileInfo {
///
/// The fully qualified path of the file
#[prost(string, tag = "1")]
pub file_name: ::prost::alloc::string::String,
///
/// The size of the file in bytes
#[prost(uint32, tag = "2")]
pub size_bytes: u32,
}
///
/// Packets/commands to the radio will be written (reliably) to the toRadio characteristic.
/// Once the write completes the phone can assume it is handled.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ToRadio {
///
/// Log levels, chosen to match python logging conventions.
#[prost(oneof = "to_radio::PayloadVariant", tags = "1, 3, 4, 5, 6, 7")]
pub payload_variant: ::core::option::Option<to_radio::PayloadVariant>,
}
/// Nested message and enum types in `ToRadio`.
pub mod to_radio {
///
/// Log levels, chosen to match python logging conventions.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// Send this packet on the mesh
#[prost(message, tag = "1")]
Packet(super::MeshPacket),
///
/// Phone wants radio to send full node db to the phone, This is
/// typically the first packet sent to the radio when the phone gets a
/// bluetooth connection. The radio will respond by sending back a
/// MyNodeInfo, a owner, a radio config and a series of
/// FromRadio.node_infos, and config_complete
/// the integer you write into this field will be reported back in the
/// config_complete_id response this allows clients to never be confused by
/// a stale old partially sent config.
#[prost(uint32, tag = "3")]
WantConfigId(u32),
///
/// Tell API server we are disconnecting now.
/// This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link.
/// (Sending this message is optional for clients)
#[prost(bool, tag = "4")]
Disconnect(bool),
#[prost(message, tag = "5")]
XmodemPacket(super::XModem),
///
/// MQTT Client Proxy Message (for client / phone subscribed to MQTT sending to device)
#[prost(message, tag = "6")]
MqttClientProxyMessage(super::MqttClientProxyMessage),
///
/// Heartbeat message (used to keep the device connection awake on serial)
#[prost(message, tag = "7")]
Heartbeat(super::Heartbeat),
}
}
///
/// Compressed message payload
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Compressed {
///
/// PortNum to determine the how to handle the compressed payload.
#[prost(enumeration = "PortNum", tag = "1")]
pub portnum: i32,
///
/// Compressed data.
#[prost(bytes = "vec", tag = "2")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
///
/// Full info on edges for a single node
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NeighborInfo {
///
/// The node ID of the node sending info on its neighbors
#[prost(uint32, tag = "1")]
pub node_id: u32,
///
/// Field to pass neighbor info for the next sending cycle
#[prost(uint32, tag = "2")]
pub last_sent_by_id: u32,
///
/// Broadcast interval of the represented node (in seconds)
#[prost(uint32, tag = "3")]
pub node_broadcast_interval_secs: u32,
///
/// The list of out edges from this node
#[prost(message, repeated, tag = "4")]
pub neighbors: ::prost::alloc::vec::Vec<Neighbor>,
}
///
/// A single edge in the mesh
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Neighbor {
///
/// Node ID of neighbor
#[prost(uint32, tag = "1")]
pub node_id: u32,
///
/// SNR of last heard message
#[prost(float, tag = "2")]
pub snr: f32,
///
/// Reception time (in secs since 1970) of last message that was last sent by this ID.
/// Note: this is for local storage only and will not be sent out over the mesh.
#[prost(fixed32, tag = "3")]
pub last_rx_time: u32,
///
/// Broadcast interval of this neighbor (in seconds).
/// Note: this is for local storage only and will not be sent out over the mesh.
#[prost(uint32, tag = "4")]
pub node_broadcast_interval_secs: u32,
}
///
/// Device metadata response
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeviceMetadata {
///
/// Device firmware version string
#[prost(string, tag = "1")]
pub firmware_version: ::prost::alloc::string::String,
///
/// Device state version
#[prost(uint32, tag = "2")]
pub device_state_version: u32,
///
/// Indicates whether the device can shutdown CPU natively or via power management chip
#[prost(bool, tag = "3")]
pub can_shutdown: bool,
///
/// Indicates that the device has native wifi capability
#[prost(bool, tag = "4")]
pub has_wifi: bool,
///
/// Indicates that the device has native bluetooth capability
#[prost(bool, tag = "5")]
pub has_bluetooth: bool,
///
/// Indicates that the device has an ethernet peripheral
#[prost(bool, tag = "6")]
pub has_ethernet: bool,
///
/// Indicates that the device's role in the mesh
#[prost(enumeration = "config::device_config::Role", tag = "7")]
pub role: i32,
///
/// Indicates the device's current enabled position flags
#[prost(uint32, tag = "8")]
pub position_flags: u32,
///
/// Device hardware model
#[prost(enumeration = "HardwareModel", tag = "9")]
pub hw_model: i32,
///
/// Has Remote Hardware enabled
#[prost(bool, tag = "10")]
pub has_remote_hardware: bool,
///
/// Has PKC capabilities
#[prost(bool, tag = "11")]
pub has_pkc: bool,
///
/// Bit field of boolean for excluded modules
/// (bitwise OR of ExcludedModules)
#[prost(uint32, tag = "12")]
pub excluded_modules: u32,
}
///
/// A heartbeat message is sent to the node from the client to keep the connection alive.
/// This is currently only needed to keep serial connections alive, but can be used by any PhoneAPI.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Heartbeat {
///
/// The nonce of the heartbeat message
#[prost(uint32, tag = "1")]
pub nonce: u32,
}
///
/// RemoteHardwarePins associated with a node
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeRemoteHardwarePin {
///
/// The node_num exposing the available gpio pin
#[prost(uint32, tag = "1")]
pub node_num: u32,
///
/// The the available gpio pin for usage with RemoteHardware module
#[prost(message, optional, tag = "2")]
pub pin: ::core::option::Option<RemoteHardwarePin>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChunkedPayload {
///
/// The ID of the entire payload
#[prost(uint32, tag = "1")]
pub payload_id: u32,
///
/// The total number of chunks in the payload
#[prost(uint32, tag = "2")]
pub chunk_count: u32,
///
/// The current chunk index in the total
#[prost(uint32, tag = "3")]
pub chunk_index: u32,
///
/// The binary data of the current chunk
#[prost(bytes = "vec", tag = "4")]
pub payload_chunk: ::prost::alloc::vec::Vec<u8>,
}
///
/// Wrapper message for broken repeated oneof support
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ResendChunks {
#[prost(uint32, repeated, tag = "1")]
pub chunks: ::prost::alloc::vec::Vec<u32>,
}
///
/// Responses to a ChunkedPayload request
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChunkedPayloadResponse {
///
/// The ID of the entire payload
#[prost(uint32, tag = "1")]
pub payload_id: u32,
#[prost(oneof = "chunked_payload_response::PayloadVariant", tags = "2, 3, 4")]
pub payload_variant: ::core::option::Option<
chunked_payload_response::PayloadVariant,
>,
}
/// Nested message and enum types in `ChunkedPayloadResponse`.
pub mod chunked_payload_response {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// Request to transfer chunked payload
#[prost(bool, tag = "2")]
RequestTransfer(bool),
///
/// Accept the transfer chunked payload
#[prost(bool, tag = "3")]
AcceptTransfer(bool),
///
/// Request missing indexes in the chunked payload
#[prost(message, tag = "4")]
ResendChunks(super::ResendChunks),
}
}
///
/// 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 .
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HardwareModel {
///
/// TODO: REPLACE
Unset = 0,
///
/// TODO: REPLACE
TloraV2 = 1,
///
/// TODO: REPLACE
TloraV1 = 2,
///
/// TODO: REPLACE
TloraV211p6 = 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).
HeltecV20 = 5,
///
/// TODO: REPLACE
TbeamV0p7 = 6,
///
/// TODO: REPLACE
TEcho = 7,
///
/// TODO: REPLACE
TloraV11p3 = 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
HeltecV21 = 10,
///
/// Ancient heltec WiFi_Lora_32 board
HeltecV1 = 11,
///
/// New T-BEAM with ESP32-S3 CPU
LilygoTbeamS3Core = 12,
///
/// RAK WisBlock ESP32 core: <https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/>
Rak11200 = 13,
///
/// B&Q Consulting Nano Edition G1: <https://uniteng.com/wiki/doku.php?id=meshtastic:nano>
NanoG1 = 14,
///
/// TODO: REPLACE
TloraV211p8 = 15,
///
/// TODO: REPLACE
TloraT3S3 = 16,
///
/// B&Q Consulting Nano G1 Explorer: <https://wiki.uniteng.com/en/meshtastic/nano-g1-explorer>
NanoG1Explorer = 17,
///
/// B&Q Consulting Nano G2 Ultra: <https://wiki.uniteng.com/en/meshtastic/nano-g2-ultra>
NanoG2Ultra = 18,
///
/// LoRAType device: <https://loratype.org/>
LoraType = 19,
///
/// wiphone <https://www.wiphone.io/>
Wiphone = 20,
///
/// WIO Tracker WM1110 family from Seeed Studio. Includes wio-1110-tracker and wio-1110-sdk
WioWm1110 = 21,
///
/// RAK2560 Solar base station based on RAK4630
Rak2560 = 22,
///
/// Heltec HRU-3601: <https://heltec.org/project/hru-3601/>
HeltecHru3601 = 23,
///
/// Heltec Wireless Bridge
HeltecWirelessBridge = 24,
///
/// B&Q Consulting Station Edition G1: <https://uniteng.com/wiki/doku.php?id=meshtastic:station>
StationG1 = 25,
///
/// RAK11310 (RP2040 + SX1262)
Rak11310 = 26,
///
/// Makerfabs SenseLoRA Receiver (RP2040 + RFM96)
SenseloraRp2040 = 27,
///
/// Makerfabs SenseLoRA Industrial Monitor (ESP32-S3 + RFM96)
SenseloraS3 = 28,
///
/// Canary Radio Company - CanaryOne: <https://canaryradio.io/products/canaryone>
Canaryone = 29,
///
/// Waveshare RP2040 LoRa - <https://www.waveshare.com/rp2040-lora.htm>
Rp2040Lora = 30,
///
/// B&Q Consulting Station G2: <https://wiki.uniteng.com/en/meshtastic/station-g2>
StationG2 = 31,
///
/// ---------------------------------------------------------------------------
/// Less common/prototype boards listed here (needs one more byte over the air)
/// ---------------------------------------------------------------------------
LoraRelayV1 = 32,
///
/// TODO: REPLACE
Nrf52840dk = 33,
///
/// TODO: REPLACE
Ppr = 34,
///
/// TODO: REPLACE
Genieblocks = 35,
///
/// TODO: REPLACE
Nrf52Unknown = 36,
///
/// TODO: REPLACE
Portduino = 37,
///
/// The simulator built into the android app
AndroidSim = 38,
///
/// Custom DIY device based on @NanoVHF schematics: <https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics>
DiyV1 = 39,
///
/// nRF52840 Dongle : <https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/>
Nrf52840Pca10059 = 40,
///
/// Custom Disaster Radio esp32 v3 device <https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3>
DrDev = 41,
///
/// M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, CoreS3, Paper) <https://m5stack.com/>
M5stack = 42,
///
/// New Heltec LoRA32 with ESP32-S3 CPU
HeltecV3 = 43,
///
/// New Heltec Wireless Stick Lite with ESP32-S3 CPU
HeltecWslV3 = 44,
///
/// New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU
Betafpv2400Tx = 45,
///
/// BetaFPV ExpressLRS "Nano" TX Module 900MHz with ESP32 CPU
Betafpv900NanoTx = 46,
///
/// Raspberry Pi Pico (W) with Waveshare SX1262 LoRa Node Module
RpiPico = 47,
///
/// Heltec Wireless Tracker with ESP32-S3 CPU, built-in GPS, and TFT
/// Newer V1.1, version is written on the PCB near the display.
HeltecWirelessTracker = 48,
///
/// Heltec Wireless Paper with ESP32-S3 CPU and E-Ink display
HeltecWirelessPaper = 49,
///
/// LilyGo T-Deck with ESP32-S3 CPU, Keyboard and IPS display
TDeck = 50,
///
/// LilyGo T-Watch S3 with ESP32-S3 CPU and IPS display
TWatchS3 = 51,
///
/// Bobricius Picomputer with ESP32-S3 CPU, Keyboard and IPS display
PicomputerS3 = 52,
///
/// Heltec HT-CT62 with ESP32-C3 CPU and SX1262 LoRa
HeltecHt62 = 53,
///
/// EBYTE SPI LoRa module and ESP32-S3
EbyteEsp32S3 = 54,
///
/// Waveshare ESP32-S3-PICO with PICO LoRa HAT and 2.9inch e-Ink
Esp32S3Pico = 55,
///
/// CircuitMess Chatter 2 LLCC68 Lora Module and ESP32 Wroom
/// Lora module can be swapped out for a Heltec RA-62 which is "almost" pin compatible
/// with one cut and one jumper Meshtastic works
Chatter2 = 56,
///
/// Heltec Wireless Paper, With ESP32-S3 CPU and E-Ink display
/// Older "V1.0" Variant, has no "version sticker"
/// E-Ink model is DEPG0213BNS800
/// Tab on the screen protector is RED
/// Flex connector marking is FPC-7528B
HeltecWirelessPaperV10 = 57,
///
/// Heltec Wireless Tracker with ESP32-S3 CPU, built-in GPS, and TFT
/// Older "V1.0" Variant
HeltecWirelessTrackerV10 = 58,
///
/// unPhone with ESP32-S3, TFT touchscreen, LSM6DS3TR-C accelerometer and gyroscope
Unphone = 59,
///
/// Teledatics TD-LORAC NRF52840 based M.2 LoRA module
/// Compatible with the TD-WRLS development board
TdLorac = 60,
///
/// CDEBYTE EoRa-S3 board using their own MM modules, clone of LILYGO T3S3
CdebyteEoraS3 = 61,
///
/// TWC_MESH_V4
/// Adafruit NRF52840 feather express with SX1262, SSD1306 OLED and NEO6M GPS
TwcMeshV4 = 62,
///
/// NRF52_PROMICRO_DIY
/// Promicro NRF52840 with SX1262/LLCC68, SSD1306 OLED and NEO6M GPS
Nrf52PromicroDiy = 63,
///
/// RadioMaster 900 Bandit Nano, <https://www.radiomasterrc.com/products/bandit-nano-expresslrs-rf-module>
/// ESP32-D0WDQ6 With SX1276/SKY66122, SSD1306 OLED and No GPS
Radiomaster900BanditNano = 64,
///
/// Heltec Capsule Sensor V3 with ESP32-S3 CPU, Portable LoRa device that can replace GNSS modules or sensors
HeltecCapsuleSensorV3 = 65,
///
/// Heltec Vision Master T190 with ESP32-S3 CPU, and a 1.90 inch TFT display
HeltecVisionMasterT190 = 66,
///
/// Heltec Vision Master E213 with ESP32-S3 CPU, and a 2.13 inch E-Ink display
HeltecVisionMasterE213 = 67,
///
/// Heltec Vision Master E290 with ESP32-S3 CPU, and a 2.9 inch E-Ink display
HeltecVisionMasterE290 = 68,
///
/// Heltec Mesh Node T114 board with nRF52840 CPU, and a 1.14 inch TFT display, Ultimate low-power design,
/// specifically adapted for the Meshtatic project
HeltecMeshNodeT114 = 69,
///
/// Sensecap Indicator from Seeed Studio. ESP32-S3 device with TFT and RP2040 coprocessor
SensecapIndicator = 70,
///
/// Seeed studio T1000-E tracker card. NRF52840 w/ LR1110 radio, GPS, button, buzzer, and sensors.
TrackerT1000E = 71,
///
/// RAK3172 STM32WLE5 Module (<https://store.rakwireless.com/products/wisduo-lpwan-module-rak3172>)
Rak3172 = 72,
///
/// Seeed Studio Wio-E5 (either mini or Dev kit) using STM32WL chip.
WioE5 = 73,
///
/// RadioMaster 900 Bandit, <https://www.radiomasterrc.com/products/bandit-expresslrs-rf-module>
/// SSD1306 OLED and No GPS
Radiomaster900Bandit = 74,
///
/// Minewsemi ME25LS01 (ME25LE01_V1.0). NRF52840 w/ LR1110 radio, buttons and leds and pins.
Me25ls014y10td = 75,
///
/// RP2040_FEATHER_RFM95
/// Adafruit Feather RP2040 with RFM95 LoRa Radio RFM95 with SX1272, SSD1306 OLED
/// <https://www.adafruit.com/product/5714>
/// <https://www.adafruit.com/product/326>
/// <https://www.adafruit.com/product/938>
/// ^^^ short A0 to switch to I2C address 0x3C
///
Rp2040FeatherRfm95 = 76,
/// M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, CoreS3, Paper) <https://m5stack.com/>
M5stackCorebasic = 77,
M5stackCore2 = 78,
/// Pico2 with Waveshare Hat, same as Pico
RpiPico2 = 79,
/// M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, CoreS3, Paper) <https://m5stack.com/>
M5stackCores3 = 80,
/// Seeed XIAO S3 DK
SeeedXiaoS3 = 81,
///
/// Nordic nRF52840+Semtech SX1262 LoRa BLE Combo Module. nRF52840+SX1262 MS24SF1
Ms24sf1 = 82,
///
/// Lilygo TLora-C6 with the new ESP32-C6 MCU
TloraC6 = 83,
///
/// WisMesh Tap
/// RAK-4631 w/ TFT in injection modled case
WismeshTap = 84,
///
/// Similar to PORTDUINO but used by Routastic devices, this is not any
/// particular device and does not run Meshtastic's code but supports
/// the same frame format.
/// Runs on linux, see <https://github.com/Jorropo/routastic>
Routastic = 85,
///
/// Mesh-Tab, esp32 based
/// <https://github.com/valzzu/Mesh-Tab>
MeshTab = 86,
///
/// MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog
/// <https://www.loraitalia.it>
Meshlink = 87,
///
/// Seeed XIAO nRF52840 + Wio SX1262 kit
XiaoNrf52Kit = 88,
///
/// Elecrow ThinkNode M1 & M2
/// <https://www.elecrow.com/wiki/ThinkNode-M1_Transceiver_Device(Meshtastic>)_Power_By_nRF52840.html
/// <https://www.elecrow.com/wiki/ThinkNode-M2_Transceiver_Device(Meshtastic>)_Power_By_NRF52840.html (this actually uses ESP32-S3)
ThinknodeM1 = 89,
ThinknodeM2 = 90,
///
/// Lilygo T-ETH-Elite
TEthElite = 91,
///
/// Heltec HRI-3621 industrial probe
HeltecSensorHub = 92,
///
/// Reserved Fried Chicken ID for future use
ReservedFriedChicken = 93,
///
/// Heltec Magnetic Power Bank with Meshtastic compatible
HeltecMeshPocket = 94,
///
/// Seeed Solar Node
SeeedSolarNode = 95,
///
/// NomadStar Meteor Pro <https://nomadstar.ch/>
NomadstarMeteorPro = 96,
///
/// Elecrow CrowPanel Advance models, ESP32-S3 and TFT with SX1262 radio plugin
Crowpanel = 97,
///
/// Lilygo LINK32 board with sensors
Link32 = 98,
///
/// Seeed Tracker L1
SeeedWioTrackerL1 = 99,
///
/// Seeed Tracker L1 EINK driver
SeeedWioTrackerL1Eink = 100,
///
/// Reserved ID for future and past use
QwantzTinyArms = 101,
///
/// Lilygo T-Deck Pro
TDeckPro = 102,
///
/// Lilygo TLora Pager
TLoraPager = 103,
///
/// GAT562 Mesh Trial Tracker
Gat562MeshTrialTracker = 104,
///
/// RAKwireless WisMesh Tag
WismeshTag = 105,
///
/// RAKwireless WisBlock Core RAK3312 <https://docs.rakwireless.com/product-categories/wisduo/rak3112-module/overview/>
Rak3312 = 106,
///
/// Elecrow ThinkNode M5 <https://www.elecrow.com/wiki/ThinkNode_M5_Meshtastic_LoRa_Signal_Transceiver_ESP32-S3.html>
ThinknodeM5 = 107,
///
/// MeshSolar is an integrated power management and communication solution designed for outdoor low-power devices.
/// <https://heltec.org/project/meshsolar/>
HeltecMeshSolar = 108,
///
/// Lilygo T-Echo Lite
TEchoLite = 109,
///
/// ------------------------------------------------------------------------------------------------------------------------------------------
/// 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.
/// ------------------------------------------------------------------------------------------------------------------------------------------
PrivateHw = 255,
}
impl HardwareModel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::TloraV2 => "TLORA_V2",
Self::TloraV1 => "TLORA_V1",
Self::TloraV211p6 => "TLORA_V2_1_1P6",
Self::Tbeam => "TBEAM",
Self::HeltecV20 => "HELTEC_V2_0",
Self::TbeamV0p7 => "TBEAM_V0P7",
Self::TEcho => "T_ECHO",
Self::TloraV11p3 => "TLORA_V1_1P3",
Self::Rak4631 => "RAK4631",
Self::HeltecV21 => "HELTEC_V2_1",
Self::HeltecV1 => "HELTEC_V1",
Self::LilygoTbeamS3Core => "LILYGO_TBEAM_S3_CORE",
Self::Rak11200 => "RAK11200",
Self::NanoG1 => "NANO_G1",
Self::TloraV211p8 => "TLORA_V2_1_1P8",
Self::TloraT3S3 => "TLORA_T3_S3",
Self::NanoG1Explorer => "NANO_G1_EXPLORER",
Self::NanoG2Ultra => "NANO_G2_ULTRA",
Self::LoraType => "LORA_TYPE",
Self::Wiphone => "WIPHONE",
Self::WioWm1110 => "WIO_WM1110",
Self::Rak2560 => "RAK2560",
Self::HeltecHru3601 => "HELTEC_HRU_3601",
Self::HeltecWirelessBridge => "HELTEC_WIRELESS_BRIDGE",
Self::StationG1 => "STATION_G1",
Self::Rak11310 => "RAK11310",
Self::SenseloraRp2040 => "SENSELORA_RP2040",
Self::SenseloraS3 => "SENSELORA_S3",
Self::Canaryone => "CANARYONE",
Self::Rp2040Lora => "RP2040_LORA",
Self::StationG2 => "STATION_G2",
Self::LoraRelayV1 => "LORA_RELAY_V1",
Self::Nrf52840dk => "NRF52840DK",
Self::Ppr => "PPR",
Self::Genieblocks => "GENIEBLOCKS",
Self::Nrf52Unknown => "NRF52_UNKNOWN",
Self::Portduino => "PORTDUINO",
Self::AndroidSim => "ANDROID_SIM",
Self::DiyV1 => "DIY_V1",
Self::Nrf52840Pca10059 => "NRF52840_PCA10059",
Self::DrDev => "DR_DEV",
Self::M5stack => "M5STACK",
Self::HeltecV3 => "HELTEC_V3",
Self::HeltecWslV3 => "HELTEC_WSL_V3",
Self::Betafpv2400Tx => "BETAFPV_2400_TX",
Self::Betafpv900NanoTx => "BETAFPV_900_NANO_TX",
Self::RpiPico => "RPI_PICO",
Self::HeltecWirelessTracker => "HELTEC_WIRELESS_TRACKER",
Self::HeltecWirelessPaper => "HELTEC_WIRELESS_PAPER",
Self::TDeck => "T_DECK",
Self::TWatchS3 => "T_WATCH_S3",
Self::PicomputerS3 => "PICOMPUTER_S3",
Self::HeltecHt62 => "HELTEC_HT62",
Self::EbyteEsp32S3 => "EBYTE_ESP32_S3",
Self::Esp32S3Pico => "ESP32_S3_PICO",
Self::Chatter2 => "CHATTER_2",
Self::HeltecWirelessPaperV10 => "HELTEC_WIRELESS_PAPER_V1_0",
Self::HeltecWirelessTrackerV10 => "HELTEC_WIRELESS_TRACKER_V1_0",
Self::Unphone => "UNPHONE",
Self::TdLorac => "TD_LORAC",
Self::CdebyteEoraS3 => "CDEBYTE_EORA_S3",
Self::TwcMeshV4 => "TWC_MESH_V4",
Self::Nrf52PromicroDiy => "NRF52_PROMICRO_DIY",
Self::Radiomaster900BanditNano => "RADIOMASTER_900_BANDIT_NANO",
Self::HeltecCapsuleSensorV3 => "HELTEC_CAPSULE_SENSOR_V3",
Self::HeltecVisionMasterT190 => "HELTEC_VISION_MASTER_T190",
Self::HeltecVisionMasterE213 => "HELTEC_VISION_MASTER_E213",
Self::HeltecVisionMasterE290 => "HELTEC_VISION_MASTER_E290",
Self::HeltecMeshNodeT114 => "HELTEC_MESH_NODE_T114",
Self::SensecapIndicator => "SENSECAP_INDICATOR",
Self::TrackerT1000E => "TRACKER_T1000_E",
Self::Rak3172 => "RAK3172",
Self::WioE5 => "WIO_E5",
Self::Radiomaster900Bandit => "RADIOMASTER_900_BANDIT",
Self::Me25ls014y10td => "ME25LS01_4Y10TD",
Self::Rp2040FeatherRfm95 => "RP2040_FEATHER_RFM95",
Self::M5stackCorebasic => "M5STACK_COREBASIC",
Self::M5stackCore2 => "M5STACK_CORE2",
Self::RpiPico2 => "RPI_PICO2",
Self::M5stackCores3 => "M5STACK_CORES3",
Self::SeeedXiaoS3 => "SEEED_XIAO_S3",
Self::Ms24sf1 => "MS24SF1",
Self::TloraC6 => "TLORA_C6",
Self::WismeshTap => "WISMESH_TAP",
Self::Routastic => "ROUTASTIC",
Self::MeshTab => "MESH_TAB",
Self::Meshlink => "MESHLINK",
Self::XiaoNrf52Kit => "XIAO_NRF52_KIT",
Self::ThinknodeM1 => "THINKNODE_M1",
Self::ThinknodeM2 => "THINKNODE_M2",
Self::TEthElite => "T_ETH_ELITE",
Self::HeltecSensorHub => "HELTEC_SENSOR_HUB",
Self::ReservedFriedChicken => "RESERVED_FRIED_CHICKEN",
Self::HeltecMeshPocket => "HELTEC_MESH_POCKET",
Self::SeeedSolarNode => "SEEED_SOLAR_NODE",
Self::NomadstarMeteorPro => "NOMADSTAR_METEOR_PRO",
Self::Crowpanel => "CROWPANEL",
Self::Link32 => "LINK_32",
Self::SeeedWioTrackerL1 => "SEEED_WIO_TRACKER_L1",
Self::SeeedWioTrackerL1Eink => "SEEED_WIO_TRACKER_L1_EINK",
Self::QwantzTinyArms => "QWANTZ_TINY_ARMS",
Self::TDeckPro => "T_DECK_PRO",
Self::TLoraPager => "T_LORA_PAGER",
Self::Gat562MeshTrialTracker => "GAT562_MESH_TRIAL_TRACKER",
Self::WismeshTag => "WISMESH_TAG",
Self::Rak3312 => "RAK3312",
Self::ThinknodeM5 => "THINKNODE_M5",
Self::HeltecMeshSolar => "HELTEC_MESH_SOLAR",
Self::TEchoLite => "T_ECHO_LITE",
Self::PrivateHw => "PRIVATE_HW",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"TLORA_V2" => Some(Self::TloraV2),
"TLORA_V1" => Some(Self::TloraV1),
"TLORA_V2_1_1P6" => Some(Self::TloraV211p6),
"TBEAM" => Some(Self::Tbeam),
"HELTEC_V2_0" => Some(Self::HeltecV20),
"TBEAM_V0P7" => Some(Self::TbeamV0p7),
"T_ECHO" => Some(Self::TEcho),
"TLORA_V1_1P3" => Some(Self::TloraV11p3),
"RAK4631" => Some(Self::Rak4631),
"HELTEC_V2_1" => Some(Self::HeltecV21),
"HELTEC_V1" => Some(Self::HeltecV1),
"LILYGO_TBEAM_S3_CORE" => Some(Self::LilygoTbeamS3Core),
"RAK11200" => Some(Self::Rak11200),
"NANO_G1" => Some(Self::NanoG1),
"TLORA_V2_1_1P8" => Some(Self::TloraV211p8),
"TLORA_T3_S3" => Some(Self::TloraT3S3),
"NANO_G1_EXPLORER" => Some(Self::NanoG1Explorer),
"NANO_G2_ULTRA" => Some(Self::NanoG2Ultra),
"LORA_TYPE" => Some(Self::LoraType),
"WIPHONE" => Some(Self::Wiphone),
"WIO_WM1110" => Some(Self::WioWm1110),
"RAK2560" => Some(Self::Rak2560),
"HELTEC_HRU_3601" => Some(Self::HeltecHru3601),
"HELTEC_WIRELESS_BRIDGE" => Some(Self::HeltecWirelessBridge),
"STATION_G1" => Some(Self::StationG1),
"RAK11310" => Some(Self::Rak11310),
"SENSELORA_RP2040" => Some(Self::SenseloraRp2040),
"SENSELORA_S3" => Some(Self::SenseloraS3),
"CANARYONE" => Some(Self::Canaryone),
"RP2040_LORA" => Some(Self::Rp2040Lora),
"STATION_G2" => Some(Self::StationG2),
"LORA_RELAY_V1" => Some(Self::LoraRelayV1),
"NRF52840DK" => Some(Self::Nrf52840dk),
"PPR" => Some(Self::Ppr),
"GENIEBLOCKS" => Some(Self::Genieblocks),
"NRF52_UNKNOWN" => Some(Self::Nrf52Unknown),
"PORTDUINO" => Some(Self::Portduino),
"ANDROID_SIM" => Some(Self::AndroidSim),
"DIY_V1" => Some(Self::DiyV1),
"NRF52840_PCA10059" => Some(Self::Nrf52840Pca10059),
"DR_DEV" => Some(Self::DrDev),
"M5STACK" => Some(Self::M5stack),
"HELTEC_V3" => Some(Self::HeltecV3),
"HELTEC_WSL_V3" => Some(Self::HeltecWslV3),
"BETAFPV_2400_TX" => Some(Self::Betafpv2400Tx),
"BETAFPV_900_NANO_TX" => Some(Self::Betafpv900NanoTx),
"RPI_PICO" => Some(Self::RpiPico),
"HELTEC_WIRELESS_TRACKER" => Some(Self::HeltecWirelessTracker),
"HELTEC_WIRELESS_PAPER" => Some(Self::HeltecWirelessPaper),
"T_DECK" => Some(Self::TDeck),
"T_WATCH_S3" => Some(Self::TWatchS3),
"PICOMPUTER_S3" => Some(Self::PicomputerS3),
"HELTEC_HT62" => Some(Self::HeltecHt62),
"EBYTE_ESP32_S3" => Some(Self::EbyteEsp32S3),
"ESP32_S3_PICO" => Some(Self::Esp32S3Pico),
"CHATTER_2" => Some(Self::Chatter2),
"HELTEC_WIRELESS_PAPER_V1_0" => Some(Self::HeltecWirelessPaperV10),
"HELTEC_WIRELESS_TRACKER_V1_0" => Some(Self::HeltecWirelessTrackerV10),
"UNPHONE" => Some(Self::Unphone),
"TD_LORAC" => Some(Self::TdLorac),
"CDEBYTE_EORA_S3" => Some(Self::CdebyteEoraS3),
"TWC_MESH_V4" => Some(Self::TwcMeshV4),
"NRF52_PROMICRO_DIY" => Some(Self::Nrf52PromicroDiy),
"RADIOMASTER_900_BANDIT_NANO" => Some(Self::Radiomaster900BanditNano),
"HELTEC_CAPSULE_SENSOR_V3" => Some(Self::HeltecCapsuleSensorV3),
"HELTEC_VISION_MASTER_T190" => Some(Self::HeltecVisionMasterT190),
"HELTEC_VISION_MASTER_E213" => Some(Self::HeltecVisionMasterE213),
"HELTEC_VISION_MASTER_E290" => Some(Self::HeltecVisionMasterE290),
"HELTEC_MESH_NODE_T114" => Some(Self::HeltecMeshNodeT114),
"SENSECAP_INDICATOR" => Some(Self::SensecapIndicator),
"TRACKER_T1000_E" => Some(Self::TrackerT1000E),
"RAK3172" => Some(Self::Rak3172),
"WIO_E5" => Some(Self::WioE5),
"RADIOMASTER_900_BANDIT" => Some(Self::Radiomaster900Bandit),
"ME25LS01_4Y10TD" => Some(Self::Me25ls014y10td),
"RP2040_FEATHER_RFM95" => Some(Self::Rp2040FeatherRfm95),
"M5STACK_COREBASIC" => Some(Self::M5stackCorebasic),
"M5STACK_CORE2" => Some(Self::M5stackCore2),
"RPI_PICO2" => Some(Self::RpiPico2),
"M5STACK_CORES3" => Some(Self::M5stackCores3),
"SEEED_XIAO_S3" => Some(Self::SeeedXiaoS3),
"MS24SF1" => Some(Self::Ms24sf1),
"TLORA_C6" => Some(Self::TloraC6),
"WISMESH_TAP" => Some(Self::WismeshTap),
"ROUTASTIC" => Some(Self::Routastic),
"MESH_TAB" => Some(Self::MeshTab),
"MESHLINK" => Some(Self::Meshlink),
"XIAO_NRF52_KIT" => Some(Self::XiaoNrf52Kit),
"THINKNODE_M1" => Some(Self::ThinknodeM1),
"THINKNODE_M2" => Some(Self::ThinknodeM2),
"T_ETH_ELITE" => Some(Self::TEthElite),
"HELTEC_SENSOR_HUB" => Some(Self::HeltecSensorHub),
"RESERVED_FRIED_CHICKEN" => Some(Self::ReservedFriedChicken),
"HELTEC_MESH_POCKET" => Some(Self::HeltecMeshPocket),
"SEEED_SOLAR_NODE" => Some(Self::SeeedSolarNode),
"NOMADSTAR_METEOR_PRO" => Some(Self::NomadstarMeteorPro),
"CROWPANEL" => Some(Self::Crowpanel),
"LINK_32" => Some(Self::Link32),
"SEEED_WIO_TRACKER_L1" => Some(Self::SeeedWioTrackerL1),
"SEEED_WIO_TRACKER_L1_EINK" => Some(Self::SeeedWioTrackerL1Eink),
"QWANTZ_TINY_ARMS" => Some(Self::QwantzTinyArms),
"T_DECK_PRO" => Some(Self::TDeckPro),
"T_LORA_PAGER" => Some(Self::TLoraPager),
"GAT562_MESH_TRIAL_TRACKER" => Some(Self::Gat562MeshTrialTracker),
"WISMESH_TAG" => Some(Self::WismeshTag),
"RAK3312" => Some(Self::Rak3312),
"THINKNODE_M5" => Some(Self::ThinknodeM5),
"HELTEC_MESH_SOLAR" => Some(Self::HeltecMeshSolar),
"T_ECHO_LITE" => Some(Self::TEchoLite),
"PRIVATE_HW" => Some(Self::PrivateHw),
_ => None,
}
}
}
///
/// Shared constants between device and phone
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Constants {
///
/// First enum must be zero, and we are just using this enum to
/// pass int constants between two very different environments
Zero = 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
DataPayloadLen = 233,
}
impl Constants {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Zero => "ZERO",
Self::DataPayloadLen => "DATA_PAYLOAD_LEN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ZERO" => Some(Self::Zero),
"DATA_PAYLOAD_LEN" => Some(Self::DataPayloadLen),
_ => None,
}
}
}
///
/// 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.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub 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
UbloxUnitFailed = 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.
TransmitFailed = 8,
///
/// We detected that the main CPU voltage dropped below the minimum acceptable value
Brownout = 9,
/// Selftest of SX1262 radio chip failed
Sx1262Failure = 10,
///
/// A (likely software but possibly hardware) failure was detected while trying to send packets.
/// If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug
RadioSpiBug = 11,
///
/// Corruption was detected on the flash filesystem but we were able to repair things.
/// If you see this failure in the field please post in the forum because we are interested in seeing if this is occurring in the field.
FlashCorruptionRecoverable = 12,
///
/// Corruption was detected on the flash filesystem but we were unable to repair things.
/// NOTE: Your node will probably need to be reconfigured the next time it reboots (it will lose the region code etc...)
/// If you see this failure in the field please post in the forum because we are interested in seeing if this is occurring in the field.
FlashCorruptionUnrecoverable = 13,
}
impl CriticalErrorCode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "NONE",
Self::TxWatchdog => "TX_WATCHDOG",
Self::SleepEnterWait => "SLEEP_ENTER_WAIT",
Self::NoRadio => "NO_RADIO",
Self::Unspecified => "UNSPECIFIED",
Self::UbloxUnitFailed => "UBLOX_UNIT_FAILED",
Self::NoAxp192 => "NO_AXP192",
Self::InvalidRadioSetting => "INVALID_RADIO_SETTING",
Self::TransmitFailed => "TRANSMIT_FAILED",
Self::Brownout => "BROWNOUT",
Self::Sx1262Failure => "SX1262_FAILURE",
Self::RadioSpiBug => "RADIO_SPI_BUG",
Self::FlashCorruptionRecoverable => "FLASH_CORRUPTION_RECOVERABLE",
Self::FlashCorruptionUnrecoverable => "FLASH_CORRUPTION_UNRECOVERABLE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NONE" => Some(Self::None),
"TX_WATCHDOG" => Some(Self::TxWatchdog),
"SLEEP_ENTER_WAIT" => Some(Self::SleepEnterWait),
"NO_RADIO" => Some(Self::NoRadio),
"UNSPECIFIED" => Some(Self::Unspecified),
"UBLOX_UNIT_FAILED" => Some(Self::UbloxUnitFailed),
"NO_AXP192" => Some(Self::NoAxp192),
"INVALID_RADIO_SETTING" => Some(Self::InvalidRadioSetting),
"TRANSMIT_FAILED" => Some(Self::TransmitFailed),
"BROWNOUT" => Some(Self::Brownout),
"SX1262_FAILURE" => Some(Self::Sx1262Failure),
"RADIO_SPI_BUG" => Some(Self::RadioSpiBug),
"FLASH_CORRUPTION_RECOVERABLE" => Some(Self::FlashCorruptionRecoverable),
"FLASH_CORRUPTION_UNRECOVERABLE" => Some(Self::FlashCorruptionUnrecoverable),
_ => None,
}
}
}
///
/// Enum to indicate to clients whether this firmware is a special firmware build, like an event.
/// The first 16 values are reserved for non-event special firmwares, like the Smart Citizen use case.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FirmwareEdition {
///
/// Vanilla firmware
Vanilla = 0,
///
/// Firmware for use in the Smart Citizen environmental monitoring network
SmartCitizen = 1,
///
/// Open Sauce, the maker conference held yearly in CA
OpenSauce = 16,
///
/// DEFCON, the yearly hacker conference
Defcon = 17,
///
/// Burning Man, the yearly hippie gathering in the desert
BurningMan = 18,
///
/// Hamvention, the Dayton amateur radio convention
Hamvention = 19,
///
/// Placeholder for DIY and unofficial events
DiyEdition = 127,
}
impl FirmwareEdition {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Vanilla => "VANILLA",
Self::SmartCitizen => "SMART_CITIZEN",
Self::OpenSauce => "OPEN_SAUCE",
Self::Defcon => "DEFCON",
Self::BurningMan => "BURNING_MAN",
Self::Hamvention => "HAMVENTION",
Self::DiyEdition => "DIY_EDITION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VANILLA" => Some(Self::Vanilla),
"SMART_CITIZEN" => Some(Self::SmartCitizen),
"OPEN_SAUCE" => Some(Self::OpenSauce),
"DEFCON" => Some(Self::Defcon),
"BURNING_MAN" => Some(Self::BurningMan),
"HAMVENTION" => Some(Self::Hamvention),
"DIY_EDITION" => Some(Self::DiyEdition),
_ => None,
}
}
}
///
/// Enum for modules excluded from a device's configuration.
/// Each value represents a ModuleConfigType that can be toggled as excluded
/// by setting its corresponding bit in the `excluded_modules` bitmask field.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExcludedModules {
///
/// Default value of 0 indicates no modules are excluded.
ExcludedNone = 0,
///
/// MQTT module
MqttConfig = 1,
///
/// Serial module
SerialConfig = 2,
///
/// External Notification module
ExtnotifConfig = 4,
///
/// Store and Forward module
StoreforwardConfig = 8,
///
/// Range Test module
RangetestConfig = 16,
///
/// Telemetry module
TelemetryConfig = 32,
///
/// Canned Message module
CannedmsgConfig = 64,
///
/// Audio module
AudioConfig = 128,
///
/// Remote Hardware module
RemotehardwareConfig = 256,
///
/// Neighbor Info module
NeighborinfoConfig = 512,
///
/// Ambient Lighting module
AmbientlightingConfig = 1024,
///
/// Detection Sensor module
DetectionsensorConfig = 2048,
///
/// Paxcounter module
PaxcounterConfig = 4096,
///
/// Bluetooth config (not technically a module, but used to indicate bluetooth capabilities)
BluetoothConfig = 8192,
///
/// Network config (not technically a module, but used to indicate network capabilities)
NetworkConfig = 16384,
}
impl ExcludedModules {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::ExcludedNone => "EXCLUDED_NONE",
Self::MqttConfig => "MQTT_CONFIG",
Self::SerialConfig => "SERIAL_CONFIG",
Self::ExtnotifConfig => "EXTNOTIF_CONFIG",
Self::StoreforwardConfig => "STOREFORWARD_CONFIG",
Self::RangetestConfig => "RANGETEST_CONFIG",
Self::TelemetryConfig => "TELEMETRY_CONFIG",
Self::CannedmsgConfig => "CANNEDMSG_CONFIG",
Self::AudioConfig => "AUDIO_CONFIG",
Self::RemotehardwareConfig => "REMOTEHARDWARE_CONFIG",
Self::NeighborinfoConfig => "NEIGHBORINFO_CONFIG",
Self::AmbientlightingConfig => "AMBIENTLIGHTING_CONFIG",
Self::DetectionsensorConfig => "DETECTIONSENSOR_CONFIG",
Self::PaxcounterConfig => "PAXCOUNTER_CONFIG",
Self::BluetoothConfig => "BLUETOOTH_CONFIG",
Self::NetworkConfig => "NETWORK_CONFIG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXCLUDED_NONE" => Some(Self::ExcludedNone),
"MQTT_CONFIG" => Some(Self::MqttConfig),
"SERIAL_CONFIG" => Some(Self::SerialConfig),
"EXTNOTIF_CONFIG" => Some(Self::ExtnotifConfig),
"STOREFORWARD_CONFIG" => Some(Self::StoreforwardConfig),
"RANGETEST_CONFIG" => Some(Self::RangetestConfig),
"TELEMETRY_CONFIG" => Some(Self::TelemetryConfig),
"CANNEDMSG_CONFIG" => Some(Self::CannedmsgConfig),
"AUDIO_CONFIG" => Some(Self::AudioConfig),
"REMOTEHARDWARE_CONFIG" => Some(Self::RemotehardwareConfig),
"NEIGHBORINFO_CONFIG" => Some(Self::NeighborinfoConfig),
"AMBIENTLIGHTING_CONFIG" => Some(Self::AmbientlightingConfig),
"DETECTIONSENSOR_CONFIG" => Some(Self::DetectionsensorConfig),
"PAXCOUNTER_CONFIG" => Some(Self::PaxcounterConfig),
"BLUETOOTH_CONFIG" => Some(Self::BluetoothConfig),
"NETWORK_CONFIG" => Some(Self::NetworkConfig),
_ => None,
}
}
}
///
/// 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)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(bytes = "vec", tag = "101")]
pub session_passkey: ::prost::alloc::vec::Vec<u8>,
///
/// TODO: REPLACE
#[prost(
oneof = "admin_message::PayloadVariant",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 64, 65, 66, 67, 94, 95, 96, 97, 98, 99, 100"
)]
pub payload_variant: ::core::option::Option<admin_message::PayloadVariant>,
}
/// Nested message and enum types in `AdminMessage`.
pub mod admin_message {
///
/// Input event message to be sent to the node.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InputEvent {
///
/// The input event code
#[prost(uint32, tag = "1")]
pub event_code: u32,
///
/// Keyboard character code
#[prost(uint32, tag = "2")]
pub kb_char: u32,
///
/// The touch X coordinate
#[prost(uint32, tag = "3")]
pub touch_x: u32,
///
/// The touch Y coordinate
#[prost(uint32, tag = "4")]
pub touch_y: u32,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ConfigType {
///
/// TODO: REPLACE
DeviceConfig = 0,
///
/// TODO: REPLACE
PositionConfig = 1,
///
/// TODO: REPLACE
PowerConfig = 2,
///
/// TODO: REPLACE
NetworkConfig = 3,
///
/// TODO: REPLACE
DisplayConfig = 4,
///
/// TODO: REPLACE
LoraConfig = 5,
///
/// TODO: REPLACE
BluetoothConfig = 6,
///
/// TODO: REPLACE
SecurityConfig = 7,
///
/// Session key config
SessionkeyConfig = 8,
///
/// device-ui config
DeviceuiConfig = 9,
}
impl ConfigType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::DeviceConfig => "DEVICE_CONFIG",
Self::PositionConfig => "POSITION_CONFIG",
Self::PowerConfig => "POWER_CONFIG",
Self::NetworkConfig => "NETWORK_CONFIG",
Self::DisplayConfig => "DISPLAY_CONFIG",
Self::LoraConfig => "LORA_CONFIG",
Self::BluetoothConfig => "BLUETOOTH_CONFIG",
Self::SecurityConfig => "SECURITY_CONFIG",
Self::SessionkeyConfig => "SESSIONKEY_CONFIG",
Self::DeviceuiConfig => "DEVICEUI_CONFIG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEVICE_CONFIG" => Some(Self::DeviceConfig),
"POSITION_CONFIG" => Some(Self::PositionConfig),
"POWER_CONFIG" => Some(Self::PowerConfig),
"NETWORK_CONFIG" => Some(Self::NetworkConfig),
"DISPLAY_CONFIG" => Some(Self::DisplayConfig),
"LORA_CONFIG" => Some(Self::LoraConfig),
"BLUETOOTH_CONFIG" => Some(Self::BluetoothConfig),
"SECURITY_CONFIG" => Some(Self::SecurityConfig),
"SESSIONKEY_CONFIG" => Some(Self::SessionkeyConfig),
"DEVICEUI_CONFIG" => Some(Self::DeviceuiConfig),
_ => None,
}
}
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ModuleConfigType {
///
/// TODO: REPLACE
MqttConfig = 0,
///
/// TODO: REPLACE
SerialConfig = 1,
///
/// TODO: REPLACE
ExtnotifConfig = 2,
///
/// TODO: REPLACE
StoreforwardConfig = 3,
///
/// TODO: REPLACE
RangetestConfig = 4,
///
/// TODO: REPLACE
TelemetryConfig = 5,
///
/// TODO: REPLACE
CannedmsgConfig = 6,
///
/// TODO: REPLACE
AudioConfig = 7,
///
/// TODO: REPLACE
RemotehardwareConfig = 8,
///
/// TODO: REPLACE
NeighborinfoConfig = 9,
///
/// TODO: REPLACE
AmbientlightingConfig = 10,
///
/// TODO: REPLACE
DetectionsensorConfig = 11,
///
/// TODO: REPLACE
PaxcounterConfig = 12,
}
impl ModuleConfigType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::MqttConfig => "MQTT_CONFIG",
Self::SerialConfig => "SERIAL_CONFIG",
Self::ExtnotifConfig => "EXTNOTIF_CONFIG",
Self::StoreforwardConfig => "STOREFORWARD_CONFIG",
Self::RangetestConfig => "RANGETEST_CONFIG",
Self::TelemetryConfig => "TELEMETRY_CONFIG",
Self::CannedmsgConfig => "CANNEDMSG_CONFIG",
Self::AudioConfig => "AUDIO_CONFIG",
Self::RemotehardwareConfig => "REMOTEHARDWARE_CONFIG",
Self::NeighborinfoConfig => "NEIGHBORINFO_CONFIG",
Self::AmbientlightingConfig => "AMBIENTLIGHTING_CONFIG",
Self::DetectionsensorConfig => "DETECTIONSENSOR_CONFIG",
Self::PaxcounterConfig => "PAXCOUNTER_CONFIG",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MQTT_CONFIG" => Some(Self::MqttConfig),
"SERIAL_CONFIG" => Some(Self::SerialConfig),
"EXTNOTIF_CONFIG" => Some(Self::ExtnotifConfig),
"STOREFORWARD_CONFIG" => Some(Self::StoreforwardConfig),
"RANGETEST_CONFIG" => Some(Self::RangetestConfig),
"TELEMETRY_CONFIG" => Some(Self::TelemetryConfig),
"CANNEDMSG_CONFIG" => Some(Self::CannedmsgConfig),
"AUDIO_CONFIG" => Some(Self::AudioConfig),
"REMOTEHARDWARE_CONFIG" => Some(Self::RemotehardwareConfig),
"NEIGHBORINFO_CONFIG" => Some(Self::NeighborinfoConfig),
"AMBIENTLIGHTING_CONFIG" => Some(Self::AmbientlightingConfig),
"DETECTIONSENSOR_CONFIG" => Some(Self::DetectionsensorConfig),
"PAXCOUNTER_CONFIG" => Some(Self::PaxcounterConfig),
_ => None,
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum BackupLocation {
///
/// Backup to the internal flash
Flash = 0,
///
/// Backup to the SD card
Sd = 1,
}
impl BackupLocation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Flash => "FLASH",
Self::Sd => "SD",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FLASH" => Some(Self::Flash),
"SD" => Some(Self::Sd),
_ => None,
}
}
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// 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)
#[prost(uint32, tag = "1")]
GetChannelRequest(u32),
///
/// TODO: REPLACE
#[prost(message, tag = "2")]
GetChannelResponse(super::Channel),
///
/// Send the current owner data in the response to this message.
#[prost(bool, tag = "3")]
GetOwnerRequest(bool),
///
/// TODO: REPLACE
#[prost(message, tag = "4")]
GetOwnerResponse(super::User),
///
/// Ask for the following config data to be sent
#[prost(enumeration = "ConfigType", tag = "5")]
GetConfigRequest(i32),
///
/// Send the current Config in the response to this message.
#[prost(message, tag = "6")]
GetConfigResponse(super::Config),
///
/// Ask for the following config data to be sent
#[prost(enumeration = "ModuleConfigType", tag = "7")]
GetModuleConfigRequest(i32),
///
/// Send the current Config in the response to this message.
#[prost(message, tag = "8")]
GetModuleConfigResponse(super::ModuleConfig),
///
/// Get the Canned Message Module messages in the response to this message.
#[prost(bool, tag = "10")]
GetCannedMessageModuleMessagesRequest(bool),
///
/// Get the Canned Message Module messages in the response to this message.
#[prost(string, tag = "11")]
GetCannedMessageModuleMessagesResponse(::prost::alloc::string::String),
///
/// Request the node to send device metadata (firmware, protobuf version, etc)
#[prost(bool, tag = "12")]
GetDeviceMetadataRequest(bool),
///
/// Device metadata response
#[prost(message, tag = "13")]
GetDeviceMetadataResponse(super::DeviceMetadata),
///
/// Get the Ringtone in the response to this message.
#[prost(bool, tag = "14")]
GetRingtoneRequest(bool),
///
/// Get the Ringtone in the response to this message.
#[prost(string, tag = "15")]
GetRingtoneResponse(::prost::alloc::string::String),
///
/// Request the node to send it's connection status
#[prost(bool, tag = "16")]
GetDeviceConnectionStatusRequest(bool),
///
/// Device connection status response
#[prost(message, tag = "17")]
GetDeviceConnectionStatusResponse(super::DeviceConnectionStatus),
///
/// Setup a node for licensed amateur (ham) radio operation
#[prost(message, tag = "18")]
SetHamMode(super::HamParameters),
///
/// Get the mesh's nodes with their available gpio pins for RemoteHardware module use
#[prost(bool, tag = "19")]
GetNodeRemoteHardwarePinsRequest(bool),
///
/// Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
#[prost(message, tag = "20")]
GetNodeRemoteHardwarePinsResponse(super::NodeRemoteHardwarePinsResponse),
///
/// Enter (UF2) DFU mode
/// Only implemented on NRF52 currently
#[prost(bool, tag = "21")]
EnterDfuModeRequest(bool),
///
/// Delete the file by the specified path from the device
#[prost(string, tag = "22")]
DeleteFileRequest(::prost::alloc::string::String),
///
/// Set zero and offset for scale chips
#[prost(uint32, tag = "23")]
SetScale(u32),
///
/// Backup the node's preferences
#[prost(enumeration = "BackupLocation", tag = "24")]
BackupPreferences(i32),
///
/// Restore the node's preferences
#[prost(enumeration = "BackupLocation", tag = "25")]
RestorePreferences(i32),
///
/// Remove backups of the node's preferences
#[prost(enumeration = "BackupLocation", tag = "26")]
RemoveBackupPreferences(i32),
///
/// Send an input event to the node.
/// This is used to trigger physical input events like button presses, touch events, etc.
#[prost(message, tag = "27")]
SendInputEvent(InputEvent),
///
/// Set the owner for this node
#[prost(message, tag = "32")]
SetOwner(super::User),
///
/// 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.
#[prost(message, tag = "33")]
SetChannel(super::Channel),
///
/// Set the current Config
#[prost(message, tag = "34")]
SetConfig(super::Config),
///
/// Set the current Config
#[prost(message, tag = "35")]
SetModuleConfig(super::ModuleConfig),
///
/// Set the Canned Message Module messages text.
#[prost(string, tag = "36")]
SetCannedMessageModuleMessages(::prost::alloc::string::String),
///
/// Set the ringtone for ExternalNotification.
#[prost(string, tag = "37")]
SetRingtoneMessage(::prost::alloc::string::String),
///
/// Remove the node by the specified node-num from the NodeDB on the device
#[prost(uint32, tag = "38")]
RemoveByNodenum(u32),
///
/// Set specified node-num to be favorited on the NodeDB on the device
#[prost(uint32, tag = "39")]
SetFavoriteNode(u32),
///
/// Set specified node-num to be un-favorited on the NodeDB on the device
#[prost(uint32, tag = "40")]
RemoveFavoriteNode(u32),
///
/// Set fixed position data on the node and then set the position.fixed_position = true
#[prost(message, tag = "41")]
SetFixedPosition(super::Position),
///
/// Clear fixed position coordinates and then set position.fixed_position = false
#[prost(bool, tag = "42")]
RemoveFixedPosition(bool),
///
/// Set time only on the node
/// Convenience method to set the time on the node (as Net quality) without any other position data
#[prost(fixed32, tag = "43")]
SetTimeOnly(u32),
///
/// Tell the node to send the stored ui data.
#[prost(bool, tag = "44")]
GetUiConfigRequest(bool),
///
/// Reply stored device ui data.
#[prost(message, tag = "45")]
GetUiConfigResponse(super::DeviceUiConfig),
///
/// Tell the node to store UI data persistently.
#[prost(message, tag = "46")]
StoreUiConfig(super::DeviceUiConfig),
///
/// Set specified node-num to be ignored on the NodeDB on the device
#[prost(uint32, tag = "47")]
SetIgnoredNode(u32),
///
/// Set specified node-num to be un-ignored on the NodeDB on the device
#[prost(uint32, tag = "48")]
RemoveIgnoredNode(u32),
///
/// 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)
#[prost(bool, tag = "64")]
BeginEditSettings(bool),
///
/// Commits an open transaction for any edits made to config, module config, owner, and channel settings
#[prost(bool, tag = "65")]
CommitEditSettings(bool),
///
/// Add a contact (User) to the nodedb
#[prost(message, tag = "66")]
AddContact(super::SharedContact),
///
/// Initiate or respond to a key verification request
#[prost(message, tag = "67")]
KeyVerification(super::KeyVerificationAdmin),
///
/// 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.
#[prost(int32, tag = "94")]
FactoryResetDevice(i32),
///
/// 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.
#[prost(int32, tag = "95")]
RebootOtaSeconds(i32),
///
/// This message is only supported for the simulator Portduino build.
/// If received the simulator will exit successfully.
#[prost(bool, tag = "96")]
ExitSimulator(bool),
///
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
#[prost(int32, tag = "97")]
RebootSeconds(i32),
///
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
#[prost(int32, tag = "98")]
ShutdownSeconds(i32),
///
/// Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
#[prost(int32, tag = "99")]
FactoryResetConfig(i32),
///
/// Tell the node to reset the nodedb.
#[prost(int32, tag = "100")]
NodedbReset(i32),
}
}
///
/// Parameters for setting up Meshtastic for ameteur radio usage
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HamParameters {
///
/// Amateur radio call sign, eg. KD2ABC
#[prost(string, tag = "1")]
pub call_sign: ::prost::alloc::string::String,
///
/// Transmit power in dBm at the LoRA transceiver, not including any amplification
#[prost(int32, tag = "2")]
pub tx_power: i32,
///
/// 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.
#[prost(float, tag = "3")]
pub frequency: f32,
///
/// Optional short name of user
#[prost(string, tag = "4")]
pub short_name: ::prost::alloc::string::String,
}
///
/// Response envelope for node_remote_hardware_pins
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeRemoteHardwarePinsResponse {
///
/// Nodes and their respective remote hardware GPIO pins
#[prost(message, repeated, tag = "1")]
pub node_remote_hardware_pins: ::prost::alloc::vec::Vec<NodeRemoteHardwarePin>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SharedContact {
///
/// The node number of the contact
#[prost(uint32, tag = "1")]
pub node_num: u32,
///
/// The User of the contact
#[prost(message, optional, tag = "2")]
pub user: ::core::option::Option<User>,
///
/// Add this contact to the blocked / ignored list
#[prost(bool, tag = "3")]
pub should_ignore: bool,
}
///
/// This message is used by a client to initiate or complete a key verification
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct KeyVerificationAdmin {
#[prost(enumeration = "key_verification_admin::MessageType", tag = "1")]
pub message_type: i32,
///
/// The nodenum we're requesting
#[prost(uint32, tag = "2")]
pub remote_nodenum: u32,
///
/// The nonce is used to track the connection
#[prost(uint64, tag = "3")]
pub nonce: u64,
///
/// The 4 digit code generated by the remote node, and communicated outside the mesh
#[prost(uint32, optional, tag = "4")]
pub security_number: ::core::option::Option<u32>,
}
/// Nested message and enum types in `KeyVerificationAdmin`.
pub mod key_verification_admin {
///
/// Three stages of this request.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum MessageType {
///
/// This is the first stage, where a client initiates
InitiateVerification = 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.
ProvideSecurityNumber = 1,
///
/// Once the user has compared the verification message, this message notifies the node.
DoVerify = 2,
///
/// This is the cancel path, can be taken at any point
DoNotVerify = 3,
}
impl MessageType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::InitiateVerification => "INITIATE_VERIFICATION",
Self::ProvideSecurityNumber => "PROVIDE_SECURITY_NUMBER",
Self::DoVerify => "DO_VERIFY",
Self::DoNotVerify => "DO_NOT_VERIFY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INITIATE_VERIFICATION" => Some(Self::InitiateVerification),
"PROVIDE_SECURITY_NUMBER" => Some(Self::ProvideSecurityNumber),
"DO_VERIFY" => Some(Self::DoVerify),
"DO_NOT_VERIFY" => Some(Self::DoNotVerify),
_ => None,
}
}
}
}
///
/// This is the most compact possible representation for a set of channels.
/// It includes only one PRIMARY channel (which must be first) and
/// any SECONDARY channels.
/// No DISABLED channels are included.
/// This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelSet {
///
/// Channel list with settings
#[prost(message, repeated, tag = "1")]
pub settings: ::prost::alloc::vec::Vec<ChannelSettings>,
///
/// LoRa config
#[prost(message, optional, tag = "2")]
pub lora_config: ::core::option::Option<config::LoRaConfig>,
}
///
/// Packets for the official ATAK Plugin
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TakPacket {
///
/// Are the payloads strings compressed for LoRA transport?
#[prost(bool, tag = "1")]
pub is_compressed: bool,
///
/// The contact / callsign for ATAK user
#[prost(message, optional, tag = "2")]
pub contact: ::core::option::Option<Contact>,
///
/// The group for ATAK user
#[prost(message, optional, tag = "3")]
pub group: ::core::option::Option<Group>,
///
/// The status of the ATAK EUD
#[prost(message, optional, tag = "4")]
pub status: ::core::option::Option<Status>,
///
/// The payload of the packet
#[prost(oneof = "tak_packet::PayloadVariant", tags = "5, 6, 7")]
pub payload_variant: ::core::option::Option<tak_packet::PayloadVariant>,
}
/// Nested message and enum types in `TAKPacket`.
pub mod tak_packet {
///
/// The payload of the packet
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum PayloadVariant {
///
/// TAK position report
#[prost(message, tag = "5")]
Pli(super::Pli),
///
/// ATAK GeoChat message
#[prost(message, tag = "6")]
Chat(super::GeoChat),
///
/// Generic CoT detail XML
/// May be compressed / truncated by the sender (EUD)
#[prost(bytes, tag = "7")]
Detail(::prost::alloc::vec::Vec<u8>),
}
}
///
/// ATAK GeoChat message
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeoChat {
///
/// The text message
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
///
/// Uid recipient of the message
#[prost(string, optional, tag = "2")]
pub to: ::core::option::Option<::prost::alloc::string::String>,
///
/// Callsign of the recipient for the message
#[prost(string, optional, tag = "3")]
pub to_callsign: ::core::option::Option<::prost::alloc::string::String>,
}
///
/// ATAK Group
/// `<__group role='Team Member' name='Cyan'/>`
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Group {
///
/// Role of the group member
#[prost(enumeration = "MemberRole", tag = "1")]
pub role: i32,
///
/// Team (color)
/// Default Cyan
#[prost(enumeration = "Team", tag = "2")]
pub team: i32,
}
///
/// ATAK EUD Status
/// `<status battery='100' />`
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Status {
///
/// Battery level
#[prost(uint32, tag = "1")]
pub battery: u32,
}
///
/// ATAK Contact
/// `<contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/>`
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Contact {
///
/// Callsign
#[prost(string, tag = "1")]
pub callsign: ::prost::alloc::string::String,
///
/// Device callsign
///
///
/// IP address of endpoint in integer form (0.0.0.0 default)
#[prost(string, tag = "2")]
pub device_callsign: ::prost::alloc::string::String,
}
///
/// Position Location Information from ATAK
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Pli {
///
/// The new preferred location encoding, multiply by 1e-7 to get degrees
/// in floating point
#[prost(sfixed32, tag = "1")]
pub latitude_i: i32,
///
/// The new preferred location encoding, multiply by 1e-7 to get degrees
/// in floating point
#[prost(sfixed32, tag = "2")]
pub longitude_i: i32,
///
/// Altitude (ATAK prefers HAE)
#[prost(int32, tag = "3")]
pub altitude: i32,
///
/// Speed
#[prost(uint32, tag = "4")]
pub speed: u32,
///
/// Course in degrees
#[prost(uint32, tag = "5")]
pub course: u32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Team {
///
/// Unspecifed
UnspecifedColor = 0,
///
/// White
White = 1,
///
/// Yellow
Yellow = 2,
///
/// Orange
Orange = 3,
///
/// Magenta
Magenta = 4,
///
/// Red
Red = 5,
///
/// Maroon
Maroon = 6,
///
/// Purple
Purple = 7,
///
/// Dark Blue
DarkBlue = 8,
///
/// Blue
Blue = 9,
///
/// Cyan
Cyan = 10,
///
/// Teal
Teal = 11,
///
/// Green
Green = 12,
///
/// Dark Green
DarkGreen = 13,
///
/// Brown
Brown = 14,
}
impl Team {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnspecifedColor => "Unspecifed_Color",
Self::White => "White",
Self::Yellow => "Yellow",
Self::Orange => "Orange",
Self::Magenta => "Magenta",
Self::Red => "Red",
Self::Maroon => "Maroon",
Self::Purple => "Purple",
Self::DarkBlue => "Dark_Blue",
Self::Blue => "Blue",
Self::Cyan => "Cyan",
Self::Teal => "Teal",
Self::Green => "Green",
Self::DarkGreen => "Dark_Green",
Self::Brown => "Brown",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unspecifed_Color" => Some(Self::UnspecifedColor),
"White" => Some(Self::White),
"Yellow" => Some(Self::Yellow),
"Orange" => Some(Self::Orange),
"Magenta" => Some(Self::Magenta),
"Red" => Some(Self::Red),
"Maroon" => Some(Self::Maroon),
"Purple" => Some(Self::Purple),
"Dark_Blue" => Some(Self::DarkBlue),
"Blue" => Some(Self::Blue),
"Cyan" => Some(Self::Cyan),
"Teal" => Some(Self::Teal),
"Green" => Some(Self::Green),
"Dark_Green" => Some(Self::DarkGreen),
"Brown" => Some(Self::Brown),
_ => None,
}
}
}
///
/// Role of the group member
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MemberRole {
///
/// Unspecifed
Unspecifed = 0,
///
/// Team Member
TeamMember = 1,
///
/// Team Lead
TeamLead = 2,
///
/// Headquarters
Hq = 3,
///
/// Airsoft enthusiast
Sniper = 4,
///
/// Medic
Medic = 5,
///
/// ForwardObserver
ForwardObserver = 6,
///
/// Radio Telephone Operator
Rto = 7,
///
/// Doggo
K9 = 8,
}
impl MemberRole {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecifed => "Unspecifed",
Self::TeamMember => "TeamMember",
Self::TeamLead => "TeamLead",
Self::Hq => "HQ",
Self::Sniper => "Sniper",
Self::Medic => "Medic",
Self::ForwardObserver => "ForwardObserver",
Self::Rto => "RTO",
Self::K9 => "K9",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unspecifed" => Some(Self::Unspecifed),
"TeamMember" => Some(Self::TeamMember),
"TeamLead" => Some(Self::TeamLead),
"HQ" => Some(Self::Hq),
"Sniper" => Some(Self::Sniper),
"Medic" => Some(Self::Medic),
"ForwardObserver" => Some(Self::ForwardObserver),
"RTO" => Some(Self::Rto),
"K9" => Some(Self::K9),
_ => None,
}
}
}
///
/// Canned message module configuration.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CannedMessageModuleConfig {
///
/// Predefined messages for canned message module separated by '|' characters.
#[prost(string, tag = "1")]
pub messages: ::prost::alloc::string::String,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalConfig {
///
/// The part of the config that is specific to the Device
#[prost(message, optional, tag = "1")]
pub device: ::core::option::Option<config::DeviceConfig>,
///
/// The part of the config that is specific to the GPS Position
#[prost(message, optional, tag = "2")]
pub position: ::core::option::Option<config::PositionConfig>,
///
/// The part of the config that is specific to the Power settings
#[prost(message, optional, tag = "3")]
pub power: ::core::option::Option<config::PowerConfig>,
///
/// The part of the config that is specific to the Wifi Settings
#[prost(message, optional, tag = "4")]
pub network: ::core::option::Option<config::NetworkConfig>,
///
/// The part of the config that is specific to the Display
#[prost(message, optional, tag = "5")]
pub display: ::core::option::Option<config::DisplayConfig>,
///
/// The part of the config that is specific to the Lora Radio
#[prost(message, optional, tag = "6")]
pub lora: ::core::option::Option<config::LoRaConfig>,
///
/// The part of the config that is specific to the Bluetooth settings
#[prost(message, optional, tag = "7")]
pub bluetooth: ::core::option::Option<config::BluetoothConfig>,
///
/// A version integer used to invalidate old save files when we make
/// incompatible changes This integer is set at build time and is private to
/// NodeDB.cpp in the device code.
#[prost(uint32, tag = "8")]
pub version: u32,
///
/// The part of the config that is specific to Security settings
#[prost(message, optional, tag = "9")]
pub security: ::core::option::Option<config::SecurityConfig>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LocalModuleConfig {
///
/// The part of the config that is specific to the MQTT module
#[prost(message, optional, tag = "1")]
pub mqtt: ::core::option::Option<module_config::MqttConfig>,
///
/// The part of the config that is specific to the Serial module
#[prost(message, optional, tag = "2")]
pub serial: ::core::option::Option<module_config::SerialConfig>,
///
/// The part of the config that is specific to the ExternalNotification module
#[prost(message, optional, tag = "3")]
pub external_notification: ::core::option::Option<
module_config::ExternalNotificationConfig,
>,
///
/// The part of the config that is specific to the Store & Forward module
#[prost(message, optional, tag = "4")]
pub store_forward: ::core::option::Option<module_config::StoreForwardConfig>,
///
/// The part of the config that is specific to the RangeTest module
#[prost(message, optional, tag = "5")]
pub range_test: ::core::option::Option<module_config::RangeTestConfig>,
///
/// The part of the config that is specific to the Telemetry module
#[prost(message, optional, tag = "6")]
pub telemetry: ::core::option::Option<module_config::TelemetryConfig>,
///
/// The part of the config that is specific to the Canned Message module
#[prost(message, optional, tag = "7")]
pub canned_message: ::core::option::Option<module_config::CannedMessageConfig>,
///
/// The part of the config that is specific to the Audio module
#[prost(message, optional, tag = "9")]
pub audio: ::core::option::Option<module_config::AudioConfig>,
///
/// The part of the config that is specific to the Remote Hardware module
#[prost(message, optional, tag = "10")]
pub remote_hardware: ::core::option::Option<module_config::RemoteHardwareConfig>,
///
/// The part of the config that is specific to the Neighbor Info module
#[prost(message, optional, tag = "11")]
pub neighbor_info: ::core::option::Option<module_config::NeighborInfoConfig>,
///
/// The part of the config that is specific to the Ambient Lighting module
#[prost(message, optional, tag = "12")]
pub ambient_lighting: ::core::option::Option<module_config::AmbientLightingConfig>,
///
/// The part of the config that is specific to the Detection Sensor module
#[prost(message, optional, tag = "13")]
pub detection_sensor: ::core::option::Option<module_config::DetectionSensorConfig>,
///
/// Paxcounter Config
#[prost(message, optional, tag = "14")]
pub paxcounter: ::core::option::Option<module_config::PaxcounterConfig>,
///
/// A version integer used to invalidate old save files when we make
/// incompatible changes This integer is set at build time and is private to
/// NodeDB.cpp in the device code.
#[prost(uint32, tag = "8")]
pub version: u32,
}
///
/// This abstraction is used to contain any configuration for provisioning a node on any client.
/// It is useful for importing and exporting configurations.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceProfile {
///
/// Long name for the node
#[prost(string, optional, tag = "1")]
pub long_name: ::core::option::Option<::prost::alloc::string::String>,
///
/// Short name of the node
#[prost(string, optional, tag = "2")]
pub short_name: ::core::option::Option<::prost::alloc::string::String>,
///
/// The url of the channels from our node
#[prost(string, optional, tag = "3")]
pub channel_url: ::core::option::Option<::prost::alloc::string::String>,
///
/// The Config of the node
#[prost(message, optional, tag = "4")]
pub config: ::core::option::Option<LocalConfig>,
///
/// The ModuleConfig of the node
#[prost(message, optional, tag = "5")]
pub module_config: ::core::option::Option<LocalModuleConfig>,
///
/// Fixed position data
#[prost(message, optional, tag = "6")]
pub fixed_position: ::core::option::Option<Position>,
///
/// Ringtone for ExternalNotification
#[prost(string, optional, tag = "7")]
pub ringtone: ::core::option::Option<::prost::alloc::string::String>,
///
/// Predefined messages for CannedMessage
#[prost(string, optional, tag = "8")]
pub canned_messages: ::core::option::Option<::prost::alloc::string::String>,
}
///
/// Position with static location information only for NodeDBLite
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PositionLite {
///
/// The new preferred location encoding, multiply by 1e-7 to get degrees
/// in floating point
#[prost(sfixed32, tag = "1")]
pub latitude_i: i32,
///
/// TODO: REPLACE
#[prost(sfixed32, tag = "2")]
pub longitude_i: i32,
///
/// In meters above MSL (but see issue #359)
#[prost(int32, tag = "3")]
pub altitude: i32,
///
/// 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
#[prost(fixed32, tag = "4")]
pub time: u32,
///
/// TODO: REPLACE
#[prost(enumeration = "position::LocSource", tag = "5")]
pub location_source: i32,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UserLite {
///
/// This is the addr of the radio.
#[deprecated]
#[prost(bytes = "vec", tag = "1")]
pub macaddr: ::prost::alloc::vec::Vec<u8>,
///
/// A full name for this user, i.e. "Kevin Hester"
#[prost(string, tag = "2")]
pub long_name: ::prost::alloc::string::String,
///
/// A VERY short name, ideally two characters.
/// Suitable for a tiny OLED screen
#[prost(string, tag = "3")]
pub short_name: ::prost::alloc::string::String,
///
/// 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.
#[prost(enumeration = "HardwareModel", tag = "4")]
pub hw_model: i32,
///
/// 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.
#[prost(bool, tag = "5")]
pub is_licensed: bool,
///
/// Indicates that the user's role in the mesh
#[prost(enumeration = "config::device_config::Role", tag = "6")]
pub role: i32,
///
/// The public key of the user's device.
/// This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
#[prost(bytes = "vec", tag = "7")]
pub public_key: ::prost::alloc::vec::Vec<u8>,
///
/// Whether or not the node can be messaged
#[prost(bool, optional, tag = "9")]
pub is_unmessagable: ::core::option::Option<bool>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfoLite {
///
/// The node number
#[prost(uint32, tag = "1")]
pub num: u32,
///
/// The user info for this node
#[prost(message, optional, tag = "2")]
pub user: ::core::option::Option<UserLite>,
///
/// 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.
#[prost(message, optional, tag = "3")]
pub position: ::core::option::Option<PositionLite>,
///
/// 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
#[prost(float, tag = "4")]
pub snr: f32,
///
/// Set to indicate the last time we received a packet from this node
#[prost(fixed32, tag = "5")]
pub last_heard: u32,
///
/// The latest device metrics for the node.
#[prost(message, optional, tag = "6")]
pub device_metrics: ::core::option::Option<DeviceMetrics>,
///
/// local channel index we heard that node on. Only populated if its not the default channel.
#[prost(uint32, tag = "7")]
pub channel: u32,
///
/// True if we witnessed the node over MQTT instead of LoRA transport
#[prost(bool, tag = "8")]
pub via_mqtt: bool,
///
/// Number of hops away from us this node is (0 if direct neighbor)
#[prost(uint32, optional, tag = "9")]
pub hops_away: ::core::option::Option<u32>,
///
/// True if node is in our favorites list
/// Persists between NodeDB internal clean ups
#[prost(bool, tag = "10")]
pub is_favorite: bool,
///
/// True if node is in our ignored list
/// Persists between NodeDB internal clean ups
#[prost(bool, tag = "11")]
pub is_ignored: bool,
///
/// Last byte of the node number of the node that should be used as the next hop to reach this node.
#[prost(uint32, tag = "12")]
pub next_hop: u32,
///
/// Bitfield for storing booleans.
/// LSB 0 is_key_manually_verified
#[prost(uint32, tag = "13")]
pub bitfield: u32,
}
///
/// This message is never sent over the wire, but it is used for serializing DB
/// state to flash in the device code
/// FIXME, since we write this each time we enter deep sleep (and have infinite
/// flash) it would be better to use some sort of append only data structure for
/// the receive queue and use the preferences store for the other stuff
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceState {
///
/// Read only settings/info about this node
#[prost(message, optional, tag = "2")]
pub my_node: ::core::option::Option<MyNodeInfo>,
///
/// My owner info
#[prost(message, optional, tag = "3")]
pub owner: ::core::option::Option<User>,
///
/// Received packets saved for delivery to the phone
#[prost(message, repeated, tag = "5")]
pub receive_queue: ::prost::alloc::vec::Vec<MeshPacket>,
///
/// A version integer used to invalidate old save files when we make
/// incompatible changes This integer is set at build time and is private to
/// NodeDB.cpp in the device code.
#[prost(uint32, tag = "8")]
pub version: u32,
///
/// We keep the last received text message (only) stored in the device flash,
/// so we can show it on the screen.
/// Might be null
#[prost(message, optional, tag = "7")]
pub rx_text_message: ::core::option::Option<MeshPacket>,
///
/// Used only during development.
/// Indicates developer is testing and changes should never be saved to flash.
/// Deprecated in 2.3.1
#[deprecated]
#[prost(bool, tag = "9")]
pub no_save: bool,
///
/// Previously used to manage GPS factory resets.
/// Deprecated in 2.5.23
#[deprecated]
#[prost(bool, tag = "11")]
pub did_gps_reset: bool,
///
/// We keep the last received waypoint stored in the device flash,
/// so we can show it on the screen.
/// Might be null
#[prost(message, optional, tag = "12")]
pub rx_waypoint: ::core::option::Option<MeshPacket>,
///
/// The mesh's nodes with their available gpio pins for RemoteHardware module
#[prost(message, repeated, tag = "13")]
pub node_remote_hardware_pins: ::prost::alloc::vec::Vec<NodeRemoteHardwarePin>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeDatabase {
///
/// A version integer used to invalidate old save files when we make
/// incompatible changes This integer is set at build time and is private to
/// NodeDB.cpp in the device code.
#[prost(uint32, tag = "1")]
pub version: u32,
///
/// New lite version of NodeDB to decrease memory footprint
#[prost(message, repeated, tag = "2")]
pub nodes: ::prost::alloc::vec::Vec<NodeInfoLite>,
}
///
/// The on-disk saved channels
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelFile {
///
/// The channels our node knows about
#[prost(message, repeated, tag = "1")]
pub channels: ::prost::alloc::vec::Vec<Channel>,
///
/// A version integer used to invalidate old save files when we make
/// incompatible changes This integer is set at build time and is private to
/// NodeDB.cpp in the device code.
#[prost(uint32, tag = "2")]
pub version: u32,
}
///
/// The on-disk backup of the node's preferences
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupPreferences {
///
/// The version of the backup
#[prost(uint32, tag = "1")]
pub version: u32,
///
/// The timestamp of the backup (if node has time)
#[prost(fixed32, tag = "2")]
pub timestamp: u32,
///
/// The node's configuration
#[prost(message, optional, tag = "3")]
pub config: ::core::option::Option<LocalConfig>,
///
/// The node's module configuration
#[prost(message, optional, tag = "4")]
pub module_config: ::core::option::Option<LocalModuleConfig>,
///
/// The node's channels
#[prost(message, optional, tag = "5")]
pub channels: ::core::option::Option<ChannelFile>,
///
/// The node's user (owner) information
#[prost(message, optional, tag = "6")]
pub owner: ::core::option::Option<User>,
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SensorData {
/// The message type
#[prost(enumeration = "MessageType", tag = "1")]
pub r#type: i32,
/// The sensor data, either as a float or an uint32
#[prost(oneof = "sensor_data::Data", tags = "2, 3")]
pub data: ::core::option::Option<sensor_data::Data>,
}
/// Nested message and enum types in `SensorData`.
pub mod sensor_data {
/// The sensor data, either as a float or an uint32
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Data {
#[prost(float, tag = "2")]
FloatValue(f32),
#[prost(uint32, tag = "3")]
Uint32Value(u32),
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterdeviceMessage {
/// The message data
#[prost(oneof = "interdevice_message::Data", tags = "1, 2")]
pub data: ::core::option::Option<interdevice_message::Data>,
}
/// Nested message and enum types in `InterdeviceMessage`.
pub mod interdevice_message {
/// The message data
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
#[prost(string, tag = "1")]
Nmea(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Sensor(super::SensorData),
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
Ack = 0,
/// in ms
CollectInterval = 160,
/// duration ms
BeepOn = 161,
/// cancel prematurely
BeepOff = 162,
Shutdown = 163,
PowerOn = 164,
Scd41Temp = 176,
Scd41Humidity = 177,
Scd41Co2 = 178,
Aht20Temp = 179,
Aht20Humidity = 180,
TvocIndex = 181,
}
impl MessageType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Ack => "ACK",
Self::CollectInterval => "COLLECT_INTERVAL",
Self::BeepOn => "BEEP_ON",
Self::BeepOff => "BEEP_OFF",
Self::Shutdown => "SHUTDOWN",
Self::PowerOn => "POWER_ON",
Self::Scd41Temp => "SCD41_TEMP",
Self::Scd41Humidity => "SCD41_HUMIDITY",
Self::Scd41Co2 => "SCD41_CO2",
Self::Aht20Temp => "AHT20_TEMP",
Self::Aht20Humidity => "AHT20_HUMIDITY",
Self::TvocIndex => "TVOC_INDEX",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACK" => Some(Self::Ack),
"COLLECT_INTERVAL" => Some(Self::CollectInterval),
"BEEP_ON" => Some(Self::BeepOn),
"BEEP_OFF" => Some(Self::BeepOff),
"SHUTDOWN" => Some(Self::Shutdown),
"POWER_ON" => Some(Self::PowerOn),
"SCD41_TEMP" => Some(Self::Scd41Temp),
"SCD41_HUMIDITY" => Some(Self::Scd41Humidity),
"SCD41_CO2" => Some(Self::Scd41Co2),
"AHT20_TEMP" => Some(Self::Aht20Temp),
"AHT20_HUMIDITY" => Some(Self::Aht20Humidity),
"TVOC_INDEX" => Some(Self::TvocIndex),
_ => None,
}
}
}
///
/// This message wraps a MeshPacket with extra metadata about the sender and how it arrived.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceEnvelope {
///
/// The (probably encrypted) packet
#[prost(message, optional, tag = "1")]
pub packet: ::core::option::Option<MeshPacket>,
///
/// The global channel ID it was sent on
#[prost(string, tag = "2")]
pub channel_id: ::prost::alloc::string::String,
///
/// The sending gateway node ID. Can we use this to authenticate/prevent fake
/// nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as
/// the globally trusted nodenum
#[prost(string, tag = "3")]
pub gateway_id: ::prost::alloc::string::String,
}
///
/// Information about a node intended to be reported unencrypted to a map using MQTT.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MapReport {
///
/// A full name for this user, i.e. "Kevin Hester"
#[prost(string, tag = "1")]
pub long_name: ::prost::alloc::string::String,
///
/// A VERY short name, ideally two characters.
/// Suitable for a tiny OLED screen
#[prost(string, tag = "2")]
pub short_name: ::prost::alloc::string::String,
///
/// Role of the node that applies specific settings for a particular use-case
#[prost(enumeration = "config::device_config::Role", tag = "3")]
pub role: i32,
///
/// Hardware model of the node, i.e. T-Beam, Heltec V3, etc...
#[prost(enumeration = "HardwareModel", tag = "4")]
pub hw_model: i32,
///
/// Device firmware version string
#[prost(string, tag = "5")]
pub firmware_version: ::prost::alloc::string::String,
///
/// The region code for the radio (US, CN, EU433, etc...)
#[prost(enumeration = "config::lo_ra_config::RegionCode", tag = "6")]
pub region: i32,
///
/// Modem preset used by the radio (LongFast, MediumSlow, etc...)
#[prost(enumeration = "config::lo_ra_config::ModemPreset", tag = "7")]
pub modem_preset: i32,
///
/// Whether the node has a channel with default PSK and name (LongFast, MediumSlow, etc...)
/// and it uses the default frequency slot given the region and modem preset.
#[prost(bool, tag = "8")]
pub has_default_channel: bool,
///
/// Latitude: multiply by 1e-7 to get degrees in floating point
#[prost(sfixed32, tag = "9")]
pub latitude_i: i32,
///
/// Longitude: multiply by 1e-7 to get degrees in floating point
#[prost(sfixed32, tag = "10")]
pub longitude_i: i32,
///
/// Altitude in meters above MSL
#[prost(int32, tag = "11")]
pub altitude: i32,
///
/// Indicates the bits of precision for latitude and longitude set by the sending node
#[prost(uint32, tag = "12")]
pub position_precision: u32,
///
/// Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT)
#[prost(uint32, tag = "13")]
pub num_online_local_nodes: u32,
///
/// User has opted in to share their location (map report) with the mqtt server
/// Controlled by map_report.should_report_location
#[prost(bool, tag = "14")]
pub has_opted_report_location: bool,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Paxcount {
///
/// seen Wifi devices
#[prost(uint32, tag = "1")]
pub wifi: u32,
///
/// Seen BLE devices
#[prost(uint32, tag = "2")]
pub ble: u32,
///
/// Uptime in seconds
#[prost(uint32, tag = "3")]
pub uptime: u32,
}
/// Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs).
/// But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PowerMon {}
/// Nested message and enum types in `PowerMon`.
pub mod power_mon {
/// Any significant power changing event in meshtastic should be tagged with a powermon state transition.
/// If you are making new meshtastic features feel free to add new entries at the end of this definition.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
None = 0,
CpuDeepSleep = 1,
CpuLightSleep = 2,
///
/// The external Vext1 power is on. Many boards have auxillary power rails that the CPU turns on only
/// occasionally. In cases where that rail has multiple devices on it we usually want to have logging on
/// the state of that rail as an independent record.
/// For instance on the Heltec Tracker 1.1 board, this rail is the power source for the GPS and screen.
///
/// The log messages will be short and complete (see PowerMon.Event in the protobufs for details).
/// something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of all current states.
/// (We use a bitmask for states so that if a log message gets lost it won't be fatal)
Vext1On = 4,
LoraRxOn = 8,
LoraTxOn = 16,
LoraRxActive = 32,
BtOn = 64,
LedOn = 128,
ScreenOn = 256,
ScreenDrawing = 512,
WifiOn = 1024,
///
/// GPS is actively trying to find our location
/// See GPSPowerState for more details
GpsActive = 2048,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::None => "None",
Self::CpuDeepSleep => "CPU_DeepSleep",
Self::CpuLightSleep => "CPU_LightSleep",
Self::Vext1On => "Vext1_On",
Self::LoraRxOn => "Lora_RXOn",
Self::LoraTxOn => "Lora_TXOn",
Self::LoraRxActive => "Lora_RXActive",
Self::BtOn => "BT_On",
Self::LedOn => "LED_On",
Self::ScreenOn => "Screen_On",
Self::ScreenDrawing => "Screen_Drawing",
Self::WifiOn => "Wifi_On",
Self::GpsActive => "GPS_Active",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"None" => Some(Self::None),
"CPU_DeepSleep" => Some(Self::CpuDeepSleep),
"CPU_LightSleep" => Some(Self::CpuLightSleep),
"Vext1_On" => Some(Self::Vext1On),
"Lora_RXOn" => Some(Self::LoraRxOn),
"Lora_TXOn" => Some(Self::LoraTxOn),
"Lora_RXActive" => Some(Self::LoraRxActive),
"BT_On" => Some(Self::BtOn),
"LED_On" => Some(Self::LedOn),
"Screen_On" => Some(Self::ScreenOn),
"Screen_Drawing" => Some(Self::ScreenDrawing),
"Wifi_On" => Some(Self::WifiOn),
"GPS_Active" => Some(Self::GpsActive),
_ => None,
}
}
}
}
///
/// PowerStress testing support via the C++ PowerStress module
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PowerStressMessage {
///
/// What type of HardwareMessage is this?
#[prost(enumeration = "power_stress_message::Opcode", tag = "1")]
pub cmd: i32,
#[prost(float, tag = "2")]
pub num_seconds: f32,
}
/// Nested message and enum types in `PowerStressMessage`.
pub mod power_stress_message {
///
/// What operation would we like the UUT to perform.
/// note: senders should probably set want_response in their request packets, so that they can know when the state
/// machine has started processing their request
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Opcode {
///
/// Unset/unused
Unset = 0,
/// Print board version slog and send an ack that we are alive and ready to process commands
PrintInfo = 1,
/// Try to turn off all automatic processing of packets, screen, sleeping, etc (to make it easier to measure in isolation)
ForceQuiet = 2,
/// Stop powerstress processing - probably by just rebooting the board
EndQuiet = 3,
/// Turn the screen on
ScreenOn = 16,
/// Turn the screen off
ScreenOff = 17,
/// Let the CPU run but we assume mostly idling for num_seconds
CpuIdle = 32,
/// Force deep sleep for FIXME seconds
CpuDeepsleep = 33,
/// Spin the CPU as fast as possible for num_seconds
CpuFullon = 34,
/// Turn the LED on for num_seconds (and leave it on - for baseline power measurement purposes)
LedOn = 48,
/// Force the LED off for num_seconds
LedOff = 49,
/// Completely turn off the LORA radio for num_seconds
LoraOff = 64,
/// Send Lora packets for num_seconds
LoraTx = 65,
/// Receive Lora packets for num_seconds (node will be mostly just listening, unless an external agent is helping stress this by sending packets on the current channel)
LoraRx = 66,
/// Turn off the BT radio for num_seconds
BtOff = 80,
/// Turn on the BT radio for num_seconds
BtOn = 81,
/// Turn off the WIFI radio for num_seconds
WifiOff = 96,
/// Turn on the WIFI radio for num_seconds
WifiOn = 97,
/// Turn off the GPS radio for num_seconds
GpsOff = 112,
/// Turn on the GPS radio for num_seconds
GpsOn = 113,
}
impl Opcode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::PrintInfo => "PRINT_INFO",
Self::ForceQuiet => "FORCE_QUIET",
Self::EndQuiet => "END_QUIET",
Self::ScreenOn => "SCREEN_ON",
Self::ScreenOff => "SCREEN_OFF",
Self::CpuIdle => "CPU_IDLE",
Self::CpuDeepsleep => "CPU_DEEPSLEEP",
Self::CpuFullon => "CPU_FULLON",
Self::LedOn => "LED_ON",
Self::LedOff => "LED_OFF",
Self::LoraOff => "LORA_OFF",
Self::LoraTx => "LORA_TX",
Self::LoraRx => "LORA_RX",
Self::BtOff => "BT_OFF",
Self::BtOn => "BT_ON",
Self::WifiOff => "WIFI_OFF",
Self::WifiOn => "WIFI_ON",
Self::GpsOff => "GPS_OFF",
Self::GpsOn => "GPS_ON",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"PRINT_INFO" => Some(Self::PrintInfo),
"FORCE_QUIET" => Some(Self::ForceQuiet),
"END_QUIET" => Some(Self::EndQuiet),
"SCREEN_ON" => Some(Self::ScreenOn),
"SCREEN_OFF" => Some(Self::ScreenOff),
"CPU_IDLE" => Some(Self::CpuIdle),
"CPU_DEEPSLEEP" => Some(Self::CpuDeepsleep),
"CPU_FULLON" => Some(Self::CpuFullon),
"LED_ON" => Some(Self::LedOn),
"LED_OFF" => Some(Self::LedOff),
"LORA_OFF" => Some(Self::LoraOff),
"LORA_TX" => Some(Self::LoraTx),
"LORA_RX" => Some(Self::LoraRx),
"BT_OFF" => Some(Self::BtOff),
"BT_ON" => Some(Self::BtOn),
"WIFI_OFF" => Some(Self::WifiOff),
"WIFI_ON" => Some(Self::WifiOn),
"GPS_OFF" => Some(Self::GpsOff),
"GPS_ON" => Some(Self::GpsOn),
_ => None,
}
}
}
}
///
/// An example app to show off the module system. This message is used for
/// REMOTE_HARDWARE_APP PortNums.
/// Also provides easy remote access to any GPIO.
/// In the future other remote hardware operations can be added based on user interest
/// (i.e. serial output, spi/i2c input/output).
/// FIXME - currently this feature is turned on by default which is dangerous
/// because no security yet (beyond the channel mechanism).
/// It should be off by default and then protected based on some TBD mechanism
/// (a special channel once multichannel support is included?)
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HardwareMessage {
///
/// What type of HardwareMessage is this?
#[prost(enumeration = "hardware_message::Type", tag = "1")]
pub r#type: i32,
///
/// What gpios are we changing. Not used for all MessageTypes, see MessageType for details
#[prost(uint64, tag = "2")]
pub gpio_mask: u64,
///
/// For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
/// Not used for all MessageTypes, see MessageType for details
#[prost(uint64, tag = "3")]
pub gpio_value: u64,
}
/// Nested message and enum types in `HardwareMessage`.
pub mod hardware_message {
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
///
/// Unset/unused
Unset = 0,
///
/// Set gpio gpios based on gpio_mask/gpio_value
WriteGpios = 1,
///
/// We are now interested in watching the gpio_mask gpios.
/// If the selected gpios change, please broadcast GPIOS_CHANGED.
/// Will implicitly change the gpios requested to be INPUT gpios.
WatchGpios = 2,
///
/// The gpios listed in gpio_mask have changed, the new values are listed in gpio_value
GpiosChanged = 3,
///
/// Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated
ReadGpios = 4,
///
/// A reply to READ_GPIOS. gpio_mask and gpio_value will be populated
ReadGpiosReply = 5,
}
impl Type {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::WriteGpios => "WRITE_GPIOS",
Self::WatchGpios => "WATCH_GPIOS",
Self::GpiosChanged => "GPIOS_CHANGED",
Self::ReadGpios => "READ_GPIOS",
Self::ReadGpiosReply => "READ_GPIOS_REPLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"WRITE_GPIOS" => Some(Self::WriteGpios),
"WATCH_GPIOS" => Some(Self::WatchGpios),
"GPIOS_CHANGED" => Some(Self::GpiosChanged),
"READ_GPIOS" => Some(Self::ReadGpios),
"READ_GPIOS_REPLY" => Some(Self::ReadGpiosReply),
_ => None,
}
}
}
}
///
/// Canned message module configuration.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RtttlConfig {
///
/// Ringtone for PWM Buzzer in RTTTL Format.
#[prost(string, tag = "1")]
pub ringtone: ::prost::alloc::string::String,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StoreAndForward {
///
/// TODO: REPLACE
#[prost(enumeration = "store_and_forward::RequestResponse", tag = "1")]
pub rr: i32,
///
/// TODO: REPLACE
#[prost(oneof = "store_and_forward::Variant", tags = "2, 3, 4, 5")]
pub variant: ::core::option::Option<store_and_forward::Variant>,
}
/// Nested message and enum types in `StoreAndForward`.
pub mod store_and_forward {
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Statistics {
///
/// Number of messages we have ever seen
#[prost(uint32, tag = "1")]
pub messages_total: u32,
///
/// Number of messages we have currently saved our history.
#[prost(uint32, tag = "2")]
pub messages_saved: u32,
///
/// Maximum number of messages we will save
#[prost(uint32, tag = "3")]
pub messages_max: u32,
///
/// Router uptime in seconds
#[prost(uint32, tag = "4")]
pub up_time: u32,
///
/// Number of times any client sent a request to the S&F.
#[prost(uint32, tag = "5")]
pub requests: u32,
///
/// Number of times the history was requested.
#[prost(uint32, tag = "6")]
pub requests_history: u32,
///
/// Is the heartbeat enabled on the server?
#[prost(bool, tag = "7")]
pub heartbeat: bool,
///
/// Maximum number of messages the server will return.
#[prost(uint32, tag = "8")]
pub return_max: u32,
///
/// Maximum history window in minutes the server will return messages from.
#[prost(uint32, tag = "9")]
pub return_window: u32,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct History {
///
/// Number of that will be sent to the client
#[prost(uint32, tag = "1")]
pub history_messages: u32,
///
/// The window of messages that was used to filter the history client requested
#[prost(uint32, tag = "2")]
pub window: u32,
///
/// Index in the packet history of the last message sent in a previous request to the server.
/// Will be sent to the client before sending the history and can be set in a subsequent request to avoid getting packets the server already sent to the client.
#[prost(uint32, tag = "3")]
pub last_request: u32,
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Heartbeat {
///
/// Period in seconds that the heartbeat is sent out that will be sent to the client
#[prost(uint32, tag = "1")]
pub period: u32,
///
/// If set, this is not the primary Store & Forward router on the mesh
#[prost(uint32, tag = "2")]
pub secondary: u32,
}
///
/// 001 - 063 = From Router
/// 064 - 127 = From Client
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RequestResponse {
///
/// Unset/unused
Unset = 0,
///
/// Router is an in error state.
RouterError = 1,
///
/// Router heartbeat
RouterHeartbeat = 2,
///
/// Router has requested the client respond. This can work as a
/// "are you there" message.
RouterPing = 3,
///
/// The response to a "Ping"
RouterPong = 4,
///
/// Router is currently busy. Please try again later.
RouterBusy = 5,
///
/// Router is responding to a request for history.
RouterHistory = 6,
///
/// Router is responding to a request for stats.
RouterStats = 7,
///
/// Router sends a text message from its history that was a direct message.
RouterTextDirect = 8,
///
/// Router sends a text message from its history that was a broadcast.
RouterTextBroadcast = 9,
///
/// Client is an in error state.
ClientError = 64,
///
/// Client has requested a replay from the router.
ClientHistory = 65,
///
/// Client has requested stats from the router.
ClientStats = 66,
///
/// Client has requested the router respond. This can work as a
/// "are you there" message.
ClientPing = 67,
///
/// The response to a "Ping"
ClientPong = 68,
///
/// Client has requested that the router abort processing the client's request
ClientAbort = 106,
}
impl RequestResponse {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unset => "UNSET",
Self::RouterError => "ROUTER_ERROR",
Self::RouterHeartbeat => "ROUTER_HEARTBEAT",
Self::RouterPing => "ROUTER_PING",
Self::RouterPong => "ROUTER_PONG",
Self::RouterBusy => "ROUTER_BUSY",
Self::RouterHistory => "ROUTER_HISTORY",
Self::RouterStats => "ROUTER_STATS",
Self::RouterTextDirect => "ROUTER_TEXT_DIRECT",
Self::RouterTextBroadcast => "ROUTER_TEXT_BROADCAST",
Self::ClientError => "CLIENT_ERROR",
Self::ClientHistory => "CLIENT_HISTORY",
Self::ClientStats => "CLIENT_STATS",
Self::ClientPing => "CLIENT_PING",
Self::ClientPong => "CLIENT_PONG",
Self::ClientAbort => "CLIENT_ABORT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSET" => Some(Self::Unset),
"ROUTER_ERROR" => Some(Self::RouterError),
"ROUTER_HEARTBEAT" => Some(Self::RouterHeartbeat),
"ROUTER_PING" => Some(Self::RouterPing),
"ROUTER_PONG" => Some(Self::RouterPong),
"ROUTER_BUSY" => Some(Self::RouterBusy),
"ROUTER_HISTORY" => Some(Self::RouterHistory),
"ROUTER_STATS" => Some(Self::RouterStats),
"ROUTER_TEXT_DIRECT" => Some(Self::RouterTextDirect),
"ROUTER_TEXT_BROADCAST" => Some(Self::RouterTextBroadcast),
"CLIENT_ERROR" => Some(Self::ClientError),
"CLIENT_HISTORY" => Some(Self::ClientHistory),
"CLIENT_STATS" => Some(Self::ClientStats),
"CLIENT_PING" => Some(Self::ClientPing),
"CLIENT_PONG" => Some(Self::ClientPong),
"CLIENT_ABORT" => Some(Self::ClientAbort),
_ => None,
}
}
}
///
/// TODO: REPLACE
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Variant {
///
/// TODO: REPLACE
#[prost(message, tag = "2")]
Stats(Statistics),
///
/// TODO: REPLACE
#[prost(message, tag = "3")]
History(History),
///
/// TODO: REPLACE
#[prost(message, tag = "4")]
Heartbeat(Heartbeat),
///
/// Text from history message.
#[prost(bytes, tag = "5")]
Text(::prost::alloc::vec::Vec<u8>),
}
}