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
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
#![doc = "This file was automatically generated, do not edit"]
use crate::MavlinkVersion;
use crate::{bytes::Bytes, bytes_mut::BytesMut, error::*, Message, MessageData};
#[allow(unused_imports)]
use bitflags::bitflags;
#[allow(unused_imports)]
use num_derive::FromPrimitive;
#[allow(unused_imports)]
use num_derive::ToPrimitive;
#[allow(unused_imports)]
use num_traits::FromPrimitive;
#[allow(unused_imports)]
use num_traits::ToPrimitive;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes presedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
impl GimbalDeviceFlags {
    pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
}
impl Default for GimbalDeviceFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum CanFilterOp {
    CAN_FILTER_REPLACE = 0,
    CAN_FILTER_ADD = 1,
    CAN_FILTER_REMOVE = 2,
}
impl CanFilterOp {
    pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
}
impl Default for CanFilterOp {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "None of the fields in HIGHRES_IMU have been updated"] const HIGHRES_IMU_UPDATED_NONE = 0 ; # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; # [doc = "All fields in HIGHRES_IMU have been updated."] const HIGHRES_IMU_UPDATED_ALL = 65535 ; } }
impl HighresImuUpdatedFlags {
    pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_NONE;
}
impl Default for HighresImuUpdatedFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "These values define the type of firmware release.  These values indicate the first version or release of this type.  For example the first alpha release would be 64, the second would be 65."]
pub enum FirmwareVersionType {
    #[doc = "development release"]
    FIRMWARE_VERSION_TYPE_DEV = 0,
    #[doc = "alpha release"]
    FIRMWARE_VERSION_TYPE_ALPHA = 64,
    #[doc = "beta release"]
    FIRMWARE_VERSION_TYPE_BETA = 128,
    #[doc = "release candidate"]
    FIRMWARE_VERSION_TYPE_RC = 192,
    #[doc = "official stable release"]
    FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
}
impl FirmwareVersionType {
    pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
}
impl Default for FirmwareVersionType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
pub enum MavType {
    #[doc = "Generic micro air vehicle"]
    MAV_TYPE_GENERIC = 0,
    #[doc = "Fixed wing aircraft."]
    MAV_TYPE_FIXED_WING = 1,
    #[doc = "Quadrotor"]
    MAV_TYPE_QUADROTOR = 2,
    #[doc = "Coaxial helicopter"]
    MAV_TYPE_COAXIAL = 3,
    #[doc = "Normal helicopter with tail rotor."]
    MAV_TYPE_HELICOPTER = 4,
    #[doc = "Ground installation"]
    MAV_TYPE_ANTENNA_TRACKER = 5,
    #[doc = "Operator control unit / ground control station"]
    MAV_TYPE_GCS = 6,
    #[doc = "Airship, controlled"]
    MAV_TYPE_AIRSHIP = 7,
    #[doc = "Free balloon, uncontrolled"]
    MAV_TYPE_FREE_BALLOON = 8,
    #[doc = "Rocket"]
    MAV_TYPE_ROCKET = 9,
    #[doc = "Ground rover"]
    MAV_TYPE_GROUND_ROVER = 10,
    #[doc = "Surface vessel, boat, ship"]
    MAV_TYPE_SURFACE_BOAT = 11,
    #[doc = "Submarine"]
    MAV_TYPE_SUBMARINE = 12,
    #[doc = "Hexarotor"]
    MAV_TYPE_HEXAROTOR = 13,
    #[doc = "Octorotor"]
    MAV_TYPE_OCTOROTOR = 14,
    #[doc = "Tricopter"]
    MAV_TYPE_TRICOPTER = 15,
    #[doc = "Flapping wing"]
    MAV_TYPE_FLAPPING_WING = 16,
    #[doc = "Kite"]
    MAV_TYPE_KITE = 17,
    #[doc = "Onboard companion controller"]
    MAV_TYPE_ONBOARD_CONTROLLER = 18,
    #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
    MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
    #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
    MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
    #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
    MAV_TYPE_VTOL_TILTROTOR = 21,
    #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
    MAV_TYPE_VTOL_FIXEDROTOR = 22,
    #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_DUOROTOR or MAV_TYPE_VTOL_QUADROTOR if appropriate."]
    MAV_TYPE_VTOL_TAILSITTER = 23,
    #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
    MAV_TYPE_VTOL_TILTWING = 24,
    #[doc = "VTOL reserved 5"]
    MAV_TYPE_VTOL_RESERVED5 = 25,
    #[doc = "Gimbal"]
    MAV_TYPE_GIMBAL = 26,
    #[doc = "ADSB system"]
    MAV_TYPE_ADSB = 27,
    #[doc = "Steerable, nonrigid airfoil"]
    MAV_TYPE_PARAFOIL = 28,
    #[doc = "Dodecarotor"]
    MAV_TYPE_DODECAROTOR = 29,
    #[doc = "Camera"]
    MAV_TYPE_CAMERA = 30,
    #[doc = "Charging station"]
    MAV_TYPE_CHARGING_STATION = 31,
    #[doc = "FLARM collision avoidance system"]
    MAV_TYPE_FLARM = 32,
    #[doc = "Servo"]
    MAV_TYPE_SERVO = 33,
    #[doc = "Open Drone ID. See https://mavlink.io/en/services/opendroneid.html."]
    MAV_TYPE_ODID = 34,
    #[doc = "Decarotor"]
    MAV_TYPE_DECAROTOR = 35,
    #[doc = "Battery"]
    MAV_TYPE_BATTERY = 36,
    #[doc = "Parachute"]
    MAV_TYPE_PARACHUTE = 37,
    #[doc = "Log"]
    MAV_TYPE_LOG = 38,
    #[doc = "OSD"]
    MAV_TYPE_OSD = 39,
    #[doc = "IMU"]
    MAV_TYPE_IMU = 40,
    #[doc = "GPS"]
    MAV_TYPE_GPS = 41,
    #[doc = "Winch"]
    MAV_TYPE_WINCH = 42,
}
impl MavType {
    pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
}
impl Default for MavType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Indicates the ESC connection type."]
pub enum EscConnectionType {
    #[doc = "Traditional PPM ESC."]
    ESC_CONNECTION_TYPE_PPM = 0,
    #[doc = "Serial Bus connected ESC."]
    ESC_CONNECTION_TYPE_SERIAL = 1,
    #[doc = "One Shot PPM ESC."]
    ESC_CONNECTION_TYPE_ONESHOT = 2,
    #[doc = "I2C ESC."]
    ESC_CONNECTION_TYPE_I2C = 3,
    #[doc = "CAN-Bus ESC."]
    ESC_CONNECTION_TYPE_CAN = 4,
    #[doc = "DShot ESC."]
    ESC_CONNECTION_TYPE_DSHOT = 5,
}
impl EscConnectionType {
    pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
}
impl Default for EscConnectionType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of distance sensor types"]
pub enum MavDistanceSensor {
    #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
    MAV_DISTANCE_SENSOR_LASER = 0,
    #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
    MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
    #[doc = "Infrared rangefinder, e.g. Sharp units"]
    MAV_DISTANCE_SENSOR_INFRARED = 2,
    #[doc = "Radar type, e.g. uLanding units"]
    MAV_DISTANCE_SENSOR_RADAR = 3,
    #[doc = "Broken or unknown type, e.g. analog units"]
    MAV_DISTANCE_SENSOR_UNKNOWN = 4,
}
impl MavDistanceSensor {
    pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
}
impl Default for MavDistanceSensor {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actions following geofence breach."]
pub enum FenceAction {
    #[doc = "Disable fenced mode. If used in a plan this would mean the next fence is disabled."]
    FENCE_ACTION_NONE = 0,
    #[doc = "Fly to geofence MAV_CMD_NAV_FENCE_RETURN_POINT in GUIDED mode. Note: This action is only supported by ArduPlane, and may not be supported in all versions."]
    FENCE_ACTION_GUIDED = 1,
    #[doc = "Report fence breach, but don't take action"]
    FENCE_ACTION_REPORT = 2,
    #[doc = "Fly to geofence MAV_CMD_NAV_FENCE_RETURN_POINT with manual throttle control in GUIDED mode. Note: This action is only supported by ArduPlane, and may not be supported in all versions."]
    FENCE_ACTION_GUIDED_THR_PASS = 3,
    #[doc = "Return/RTL mode."]
    FENCE_ACTION_RTL = 4,
    #[doc = "Hold at current location."]
    FENCE_ACTION_HOLD = 5,
    #[doc = "Termination failsafe. Motors are shut down (some flight stacks may trigger other failsafe actions)."]
    FENCE_ACTION_TERMINATE = 6,
    #[doc = "Land at current location."]
    FENCE_ACTION_LAND = 7,
}
impl FenceAction {
    pub const DEFAULT: Self = Self::FENCE_ACTION_NONE;
}
impl Default for FenceAction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "States of the mission state machine.         Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended).         They may not all be relevant on all vehicles."]
pub enum MissionState {
    #[doc = "The mission status reporting is not supported."]
    MISSION_STATE_UNKNOWN = 0,
    #[doc = "No mission on the vehicle."]
    MISSION_STATE_NO_MISSION = 1,
    #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
    MISSION_STATE_NOT_STARTED = 2,
    #[doc = "Mission is active, and will execute mission items when in auto mode."]
    MISSION_STATE_ACTIVE = 3,
    #[doc = "Mission is paused when in auto mode."]
    MISSION_STATE_PAUSED = 4,
    #[doc = "Mission has executed all mission items."]
    MISSION_STATE_COMPLETE = 5,
}
impl MissionState {
    pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
}
impl Default for MissionState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidClassificationType {
    #[doc = "The classification type for the UA is undeclared."]
    MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
    #[doc = "The classification type for the UA follows EU (European Union) specifications."]
    MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
}
impl MavOdidClassificationType {
    pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
}
impl Default for MavOdidClassificationType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
pub enum CellularNetworkFailedReason {
    #[doc = "No error"]
    CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
    #[doc = "Error state is unknown"]
    CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
    #[doc = "SIM is required for the modem but missing"]
    CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
    #[doc = "SIM is available, but not usable for connection"]
    CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
}
impl CellularNetworkFailedReason {
    pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
}
impl Default for CellularNetworkFailedReason {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavArmAuthDeniedReason {
    #[doc = "Not a specific reason"]
    MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
    #[doc = "Authorizer will send the error as string to GCS"]
    MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
    #[doc = "At least one waypoint have a invalid value"]
    MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
    #[doc = "Timeout in the authorizer process(in case it depends on network)"]
    MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
    #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
    MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
    #[doc = "Weather is not good to fly"]
    MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
}
impl MavArmAuthDeniedReason {
    pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
}
impl Default for MavArmAuthDeniedReason {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags for CURRENT_EVENT_SEQUENCE."] pub struct MavEventCurrentSequenceFlags : u8 { # [doc = "A sequence reset has happened (e.g. vehicle reboot)."] const MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1 ; } }
impl MavEventCurrentSequenceFlags {
    pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
}
impl Default for MavEventCurrentSequenceFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinetely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
impl GimbalDeviceCapFlags {
    pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
}
impl Default for GimbalDeviceCapFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Airborne status of UAS."]
pub enum UtmFlightState {
    #[doc = "The flight state can't be determined."]
    UTM_FLIGHT_STATE_UNKNOWN = 1,
    #[doc = "UAS on ground."]
    UTM_FLIGHT_STATE_GROUND = 2,
    #[doc = "UAS airborne."]
    UTM_FLIGHT_STATE_AIRBORNE = 3,
    #[doc = "UAS is in an emergency flight state."]
    UTM_FLIGHT_STATE_EMERGENCY = 16,
    #[doc = "UAS has no active controls."]
    UTM_FLIGHT_STATE_NOCTRL = 32,
}
impl UtmFlightState {
    pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
}
impl Default for UtmFlightState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
pub enum ActuatorConfiguration {
    #[doc = "Do nothing."]
    ACTUATOR_CONFIGURATION_NONE = 0,
    #[doc = "Command the actuator to beep now."]
    ACTUATOR_CONFIGURATION_BEEP = 1,
    #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
    ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
    #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
    ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
    #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
    ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
    #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
    ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
}
impl ActuatorConfiguration {
    pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
}
impl Default for ActuatorConfiguration {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/."]
pub enum MavSeverity {
    #[doc = "System is unusable. This is a \"panic\" condition."]
    MAV_SEVERITY_EMERGENCY = 0,
    #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
    MAV_SEVERITY_ALERT = 1,
    #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
    MAV_SEVERITY_CRITICAL = 2,
    #[doc = "Indicates an error in secondary/redundant systems."]
    MAV_SEVERITY_ERROR = 3,
    #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
    MAV_SEVERITY_WARNING = 4,
    #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
    MAV_SEVERITY_NOTICE = 5,
    #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
    MAV_SEVERITY_INFO = 6,
    #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
    MAV_SEVERITY_DEBUG = 7,
}
impl MavSeverity {
    pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
}
impl Default for MavSeverity {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of the ADSB altimeter types"]
pub enum AdsbAltitudeType {
    #[doc = "Altitude reported from a Baro source using QNH reference"]
    ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
    #[doc = "Altitude reported from a GNSS source"]
    ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
}
impl AdsbAltitudeType {
    pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
}
impl Default for AdsbAltitudeType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Generalized UAVCAN node health"]
pub enum UavcanNodeHealth {
    #[doc = "The node is functioning properly."]
    UAVCAN_NODE_HEALTH_OK = 0,
    #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
    UAVCAN_NODE_HEALTH_WARNING = 1,
    #[doc = "The node has encountered a major failure."]
    UAVCAN_NODE_HEALTH_ERROR = 2,
    #[doc = "The node has suffered a fatal malfunction."]
    UAVCAN_NODE_HEALTH_CRITICAL = 3,
}
impl UavcanNodeHealth {
    pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
}
impl Default for UavcanNodeHealth {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
impl AisFlags {
    pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
}
impl Default for AisFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "MAV FTP error codes (https://mavlink.io/en/services/ftp.html)"]
pub enum MavFtpErr {
    #[doc = "None: No error"]
    MAV_FTP_ERR_NONE = 0,
    #[doc = "Fail: Unknown failure"]
    MAV_FTP_ERR_FAIL = 1,
    #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
    MAV_FTP_ERR_FAILERRNO = 2,
    #[doc = "InvalidDataSize: Payload size is invalid"]
    MAV_FTP_ERR_INVALIDDATASIZE = 3,
    #[doc = "InvalidSession: Session is not currently open"]
    MAV_FTP_ERR_INVALIDSESSION = 4,
    #[doc = "NoSessionsAvailable: All available sessions are already in use"]
    MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
    #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
    MAV_FTP_ERR_EOF = 6,
    #[doc = "UnknownCommand: Unknown command / opcode"]
    MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
    #[doc = "FileExists: File/directory already exists"]
    MAV_FTP_ERR_FILEEXISTS = 8,
    #[doc = "FileProtected: File/directory is write protected"]
    MAV_FTP_ERR_FILEPROTECTED = 9,
    #[doc = "FileNotFound: File/directory not found"]
    MAV_FTP_ERR_FILENOTFOUND = 10,
}
impl MavFtpErr {
    pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
}
impl Default for MavFtpErr {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Camera tracking modes"]
pub enum CameraTrackingMode {
    #[doc = "Not tracking"]
    CAMERA_TRACKING_MODE_NONE = 0,
    #[doc = "Target is a point"]
    CAMERA_TRACKING_MODE_POINT = 1,
    #[doc = "Target is a rectangle"]
    CAMERA_TRACKING_MODE_RECTANGLE = 2,
}
impl CameraTrackingMode {
    pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
}
impl Default for CameraTrackingMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Type of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html"]
pub enum AisType {
    #[doc = "Not available (default)."]
    AIS_TYPE_UNKNOWN = 0,
    AIS_TYPE_RESERVED_1 = 1,
    AIS_TYPE_RESERVED_2 = 2,
    AIS_TYPE_RESERVED_3 = 3,
    AIS_TYPE_RESERVED_4 = 4,
    AIS_TYPE_RESERVED_5 = 5,
    AIS_TYPE_RESERVED_6 = 6,
    AIS_TYPE_RESERVED_7 = 7,
    AIS_TYPE_RESERVED_8 = 8,
    AIS_TYPE_RESERVED_9 = 9,
    AIS_TYPE_RESERVED_10 = 10,
    AIS_TYPE_RESERVED_11 = 11,
    AIS_TYPE_RESERVED_12 = 12,
    AIS_TYPE_RESERVED_13 = 13,
    AIS_TYPE_RESERVED_14 = 14,
    AIS_TYPE_RESERVED_15 = 15,
    AIS_TYPE_RESERVED_16 = 16,
    AIS_TYPE_RESERVED_17 = 17,
    AIS_TYPE_RESERVED_18 = 18,
    AIS_TYPE_RESERVED_19 = 19,
    #[doc = "Wing In Ground effect."]
    AIS_TYPE_WIG = 20,
    AIS_TYPE_WIG_HAZARDOUS_A = 21,
    AIS_TYPE_WIG_HAZARDOUS_B = 22,
    AIS_TYPE_WIG_HAZARDOUS_C = 23,
    AIS_TYPE_WIG_HAZARDOUS_D = 24,
    AIS_TYPE_WIG_RESERVED_1 = 25,
    AIS_TYPE_WIG_RESERVED_2 = 26,
    AIS_TYPE_WIG_RESERVED_3 = 27,
    AIS_TYPE_WIG_RESERVED_4 = 28,
    AIS_TYPE_WIG_RESERVED_5 = 29,
    AIS_TYPE_FISHING = 30,
    AIS_TYPE_TOWING = 31,
    #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
    AIS_TYPE_TOWING_LARGE = 32,
    #[doc = "Dredging or other underwater ops."]
    AIS_TYPE_DREDGING = 33,
    AIS_TYPE_DIVING = 34,
    AIS_TYPE_MILITARY = 35,
    AIS_TYPE_SAILING = 36,
    AIS_TYPE_PLEASURE = 37,
    AIS_TYPE_RESERVED_20 = 38,
    AIS_TYPE_RESERVED_21 = 39,
    #[doc = "High Speed Craft."]
    AIS_TYPE_HSC = 40,
    AIS_TYPE_HSC_HAZARDOUS_A = 41,
    AIS_TYPE_HSC_HAZARDOUS_B = 42,
    AIS_TYPE_HSC_HAZARDOUS_C = 43,
    AIS_TYPE_HSC_HAZARDOUS_D = 44,
    AIS_TYPE_HSC_RESERVED_1 = 45,
    AIS_TYPE_HSC_RESERVED_2 = 46,
    AIS_TYPE_HSC_RESERVED_3 = 47,
    AIS_TYPE_HSC_RESERVED_4 = 48,
    AIS_TYPE_HSC_UNKNOWN = 49,
    AIS_TYPE_PILOT = 50,
    #[doc = "Search And Rescue vessel."]
    AIS_TYPE_SAR = 51,
    AIS_TYPE_TUG = 52,
    AIS_TYPE_PORT_TENDER = 53,
    #[doc = "Anti-pollution equipment."]
    AIS_TYPE_ANTI_POLLUTION = 54,
    AIS_TYPE_LAW_ENFORCEMENT = 55,
    AIS_TYPE_SPARE_LOCAL_1 = 56,
    AIS_TYPE_SPARE_LOCAL_2 = 57,
    AIS_TYPE_MEDICAL_TRANSPORT = 58,
    #[doc = "Noncombatant ship according to RR Resolution No. 18."]
    AIS_TYPE_NONECOMBATANT = 59,
    AIS_TYPE_PASSENGER = 60,
    AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
    AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
    AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
    AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
    AIS_TYPE_PASSENGER_RESERVED_1 = 65,
    AIS_TYPE_PASSENGER_RESERVED_2 = 66,
    AIS_TYPE_PASSENGER_RESERVED_3 = 67,
    AIS_TYPE_PASSENGER_RESERVED_4 = 68,
    AIS_TYPE_PASSENGER_UNKNOWN = 69,
    AIS_TYPE_CARGO = 70,
    AIS_TYPE_CARGO_HAZARDOUS_A = 71,
    AIS_TYPE_CARGO_HAZARDOUS_B = 72,
    AIS_TYPE_CARGO_HAZARDOUS_C = 73,
    AIS_TYPE_CARGO_HAZARDOUS_D = 74,
    AIS_TYPE_CARGO_RESERVED_1 = 75,
    AIS_TYPE_CARGO_RESERVED_2 = 76,
    AIS_TYPE_CARGO_RESERVED_3 = 77,
    AIS_TYPE_CARGO_RESERVED_4 = 78,
    AIS_TYPE_CARGO_UNKNOWN = 79,
    AIS_TYPE_TANKER = 80,
    AIS_TYPE_TANKER_HAZARDOUS_A = 81,
    AIS_TYPE_TANKER_HAZARDOUS_B = 82,
    AIS_TYPE_TANKER_HAZARDOUS_C = 83,
    AIS_TYPE_TANKER_HAZARDOUS_D = 84,
    AIS_TYPE_TANKER_RESERVED_1 = 85,
    AIS_TYPE_TANKER_RESERVED_2 = 86,
    AIS_TYPE_TANKER_RESERVED_3 = 87,
    AIS_TYPE_TANKER_RESERVED_4 = 88,
    AIS_TYPE_TANKER_UNKNOWN = 89,
    AIS_TYPE_OTHER = 90,
    AIS_TYPE_OTHER_HAZARDOUS_A = 91,
    AIS_TYPE_OTHER_HAZARDOUS_B = 92,
    AIS_TYPE_OTHER_HAZARDOUS_C = 93,
    AIS_TYPE_OTHER_HAZARDOUS_D = 94,
    AIS_TYPE_OTHER_RESERVED_1 = 95,
    AIS_TYPE_OTHER_RESERVED_2 = 96,
    AIS_TYPE_OTHER_RESERVED_3 = 97,
    AIS_TYPE_OTHER_RESERVED_4 = 98,
    AIS_TYPE_OTHER_UNKNOWN = 99,
}
impl AisType {
    pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
}
impl Default for AisType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidUaType {
    #[doc = "No UA (Unmanned Aircraft) type defined."]
    MAV_ODID_UA_TYPE_NONE = 0,
    #[doc = "Aeroplane/Airplane. Fixed wing."]
    MAV_ODID_UA_TYPE_AEROPLANE = 1,
    #[doc = "Helicopter or multirotor."]
    MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
    #[doc = "Gyroplane."]
    MAV_ODID_UA_TYPE_GYROPLANE = 3,
    #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
    MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
    #[doc = "Ornithopter."]
    MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
    #[doc = "Glider."]
    MAV_ODID_UA_TYPE_GLIDER = 6,
    #[doc = "Kite."]
    MAV_ODID_UA_TYPE_KITE = 7,
    #[doc = "Free Balloon."]
    MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
    #[doc = "Captive Balloon."]
    MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
    #[doc = "Airship. E.g. a blimp."]
    MAV_ODID_UA_TYPE_AIRSHIP = 10,
    #[doc = "Free Fall/Parachute (unpowered)."]
    MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
    #[doc = "Rocket."]
    MAV_ODID_UA_TYPE_ROCKET = 12,
    #[doc = "Tethered powered aircraft."]
    MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
    #[doc = "Ground Obstacle."]
    MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
    #[doc = "Other type of aircraft not listed earlier."]
    MAV_ODID_UA_TYPE_OTHER = 15,
}
impl MavOdidUaType {
    pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
}
impl Default for MavOdidUaType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of VTOL states"]
pub enum MavVtolState {
    #[doc = "MAV is not configured as VTOL"]
    MAV_VTOL_STATE_UNDEFINED = 0,
    #[doc = "VTOL is in transition from multicopter to fixed-wing"]
    MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
    #[doc = "VTOL is in transition from fixed-wing to multicopter"]
    MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
    #[doc = "VTOL is in multicopter state"]
    MAV_VTOL_STATE_MC = 3,
    #[doc = "VTOL is in fixed-wing state"]
    MAV_VTOL_STATE_FW = 4,
}
impl MavVtolState {
    pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
}
impl Default for MavVtolState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actions being taken to mitigate/prevent fence breach"]
pub enum FenceMitigate {
    #[doc = "Unknown"]
    FENCE_MITIGATE_UNKNOWN = 0,
    #[doc = "No actions being taken"]
    FENCE_MITIGATE_NONE = 1,
    #[doc = "Velocity limiting active to prevent breach"]
    FENCE_MITIGATE_VEL_LIMIT = 2,
}
impl FenceMitigate {
    pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
}
impl Default for FenceMitigate {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidOperatorLocationType {
    #[doc = "The location/altitude of the operator is the same as the take-off location."]
    MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
    #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
    MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
    #[doc = "The location/altitude of the operator are fixed values."]
    MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
}
impl MavOdidOperatorLocationType {
    pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
}
impl Default for MavOdidOperatorLocationType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
pub enum WifiConfigApResponse {
    #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
    WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
    #[doc = "Changes accepted."]
    WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
    #[doc = "Changes rejected."]
    WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
    #[doc = "Invalid Mode."]
    WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
    #[doc = "Invalid SSID."]
    WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
    #[doc = "Invalid Password."]
    WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
}
impl WifiConfigApResponse {
    pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
}
impl Default for WifiConfigApResponse {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
impl AdsbFlags {
    pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
}
impl Default for AdsbFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidStatus {
    #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
    MAV_ODID_STATUS_UNDECLARED = 0,
    #[doc = "The UA is on the ground."]
    MAV_ODID_STATUS_GROUND = 1,
    #[doc = "The UA is in the air."]
    MAV_ODID_STATUS_AIRBORNE = 2,
    #[doc = "The UA is having an emergency."]
    MAV_ODID_STATUS_EMERGENCY = 3,
    #[doc = "The remote ID system is failing or unreliable in some way."]
    MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
}
impl MavOdidStatus {
    pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
}
impl Default for MavOdidStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Result from a MAVLink command (MAV_CMD)"]
pub enum MavResult {
    #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
    MAV_RESULT_ACCEPTED = 0,
    #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
    MAV_RESULT_TEMPORARILY_REJECTED = 1,
    #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
    MAV_RESULT_DENIED = 2,
    #[doc = "Command is not supported (unknown)."]
    MAV_RESULT_UNSUPPORTED = 3,
    #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
    MAV_RESULT_FAILED = 4,
    #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
    MAV_RESULT_IN_PROGRESS = 5,
    #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
    MAV_RESULT_CANCELLED = 6,
}
impl MavResult {
    pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
}
impl Default for MavResult {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Generalized UAVCAN node mode"]
pub enum UavcanNodeMode {
    #[doc = "The node is performing its primary functions."]
    UAVCAN_NODE_MODE_OPERATIONAL = 0,
    #[doc = "The node is initializing; this mode is entered immediately after startup."]
    UAVCAN_NODE_MODE_INITIALIZATION = 1,
    #[doc = "The node is under maintenance."]
    UAVCAN_NODE_MODE_MAINTENANCE = 2,
    #[doc = "The node is in the process of updating its software."]
    UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
    #[doc = "The node is no longer available online."]
    UAVCAN_NODE_MODE_OFFLINE = 7,
}
impl UavcanNodeMode {
    pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
}
impl Default for UavcanNodeMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidAuthType {
    #[doc = "No authentication type is specified."]
    MAV_ODID_AUTH_TYPE_NONE = 0,
    #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
    MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
    #[doc = "Signature for the Operator ID."]
    MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
    #[doc = "Signature for the entire message set."]
    MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
    #[doc = "Authentication is provided by Network Remote ID."]
    MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
    #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
    MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
}
impl MavOdidAuthType {
    pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
}
impl Default for MavOdidAuthType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Flags to indicate the status of camera storage."]
pub enum StorageStatus {
    #[doc = "Storage is missing (no microSD card loaded for example.)"]
    STORAGE_STATUS_EMPTY = 0,
    #[doc = "Storage present but unformatted."]
    STORAGE_STATUS_UNFORMATTED = 1,
    #[doc = "Storage present and ready."]
    STORAGE_STATUS_READY = 2,
    #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
    STORAGE_STATUS_NOT_SUPPORTED = 3,
}
impl StorageStatus {
    pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
}
impl Default for StorageStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidClassEu {
    #[doc = "The class for the UA, according to the EU specification, is undeclared."]
    MAV_ODID_CLASS_EU_UNDECLARED = 0,
    #[doc = "The class for the UA, according to the EU specification, is Class 0."]
    MAV_ODID_CLASS_EU_CLASS_0 = 1,
    #[doc = "The class for the UA, according to the EU specification, is Class 1."]
    MAV_ODID_CLASS_EU_CLASS_1 = 2,
    #[doc = "The class for the UA, according to the EU specification, is Class 2."]
    MAV_ODID_CLASS_EU_CLASS_2 = 3,
    #[doc = "The class for the UA, according to the EU specification, is Class 3."]
    MAV_ODID_CLASS_EU_CLASS_3 = 4,
    #[doc = "The class for the UA, according to the EU specification, is Class 4."]
    MAV_ODID_CLASS_EU_CLASS_4 = 5,
    #[doc = "The class for the UA, according to the EU specification, is Class 5."]
    MAV_ODID_CLASS_EU_CLASS_5 = 6,
    #[doc = "The class for the UA, according to the EU specification, is Class 6."]
    MAV_ODID_CLASS_EU_CLASS_6 = 7,
}
impl MavOdidClassEu {
    pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
}
impl Default for MavOdidClassEu {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
impl SerialControlFlag {
    pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
}
impl Default for SerialControlFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "SERIAL_CONTROL device types"]
pub enum SerialControlDev {
    #[doc = "First telemetry port"]
    SERIAL_CONTROL_DEV_TELEM1 = 0,
    #[doc = "Second telemetry port"]
    SERIAL_CONTROL_DEV_TELEM2 = 1,
    #[doc = "First GPS port"]
    SERIAL_CONTROL_DEV_GPS1 = 2,
    #[doc = "Second GPS port"]
    SERIAL_CONTROL_DEV_GPS2 = 3,
    #[doc = "system shell"]
    SERIAL_CONTROL_DEV_SHELL = 10,
    #[doc = "SERIAL0"]
    SERIAL_CONTROL_SERIAL0 = 100,
    #[doc = "SERIAL1"]
    SERIAL_CONTROL_SERIAL1 = 101,
    #[doc = "SERIAL2"]
    SERIAL_CONTROL_SERIAL2 = 102,
    #[doc = "SERIAL3"]
    SERIAL_CONTROL_SERIAL3 = 103,
    #[doc = "SERIAL4"]
    SERIAL_CONTROL_SERIAL4 = 104,
    #[doc = "SERIAL5"]
    SERIAL_CONTROL_SERIAL5 = 105,
    #[doc = "SERIAL6"]
    SERIAL_CONTROL_SERIAL6 = 106,
    #[doc = "SERIAL7"]
    SERIAL_CONTROL_SERIAL7 = 107,
    #[doc = "SERIAL8"]
    SERIAL_CONTROL_SERIAL8 = 108,
    #[doc = "SERIAL9"]
    SERIAL_CONTROL_SERIAL9 = 109,
}
impl SerialControlDev {
    pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
}
impl Default for SerialControlDev {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidIdType {
    #[doc = "No type defined."]
    MAV_ODID_ID_TYPE_NONE = 0,
    #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
    MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
    #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
    MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
    #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
    MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
    #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
    MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
}
impl MavOdidIdType {
    pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
}
impl Default for MavOdidIdType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Winch actions."]
pub enum WinchActions {
    #[doc = "Allow motor to freewheel."]
    WINCH_RELAXED = 0,
    #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
    WINCH_RELATIVE_LENGTH_CONTROL = 1,
    #[doc = "Wind or unwind line at specified rate."]
    WINCH_RATE_CONTROL = 2,
    #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
    WINCH_LOCK = 3,
    #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
    WINCH_DELIVER = 4,
    #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
    WINCH_HOLD = 5,
    #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
    WINCH_RETRACT = 6,
    #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
    WINCH_LOAD_LINE = 7,
    #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
    WINCH_ABANDON_LINE = 8,
    #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
    WINCH_LOAD_PAYLOAD = 9,
}
impl WinchActions {
    pub const DEFAULT: Self = Self::WINCH_RELAXED;
}
impl Default for WinchActions {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Reason for an event error response."]
pub enum MavEventErrorReason {
    #[doc = "The requested event is not available (anymore)."]
    MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
}
impl MavEventErrorReason {
    pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
}
impl Default for MavEventErrorReason {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Flags to indicate the type of storage."]
pub enum StorageType {
    #[doc = "Storage type is not known."]
    STORAGE_TYPE_UNKNOWN = 0,
    #[doc = "Storage type is USB device."]
    STORAGE_TYPE_USB_STICK = 1,
    #[doc = "Storage type is SD card."]
    STORAGE_TYPE_SD = 2,
    #[doc = "Storage type is microSD card."]
    STORAGE_TYPE_MICROSD = 3,
    #[doc = "Storage type is CFast."]
    STORAGE_TYPE_CF = 4,
    #[doc = "Storage type is CFexpress."]
    STORAGE_TYPE_CFE = 5,
    #[doc = "Storage type is XQD."]
    STORAGE_TYPE_XQD = 6,
    #[doc = "Storage type is HD mass storage type."]
    STORAGE_TYPE_HD = 7,
    #[doc = "Storage type is other, not listed type."]
    STORAGE_TYPE_OTHER = 254,
}
impl StorageType {
    pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
}
impl Default for StorageType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
pub enum SetFocusType {
    #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
    FOCUS_TYPE_STEP = 0,
    #[doc = "Continuous focus up/down until stopped (-1 for focusing in, 1 for focusing out towards infinity, 0 to stop focusing)"]
    FOCUS_TYPE_CONTINUOUS = 1,
    #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
    FOCUS_TYPE_RANGE = 2,
    #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
    FOCUS_TYPE_METERS = 3,
    #[doc = "Focus automatically."]
    FOCUS_TYPE_AUTO = 4,
    #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
    FOCUS_TYPE_AUTO_SINGLE = 5,
    #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
    FOCUS_TYPE_AUTO_CONTINUOUS = 6,
}
impl SetFocusType {
    pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
}
impl Default for SetFocusType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavTunnelPayloadType {
    #[doc = "Encoding of payload unknown."]
    MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
    #[doc = "Registered for STorM32 gimbal controller."]
    MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
}
impl MavTunnelPayloadType {
    pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
}
impl Default for MavTunnelPayloadType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."]
pub enum StorageUsageFlag {
    #[doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."]
    STORAGE_USAGE_FLAG_SET = 1,
    #[doc = "Storage for saving photos."]
    STORAGE_USAGE_FLAG_PHOTO = 2,
    #[doc = "Storage for saving videos."]
    STORAGE_USAGE_FLAG_VIDEO = 4,
    #[doc = "Storage for saving logs."]
    STORAGE_USAGE_FLAG_LOGS = 8,
}
impl StorageUsageFlag {
    pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
}
impl Default for StorageUsageFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
pub enum MavDoRepositionFlags {
    #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
    MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
}
impl MavDoRepositionFlags {
    pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
}
impl Default for MavDoRepositionFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "RC type"]
pub enum RcType {
    #[doc = "Spektrum DSM2"]
    RC_TYPE_SPEKTRUM_DSM2 = 0,
    #[doc = "Spektrum DSMX"]
    RC_TYPE_SPEKTRUM_DSMX = 1,
}
impl RcType {
    pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM_DSM2;
}
impl Default for RcType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidArmStatus {
    #[doc = "Passing arming checks."]
    MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
    #[doc = "Generic arming failure, see error string for details."]
    MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
}
impl MavOdidArmStatus {
    pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
}
impl Default for MavOdidArmStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Possible responses from a CELLULAR_CONFIG message."]
pub enum CellularConfigResponse {
    #[doc = "Changes accepted."]
    CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
    #[doc = "Invalid APN."]
    CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
    #[doc = "Invalid PIN."]
    CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
    #[doc = "Changes rejected."]
    CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
    #[doc = "PUK is required to unblock SIM card."]
    CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
}
impl CellularConfigResponse {
    pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
}
impl Default for CellularConfigResponse {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "List of possible failure type to inject."]
pub enum FailureType {
    #[doc = "No failure injected, used to reset a previous failure."]
    FAILURE_TYPE_OK = 0,
    #[doc = "Sets unit off, so completely non-responsive."]
    FAILURE_TYPE_OFF = 1,
    #[doc = "Unit is stuck e.g. keeps reporting the same value."]
    FAILURE_TYPE_STUCK = 2,
    #[doc = "Unit is reporting complete garbage."]
    FAILURE_TYPE_GARBAGE = 3,
    #[doc = "Unit is consistently wrong."]
    FAILURE_TYPE_WRONG = 4,
    #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
    FAILURE_TYPE_SLOW = 5,
    #[doc = "Data of unit is delayed in time."]
    FAILURE_TYPE_DELAYED = 6,
    #[doc = "Unit is sometimes working, sometimes not."]
    FAILURE_TYPE_INTERMITTENT = 7,
}
impl FailureType {
    pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
}
impl Default for FailureType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidOperatorIdType {
    #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
    MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
}
impl MavOdidOperatorIdType {
    pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
}
impl Default for MavOdidOperatorIdType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Cellular network radio type"]
pub enum CellularNetworkRadioType {
    CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
    CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
    CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
    CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
    CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
}
impl CellularNetworkRadioType {
    pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
}
impl Default for CellularNetworkRadioType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavState {
    #[doc = "Uninitialized system, state is unknown."]
    MAV_STATE_UNINIT = 0,
    #[doc = "System is booting up."]
    MAV_STATE_BOOT = 1,
    #[doc = "System is calibrating and not flight-ready."]
    MAV_STATE_CALIBRATING = 2,
    #[doc = "System is grounded and on standby. It can be launched any time."]
    MAV_STATE_STANDBY = 3,
    #[doc = "System is active and might be already airborne. Motors are engaged."]
    MAV_STATE_ACTIVE = 4,
    #[doc = "System is in a non-normal flight mode. It can however still navigate."]
    MAV_STATE_CRITICAL = 5,
    #[doc = "System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down."]
    MAV_STATE_EMERGENCY = 6,
    #[doc = "System just initialized its power-down sequence, will shut down now."]
    MAV_STATE_POWEROFF = 7,
    #[doc = "System is terminating itself."]
    MAV_STATE_FLIGHT_TERMINATION = 8,
}
impl MavState {
    pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
}
impl Default for MavState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of sensor orientation, according to its rotations"]
pub enum MavSensorOrientation {
    #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
    MAV_SENSOR_ROTATION_NONE = 0,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
    MAV_SENSOR_ROTATION_YAW_45 = 1,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
    MAV_SENSOR_ROTATION_YAW_90 = 2,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
    MAV_SENSOR_ROTATION_YAW_135 = 3,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
    MAV_SENSOR_ROTATION_YAW_180 = 4,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
    MAV_SENSOR_ROTATION_YAW_225 = 5,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
    MAV_SENSOR_ROTATION_YAW_270 = 6,
    #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
    MAV_SENSOR_ROTATION_YAW_315 = 7,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_180 = 8,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
    #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
    MAV_SENSOR_ROTATION_PITCH_180 = 12,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
    #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
    MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
    #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_90 = 16,
    #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
    MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
    #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
    MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
    #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
    MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
    #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_270 = 20,
    #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
    MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
    #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
    MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
    #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
    MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
    #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
    MAV_SENSOR_ROTATION_PITCH_90 = 24,
    #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
    MAV_SENSOR_ROTATION_PITCH_270 = 25,
    #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
    MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
    #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
    MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
    #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
    #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
    #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
    #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
    #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
    #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
    #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
    #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
    MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
    #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
    #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
    MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
    #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
    #[doc = "Pitch: 315"]
    MAV_SENSOR_ROTATION_PITCH_315 = 39,
    #[doc = "Roll: 90, Pitch: 315"]
    MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
    #[doc = "Custom orientation"]
    MAV_SENSOR_ROTATION_CUSTOM = 100,
}
impl MavSensorOrientation {
    pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
}
impl Default for MavSensorOrientation {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; } }
impl CameraCapFlags {
    pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
}
impl Default for CameraCapFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum FenceBreach {
    #[doc = "No last fence breach"]
    FENCE_BREACH_NONE = 0,
    #[doc = "Breached minimum altitude"]
    FENCE_BREACH_MINALT = 1,
    #[doc = "Breached maximum altitude"]
    FENCE_BREACH_MAXALT = 2,
    #[doc = "Breached fence boundary"]
    FENCE_BREACH_BOUNDARY = 3,
}
impl FenceBreach {
    pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
}
impl Default for FenceBreach {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Tune formats (used for vehicle buzzer/tone generation)."] pub struct TuneFormat : u32 { # [doc = "Format is QBasic 1.1 Play: https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm."] const TUNE_FORMAT_QBASIC1_1 = 1 ; # [doc = "Format is Modern Music Markup Language (MML): https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML."] const TUNE_FORMAT_MML_MODERN = 2 ; } }
impl TuneFormat {
    pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
}
impl Default for TuneFormat {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
pub enum CompMetadataType {
    #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
    COMP_METADATA_TYPE_GENERAL = 0,
    #[doc = "Parameter meta data."]
    COMP_METADATA_TYPE_PARAMETER = 1,
    #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
    COMP_METADATA_TYPE_COMMANDS = 2,
    #[doc = "Meta data that specifies external non-MAVLink peripherals."]
    COMP_METADATA_TYPE_PERIPHERALS = 3,
    #[doc = "Meta data for the events interface."]
    COMP_METADATA_TYPE_EVENTS = 4,
    #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
    COMP_METADATA_TYPE_ACTUATORS = 5,
}
impl CompMetadataType {
    pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
}
impl Default for CompMetadataType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."]
pub enum GimbalManagerFlags {
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."]
    GIMBAL_MANAGER_FLAGS_RETRACT = 1,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."]
    GIMBAL_MANAGER_FLAGS_NEUTRAL = 2,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."]
    GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."]
    GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."]
    GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."]
    GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
    GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."]
    GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."]
    GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256,
    #[doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."]
    GIMBAL_MANAGER_FLAGS_RC_MIXED = 512,
}
impl GimbalManagerFlags {
    pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
}
impl Default for GimbalManagerFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Type of mission items being requested/sent in mission protocol."]
pub enum MavMissionType {
    #[doc = "Items are mission commands for main mission."]
    MAV_MISSION_TYPE_MISSION = 0,
    #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
    MAV_MISSION_TYPE_FENCE = 1,
    #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
    MAV_MISSION_TYPE_RALLY = 2,
    #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
    MAV_MISSION_TYPE_ALL = 255,
}
impl MavMissionType {
    pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
}
impl Default for MavMissionType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Stream status flags (Bitmap)"]
pub enum VideoStreamStatusFlags {
    #[doc = "Stream is active (running)"]
    VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1,
    #[doc = "Stream is thermal imaging"]
    VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2,
}
impl VideoStreamStatusFlags {
    pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
}
impl Default for VideoStreamStatusFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Specifies the datatype of a MAVLink parameter."]
pub enum MavParamType {
    #[doc = "8-bit unsigned integer"]
    MAV_PARAM_TYPE_UINT8 = 1,
    #[doc = "8-bit signed integer"]
    MAV_PARAM_TYPE_INT8 = 2,
    #[doc = "16-bit unsigned integer"]
    MAV_PARAM_TYPE_UINT16 = 3,
    #[doc = "16-bit signed integer"]
    MAV_PARAM_TYPE_INT16 = 4,
    #[doc = "32-bit unsigned integer"]
    MAV_PARAM_TYPE_UINT32 = 5,
    #[doc = "32-bit signed integer"]
    MAV_PARAM_TYPE_INT32 = 6,
    #[doc = "64-bit unsigned integer"]
    MAV_PARAM_TYPE_UINT64 = 7,
    #[doc = "64-bit signed integer"]
    MAV_PARAM_TYPE_INT64 = 8,
    #[doc = "32-bit floating-point"]
    MAV_PARAM_TYPE_REAL32 = 9,
    #[doc = "64-bit floating-point"]
    MAV_PARAM_TYPE_REAL64 = 10,
}
impl MavParamType {
    pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
}
impl Default for MavParamType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Type of GPS fix"]
pub enum GpsFixType {
    #[doc = "No GPS connected"]
    GPS_FIX_TYPE_NO_GPS = 0,
    #[doc = "No position information, GPS is connected"]
    GPS_FIX_TYPE_NO_FIX = 1,
    #[doc = "2D position"]
    GPS_FIX_TYPE_2D_FIX = 2,
    #[doc = "3D position"]
    GPS_FIX_TYPE_3D_FIX = 3,
    #[doc = "DGPS/SBAS aided 3D position"]
    GPS_FIX_TYPE_DGPS = 4,
    #[doc = "RTK float, 3D position"]
    GPS_FIX_TYPE_RTK_FLOAT = 5,
    #[doc = "RTK Fixed, 3D position"]
    GPS_FIX_TYPE_RTK_FIXED = 6,
    #[doc = "Static fixed, typically used for base stations"]
    GPS_FIX_TYPE_STATIC = 7,
    #[doc = "PPP, 3D position."]
    GPS_FIX_TYPE_PPP = 8,
}
impl GpsFixType {
    pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
}
impl Default for GpsFixType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Camera tracking target data (shows where tracked target is within image)"]
pub enum CameraTrackingTargetData {
    #[doc = "No target data"]
    CAMERA_TRACKING_TARGET_DATA_NONE = 0,
    #[doc = "Target data embedded in image data (proprietary)"]
    CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1,
    #[doc = "Target data rendered in image"]
    CAMERA_TRACKING_TARGET_DATA_RENDERED = 2,
    #[doc = "Target data within status message (Point or Rectangle)"]
    CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4,
}
impl CameraTrackingTargetData {
    pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_NONE;
}
impl Default for CameraTrackingTargetData {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidHeightRef {
    #[doc = "The height field is relative to the take-off location."]
    MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
    #[doc = "The height field is relative to ground."]
    MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
}
impl MavOdidHeightRef {
    pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
}
impl Default for MavOdidHeightRef {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
impl MavPowerStatus {
    pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
}
impl Default for MavPowerStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of battery functions"]
pub enum MavBatteryFunction {
    #[doc = "Battery function is unknown"]
    MAV_BATTERY_FUNCTION_UNKNOWN = 0,
    #[doc = "Battery supports all flight systems"]
    MAV_BATTERY_FUNCTION_ALL = 1,
    #[doc = "Battery for the propulsion system"]
    MAV_BATTERY_FUNCTION_PROPULSION = 2,
    #[doc = "Avionics battery"]
    MAV_BATTERY_FUNCTION_AVIONICS = 3,
    #[doc = "Payload battery"]
    MAV_BATTERY_FUNCTION_PAYLOAD = 4,
}
impl MavBatteryFunction {
    pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
}
impl Default for MavBatteryFunction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidDescType {
    #[doc = "Optional free-form text description of the purpose of the flight."]
    MAV_ODID_DESC_TYPE_TEXT = 0,
    #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
    MAV_ODID_DESC_TYPE_EMERGENCY = 1,
    #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
    MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
}
impl MavOdidDescType {
    pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
}
impl Default for MavOdidDescType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enable axes that will be tuned via autotuning. Used in MAV_CMD_DO_AUTOTUNE_ENABLE."]
pub enum AutotuneAxis {
    #[doc = "Flight stack tunes axis according to its default settings."]
    AUTOTUNE_AXIS_DEFAULT = 0,
    #[doc = "Autotune roll axis."]
    AUTOTUNE_AXIS_ROLL = 1,
    #[doc = "Autotune pitch axis."]
    AUTOTUNE_AXIS_PITCH = 2,
    #[doc = "Autotune yaw axis."]
    AUTOTUNE_AXIS_YAW = 4,
}
impl AutotuneAxis {
    pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_DEFAULT;
}
impl Default for AutotuneAxis {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum NavVtolLandOptions {
    #[doc = "Default autopilot landing behaviour."]
    NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
    #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground.           The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
    NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
    #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
    NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
}
impl NavVtolLandOptions {
    pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
}
impl Default for NavVtolLandOptions {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Result of mission operation (in a MISSION_ACK message)."]
pub enum MavMissionResult {
    #[doc = "mission accepted OK"]
    MAV_MISSION_ACCEPTED = 0,
    #[doc = "Generic error / not accepting mission commands at all right now."]
    MAV_MISSION_ERROR = 1,
    #[doc = "Coordinate frame is not supported."]
    MAV_MISSION_UNSUPPORTED_FRAME = 2,
    #[doc = "Command is not supported."]
    MAV_MISSION_UNSUPPORTED = 3,
    #[doc = "Mission items exceed storage space."]
    MAV_MISSION_NO_SPACE = 4,
    #[doc = "One of the parameters has an invalid value."]
    MAV_MISSION_INVALID = 5,
    #[doc = "param1 has an invalid value."]
    MAV_MISSION_INVALID_PARAM1 = 6,
    #[doc = "param2 has an invalid value."]
    MAV_MISSION_INVALID_PARAM2 = 7,
    #[doc = "param3 has an invalid value."]
    MAV_MISSION_INVALID_PARAM3 = 8,
    #[doc = "param4 has an invalid value."]
    MAV_MISSION_INVALID_PARAM4 = 9,
    #[doc = "x / param5 has an invalid value."]
    MAV_MISSION_INVALID_PARAM5_X = 10,
    #[doc = "y / param6 has an invalid value."]
    MAV_MISSION_INVALID_PARAM6_Y = 11,
    #[doc = "z / param7 has an invalid value."]
    MAV_MISSION_INVALID_PARAM7 = 12,
    #[doc = "Mission item received out of sequence"]
    MAV_MISSION_INVALID_SEQUENCE = 13,
    #[doc = "Not accepting any mission commands from this communication partner."]
    MAV_MISSION_DENIED = 14,
    #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
    MAV_MISSION_OPERATION_CANCELLED = 15,
}
impl MavMissionResult {
    pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
}
impl Default for MavMissionResult {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Camera Modes."]
pub enum CameraMode {
    #[doc = "Camera is in image/photo capture mode."]
    CAMERA_MODE_IMAGE = 0,
    #[doc = "Camera is in video capture mode."]
    CAMERA_MODE_VIDEO = 1,
    #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
    CAMERA_MODE_IMAGE_SURVEY = 2,
}
impl CameraMode {
    pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
}
impl Default for CameraMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
impl PositionTargetTypemask {
    pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
}
impl Default for PositionTargetTypemask {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "No ESC failure."] const ESC_FAILURE_NONE = 0 ; # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
impl EscFailureFlags {
    pub const DEFAULT: Self = Self::ESC_FAILURE_NONE;
}
impl Default for EscFailureFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "WiFi Mode."]
pub enum WifiConfigApMode {
    #[doc = "WiFi mode is undefined."]
    WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
    #[doc = "WiFi configured as an access point."]
    WIFI_CONFIG_AP_MODE_AP = 1,
    #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
    WIFI_CONFIG_AP_MODE_STATION = 2,
    #[doc = "WiFi disabled."]
    WIFI_CONFIG_AP_MODE_DISABLED = 3,
}
impl WifiConfigApMode {
    pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
}
impl Default for WifiConfigApMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
impl MavModeFlag {
    pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
}
impl Default for MavModeFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the  vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
impl EstimatorStatusFlags {
    pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
}
impl Default for EstimatorStatusFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
pub enum MotorTestOrder {
    #[doc = "Default autopilot motor test method."]
    MOTOR_TEST_ORDER_DEFAULT = 0,
    #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
    MOTOR_TEST_ORDER_SEQUENCE = 1,
    #[doc = "Motor numbers are specified as the output as labeled on the board."]
    MOTOR_TEST_ORDER_BOARD = 2,
}
impl MotorTestOrder {
    pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
}
impl Default for MotorTestOrder {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Camera tracking status flags"]
pub enum CameraTrackingStatusFlags {
    #[doc = "Camera is not tracking"]
    CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
    #[doc = "Camera is tracking"]
    CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
    #[doc = "Camera tracking in error state"]
    CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
}
impl CameraTrackingStatusFlags {
    pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
}
impl Default for CameraTrackingStatusFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
impl MavWinchStatusFlag {
    pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
}
impl Default for MavWinchStatusFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
pub enum RtkBaselineCoordinateSystem {
    #[doc = "Earth-centered, Earth-fixed"]
    RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
    #[doc = "RTK basestation centered, north, east, down"]
    RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
}
impl RtkBaselineCoordinateSystem {
    pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
}
impl Default for RtkBaselineCoordinateSystem {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "MAV FTP opcodes: https://mavlink.io/en/services/ftp.html"]
pub enum MavFtpOpcode {
    #[doc = "None. Ignored, always ACKed"]
    MAV_FTP_OPCODE_NONE = 0,
    #[doc = "TerminateSession: Terminates open Read session"]
    MAV_FTP_OPCODE_TERMINATESESSION = 1,
    #[doc = "ResetSessions: Terminates all open read sessions"]
    MAV_FTP_OPCODE_RESETSESSION = 2,
    #[doc = "ListDirectory. List files and directories in path from offset"]
    MAV_FTP_OPCODE_LISTDIRECTORY = 3,
    #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
    MAV_FTP_OPCODE_OPENFILERO = 4,
    #[doc = "ReadFile: Reads size bytes from offset in session"]
    MAV_FTP_OPCODE_READFILE = 5,
    #[doc = "CreateFile: Creates file at path for writing, returns session"]
    MAV_FTP_OPCODE_CREATEFILE = 6,
    #[doc = "WriteFile: Writes size bytes to offset in session"]
    MAV_FTP_OPCODE_WRITEFILE = 7,
    #[doc = "RemoveFile: Remove file at path"]
    MAV_FTP_OPCODE_REMOVEFILE = 8,
    #[doc = "CreateDirectory: Creates directory at path"]
    MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
    #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
    MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
    #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
    MAV_FTP_OPCODE_OPENFILEWO = 11,
    #[doc = "TruncateFile: Truncate file at path to offset length"]
    MAV_FTP_OPCODE_TRUNCATEFILE = 12,
    #[doc = "Rename: Rename path1 to path2"]
    MAV_FTP_OPCODE_RENAME = 13,
    #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
    MAV_FTP_OPCODE_CALCFILECRC = 14,
    #[doc = "BurstReadFile: Burst download session file"]
    MAV_FTP_OPCODE_BURSTREADFILE = 15,
    #[doc = "ACK: ACK response"]
    MAV_FTP_OPCODE_ACK = 128,
    #[doc = "NAK: NAK response"]
    MAV_FTP_OPCODE_NAK = 129,
}
impl MavFtpOpcode {
    pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
}
impl Default for MavFtpOpcode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Result from PARAM_EXT_SET message (or a PARAM_SET within a transaction)."]
pub enum ParamAck {
    #[doc = "Parameter value ACCEPTED and SET"]
    PARAM_ACK_ACCEPTED = 0,
    #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
    PARAM_ACK_VALUE_UNSUPPORTED = 1,
    #[doc = "Parameter failed to set"]
    PARAM_ACK_FAILED = 2,
    #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_ACK_TRANSACTION or PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
    PARAM_ACK_IN_PROGRESS = 3,
}
impl ParamAck {
    pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
}
impl Default for ParamAck {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
pub enum ParachuteAction {
    #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
    PARACHUTE_DISABLE = 0,
    #[doc = "Enable auto-release of parachute."]
    PARACHUTE_ENABLE = 1,
    #[doc = "Release parachute and kill motors."]
    PARACHUTE_RELEASE = 2,
}
impl ParachuteAction {
    pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
}
impl Default for ParachuteAction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidTimeAcc {
    #[doc = "The timestamp accuracy is unknown."]
    MAV_ODID_TIME_ACC_UNKNOWN = 0,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
    MAV_ODID_TIME_ACC_0_1_SECOND = 1,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
    MAV_ODID_TIME_ACC_0_2_SECOND = 2,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
    MAV_ODID_TIME_ACC_0_3_SECOND = 3,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
    MAV_ODID_TIME_ACC_0_4_SECOND = 4,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
    MAV_ODID_TIME_ACC_0_5_SECOND = 5,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
    MAV_ODID_TIME_ACC_0_6_SECOND = 6,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
    MAV_ODID_TIME_ACC_0_7_SECOND = 7,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
    MAV_ODID_TIME_ACC_0_8_SECOND = 8,
    #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
    MAV_ODID_TIME_ACC_0_9_SECOND = 9,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
    MAV_ODID_TIME_ACC_1_0_SECOND = 10,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
    MAV_ODID_TIME_ACC_1_1_SECOND = 11,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
    MAV_ODID_TIME_ACC_1_2_SECOND = 12,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
    MAV_ODID_TIME_ACC_1_3_SECOND = 13,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
    MAV_ODID_TIME_ACC_1_4_SECOND = 14,
    #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
    MAV_ODID_TIME_ACC_1_5_SECOND = 15,
}
impl MavOdidTimeAcc {
    pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
}
impl Default for MavOdidTimeAcc {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
impl MavSysStatusSensorExtended {
    pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
}
impl Default for MavSysStatusSensorExtended {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of estimator types"]
pub enum MavEstimatorType {
    #[doc = "Unknown type of the estimator."]
    MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
    #[doc = "This is a naive estimator without any real covariance feedback."]
    MAV_ESTIMATOR_TYPE_NAIVE = 1,
    #[doc = "Computer vision based estimate. Might be up to scale."]
    MAV_ESTIMATOR_TYPE_VISION = 2,
    #[doc = "Visual-inertial estimate."]
    MAV_ESTIMATOR_TYPE_VIO = 3,
    #[doc = "Plain GPS estimate."]
    MAV_ESTIMATOR_TYPE_GPS = 4,
    #[doc = "Estimator integrating GPS and inertial sensing."]
    MAV_ESTIMATOR_TYPE_GPS_INS = 5,
    #[doc = "Estimate from external motion capturing system."]
    MAV_ESTIMATOR_TYPE_MOCAP = 6,
    #[doc = "Estimator based on lidar sensor input."]
    MAV_ESTIMATOR_TYPE_LIDAR = 7,
    #[doc = "Estimator on autopilot."]
    MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
}
impl MavEstimatorType {
    pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
}
impl Default for MavEstimatorType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
impl AttitudeTargetTypemask {
    pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
}
impl Default for AttitudeTargetTypemask {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of landed detector states"]
pub enum MavLandedState {
    #[doc = "MAV landed state is unknown"]
    MAV_LANDED_STATE_UNDEFINED = 0,
    #[doc = "MAV is landed (on ground)"]
    MAV_LANDED_STATE_ON_GROUND = 1,
    #[doc = "MAV is in air"]
    MAV_LANDED_STATE_IN_AIR = 2,
    #[doc = "MAV currently taking off"]
    MAV_LANDED_STATE_TAKEOFF = 3,
    #[doc = "MAV currently landing"]
    MAV_LANDED_STATE_LANDING = 4,
}
impl MavLandedState {
    pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
}
impl Default for MavLandedState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
pub enum PrecisionLandMode {
    #[doc = "Normal (non-precision) landing."]
    PRECISION_LAND_MODE_DISABLED = 0,
    #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
    PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
    #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
    PRECISION_LAND_MODE_REQUIRED = 2,
}
impl PrecisionLandMode {
    pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
}
impl Default for PrecisionLandMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it                simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
pub enum MavMode {
    #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
    MAV_MODE_PREFLIGHT = 0,
    #[doc = "System is allowed to be active, under assisted RC control."]
    MAV_MODE_STABILIZE_DISARMED = 80,
    #[doc = "System is allowed to be active, under assisted RC control."]
    MAV_MODE_STABILIZE_ARMED = 208,
    #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
    MAV_MODE_MANUAL_DISARMED = 64,
    #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
    MAV_MODE_MANUAL_ARMED = 192,
    #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
    MAV_MODE_GUIDED_DISARMED = 88,
    #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
    MAV_MODE_GUIDED_ARMED = 216,
    #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
    MAV_MODE_AUTO_DISARMED = 92,
    #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
    MAV_MODE_AUTO_ARMED = 220,
    #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
    MAV_MODE_TEST_DISARMED = 66,
    #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
    MAV_MODE_TEST_ARMED = 194,
}
impl MavMode {
    pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
}
impl Default for MavMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
pub enum MavAutopilot {
    #[doc = "Generic autopilot, full support for everything"]
    MAV_AUTOPILOT_GENERIC = 0,
    #[doc = "Reserved for future use."]
    MAV_AUTOPILOT_RESERVED = 1,
    #[doc = "SLUGS autopilot, http://slugsuav.soe.ucsc.edu"]
    MAV_AUTOPILOT_SLUGS = 2,
    #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, https://ardupilot.org"]
    MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
    #[doc = "OpenPilot, http://openpilot.org"]
    MAV_AUTOPILOT_OPENPILOT = 4,
    #[doc = "Generic autopilot only supporting simple waypoints"]
    MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
    #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
    MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
    #[doc = "Generic autopilot supporting the full mission command set"]
    MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
    #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
    MAV_AUTOPILOT_INVALID = 8,
    #[doc = "PPZ UAV - http://nongnu.org/paparazzi"]
    MAV_AUTOPILOT_PPZ = 9,
    #[doc = "UAV Dev Board"]
    MAV_AUTOPILOT_UDB = 10,
    #[doc = "FlexiPilot"]
    MAV_AUTOPILOT_FP = 11,
    #[doc = "PX4 Autopilot - http://px4.io/"]
    MAV_AUTOPILOT_PX4 = 12,
    #[doc = "SMACCMPilot - http://smaccmpilot.org"]
    MAV_AUTOPILOT_SMACCMPILOT = 13,
    #[doc = "AutoQuad -- http://autoquad.org"]
    MAV_AUTOPILOT_AUTOQUAD = 14,
    #[doc = "Armazila -- http://armazila.com"]
    MAV_AUTOPILOT_ARMAZILA = 15,
    #[doc = "Aerob -- http://aerob.ru"]
    MAV_AUTOPILOT_AEROB = 16,
    #[doc = "ASLUAV autopilot -- http://www.asl.ethz.ch"]
    MAV_AUTOPILOT_ASLUAV = 17,
    #[doc = "SmartAP Autopilot - http://sky-drones.com"]
    MAV_AUTOPILOT_SMARTAP = 18,
    #[doc = "AirRails - http://uaventure.com"]
    MAV_AUTOPILOT_AIRRAILS = 19,
    #[doc = "Fusion Reflex - https://fusion.engineering"]
    MAV_AUTOPILOT_REFLEX = 20,
}
impl MavAutopilot {
    pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
}
impl Default for MavAutopilot {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
impl GimbalManagerCapFlags {
    pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
}
impl Default for GimbalManagerCapFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Source of information about this collision."]
pub enum MavCollisionSrc {
    #[doc = "ID field references ADSB_VEHICLE packets"]
    MAV_COLLISION_SRC_ADSB = 0,
    #[doc = "ID field references MAVLink SRC ID"]
    MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
}
impl MavCollisionSrc {
    pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
}
impl Default for MavCollisionSrc {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "The ROI (region of interest) for the vehicle. This can be                 be used by the vehicle for camera/vehicle attitude alignment (see                 MAV_CMD_NAV_ROI)."]
pub enum MavRoi {
    #[doc = "No region of interest."]
    MAV_ROI_NONE = 0,
    #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
    MAV_ROI_WPNEXT = 1,
    #[doc = "Point toward given waypoint."]
    MAV_ROI_WPINDEX = 2,
    #[doc = "Point toward fixed location."]
    MAV_ROI_LOCATION = 3,
    #[doc = "Point toward of given id."]
    MAV_ROI_TARGET = 4,
}
impl MavRoi {
    pub const DEFAULT: Self = Self::MAV_ROI_NONE;
}
impl Default for MavRoi {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
pub enum MavModeFlagDecodePosition {
    #[doc = "First bit:  10000000"]
    MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
    #[doc = "Second bit: 01000000"]
    MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
    #[doc = "Third bit:  00100000"]
    MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
    #[doc = "Fourth bit: 00010000"]
    MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
    #[doc = "Fifth bit:  00001000"]
    MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
    #[doc = "Sixth bit:   00000100"]
    MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
    #[doc = "Seventh bit: 00000010"]
    MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
    #[doc = "Eighth bit: 00000001"]
    MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
}
impl MavModeFlagDecodePosition {
    pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
}
impl Default for MavModeFlagDecodePosition {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of battery types"]
pub enum MavBatteryType {
    #[doc = "Not specified."]
    MAV_BATTERY_TYPE_UNKNOWN = 0,
    #[doc = "Lithium polymer battery"]
    MAV_BATTERY_TYPE_LIPO = 1,
    #[doc = "Lithium-iron-phosphate battery"]
    MAV_BATTERY_TYPE_LIFE = 2,
    #[doc = "Lithium-ION battery"]
    MAV_BATTERY_TYPE_LION = 3,
    #[doc = "Nickel metal hydride battery"]
    MAV_BATTERY_TYPE_NIMH = 4,
}
impl MavBatteryType {
    pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
}
impl Default for MavBatteryType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Specifies the datatype of a MAVLink extended parameter."]
pub enum MavParamExtType {
    #[doc = "8-bit unsigned integer"]
    MAV_PARAM_EXT_TYPE_UINT8 = 1,
    #[doc = "8-bit signed integer"]
    MAV_PARAM_EXT_TYPE_INT8 = 2,
    #[doc = "16-bit unsigned integer"]
    MAV_PARAM_EXT_TYPE_UINT16 = 3,
    #[doc = "16-bit signed integer"]
    MAV_PARAM_EXT_TYPE_INT16 = 4,
    #[doc = "32-bit unsigned integer"]
    MAV_PARAM_EXT_TYPE_UINT32 = 5,
    #[doc = "32-bit signed integer"]
    MAV_PARAM_EXT_TYPE_INT32 = 6,
    #[doc = "64-bit unsigned integer"]
    MAV_PARAM_EXT_TYPE_UINT64 = 7,
    #[doc = "64-bit signed integer"]
    MAV_PARAM_EXT_TYPE_INT64 = 8,
    #[doc = "32-bit floating-point"]
    MAV_PARAM_EXT_TYPE_REAL32 = 9,
    #[doc = "64-bit floating-point"]
    MAV_PARAM_EXT_TYPE_REAL64 = 10,
    #[doc = "Custom Type"]
    MAV_PARAM_EXT_TYPE_CUSTOM = 11,
}
impl MavParamExtType {
    pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
}
impl Default for MavParamExtType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
impl GimbalDeviceErrorFlags {
    pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
}
impl Default for GimbalDeviceErrorFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
pub enum MotorTestThrottleType {
    #[doc = "Throttle as a percentage (0 ~ 100)"]
    MOTOR_TEST_THROTTLE_PERCENT = 0,
    #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
    MOTOR_TEST_THROTTLE_PWM = 1,
    #[doc = "Throttle pass-through from pilot's transmitter."]
    MOTOR_TEST_THROTTLE_PILOT = 2,
    #[doc = "Per-motor compass calibration test."]
    MOTOR_TEST_COMPASS_CAL = 3,
}
impl MotorTestThrottleType {
    pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
}
impl Default for MotorTestThrottleType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Direction of VTOL transition"]
pub enum VtolTransitionHeading {
    #[doc = "Respect the heading configuration of the vehicle."]
    VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
    #[doc = "Use the heading pointing towards the next waypoint."]
    VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
    #[doc = "Use the heading on takeoff (while sitting on the ground)."]
    VTOL_TRANSITION_HEADING_TAKEOFF = 2,
    #[doc = "Use the specified heading in parameter 4."]
    VTOL_TRANSITION_HEADING_SPECIFIED = 3,
    #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
    VTOL_TRANSITION_HEADING_ANY = 4,
}
impl VtolTransitionHeading {
    pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
}
impl Default for VtolTransitionHeading {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
impl UtmDataAvailFlags {
    pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
}
impl Default for UtmDataAvailFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type.           Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type.           Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: https://mavlink.io/en/services/parameter.html#parameter-encoding.           Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: https://mavlink.io/en/services/ftp.html."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Autopilot supports direct actuator control."] const MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: https://mavlink.io/en/services/parameter.html#parameter-encoding.           Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; } }
impl MavProtocolCapability {
    pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
}
impl Default for MavProtocolCapability {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
impl GpsInputIgnoreFlags {
    pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
}
impl Default for GpsInputIgnoreFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "These flags encode the cellular network status"]
pub enum CellularStatusFlag {
    #[doc = "State unknown or not reportable."]
    CELLULAR_STATUS_FLAG_UNKNOWN = 0,
    #[doc = "Modem is unusable"]
    CELLULAR_STATUS_FLAG_FAILED = 1,
    #[doc = "Modem is being initialized"]
    CELLULAR_STATUS_FLAG_INITIALIZING = 2,
    #[doc = "Modem is locked"]
    CELLULAR_STATUS_FLAG_LOCKED = 3,
    #[doc = "Modem is not enabled and is powered down"]
    CELLULAR_STATUS_FLAG_DISABLED = 4,
    #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
    CELLULAR_STATUS_FLAG_DISABLING = 5,
    #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
    CELLULAR_STATUS_FLAG_ENABLING = 6,
    #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
    CELLULAR_STATUS_FLAG_ENABLED = 7,
    #[doc = "Modem is searching for a network provider to register"]
    CELLULAR_STATUS_FLAG_SEARCHING = 8,
    #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
    CELLULAR_STATUS_FLAG_REGISTERED = 9,
    #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
    CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
    #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
    CELLULAR_STATUS_FLAG_CONNECTING = 11,
    #[doc = "One or more packet data bearers is active and connected"]
    CELLULAR_STATUS_FLAG_CONNECTED = 12,
}
impl CellularStatusFlag {
    pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
}
impl Default for CellularStatusFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles.        Global frames use the following naming conventions:       - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default.         The following modifiers may be used with \"GLOBAL\":         - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL.         - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL.         - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7.        Local frames use the following naming conventions:       - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\").       - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude.       - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames.        Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
pub enum MavFrame {
    #[doc = "Global (WGS84) coordinate frame + MSL altitude. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL)."]
    MAV_FRAME_GLOBAL = 0,
    #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
    MAV_FRAME_LOCAL_NED = 1,
    #[doc = "NOT a coordinate frame, indicates a mission command."]
    MAV_FRAME_MISSION = 2,
    #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position.           First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home position."]
    MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
    #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
    MAV_FRAME_LOCAL_ENU = 4,
    #[doc = "Global (WGS84) coordinate frame (scaled) + MSL altitude. First value / x: latitude in degrees*1E7, second value / y: longitude in degrees*1E7, third value / z: positive altitude over mean sea level (MSL)."]
    MAV_FRAME_GLOBAL_INT = 5,
    #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position.           First value / x: latitude in degrees*1E7, second value / y: longitude in degrees*1E7, third value / z: positive altitude with 0 being at the altitude of the home position."]
    MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
    #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
    MAV_FRAME_LOCAL_OFFSET_NED = 7,
    #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
    MAV_FRAME_BODY_NED = 8,
    #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
    MAV_FRAME_BODY_OFFSET_NED = 9,
    #[doc = "Global (WGS84) coordinate frame with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model."]
    MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
    #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees*1E7, second value / y: longitude in degrees*1E7, third value / z: positive altitude in meters with 0 being at ground level in terrain model."]
    MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
    #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
    MAV_FRAME_BODY_FRD = 12,
    #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
    MAV_FRAME_RESERVED_13 = 13,
    #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
    MAV_FRAME_RESERVED_14 = 14,
    #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
    MAV_FRAME_RESERVED_15 = 15,
    #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
    MAV_FRAME_RESERVED_16 = 16,
    #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
    MAV_FRAME_RESERVED_17 = 17,
    #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
    MAV_FRAME_RESERVED_18 = 18,
    #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
    MAV_FRAME_RESERVED_19 = 19,
    #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
    MAV_FRAME_LOCAL_FRD = 20,
    #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
    MAV_FRAME_LOCAL_FLU = 21,
}
impl MavFrame {
    pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
}
impl Default for MavFrame {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
pub enum MavMountMode {
    #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization"]
    MAV_MOUNT_MODE_RETRACT = 0,
    #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
    MAV_MOUNT_MODE_NEUTRAL = 1,
    #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
    MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
    #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
    MAV_MOUNT_MODE_RC_TARGETING = 3,
    #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
    MAV_MOUNT_MODE_GPS_POINT = 4,
    #[doc = "Gimbal tracks system with specified system ID"]
    MAV_MOUNT_MODE_SYSID_TARGET = 5,
    #[doc = "Gimbal tracks home position"]
    MAV_MOUNT_MODE_HOME_LOCATION = 6,
}
impl MavMountMode {
    pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
}
impl Default for MavMountMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
pub enum CameraZoomType {
    #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
    ZOOM_TYPE_STEP = 0,
    #[doc = "Continuous zoom up/down until stopped (-1 for wide, 1 for tele, 0 to stop zooming)"]
    ZOOM_TYPE_CONTINUOUS = 1,
    #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
    ZOOM_TYPE_RANGE = 2,
    #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
    ZOOM_TYPE_FOCAL_LENGTH = 3,
}
impl CameraZoomType {
    pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
}
impl Default for CameraZoomType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidSpeedAcc {
    #[doc = "The speed accuracy is unknown."]
    MAV_ODID_SPEED_ACC_UNKNOWN = 0,
    #[doc = "The speed accuracy is smaller than 10 meters per second."]
    MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
    #[doc = "The speed accuracy is smaller than 3 meters per second."]
    MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
    #[doc = "The speed accuracy is smaller than 1 meters per second."]
    MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
    #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
    MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
}
impl MavOdidSpeedAcc {
    pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
}
impl Default for MavOdidSpeedAcc {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Type of landing target"]
pub enum LandingTargetType {
    #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
    LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
    #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
    LANDING_TARGET_TYPE_RADIO_BEACON = 1,
    #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
    LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
    #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
    LANDING_TARGET_TYPE_VISION_OTHER = 3,
}
impl LandingTargetType {
    pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
}
impl Default for LandingTargetType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "None of the fields in HIL_SENSOR have been updated"] const HIL_SENSOR_UPDATED_NONE = 0 ; # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
impl HilSensorUpdatedFlags {
    pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_NONE;
}
impl Default for HilSensorUpdatedFlags {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Video stream types"]
pub enum VideoStreamType {
    #[doc = "Stream is RTSP"]
    VIDEO_STREAM_TYPE_RTSP = 0,
    #[doc = "Stream is RTP UDP (URI gives the port number)"]
    VIDEO_STREAM_TYPE_RTPUDP = 1,
    #[doc = "Stream is MPEG on TCP"]
    VIDEO_STREAM_TYPE_TCP_MPEG = 2,
    #[doc = "Stream is h.264 on MPEG TS (URI gives the port number)"]
    VIDEO_STREAM_TYPE_MPEG_TS_H264 = 3,
}
impl VideoStreamType {
    pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
}
impl Default for VideoStreamType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Enumeration for battery charge states."]
pub enum MavBatteryChargeState {
    #[doc = "Low battery state is not provided"]
    MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
    #[doc = "Battery is not in low state. Normal operation."]
    MAV_BATTERY_CHARGE_STATE_OK = 1,
    #[doc = "Battery state is low, warn and monitor close."]
    MAV_BATTERY_CHARGE_STATE_LOW = 2,
    #[doc = "Battery state is critical, return or abort immediately."]
    MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
    #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
    MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
    #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
    MAV_BATTERY_CHARGE_STATE_FAILED = 5,
    #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
    MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
    #[doc = "Battery is charging."]
    MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
}
impl MavBatteryChargeState {
    pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
}
impl Default for MavBatteryChargeState {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
pub enum MavBatteryMode {
    #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
    MAV_BATTERY_MODE_UNKNOWN = 0,
    #[doc = "Battery is auto discharging (towards storage level)."]
    MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
    #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
    MAV_BATTERY_MODE_HOT_SWAP = 2,
}
impl MavBatteryMode {
    pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
}
impl Default for MavBatteryMode {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
pub enum MavGoto {
    #[doc = "Hold at the current position."]
    MAV_GOTO_DO_HOLD = 0,
    #[doc = "Continue with the next item in mission execution."]
    MAV_GOTO_DO_CONTINUE = 1,
    #[doc = "Hold at the current position of the system"]
    MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
    #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
    MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
}
impl MavGoto {
    pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
}
impl Default for MavGoto {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE.         (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
pub enum PreflightStorageMissionAction {
    #[doc = "Read current mission data from persistent storage"]
    MISSION_READ_PERSISTENT = 0,
    #[doc = "Write current mission data to persistent storage"]
    MISSION_WRITE_PERSISTENT = 1,
    #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
    MISSION_RESET_DEFAULT = 2,
}
impl PreflightStorageMissionAction {
    pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
}
impl Default for PreflightStorageMissionAction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Possible actions an aircraft can take to avoid a collision."]
pub enum MavCollisionAction {
    #[doc = "Ignore any potential collisions"]
    MAV_COLLISION_ACTION_NONE = 0,
    #[doc = "Report potential collision"]
    MAV_COLLISION_ACTION_REPORT = 1,
    #[doc = "Ascend or Descend to avoid threat"]
    MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
    #[doc = "Move horizontally to avoid threat"]
    MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
    #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
    MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
    #[doc = "Aircraft to fly directly back to its launch point"]
    MAV_COLLISION_ACTION_RTL = 5,
    #[doc = "Aircraft to stop in place"]
    MAV_COLLISION_ACTION_HOVER = 6,
}
impl MavCollisionAction {
    pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
}
impl Default for MavCollisionAction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Aircraft-rated danger from this threat."]
pub enum MavCollisionThreatLevel {
    #[doc = "Not a threat"]
    MAV_COLLISION_THREAT_LEVEL_NONE = 0,
    #[doc = "Craft is mildly concerned about this threat"]
    MAV_COLLISION_THREAT_LEVEL_LOW = 1,
    #[doc = "Craft is panicking, and may take actions to avoid threat"]
    MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
}
impl MavCollisionThreatLevel {
    pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
}
impl Default for MavCollisionThreatLevel {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE.         (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
pub enum PreflightStorageParameterAction {
    #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
    PARAM_READ_PERSISTENT = 0,
    #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
    PARAM_WRITE_PERSISTENT = 1,
    #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
    PARAM_RESET_CONFIG_DEFAULT = 2,
    #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
    PARAM_RESET_SENSOR_DEFAULT = 3,
    #[doc = "Reset all parameters, including operation counters, to default values"]
    PARAM_RESET_ALL_DEFAULT = 4,
}
impl PreflightStorageParameterAction {
    pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
}
impl Default for PreflightStorageParameterAction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Yaw behaviour during orbit flight."]
pub enum OrbitYawBehaviour {
    #[doc = "Vehicle front points to the center (default)."]
    ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
    #[doc = "Vehicle front holds heading when message received."]
    ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
    #[doc = "Yaw uncontrolled."]
    ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
    #[doc = "Vehicle front follows flight path (tangential to circle)."]
    ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
    #[doc = "Yaw controlled by RC input."]
    ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
}
impl OrbitYawBehaviour {
    pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
}
impl Default for OrbitYawBehaviour {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "List of possible units where failures can be injected."]
pub enum FailureUnit {
    FAILURE_UNIT_SENSOR_GYRO = 0,
    FAILURE_UNIT_SENSOR_ACCEL = 1,
    FAILURE_UNIT_SENSOR_MAG = 2,
    FAILURE_UNIT_SENSOR_BARO = 3,
    FAILURE_UNIT_SENSOR_GPS = 4,
    FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
    FAILURE_UNIT_SENSOR_VIO = 6,
    FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
    FAILURE_UNIT_SENSOR_AIRSPEED = 8,
    FAILURE_UNIT_SYSTEM_BATTERY = 100,
    FAILURE_UNIT_SYSTEM_MOTOR = 101,
    FAILURE_UNIT_SYSTEM_SERVO = 102,
    FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
    FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
    FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
}
impl FailureUnit {
    pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
}
impl Default for FailureUnit {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 rc receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
impl MavSysStatusSensor {
    pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
}
impl Default for MavSysStatusSensor {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See https://mavlink.io/en/guide/xml_schema.html#MAV_CMD for information about the structure of the MAV_CMD entries"]
pub enum MavCmd {
    #[doc = "Navigate to waypoint."]
    MAV_CMD_NAV_WAYPOINT = 16,
    #[doc = "Loiter around this waypoint an unlimited amount of time"]
    MAV_CMD_NAV_LOITER_UNLIM = 17,
    #[doc = "Loiter around this waypoint for X turns"]
    MAV_CMD_NAV_LOITER_TURNS = 18,
    #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
    MAV_CMD_NAV_LOITER_TIME = 19,
    #[doc = "Return to launch location"]
    MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
    #[doc = "Land at location."]
    MAV_CMD_NAV_LAND = 21,
    #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
    MAV_CMD_NAV_TAKEOFF = 22,
    #[doc = "Land at local position (local frame only)"]
    MAV_CMD_NAV_LAND_LOCAL = 23,
    #[doc = "Takeoff from local position (local frame only)"]
    MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
    #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
    MAV_CMD_NAV_FOLLOW = 25,
    #[doc = "Continue on the current course and climb/descend to specified altitude.  When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
    MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
    #[doc = "Begin loiter at the specified Latitude and Longitude.  If Lat=Lon=0, then loiter at the current position.  Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
    MAV_CMD_NAV_LOITER_TO_ALT = 31,
    #[doc = "Begin following a target"]
    MAV_CMD_DO_FOLLOW = 32,
    #[doc = "Reposition the MAV after a follow target command has been sent"]
    MAV_CMD_DO_FOLLOW_REPOSITION = 33,
    #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
    MAV_CMD_DO_ORBIT = 34,
    #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
    MAV_CMD_NAV_ROI = 80,
    #[doc = "Control autonomous path planning on the MAV."]
    MAV_CMD_NAV_PATHPLANNING = 81,
    #[doc = "Navigate to waypoint using a spline path."]
    MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
    #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
    MAV_CMD_NAV_VTOL_TAKEOFF = 84,
    #[doc = "Land using VTOL mode"]
    MAV_CMD_NAV_VTOL_LAND = 85,
    #[doc = "hand control over to an external controller"]
    MAV_CMD_NAV_GUIDED_ENABLE = 92,
    #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
    MAV_CMD_NAV_DELAY = 93,
    #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
    MAV_CMD_NAV_PAYLOAD_PLACE = 94,
    #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
    MAV_CMD_NAV_LAST = 95,
    #[doc = "Delay mission state machine."]
    MAV_CMD_CONDITION_DELAY = 112,
    #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
    MAV_CMD_CONDITION_CHANGE_ALT = 113,
    #[doc = "Delay mission state machine until within desired distance of next NAV point."]
    MAV_CMD_CONDITION_DISTANCE = 114,
    #[doc = "Reach a certain target angle."]
    MAV_CMD_CONDITION_YAW = 115,
    #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
    MAV_CMD_CONDITION_LAST = 159,
    #[doc = "Set system mode."]
    MAV_CMD_DO_SET_MODE = 176,
    #[doc = "Jump to the desired command in the mission list.  Repeat this action only the specified number of times"]
    MAV_CMD_DO_JUMP = 177,
    #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change."]
    MAV_CMD_DO_CHANGE_SPEED = 178,
    #[doc = "Sets the home position to either to the current position or a specified position.           The home position is the default position that the system will return to and land on.           The position is set automatically by the system during the takeoff (and may also be set using this command).           Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
    MAV_CMD_DO_SET_HOME = 179,
    #[doc = "Set a system parameter.  Caution!  Use of this command requires knowledge of the numeric enumeration value of the parameter."]
    MAV_CMD_DO_SET_PARAMETER = 180,
    #[doc = "Set a relay to a condition."]
    MAV_CMD_DO_SET_RELAY = 181,
    #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
    MAV_CMD_DO_REPEAT_RELAY = 182,
    #[doc = "Set a servo to a desired PWM value."]
    MAV_CMD_DO_SET_SERVO = 183,
    #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
    MAV_CMD_DO_REPEAT_SERVO = 184,
    #[doc = "Terminate flight immediately.           Flight termination immediately and irreversably terminates the current flight, returning the vehicle to ground.           The vehicle will ignore RC or other input until it has been power-cycled.           Termination may trigger safety measures, including: disabling motors and deployment of parachute on multicopters, and setting flight surfaces to initiate a landing pattern on fixed-wing).           On multicopters without a parachute it may trigger a crash landing.           Support for this command can be tested using the protocol bit: MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION.           Support for this command can also be tested by sending the command with param1=0 (< 0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
    MAV_CMD_DO_FLIGHTTERMINATION = 185,
    #[doc = "Change altitude set point."]
    MAV_CMD_DO_CHANGE_ALTITUDE = 186,
    #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
    MAV_CMD_DO_SET_ACTUATOR = 187,
    #[doc = "Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. \t  It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. \t  The Latitude/Longitude/Altitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence."]
    MAV_CMD_DO_LAND_START = 189,
    #[doc = "Mission command to perform a landing from a rally point."]
    MAV_CMD_DO_RALLY_LAND = 190,
    #[doc = "Mission command to safely abort an autonomous landing."]
    MAV_CMD_DO_GO_AROUND = 191,
    #[doc = "Reposition the vehicle to a specific WGS84 global position."]
    MAV_CMD_DO_REPOSITION = 192,
    #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
    MAV_CMD_DO_PAUSE_CONTINUE = 193,
    #[doc = "Set moving direction to forward or reverse."]
    MAV_CMD_DO_SET_REVERSE = 194,
    #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
    MAV_CMD_DO_SET_ROI_LOCATION = 195,
    #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
    MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
    #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
    MAV_CMD_DO_SET_ROI_NONE = 197,
    #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
    MAV_CMD_DO_SET_ROI_SYSID = 198,
    #[doc = "Control onboard camera system."]
    MAV_CMD_DO_CONTROL_VIDEO = 200,
    #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
    MAV_CMD_DO_SET_ROI = 201,
    #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html )."]
    MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
    #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html )."]
    MAV_CMD_DO_DIGICAM_CONTROL = 203,
    #[doc = "Mission command to configure a camera or antenna mount"]
    MAV_CMD_DO_MOUNT_CONFIGURE = 204,
    #[doc = "Mission command to control a camera or antenna mount"]
    MAV_CMD_DO_MOUNT_CONTROL = 205,
    #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
    MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
    #[doc = "Mission command to enable the geofence"]
    MAV_CMD_DO_FENCE_ENABLE = 207,
    #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
    MAV_CMD_DO_PARACHUTE = 208,
    #[doc = "Command to perform motor test."]
    MAV_CMD_DO_MOTOR_TEST = 209,
    #[doc = "Change to/from inverted flight."]
    MAV_CMD_DO_INVERTED_FLIGHT = 210,
    #[doc = "Mission command to operate a gripper."]
    MAV_CMD_DO_GRIPPER = 211,
    #[doc = "Enable/disable autotune."]
    MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
    #[doc = "Sets a desired vehicle turn angle and speed change."]
    MAV_CMD_NAV_SET_YAW_SPEED = 213,
    #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
    MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
    #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
    MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
    #[doc = "set id of master controller"]
    MAV_CMD_DO_GUIDED_MASTER = 221,
    #[doc = "Set limits for external control"]
    MAV_CMD_DO_GUIDED_LIMITS = 222,
    #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
    MAV_CMD_DO_ENGINE_CONTROL = 223,
    #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed).           If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t  Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2).            This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE.           If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission.           If the system is not in mission mode this command must not trigger a switch to mission mode.            The mission may be \"reset\" using param2.           Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`).           Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode.  \t  The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
    MAV_CMD_DO_SET_MISSION_CURRENT = 224,
    #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
    MAV_CMD_DO_LAST = 240,
    #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
    MAV_CMD_PREFLIGHT_CALIBRATION = 241,
    #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
    MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
    #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
    MAV_CMD_PREFLIGHT_UAVCAN = 243,
    #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
    MAV_CMD_PREFLIGHT_STORAGE = 245,
    #[doc = "Request the reboot or shutdown of system components."]
    MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
    #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
    MAV_CMD_OVERRIDE_GOTO = 252,
    #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
    MAV_CMD_OBLIQUE_SURVEY = 260,
    #[doc = "start running a mission"]
    MAV_CMD_MISSION_START = 300,
    #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots typically refuse this command while armed."]
    MAV_CMD_ACTUATOR_TEST = 310,
    #[doc = "Actuator configuration command."]
    MAV_CMD_CONFIGURE_ACTUATOR = 311,
    #[doc = "Arms / Disarms a component"]
    MAV_CMD_COMPONENT_ARM_DISARM = 400,
    #[doc = "Instructs a target system to run pre-arm checks.           This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed.           This command should return MAV_RESULT_ACCEPTED if it will run the checks.           The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific).           The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
    MAV_CMD_RUN_PREARM_CHECKS = 401,
    #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
    MAV_CMD_ILLUMINATOR_ON_OFF = 405,
    #[doc = "Request the home position from the vehicle. \t  The vehicle will ACK the command and then emit the HOME_POSITION message."]
    MAV_CMD_GET_HOME_POSITION = 410,
    #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
    MAV_CMD_INJECT_FAILURE = 420,
    #[doc = "Starts receiver pairing."]
    MAV_CMD_START_RX_PAIR = 500,
    #[doc = "Request the interval between messages for a particular MAVLink message ID.           The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
    MAV_CMD_GET_MESSAGE_INTERVAL = 510,
    #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
    MAV_CMD_SET_MESSAGE_INTERVAL = 511,
    #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
    MAV_CMD_REQUEST_MESSAGE = 512,
    #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
    MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
    #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
    MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
    #[doc = "Request camera information (CAMERA_INFORMATION)."]
    MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
    #[doc = "Request camera settings (CAMERA_SETTINGS)."]
    MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
    #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
    MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
    #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
    MAV_CMD_STORAGE_FORMAT = 526,
    #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
    MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
    #[doc = "Request flight information (FLIGHT_INFORMATION)"]
    MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
    #[doc = "Reset all camera settings to Factory Default"]
    MAV_CMD_RESET_CAMERA_SETTINGS = 529,
    #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
    MAV_CMD_SET_CAMERA_MODE = 530,
    #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
    MAV_CMD_SET_CAMERA_ZOOM = 531,
    #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
    MAV_CMD_SET_CAMERA_FOCUS = 532,
    #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos).           There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage.           If no flag is set the system should use its default storage.           A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED.           A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
    MAV_CMD_SET_STORAGE_USAGE = 533,
    #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
    MAV_CMD_JUMP_TAG = 600,
    #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
    MAV_CMD_DO_JUMP_TAG = 601,
    #[doc = "High level setpoint to be sent to a gimbal manager to set a gimbal attitude. It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: a gimbal is never to react to this command but only the gimbal manager."]
    MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
    #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
    MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
    #[doc = "Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. Use NaN for reserved values."]
    MAV_CMD_IMAGE_START_CAPTURE = 2000,
    #[doc = "Stop image capture sequence Use NaN for reserved values."]
    MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
    #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
    MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
    #[doc = "Enable or disable on-board camera triggering system."]
    MAV_CMD_DO_TRIGGER_CONTROL = 2003,
    #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
    MAV_CMD_CAMERA_TRACK_POINT = 2004,
    #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
    MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
    #[doc = "Stops ongoing tracking."]
    MAV_CMD_CAMERA_STOP_TRACKING = 2010,
    #[doc = "Starts video capture (recording)."]
    MAV_CMD_VIDEO_START_CAPTURE = 2500,
    #[doc = "Stop the current video capture (recording)."]
    MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
    #[doc = "Start video streaming"]
    MAV_CMD_VIDEO_START_STREAMING = 2502,
    #[doc = "Stop the given video stream"]
    MAV_CMD_VIDEO_STOP_STREAMING = 2503,
    #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
    MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
    #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
    MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
    #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
    MAV_CMD_LOGGING_START = 2510,
    #[doc = "Request to stop streaming log data over MAVLink"]
    MAV_CMD_LOGGING_STOP = 2511,
    MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
    #[doc = "Request to start/stop transmitting over the high latency telemetry"]
    MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
    #[doc = "Create a panorama at the current position"]
    MAV_CMD_PANORAMA_CREATE = 2800,
    #[doc = "Request VTOL transition"]
    MAV_CMD_DO_VTOL_TRANSITION = 3000,
    #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
    MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
    #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
    MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
    #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
    MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
    #[doc = "Delay mission state machine until gate has been reached."]
    MAV_CMD_CONDITION_GATE = 4501,
    #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
    MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
    #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required."]
    MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
    #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required."]
    MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
    #[doc = "Circular fence area. The vehicle must stay inside this area."]
    MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
    #[doc = "Circular fence area. The vehicle must stay outside this area."]
    MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
    #[doc = "Rally point. You can have multiple rally points defined."]
    MAV_CMD_NAV_RALLY_POINT = 5100,
    #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
    MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
    #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
    MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
    #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
    MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
    #[doc = "Control the payload deployment."]
    MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
    #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
    MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
    #[doc = "Command to operate winch."]
    MAV_CMD_DO_WINCH = 42600,
    #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
    MAV_CMD_WAYPOINT_USER_1 = 31000,
    #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
    MAV_CMD_WAYPOINT_USER_2 = 31001,
    #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
    MAV_CMD_WAYPOINT_USER_3 = 31002,
    #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
    MAV_CMD_WAYPOINT_USER_4 = 31003,
    #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
    MAV_CMD_WAYPOINT_USER_5 = 31004,
    #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
    MAV_CMD_SPATIAL_USER_1 = 31005,
    #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
    MAV_CMD_SPATIAL_USER_2 = 31006,
    #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
    MAV_CMD_SPATIAL_USER_3 = 31007,
    #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
    MAV_CMD_SPATIAL_USER_4 = 31008,
    #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
    MAV_CMD_SPATIAL_USER_5 = 31009,
    #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
    MAV_CMD_USER_1 = 31010,
    #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
    MAV_CMD_USER_2 = 31011,
    #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
    MAV_CMD_USER_3 = 31012,
    #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
    MAV_CMD_USER_4 = 31013,
    #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
    MAV_CMD_USER_5 = 31014,
    #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
    MAV_CMD_CAN_FORWARD = 32000,
}
impl MavCmd {
    pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
}
impl Default for MavCmd {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidHorAcc {
    #[doc = "The horizontal accuracy is unknown."]
    MAV_ODID_HOR_ACC_UNKNOWN = 0,
    #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
    MAV_ODID_HOR_ACC_10NM = 1,
    #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
    MAV_ODID_HOR_ACC_4NM = 2,
    #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
    MAV_ODID_HOR_ACC_2NM = 3,
    #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
    MAV_ODID_HOR_ACC_1NM = 4,
    #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
    MAV_ODID_HOR_ACC_0_5NM = 5,
    #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
    MAV_ODID_HOR_ACC_0_3NM = 6,
    #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
    MAV_ODID_HOR_ACC_0_1NM = 7,
    #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
    MAV_ODID_HOR_ACC_0_05NM = 8,
    #[doc = "The horizontal accuracy is smaller than 30 meter."]
    MAV_ODID_HOR_ACC_30_METER = 9,
    #[doc = "The horizontal accuracy is smaller than 10 meter."]
    MAV_ODID_HOR_ACC_10_METER = 10,
    #[doc = "The horizontal accuracy is smaller than 3 meter."]
    MAV_ODID_HOR_ACC_3_METER = 11,
    #[doc = "The horizontal accuracy is smaller than 1 meter."]
    MAV_ODID_HOR_ACC_1_METER = 12,
}
impl MavOdidHorAcc {
    pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
}
impl Default for MavOdidHorAcc {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission."]
pub enum MavCmdAck {
    #[doc = "Command / mission item is ok."]
    MAV_CMD_ACK_OK = 0,
    #[doc = "Generic error message if none of the other reasons fails or if no detailed error reporting is implemented."]
    MAV_CMD_ACK_ERR_FAIL = 1,
    #[doc = "The system is refusing to accept this command from this source / communication partner."]
    MAV_CMD_ACK_ERR_ACCESS_DENIED = 2,
    #[doc = "Command or mission item is not supported, other commands would be accepted."]
    MAV_CMD_ACK_ERR_NOT_SUPPORTED = 3,
    #[doc = "The coordinate frame of this command / mission item is not supported."]
    MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 4,
    #[doc = "The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible."]
    MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 5,
    #[doc = "The X or latitude value is out of range."]
    MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 6,
    #[doc = "The Y or longitude value is out of range."]
    MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 7,
    #[doc = "The Z or altitude value is out of range."]
    MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 8,
}
impl MavCmdAck {
    pub const DEFAULT: Self = Self::MAV_CMD_ACK_OK;
}
impl Default for MavCmdAck {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "A data stream is not a fixed set of messages, but rather a      recommendation to the autopilot software. Individual autopilots may or may not obey      the recommended messages."]
pub enum MavDataStream {
    #[doc = "Enable all data streams"]
    MAV_DATA_STREAM_ALL = 0,
    #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
    MAV_DATA_STREAM_RAW_SENSORS = 1,
    #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
    MAV_DATA_STREAM_EXTENDED_STATUS = 2,
    #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
    MAV_DATA_STREAM_RC_CHANNELS = 3,
    #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
    MAV_DATA_STREAM_RAW_CONTROLLER = 4,
    #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
    MAV_DATA_STREAM_POSITION = 6,
    #[doc = "Dependent on the autopilot"]
    MAV_DATA_STREAM_EXTRA1 = 10,
    #[doc = "Dependent on the autopilot"]
    MAV_DATA_STREAM_EXTRA2 = 11,
    #[doc = "Dependent on the autopilot"]
    MAV_DATA_STREAM_EXTRA3 = 12,
}
impl MavDataStream {
    pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
}
impl Default for MavDataStream {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, https://gpsd.gitlab.io/gpsd/AIVDM.html"]
pub enum AisNavStatus {
    #[doc = "Under way using engine."]
    UNDER_WAY = 0,
    AIS_NAV_ANCHORED = 1,
    AIS_NAV_UN_COMMANDED = 2,
    AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
    AIS_NAV_DRAUGHT_CONSTRAINED = 4,
    AIS_NAV_MOORED = 5,
    AIS_NAV_AGROUND = 6,
    AIS_NAV_FISHING = 7,
    AIS_NAV_SAILING = 8,
    AIS_NAV_RESERVED_HSC = 9,
    AIS_NAV_RESERVED_WIG = 10,
    AIS_NAV_RESERVED_1 = 11,
    AIS_NAV_RESERVED_2 = 12,
    AIS_NAV_RESERVED_3 = 13,
    #[doc = "Search And Rescue Transponder."]
    AIS_NAV_AIS_SART = 14,
    #[doc = "Not available (default)."]
    AIS_NAV_UNKNOWN = 15,
}
impl AisNavStatus {
    pub const DEFAULT: Self = Self::UNDER_WAY;
}
impl Default for AisNavStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Gripper actions."]
pub enum GripperActions {
    #[doc = "Gripper release cargo."]
    GRIPPER_ACTION_RELEASE = 0,
    #[doc = "Gripper grab onto cargo."]
    GRIPPER_ACTION_GRAB = 1,
}
impl GripperActions {
    pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
}
impl Default for GripperActions {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavlinkDataStreamType {
    MAVLINK_DATA_STREAM_IMG_JPEG = 0,
    MAVLINK_DATA_STREAM_IMG_BMP = 1,
    MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
    MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
    MAVLINK_DATA_STREAM_IMG_PGM = 4,
    MAVLINK_DATA_STREAM_IMG_PNG = 5,
}
impl MavlinkDataStreamType {
    pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
}
impl Default for MavlinkDataStreamType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
pub enum AdsbEmitterType {
    ADSB_EMITTER_TYPE_NO_INFO = 0,
    ADSB_EMITTER_TYPE_LIGHT = 1,
    ADSB_EMITTER_TYPE_SMALL = 2,
    ADSB_EMITTER_TYPE_LARGE = 3,
    ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
    ADSB_EMITTER_TYPE_HEAVY = 5,
    ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
    ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
    ADSB_EMITTER_TYPE_UNASSIGNED = 8,
    ADSB_EMITTER_TYPE_GLIDER = 9,
    ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
    ADSB_EMITTER_TYPE_PARACHUTE = 11,
    ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
    ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
    ADSB_EMITTER_TYPE_UAV = 14,
    ADSB_EMITTER_TYPE_SPACE = 15,
    ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
    ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
    ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
    ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
}
impl AdsbEmitterType {
    pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
}
impl Default for AdsbEmitterType {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags to report failure cases over the high latency telemtry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no rc connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
impl HlFailureFlag {
    pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
}
impl Default for HlFailureFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
impl MavGeneratorStatusFlag {
    pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
}
impl Default for MavGeneratorStatusFlag {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidVerAcc {
    #[doc = "The vertical accuracy is unknown."]
    MAV_ODID_VER_ACC_UNKNOWN = 0,
    #[doc = "The vertical accuracy is smaller than 150 meter."]
    MAV_ODID_VER_ACC_150_METER = 1,
    #[doc = "The vertical accuracy is smaller than 45 meter."]
    MAV_ODID_VER_ACC_45_METER = 2,
    #[doc = "The vertical accuracy is smaller than 25 meter."]
    MAV_ODID_VER_ACC_25_METER = 3,
    #[doc = "The vertical accuracy is smaller than 10 meter."]
    MAV_ODID_VER_ACC_10_METER = 4,
    #[doc = "The vertical accuracy is smaller than 3 meter."]
    MAV_ODID_VER_ACC_3_METER = 5,
    #[doc = "The vertical accuracy is smaller than 1 meter."]
    MAV_ODID_VER_ACC_1_METER = 6,
}
impl MavOdidVerAcc {
    pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
}
impl Default for MavOdidVerAcc {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
pub enum ActuatorOutputFunction {
    #[doc = "No function (disabled)."]
    ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
    #[doc = "Motor 1"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
    #[doc = "Motor 2"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
    #[doc = "Motor 3"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
    #[doc = "Motor 4"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
    #[doc = "Motor 5"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
    #[doc = "Motor 6"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
    #[doc = "Motor 7"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
    #[doc = "Motor 8"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
    #[doc = "Motor 9"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
    #[doc = "Motor 10"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
    #[doc = "Motor 11"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
    #[doc = "Motor 12"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
    #[doc = "Motor 13"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
    #[doc = "Motor 14"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
    #[doc = "Motor 15"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
    #[doc = "Motor 16"]
    ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
    #[doc = "Servo 1"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
    #[doc = "Servo 2"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
    #[doc = "Servo 3"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
    #[doc = "Servo 4"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
    #[doc = "Servo 5"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
    #[doc = "Servo 6"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
    #[doc = "Servo 7"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
    #[doc = "Servo 8"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
    #[doc = "Servo 9"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
    #[doc = "Servo 10"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
    #[doc = "Servo 11"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
    #[doc = "Servo 12"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
    #[doc = "Servo 13"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
    #[doc = "Servo 14"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
    #[doc = "Servo 15"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
    #[doc = "Servo 16"]
    ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
}
impl ActuatorOutputFunction {
    pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
}
impl Default for ActuatorOutputFunction {
    fn default() -> Self {
        Self::DEFAULT
    }
}
bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
impl MavBatteryFault {
    pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
}
impl Default for MavBatteryFault {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.).       Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components.       When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
pub enum MavComponent {
    #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
    MAV_COMP_ID_ALL = 0,
    #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
    MAV_COMP_ID_AUTOPILOT1 = 1,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER1 = 25,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER2 = 26,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER3 = 27,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER4 = 28,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER5 = 29,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER6 = 30,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER7 = 31,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER8 = 32,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER9 = 33,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER10 = 34,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER11 = 35,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER12 = 36,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER13 = 37,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER14 = 38,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER15 = 39,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER16 = 40,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER17 = 41,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER18 = 42,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER19 = 43,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER20 = 44,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER21 = 45,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER22 = 46,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER23 = 47,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER24 = 48,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER25 = 49,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER26 = 50,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER27 = 51,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER28 = 52,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER29 = 53,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER30 = 54,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER31 = 55,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER32 = 56,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER33 = 57,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER34 = 58,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER35 = 59,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER36 = 60,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER37 = 61,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER38 = 62,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER39 = 63,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER40 = 64,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER41 = 65,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER42 = 66,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER43 = 67,
    #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
    MAV_COMP_ID_TELEMETRY_RADIO = 68,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER45 = 69,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER46 = 70,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER47 = 71,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER48 = 72,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER49 = 73,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER50 = 74,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER51 = 75,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER52 = 76,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER53 = 77,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER54 = 78,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER55 = 79,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER56 = 80,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER57 = 81,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER58 = 82,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER59 = 83,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER60 = 84,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER61 = 85,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER62 = 86,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER63 = 87,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER64 = 88,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER65 = 89,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER66 = 90,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER67 = 91,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER68 = 92,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER69 = 93,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER70 = 94,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER71 = 95,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER72 = 96,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER73 = 97,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER74 = 98,
    #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
    MAV_COMP_ID_USER75 = 99,
    #[doc = "Camera #1."]
    MAV_COMP_ID_CAMERA = 100,
    #[doc = "Camera #2."]
    MAV_COMP_ID_CAMERA2 = 101,
    #[doc = "Camera #3."]
    MAV_COMP_ID_CAMERA3 = 102,
    #[doc = "Camera #4."]
    MAV_COMP_ID_CAMERA4 = 103,
    #[doc = "Camera #5."]
    MAV_COMP_ID_CAMERA5 = 104,
    #[doc = "Camera #6."]
    MAV_COMP_ID_CAMERA6 = 105,
    #[doc = "Servo #1."]
    MAV_COMP_ID_SERVO1 = 140,
    #[doc = "Servo #2."]
    MAV_COMP_ID_SERVO2 = 141,
    #[doc = "Servo #3."]
    MAV_COMP_ID_SERVO3 = 142,
    #[doc = "Servo #4."]
    MAV_COMP_ID_SERVO4 = 143,
    #[doc = "Servo #5."]
    MAV_COMP_ID_SERVO5 = 144,
    #[doc = "Servo #6."]
    MAV_COMP_ID_SERVO6 = 145,
    #[doc = "Servo #7."]
    MAV_COMP_ID_SERVO7 = 146,
    #[doc = "Servo #8."]
    MAV_COMP_ID_SERVO8 = 147,
    #[doc = "Servo #9."]
    MAV_COMP_ID_SERVO9 = 148,
    #[doc = "Servo #10."]
    MAV_COMP_ID_SERVO10 = 149,
    #[doc = "Servo #11."]
    MAV_COMP_ID_SERVO11 = 150,
    #[doc = "Servo #12."]
    MAV_COMP_ID_SERVO12 = 151,
    #[doc = "Servo #13."]
    MAV_COMP_ID_SERVO13 = 152,
    #[doc = "Servo #14."]
    MAV_COMP_ID_SERVO14 = 153,
    #[doc = "Gimbal #1."]
    MAV_COMP_ID_GIMBAL = 154,
    #[doc = "Logging component."]
    MAV_COMP_ID_LOG = 155,
    #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
    MAV_COMP_ID_ADSB = 156,
    #[doc = "On Screen Display (OSD) devices for video links."]
    MAV_COMP_ID_OSD = 157,
    #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
    MAV_COMP_ID_PERIPHERAL = 158,
    #[doc = "Gimbal ID for QX1."]
    MAV_COMP_ID_QX1_GIMBAL = 159,
    #[doc = "FLARM collision alert component."]
    MAV_COMP_ID_FLARM = 160,
    #[doc = "Parachute component."]
    MAV_COMP_ID_PARACHUTE = 161,
    #[doc = "Winch component."]
    MAV_COMP_ID_WINCH = 169,
    #[doc = "Gimbal #2."]
    MAV_COMP_ID_GIMBAL2 = 171,
    #[doc = "Gimbal #3."]
    MAV_COMP_ID_GIMBAL3 = 172,
    #[doc = "Gimbal #4"]
    MAV_COMP_ID_GIMBAL4 = 173,
    #[doc = "Gimbal #5."]
    MAV_COMP_ID_GIMBAL5 = 174,
    #[doc = "Gimbal #6."]
    MAV_COMP_ID_GIMBAL6 = 175,
    #[doc = "Battery #1."]
    MAV_COMP_ID_BATTERY = 180,
    #[doc = "Battery #2."]
    MAV_COMP_ID_BATTERY2 = 181,
    #[doc = "CAN over MAVLink client."]
    MAV_COMP_ID_MAVCAN = 189,
    #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
    MAV_COMP_ID_MISSIONPLANNER = 190,
    #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
    MAV_COMP_ID_ONBOARD_COMPUTER = 191,
    #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
    MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
    #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
    MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
    #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
    MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
    #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
    MAV_COMP_ID_PATHPLANNER = 195,
    #[doc = "Component that plans a collision free path between two points."]
    MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
    #[doc = "Component that provides position estimates using VIO techniques."]
    MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
    #[doc = "Component that manages pairing of vehicle and GCS."]
    MAV_COMP_ID_PAIRING_MANAGER = 198,
    #[doc = "Inertial Measurement Unit (IMU) #1."]
    MAV_COMP_ID_IMU = 200,
    #[doc = "Inertial Measurement Unit (IMU) #2."]
    MAV_COMP_ID_IMU_2 = 201,
    #[doc = "Inertial Measurement Unit (IMU) #3."]
    MAV_COMP_ID_IMU_3 = 202,
    #[doc = "GPS #1."]
    MAV_COMP_ID_GPS = 220,
    #[doc = "GPS #2."]
    MAV_COMP_ID_GPS2 = 221,
    #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
    MAV_COMP_ID_ODID_TXRX_1 = 236,
    #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
    MAV_COMP_ID_ODID_TXRX_2 = 237,
    #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
    MAV_COMP_ID_ODID_TXRX_3 = 238,
    #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
    MAV_COMP_ID_UDP_BRIDGE = 240,
    #[doc = "Component to bridge to UART (i.e. from UDP)."]
    MAV_COMP_ID_UART_BRIDGE = 241,
    #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
    MAV_COMP_ID_TUNNEL_NODE = 242,
    #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
    MAV_COMP_ID_SYSTEM_CONTROL = 250,
}
impl MavComponent {
    pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
}
impl Default for MavComponent {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MagCalStatus {
    MAG_CAL_NOT_STARTED = 0,
    MAG_CAL_WAITING_TO_START = 1,
    MAG_CAL_RUNNING_STEP_ONE = 2,
    MAG_CAL_RUNNING_STEP_TWO = 3,
    MAG_CAL_SUCCESS = 4,
    MAG_CAL_FAILED = 5,
    MAG_CAL_BAD_ORIENTATION = 6,
    MAG_CAL_BAD_RADIUS = 7,
}
impl MagCalStatus {
    pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
}
impl Default for MagCalStatus {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavOdidCategoryEu {
    #[doc = "The category for the UA, according to the EU specification, is undeclared."]
    MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
    #[doc = "The category for the UA, according to the EU specification, is the Open category."]
    MAV_ODID_CATEGORY_EU_OPEN = 1,
    #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
    MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
    #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
    MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
}
impl MavOdidCategoryEu {
    pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
}
impl Default for MavOdidCategoryEu {
    fn default() -> Self {
        Self::DEFAULT
    }
}
#[doc = "id: 411"]
#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CURRENT_EVENT_SEQUENCE_DATA {
    #[doc = "Sequence number.."]
    pub sequence: u16,
    #[doc = "Flag bitset.."]
    pub flags: MavEventCurrentSequenceFlags,
}
impl CURRENT_EVENT_SEQUENCE_DATA {
    pub const ENCODED_LEN: usize = 3usize;
    pub const DEFAULT: Self = Self {
        sequence: 0_u16,
        flags: MavEventCurrentSequenceFlags::DEFAULT,
    };
}
impl Default for CURRENT_EVENT_SEQUENCE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
    type Message = MavMessage;
    const ID: u32 = 411u32;
    const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
    const EXTRA_CRC: u8 = 106u8;
    const ENCODED_LEN: usize = 3usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.sequence = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.flags = MavEventCurrentSequenceFlags::from_bits(
            tmp & MavEventCurrentSequenceFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavEventCurrentSequenceFlags",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u8(self.flags.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 321"]
#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_EXT_REQUEST_LIST_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl PARAM_EXT_REQUEST_LIST_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for PARAM_EXT_REQUEST_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 321u32;
    const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
    const EXTRA_CRC: u8 = 88u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 92"]
#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_RC_INPUTS_RAW_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "RC channel 1 value."]
    pub chan1_raw: u16,
    #[doc = "RC channel 2 value."]
    pub chan2_raw: u16,
    #[doc = "RC channel 3 value."]
    pub chan3_raw: u16,
    #[doc = "RC channel 4 value."]
    pub chan4_raw: u16,
    #[doc = "RC channel 5 value."]
    pub chan5_raw: u16,
    #[doc = "RC channel 6 value."]
    pub chan6_raw: u16,
    #[doc = "RC channel 7 value."]
    pub chan7_raw: u16,
    #[doc = "RC channel 8 value."]
    pub chan8_raw: u16,
    #[doc = "RC channel 9 value."]
    pub chan9_raw: u16,
    #[doc = "RC channel 10 value."]
    pub chan10_raw: u16,
    #[doc = "RC channel 11 value."]
    pub chan11_raw: u16,
    #[doc = "RC channel 12 value."]
    pub chan12_raw: u16,
    #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub rssi: u8,
}
impl HIL_RC_INPUTS_RAW_DATA {
    pub const ENCODED_LEN: usize = 33usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        chan1_raw: 0_u16,
        chan2_raw: 0_u16,
        chan3_raw: 0_u16,
        chan4_raw: 0_u16,
        chan5_raw: 0_u16,
        chan6_raw: 0_u16,
        chan7_raw: 0_u16,
        chan8_raw: 0_u16,
        chan9_raw: 0_u16,
        chan10_raw: 0_u16,
        chan11_raw: 0_u16,
        chan12_raw: 0_u16,
        rssi: 0_u8,
    };
}
impl Default for HIL_RC_INPUTS_RAW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_RC_INPUTS_RAW_DATA {
    type Message = MavMessage;
    const ID: u32 = 92u32;
    const NAME: &'static str = "HIL_RC_INPUTS_RAW";
    const EXTRA_CRC: u8 = 54u8;
    const ENCODED_LEN: usize = 33usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.chan1_raw = buf.get_u16_le();
        __struct.chan2_raw = buf.get_u16_le();
        __struct.chan3_raw = buf.get_u16_le();
        __struct.chan4_raw = buf.get_u16_le();
        __struct.chan5_raw = buf.get_u16_le();
        __struct.chan6_raw = buf.get_u16_le();
        __struct.chan7_raw = buf.get_u16_le();
        __struct.chan8_raw = buf.get_u16_le();
        __struct.chan9_raw = buf.get_u16_le();
        __struct.chan10_raw = buf.get_u16_le();
        __struct.chan11_raw = buf.get_u16_le();
        __struct.chan12_raw = buf.get_u16_le();
        __struct.rssi = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u16_le(self.chan1_raw);
        __tmp.put_u16_le(self.chan2_raw);
        __tmp.put_u16_le(self.chan3_raw);
        __tmp.put_u16_le(self.chan4_raw);
        __tmp.put_u16_le(self.chan5_raw);
        __tmp.put_u16_le(self.chan6_raw);
        __tmp.put_u16_le(self.chan7_raw);
        __tmp.put_u16_le(self.chan8_raw);
        __tmp.put_u16_le(self.chan9_raw);
        __tmp.put_u16_le(self.chan10_raw);
        __tmp.put_u16_le(self.chan11_raw);
        __tmp.put_u16_le(self.chan12_raw);
        __tmp.put_u8(self.rssi);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 137"]
#[doc = "Barometer readings for 2nd barometer."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_PRESSURE2_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Absolute pressure."]
    pub press_abs: f32,
    #[doc = "Differential pressure."]
    pub press_diff: f32,
    #[doc = "Absolute pressure temperature."]
    pub temperature: i16,
    #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature_press_diff: i16,
}
impl SCALED_PRESSURE2_DATA {
    pub const ENCODED_LEN: usize = 16usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        press_abs: 0.0_f32,
        press_diff: 0.0_f32,
        temperature: 0_i16,
        temperature_press_diff: 0_i16,
    };
}
impl Default for SCALED_PRESSURE2_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_PRESSURE2_DATA {
    type Message = MavMessage;
    const ID: u32 = 137u32;
    const NAME: &'static str = "SCALED_PRESSURE2";
    const EXTRA_CRC: u8 = 195u8;
    const ENCODED_LEN: usize = 16usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.press_abs = buf.get_f32_le();
        __struct.press_diff = buf.get_f32_le();
        __struct.temperature = buf.get_i16_le();
        __struct.temperature_press_diff = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.press_abs);
        __tmp.put_f32_le(self.press_diff);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_i16_le(self.temperature_press_diff);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 112"]
#[doc = "Camera-IMU triggering and synchronisation message.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_TRIGGER_DATA {
    #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Image frame sequence."]
    pub seq: u32,
}
impl CAMERA_TRIGGER_DATA {
    pub const ENCODED_LEN: usize = 12usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        seq: 0_u32,
    };
}
impl Default for CAMERA_TRIGGER_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_TRIGGER_DATA {
    type Message = MavMessage;
    const ID: u32 = 112u32;
    const NAME: &'static str = "CAMERA_TRIGGER";
    const EXTRA_CRC: u8 = 174u8;
    const ENCODED_LEN: usize = 12usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.seq = buf.get_u32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.seq);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 264"]
#[doc = "Information about flight since last arming.         This can be requested using MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct FLIGHT_INFORMATION_DATA {
    #[doc = "Timestamp at arming (time since UNIX epoch) in UTC, 0 for unknown."]
    pub arming_time_utc: u64,
    #[doc = "Timestamp at takeoff (time since UNIX epoch) in UTC, 0 for unknown."]
    pub takeoff_time_utc: u64,
    #[doc = "Universally unique identifier (UUID) of flight, should correspond to name of log files."]
    pub flight_uuid: u64,
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
}
impl FLIGHT_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        arming_time_utc: 0_u64,
        takeoff_time_utc: 0_u64,
        flight_uuid: 0_u64,
        time_boot_ms: 0_u32,
    };
}
impl Default for FLIGHT_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for FLIGHT_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 264u32;
    const NAME: &'static str = "FLIGHT_INFORMATION";
    const EXTRA_CRC: u8 = 49u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.arming_time_utc = buf.get_u64_le();
        __struct.takeoff_time_utc = buf.get_u64_le();
        __struct.flight_uuid = buf.get_u64_le();
        __struct.time_boot_ms = buf.get_u32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.arming_time_utc);
        __tmp.put_u64_le(self.takeoff_time_utc);
        __tmp.put_u64_le(self.flight_uuid);
        __tmp.put_u32_le(self.time_boot_ms);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 111"]
#[doc = "Time synchronization message.         The message is used for both timesync requests and responses.         The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component.         The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request.         Systems can determine if they are receiving a request or response based on the value of `tc`.         If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error.         Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used).         The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TIMESYNC_DATA {
    #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component.."]
    pub tc1: i64,
    #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response).."]
    pub ts1: i64,
    #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_system: u8,
    #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_component: u8,
}
impl TIMESYNC_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        tc1: 0_i64,
        ts1: 0_i64,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for TIMESYNC_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TIMESYNC_DATA {
    type Message = MavMessage;
    const ID: u32 = 111u32;
    const NAME: &'static str = "TIMESYNC";
    const EXTRA_CRC: u8 = 34u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.tc1 = buf.get_i64_le();
        __struct.ts1 = buf.get_i64_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i64_le(self.tc1);
        __tmp.put_i64_le(self.ts1);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 126"]
#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SERIAL_CONTROL_DATA {
    #[doc = "Baudrate of transfer. Zero means no change.."]
    pub baudrate: u32,
    #[doc = "Timeout for reply data."]
    pub timeout: u16,
    #[doc = "Serial control device type.."]
    pub device: SerialControlDev,
    #[doc = "Bitmap of serial control flags.."]
    pub flags: SerialControlFlag,
    #[doc = "how many bytes in this transfer."]
    pub count: u8,
    #[doc = "serial data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 70],
    #[doc = "System ID."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_system: u8,
    #[doc = "Component ID."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_component: u8,
}
impl SERIAL_CONTROL_DATA {
    pub const ENCODED_LEN: usize = 81usize;
    pub const DEFAULT: Self = Self {
        baudrate: 0_u32,
        timeout: 0_u16,
        device: SerialControlDev::DEFAULT,
        flags: SerialControlFlag::DEFAULT,
        count: 0_u8,
        data: [0_u8; 70usize],
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for SERIAL_CONTROL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SERIAL_CONTROL_DATA {
    type Message = MavMessage;
    const ID: u32 = 126u32;
    const NAME: &'static str = "SERIAL_CONTROL";
    const EXTRA_CRC: u8 = 220u8;
    const ENCODED_LEN: usize = 81usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.baudrate = buf.get_u32_le();
        __struct.timeout = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.device = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "SerialControlDev",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "SerialControlFlag",
                value: tmp as u32,
            })?;
        __struct.count = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.baudrate);
        __tmp.put_u16_le(self.timeout);
        __tmp.put_u8(self.device as u8);
        __tmp.put_u8(self.flags.bits());
        __tmp.put_u8(self.count);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 104"]
#[doc = "Global position estimate from a Vicon motion system source.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VICON_POSITION_ESTIMATE_DATA {
    #[doc = "Timestamp (UNIX time or time since system boot)."]
    pub usec: u64,
    #[doc = "Global X position."]
    pub x: f32,
    #[doc = "Global Y position."]
    pub y: f32,
    #[doc = "Global Z position."]
    pub z: f32,
    #[doc = "Roll angle."]
    pub roll: f32,
    #[doc = "Pitch angle."]
    pub pitch: f32,
    #[doc = "Yaw angle."]
    pub yaw: f32,
    #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 21],
}
impl VICON_POSITION_ESTIMATE_DATA {
    pub const ENCODED_LEN: usize = 116usize;
    pub const DEFAULT: Self = Self {
        usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        covariance: [0.0_f32; 21usize],
    };
}
impl Default for VICON_POSITION_ESTIMATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VICON_POSITION_ESTIMATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 104u32;
    const NAME: &'static str = "VICON_POSITION_ESTIMATE";
    const EXTRA_CRC: u8 = 56u8;
    const ENCODED_LEN: usize = 116usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 110"]
#[doc = "File transfer protocol message: https://mavlink.io/en/services/ftp.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct FILE_TRANSFER_PROTOCOL_DATA {
    #[doc = "Network ID (0 for broadcast)."]
    pub target_network: u8,
    #[doc = "System ID (0 for broadcast)."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast)."]
    pub target_component: u8,
    #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in https://mavlink.io/en/services/ftp.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub payload: [u8; 251],
}
impl FILE_TRANSFER_PROTOCOL_DATA {
    pub const ENCODED_LEN: usize = 254usize;
    pub const DEFAULT: Self = Self {
        target_network: 0_u8,
        target_system: 0_u8,
        target_component: 0_u8,
        payload: [0_u8; 251usize],
    };
}
impl Default for FILE_TRANSFER_PROTOCOL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
    type Message = MavMessage;
    const ID: u32 = 110u32;
    const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
    const EXTRA_CRC: u8 = 84u8;
    const ENCODED_LEN: usize = 254usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_network = buf.get_u8();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.payload {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_network);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.payload {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 263"]
#[doc = "Information about a captured image. This is emitted every time a message is captured.         MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers:         MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers.         MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send:         set to 0 (default) to send just the the message for the sequence number in param 2,         set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers,         set to the sequence number of the final message in the range.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_IMAGE_CAPTURED_DATA {
    #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown.."]
    pub time_utc: u64,
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Latitude where image was taken."]
    pub lat: i32,
    #[doc = "Longitude where capture was taken."]
    pub lon: i32,
    #[doc = "Altitude (MSL) where image was taken."]
    pub alt: i32,
    #[doc = "Altitude above ground."]
    pub relative_alt: i32,
    #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)."]
    pub image_index: i32,
    #[doc = "Deprecated/unused. Component IDs are used to differentiate multiple cameras.."]
    pub camera_id: u8,
    #[doc = "Boolean indicating success (1) or failure (0) while capturing this image.."]
    pub capture_result: i8,
    #[doc = "URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub file_url: [u8; 205],
}
impl CAMERA_IMAGE_CAPTURED_DATA {
    pub const ENCODED_LEN: usize = 255usize;
    pub const DEFAULT: Self = Self {
        time_utc: 0_u64,
        time_boot_ms: 0_u32,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        relative_alt: 0_i32,
        q: [0.0_f32; 4usize],
        image_index: 0_i32,
        camera_id: 0_u8,
        capture_result: 0_i8,
        file_url: [0_u8; 205usize],
    };
}
impl Default for CAMERA_IMAGE_CAPTURED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
    type Message = MavMessage;
    const ID: u32 = 263u32;
    const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
    const EXTRA_CRC: u8 = 133u8;
    const ENCODED_LEN: usize = 255usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_utc = buf.get_u64_le();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.relative_alt = buf.get_i32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.image_index = buf.get_i32_le();
        __struct.camera_id = buf.get_u8();
        __struct.capture_result = buf.get_i8();
        for v in &mut __struct.file_url {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_utc);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i32_le(self.relative_alt);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_i32_le(self.image_index);
        __tmp.put_u8(self.camera_id);
        __tmp.put_i8(self.capture_result);
        for val in &self.file_url {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 37"]
#[doc = "Request a partial list of mission items from the system/component. https://mavlink.io/en/services/mission.html. If start and end index are the same, just send one waypoint.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
    #[doc = "Start index."]
    pub start_index: i16,
    #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list."]
    pub end_index: i16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_REQUEST_PARTIAL_LIST_DATA {
    pub const ENCODED_LEN: usize = 7usize;
    pub const DEFAULT: Self = Self {
        start_index: 0_i16,
        end_index: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 37u32;
    const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
    const EXTRA_CRC: u8 = 212u8;
    const ENCODED_LEN: usize = 7usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.start_index = buf.get_i16_le();
        __struct.end_index = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.start_index);
        __tmp.put_i16_le(self.end_index);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 276"]
#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
    #[doc = "Latitude of tracked object."]
    pub lat: i32,
    #[doc = "Longitude of tracked object."]
    pub lon: i32,
    #[doc = "Altitude of tracked object(AMSL, WGS84)."]
    pub alt: f32,
    #[doc = "Horizontal accuracy. NAN if unknown."]
    pub h_acc: f32,
    #[doc = "Vertical accuracy. NAN if unknown."]
    pub v_acc: f32,
    #[doc = "North velocity of tracked object. NAN if unknown."]
    pub vel_n: f32,
    #[doc = "East velocity of tracked object. NAN if unknown."]
    pub vel_e: f32,
    #[doc = "Down velocity of tracked object. NAN if unknown."]
    pub vel_d: f32,
    #[doc = "Velocity accuracy. NAN if unknown."]
    pub vel_acc: f32,
    #[doc = "Distance between camera and tracked object. NAN if unknown."]
    pub dist: f32,
    #[doc = "Heading in radians, in NED. NAN if unknown."]
    pub hdg: f32,
    #[doc = "Accuracy of heading, in NED. NAN if unknown."]
    pub hdg_acc: f32,
    #[doc = "Current tracking status."]
    pub tracking_status: CameraTrackingStatusFlags,
}
impl CAMERA_TRACKING_GEO_STATUS_DATA {
    pub const ENCODED_LEN: usize = 49usize;
    pub const DEFAULT: Self = Self {
        lat: 0_i32,
        lon: 0_i32,
        alt: 0.0_f32,
        h_acc: 0.0_f32,
        v_acc: 0.0_f32,
        vel_n: 0.0_f32,
        vel_e: 0.0_f32,
        vel_d: 0.0_f32,
        vel_acc: 0.0_f32,
        dist: 0.0_f32,
        hdg: 0.0_f32,
        hdg_acc: 0.0_f32,
        tracking_status: CameraTrackingStatusFlags::DEFAULT,
    };
}
impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 276u32;
    const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
    const EXTRA_CRC: u8 = 18u8;
    const ENCODED_LEN: usize = 49usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_f32_le();
        __struct.h_acc = buf.get_f32_le();
        __struct.v_acc = buf.get_f32_le();
        __struct.vel_n = buf.get_f32_le();
        __struct.vel_e = buf.get_f32_le();
        __struct.vel_d = buf.get_f32_le();
        __struct.vel_acc = buf.get_f32_le();
        __struct.dist = buf.get_f32_le();
        __struct.hdg = buf.get_f32_le();
        __struct.hdg_acc = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.tracking_status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CameraTrackingStatusFlags",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.h_acc);
        __tmp.put_f32_le(self.v_acc);
        __tmp.put_f32_le(self.vel_n);
        __tmp.put_f32_le(self.vel_e);
        __tmp.put_f32_le(self.vel_d);
        __tmp.put_f32_le(self.vel_acc);
        __tmp.put_f32_le(self.dist);
        __tmp.put_f32_le(self.hdg);
        __tmp.put_f32_le(self.hdg_acc);
        __tmp.put_u8(self.tracking_status as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 65"]
#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%.  A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RC_CHANNELS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "RC channel 1 value.."]
    pub chan1_raw: u16,
    #[doc = "RC channel 2 value.."]
    pub chan2_raw: u16,
    #[doc = "RC channel 3 value.."]
    pub chan3_raw: u16,
    #[doc = "RC channel 4 value.."]
    pub chan4_raw: u16,
    #[doc = "RC channel 5 value.."]
    pub chan5_raw: u16,
    #[doc = "RC channel 6 value.."]
    pub chan6_raw: u16,
    #[doc = "RC channel 7 value.."]
    pub chan7_raw: u16,
    #[doc = "RC channel 8 value.."]
    pub chan8_raw: u16,
    #[doc = "RC channel 9 value.."]
    pub chan9_raw: u16,
    #[doc = "RC channel 10 value.."]
    pub chan10_raw: u16,
    #[doc = "RC channel 11 value.."]
    pub chan11_raw: u16,
    #[doc = "RC channel 12 value.."]
    pub chan12_raw: u16,
    #[doc = "RC channel 13 value.."]
    pub chan13_raw: u16,
    #[doc = "RC channel 14 value.."]
    pub chan14_raw: u16,
    #[doc = "RC channel 15 value.."]
    pub chan15_raw: u16,
    #[doc = "RC channel 16 value.."]
    pub chan16_raw: u16,
    #[doc = "RC channel 17 value.."]
    pub chan17_raw: u16,
    #[doc = "RC channel 18 value.."]
    pub chan18_raw: u16,
    #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.."]
    pub chancount: u8,
    #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub rssi: u8,
}
impl RC_CHANNELS_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        chan1_raw: 0_u16,
        chan2_raw: 0_u16,
        chan3_raw: 0_u16,
        chan4_raw: 0_u16,
        chan5_raw: 0_u16,
        chan6_raw: 0_u16,
        chan7_raw: 0_u16,
        chan8_raw: 0_u16,
        chan9_raw: 0_u16,
        chan10_raw: 0_u16,
        chan11_raw: 0_u16,
        chan12_raw: 0_u16,
        chan13_raw: 0_u16,
        chan14_raw: 0_u16,
        chan15_raw: 0_u16,
        chan16_raw: 0_u16,
        chan17_raw: 0_u16,
        chan18_raw: 0_u16,
        chancount: 0_u8,
        rssi: 0_u8,
    };
}
impl Default for RC_CHANNELS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RC_CHANNELS_DATA {
    type Message = MavMessage;
    const ID: u32 = 65u32;
    const NAME: &'static str = "RC_CHANNELS";
    const EXTRA_CRC: u8 = 118u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.chan1_raw = buf.get_u16_le();
        __struct.chan2_raw = buf.get_u16_le();
        __struct.chan3_raw = buf.get_u16_le();
        __struct.chan4_raw = buf.get_u16_le();
        __struct.chan5_raw = buf.get_u16_le();
        __struct.chan6_raw = buf.get_u16_le();
        __struct.chan7_raw = buf.get_u16_le();
        __struct.chan8_raw = buf.get_u16_le();
        __struct.chan9_raw = buf.get_u16_le();
        __struct.chan10_raw = buf.get_u16_le();
        __struct.chan11_raw = buf.get_u16_le();
        __struct.chan12_raw = buf.get_u16_le();
        __struct.chan13_raw = buf.get_u16_le();
        __struct.chan14_raw = buf.get_u16_le();
        __struct.chan15_raw = buf.get_u16_le();
        __struct.chan16_raw = buf.get_u16_le();
        __struct.chan17_raw = buf.get_u16_le();
        __struct.chan18_raw = buf.get_u16_le();
        __struct.chancount = buf.get_u8();
        __struct.rssi = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u16_le(self.chan1_raw);
        __tmp.put_u16_le(self.chan2_raw);
        __tmp.put_u16_le(self.chan3_raw);
        __tmp.put_u16_le(self.chan4_raw);
        __tmp.put_u16_le(self.chan5_raw);
        __tmp.put_u16_le(self.chan6_raw);
        __tmp.put_u16_le(self.chan7_raw);
        __tmp.put_u16_le(self.chan8_raw);
        __tmp.put_u16_le(self.chan9_raw);
        __tmp.put_u16_le(self.chan10_raw);
        __tmp.put_u16_le(self.chan11_raw);
        __tmp.put_u16_le(self.chan12_raw);
        __tmp.put_u16_le(self.chan13_raw);
        __tmp.put_u16_le(self.chan14_raw);
        __tmp.put_u16_le(self.chan15_raw);
        __tmp.put_u16_le(self.chan16_raw);
        __tmp.put_u16_le(self.chan17_raw);
        __tmp.put_u16_le(self.chan18_raw);
        __tmp.put_u8(self.chancount);
        __tmp.put_u8(self.rssi);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 1"]
#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SYS_STATUS_DATA {
    #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present.."]
    pub onboard_control_sensors_present: MavSysStatusSensor,
    #[doc = "Bitmap showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled.."]
    pub onboard_control_sensors_enabled: MavSysStatusSensor,
    #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy.."]
    pub onboard_control_sensors_health: MavSysStatusSensor,
    #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000."]
    pub load: u16,
    #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot."]
    pub voltage_battery: u16,
    #[doc = "Battery current, -1: Current not sent by autopilot."]
    pub current_battery: i16,
    #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)."]
    pub drop_rate_comm: u16,
    #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)."]
    pub errors_comm: u16,
    #[doc = "Autopilot-specific errors."]
    pub errors_count1: u16,
    #[doc = "Autopilot-specific errors."]
    pub errors_count2: u16,
    #[doc = "Autopilot-specific errors."]
    pub errors_count3: u16,
    #[doc = "Autopilot-specific errors."]
    pub errors_count4: u16,
    #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot."]
    pub battery_remaining: i8,
    #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
    #[doc = "Bitmap showing which onboard controllers and sensors are enabled:  Value of 0: not enabled. Value of 1: enabled.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
    #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
}
impl SYS_STATUS_DATA {
    pub const ENCODED_LEN: usize = 43usize;
    pub const DEFAULT: Self = Self {
        onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
        onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
        onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
        load: 0_u16,
        voltage_battery: 0_u16,
        current_battery: 0_i16,
        drop_rate_comm: 0_u16,
        errors_comm: 0_u16,
        errors_count1: 0_u16,
        errors_count2: 0_u16,
        errors_count3: 0_u16,
        errors_count4: 0_u16,
        battery_remaining: 0_i8,
        onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
        onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
        onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
    };
}
impl Default for SYS_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SYS_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 1u32;
    const NAME: &'static str = "SYS_STATUS";
    const EXTRA_CRC: u8 = 124u8;
    const ENCODED_LEN: usize = 43usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
            tmp & MavSysStatusSensor::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavSysStatusSensor",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
            tmp & MavSysStatusSensor::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavSysStatusSensor",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
            tmp & MavSysStatusSensor::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavSysStatusSensor",
            value: tmp as u32,
        })?;
        __struct.load = buf.get_u16_le();
        __struct.voltage_battery = buf.get_u16_le();
        __struct.current_battery = buf.get_i16_le();
        __struct.drop_rate_comm = buf.get_u16_le();
        __struct.errors_comm = buf.get_u16_le();
        __struct.errors_count1 = buf.get_u16_le();
        __struct.errors_count2 = buf.get_u16_le();
        __struct.errors_count3 = buf.get_u16_le();
        __struct.errors_count4 = buf.get_u16_le();
        __struct.battery_remaining = buf.get_i8();
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_present_extended =
            MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
                .ok_or(ParserError::InvalidFlag {
                flag_type: "MavSysStatusSensorExtended",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_enabled_extended =
            MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
                .ok_or(ParserError::InvalidFlag {
                flag_type: "MavSysStatusSensorExtended",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u32_le();
        __struct.onboard_control_sensors_health_extended =
            MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
                .ok_or(ParserError::InvalidFlag {
                flag_type: "MavSysStatusSensorExtended",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
        __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
        __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
        __tmp.put_u16_le(self.load);
        __tmp.put_u16_le(self.voltage_battery);
        __tmp.put_i16_le(self.current_battery);
        __tmp.put_u16_le(self.drop_rate_comm);
        __tmp.put_u16_le(self.errors_comm);
        __tmp.put_u16_le(self.errors_count1);
        __tmp.put_u16_le(self.errors_count2);
        __tmp.put_u16_le(self.errors_count3);
        __tmp.put_u16_le(self.errors_count4);
        __tmp.put_i8(self.battery_remaining);
        __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
        __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
        __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 107"]
#[doc = "The IMU readings in SI units in NED body frame."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_SENSOR_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X acceleration."]
    pub xacc: f32,
    #[doc = "Y acceleration."]
    pub yacc: f32,
    #[doc = "Z acceleration."]
    pub zacc: f32,
    #[doc = "Angular speed around X axis in body frame."]
    pub xgyro: f32,
    #[doc = "Angular speed around Y axis in body frame."]
    pub ygyro: f32,
    #[doc = "Angular speed around Z axis in body frame."]
    pub zgyro: f32,
    #[doc = "X Magnetic field."]
    pub xmag: f32,
    #[doc = "Y Magnetic field."]
    pub ymag: f32,
    #[doc = "Z Magnetic field."]
    pub zmag: f32,
    #[doc = "Absolute pressure."]
    pub abs_pressure: f32,
    #[doc = "Differential pressure (airspeed)."]
    pub diff_pressure: f32,
    #[doc = "Altitude calculated from pressure."]
    pub pressure_alt: f32,
    #[doc = "Temperature."]
    pub temperature: f32,
    #[doc = "Bitmap for fields that have updated since last message."]
    pub fields_updated: HilSensorUpdatedFlags,
    #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub id: u8,
}
impl HIL_SENSOR_DATA {
    pub const ENCODED_LEN: usize = 65usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        xacc: 0.0_f32,
        yacc: 0.0_f32,
        zacc: 0.0_f32,
        xgyro: 0.0_f32,
        ygyro: 0.0_f32,
        zgyro: 0.0_f32,
        xmag: 0.0_f32,
        ymag: 0.0_f32,
        zmag: 0.0_f32,
        abs_pressure: 0.0_f32,
        diff_pressure: 0.0_f32,
        pressure_alt: 0.0_f32,
        temperature: 0.0_f32,
        fields_updated: HilSensorUpdatedFlags::DEFAULT,
        id: 0_u8,
    };
}
impl Default for HIL_SENSOR_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_SENSOR_DATA {
    type Message = MavMessage;
    const ID: u32 = 107u32;
    const NAME: &'static str = "HIL_SENSOR";
    const EXTRA_CRC: u8 = 108u8;
    const ENCODED_LEN: usize = 65usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.xacc = buf.get_f32_le();
        __struct.yacc = buf.get_f32_le();
        __struct.zacc = buf.get_f32_le();
        __struct.xgyro = buf.get_f32_le();
        __struct.ygyro = buf.get_f32_le();
        __struct.zgyro = buf.get_f32_le();
        __struct.xmag = buf.get_f32_le();
        __struct.ymag = buf.get_f32_le();
        __struct.zmag = buf.get_f32_le();
        __struct.abs_pressure = buf.get_f32_le();
        __struct.diff_pressure = buf.get_f32_le();
        __struct.pressure_alt = buf.get_f32_le();
        __struct.temperature = buf.get_f32_le();
        let tmp = buf.get_u32_le();
        __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
            tmp & HilSensorUpdatedFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "HilSensorUpdatedFlags",
            value: tmp as u32,
        })?;
        __struct.id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.xacc);
        __tmp.put_f32_le(self.yacc);
        __tmp.put_f32_le(self.zacc);
        __tmp.put_f32_le(self.xgyro);
        __tmp.put_f32_le(self.ygyro);
        __tmp.put_f32_le(self.zgyro);
        __tmp.put_f32_le(self.xmag);
        __tmp.put_f32_le(self.ymag);
        __tmp.put_f32_le(self.zmag);
        __tmp.put_f32_le(self.abs_pressure);
        __tmp.put_f32_le(self.diff_pressure);
        __tmp.put_f32_le(self.pressure_alt);
        __tmp.put_f32_le(self.temperature);
        __tmp.put_u32_le(self.fields_updated.bits());
        __tmp.put_u8(self.id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 192"]
#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MAG_CAL_REPORT_DATA {
    #[doc = "RMS milligauss residuals.."]
    pub fitness: f32,
    #[doc = "X offset.."]
    pub ofs_x: f32,
    #[doc = "Y offset.."]
    pub ofs_y: f32,
    #[doc = "Z offset.."]
    pub ofs_z: f32,
    #[doc = "X diagonal (matrix 11).."]
    pub diag_x: f32,
    #[doc = "Y diagonal (matrix 22).."]
    pub diag_y: f32,
    #[doc = "Z diagonal (matrix 33).."]
    pub diag_z: f32,
    #[doc = "X off-diagonal (matrix 12 and 21).."]
    pub offdiag_x: f32,
    #[doc = "Y off-diagonal (matrix 13 and 31).."]
    pub offdiag_y: f32,
    #[doc = "Z off-diagonal (matrix 32 and 23).."]
    pub offdiag_z: f32,
    #[doc = "Compass being calibrated.."]
    pub compass_id: u8,
    #[doc = "Bitmask of compasses being calibrated.."]
    pub cal_mask: u8,
    #[doc = "Calibration Status.."]
    pub cal_status: MagCalStatus,
    #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters.."]
    pub autosaved: u8,
    #[doc = "Confidence in orientation (higher is better).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub orientation_confidence: f32,
    #[doc = "orientation before calibration.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub old_orientation: MavSensorOrientation,
    #[doc = "orientation after calibration.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub new_orientation: MavSensorOrientation,
    #[doc = "field radius correction factor."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub scale_factor: f32,
}
impl MAG_CAL_REPORT_DATA {
    pub const ENCODED_LEN: usize = 54usize;
    pub const DEFAULT: Self = Self {
        fitness: 0.0_f32,
        ofs_x: 0.0_f32,
        ofs_y: 0.0_f32,
        ofs_z: 0.0_f32,
        diag_x: 0.0_f32,
        diag_y: 0.0_f32,
        diag_z: 0.0_f32,
        offdiag_x: 0.0_f32,
        offdiag_y: 0.0_f32,
        offdiag_z: 0.0_f32,
        compass_id: 0_u8,
        cal_mask: 0_u8,
        cal_status: MagCalStatus::DEFAULT,
        autosaved: 0_u8,
        orientation_confidence: 0.0_f32,
        old_orientation: MavSensorOrientation::DEFAULT,
        new_orientation: MavSensorOrientation::DEFAULT,
        scale_factor: 0.0_f32,
    };
}
impl Default for MAG_CAL_REPORT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MAG_CAL_REPORT_DATA {
    type Message = MavMessage;
    const ID: u32 = 192u32;
    const NAME: &'static str = "MAG_CAL_REPORT";
    const EXTRA_CRC: u8 = 36u8;
    const ENCODED_LEN: usize = 54usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.fitness = buf.get_f32_le();
        __struct.ofs_x = buf.get_f32_le();
        __struct.ofs_y = buf.get_f32_le();
        __struct.ofs_z = buf.get_f32_le();
        __struct.diag_x = buf.get_f32_le();
        __struct.diag_y = buf.get_f32_le();
        __struct.diag_z = buf.get_f32_le();
        __struct.offdiag_x = buf.get_f32_le();
        __struct.offdiag_y = buf.get_f32_le();
        __struct.offdiag_z = buf.get_f32_le();
        __struct.compass_id = buf.get_u8();
        __struct.cal_mask = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.cal_status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MagCalStatus",
            value: tmp as u32,
        })?;
        __struct.autosaved = buf.get_u8();
        __struct.orientation_confidence = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.old_orientation = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavSensorOrientation",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.new_orientation = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavSensorOrientation",
            value: tmp as u32,
        })?;
        __struct.scale_factor = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.fitness);
        __tmp.put_f32_le(self.ofs_x);
        __tmp.put_f32_le(self.ofs_y);
        __tmp.put_f32_le(self.ofs_z);
        __tmp.put_f32_le(self.diag_x);
        __tmp.put_f32_le(self.diag_y);
        __tmp.put_f32_le(self.diag_z);
        __tmp.put_f32_le(self.offdiag_x);
        __tmp.put_f32_le(self.offdiag_y);
        __tmp.put_f32_le(self.offdiag_z);
        __tmp.put_u8(self.compass_id);
        __tmp.put_u8(self.cal_mask);
        __tmp.put_u8(self.cal_status as u8);
        __tmp.put_u8(self.autosaved);
        __tmp.put_f32_le(self.orientation_confidence);
        __tmp.put_u8(self.old_orientation as u8);
        __tmp.put_u8(self.new_orientation as u8);
        __tmp.put_f32_le(self.scale_factor);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 7"]
#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct AUTH_KEY_DATA {
    #[doc = "key."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub key: [u8; 32],
}
impl AUTH_KEY_DATA {
    pub const ENCODED_LEN: usize = 32usize;
    pub const DEFAULT: Self = Self {
        key: [0_u8; 32usize],
    };
}
impl Default for AUTH_KEY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for AUTH_KEY_DATA {
    type Message = MavMessage;
    const ID: u32 = 7u32;
    const NAME: &'static str = "AUTH_KEY";
    const EXTRA_CRC: u8 = 119u8;
    const ENCODED_LEN: usize = 32usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        for v in &mut __struct.key {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        for val in &self.key {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 149"]
#[doc = "The location of a landing target. See: https://mavlink.io/en/services/landing_target.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LANDING_TARGET_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X-axis angular offset of the target from the center of the image."]
    pub angle_x: f32,
    #[doc = "Y-axis angular offset of the target from the center of the image."]
    pub angle_y: f32,
    #[doc = "Distance to the target from the vehicle."]
    pub distance: f32,
    #[doc = "Size of target along x-axis."]
    pub size_x: f32,
    #[doc = "Size of target along y-axis."]
    pub size_y: f32,
    #[doc = "The ID of the target if multiple targets are present."]
    pub target_num: u8,
    #[doc = "Coordinate frame used for following fields.."]
    pub frame: MavFrame,
    #[doc = "X Position of the landing target in MAV_FRAME."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub x: f32,
    #[doc = "Y Position of the landing target in MAV_FRAME."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub y: f32,
    #[doc = "Z Position of the landing target in MAV_FRAME."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub z: f32,
    #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Type of landing target."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mavtype: LandingTargetType,
    #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub position_valid: u8,
}
impl LANDING_TARGET_DATA {
    pub const ENCODED_LEN: usize = 60usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        angle_x: 0.0_f32,
        angle_y: 0.0_f32,
        distance: 0.0_f32,
        size_x: 0.0_f32,
        size_y: 0.0_f32,
        target_num: 0_u8,
        frame: MavFrame::DEFAULT,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        q: [0.0_f32; 4usize],
        mavtype: LandingTargetType::DEFAULT,
        position_valid: 0_u8,
    };
}
impl Default for LANDING_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LANDING_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 149u32;
    const NAME: &'static str = "LANDING_TARGET";
    const EXTRA_CRC: u8 = 200u8;
    const ENCODED_LEN: usize = 60usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.angle_x = buf.get_f32_le();
        __struct.angle_y = buf.get_f32_le();
        __struct.distance = buf.get_f32_le();
        __struct.size_x = buf.get_f32_le();
        __struct.size_y = buf.get_f32_le();
        __struct.target_num = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "LandingTargetType",
            value: tmp as u32,
        })?;
        __struct.position_valid = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.angle_x);
        __tmp.put_f32_le(self.angle_y);
        __tmp.put_f32_le(self.distance);
        __tmp.put_f32_le(self.size_x);
        __tmp.put_f32_le(self.size_y);
        __tmp.put_u8(self.target_num);
        __tmp.put_u8(self.frame as u8);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.position_valid);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 23"]
#[doc = "Set a parameter value (write new value to permanent storage).         The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html.         PARAM_SET may also be called within the context of a transaction (started with MAV_CMD_PARAM_TRANSACTION). Within a transaction the receiving component should respond with PARAM_ACK_TRANSACTION to the setter component (instead of broadcasting PARAM_VALUE), and PARAM_SET should be re-sent if this is ACK not received.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_SET_DATA {
    #[doc = "Onboard parameter value."]
    pub param_value: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Onboard parameter type.."]
    pub param_type: MavParamType,
}
impl PARAM_SET_DATA {
    pub const ENCODED_LEN: usize = 23usize;
    pub const DEFAULT: Self = Self {
        param_value: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        param_id: [0_u8; 16usize],
        param_type: MavParamType::DEFAULT,
    };
}
impl Default for PARAM_SET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_SET_DATA {
    type Message = MavMessage;
    const ID: u32 = 23u32;
    const NAME: &'static str = "PARAM_SET";
    const EXTRA_CRC: u8 = 168u8;
    const ENCODED_LEN: usize = 23usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_value = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.param_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavParamType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param_value);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.param_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 141"]
#[doc = "The current system altitude.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ALTITUDE_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.."]
    pub altitude_monotonic: f32,
    #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude.."]
    pub altitude_amsl: f32,
    #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.."]
    pub altitude_local: f32,
    #[doc = "This is the altitude above the home position. It resets on each change of the current home position.."]
    pub altitude_relative: f32,
    #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.."]
    pub altitude_terrain: f32,
    #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.."]
    pub bottom_clearance: f32,
}
impl ALTITUDE_DATA {
    pub const ENCODED_LEN: usize = 32usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        altitude_monotonic: 0.0_f32,
        altitude_amsl: 0.0_f32,
        altitude_local: 0.0_f32,
        altitude_relative: 0.0_f32,
        altitude_terrain: 0.0_f32,
        bottom_clearance: 0.0_f32,
    };
}
impl Default for ALTITUDE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ALTITUDE_DATA {
    type Message = MavMessage;
    const ID: u32 = 141u32;
    const NAME: &'static str = "ALTITUDE";
    const EXTRA_CRC: u8 = 47u8;
    const ENCODED_LEN: usize = 32usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.altitude_monotonic = buf.get_f32_le();
        __struct.altitude_amsl = buf.get_f32_le();
        __struct.altitude_local = buf.get_f32_le();
        __struct.altitude_relative = buf.get_f32_le();
        __struct.altitude_terrain = buf.get_f32_le();
        __struct.bottom_clearance = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.altitude_monotonic);
        __tmp.put_f32_le(self.altitude_amsl);
        __tmp.put_f32_le(self.altitude_local);
        __tmp.put_f32_le(self.altitude_relative);
        __tmp.put_f32_le(self.altitude_terrain);
        __tmp.put_f32_le(self.bottom_clearance);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 248"]
#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct V2_EXTENSION_DATA {
    #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.."]
    pub message_type: u16,
    #[doc = "Network ID (0 for broadcast)."]
    pub target_network: u8,
    #[doc = "System ID (0 for broadcast)."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast)."]
    pub target_component: u8,
    #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub payload: [u8; 249],
}
impl V2_EXTENSION_DATA {
    pub const ENCODED_LEN: usize = 254usize;
    pub const DEFAULT: Self = Self {
        message_type: 0_u16,
        target_network: 0_u8,
        target_system: 0_u8,
        target_component: 0_u8,
        payload: [0_u8; 249usize],
    };
}
impl Default for V2_EXTENSION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for V2_EXTENSION_DATA {
    type Message = MavMessage;
    const ID: u32 = 248u32;
    const NAME: &'static str = "V2_EXTENSION";
    const EXTRA_CRC: u8 = 8u8;
    const ENCODED_LEN: usize = 254usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.message_type = buf.get_u16_le();
        __struct.target_network = buf.get_u8();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.payload {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.message_type);
        __tmp.put_u8(self.target_network);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.payload {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 30"]
#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ATTITUDE_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Roll angle (-pi..+pi)."]
    pub roll: f32,
    #[doc = "Pitch angle (-pi..+pi)."]
    pub pitch: f32,
    #[doc = "Yaw angle (-pi..+pi)."]
    pub yaw: f32,
    #[doc = "Roll angular speed."]
    pub rollspeed: f32,
    #[doc = "Pitch angular speed."]
    pub pitchspeed: f32,
    #[doc = "Yaw angular speed."]
    pub yawspeed: f32,
}
impl ATTITUDE_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
    };
}
impl Default for ATTITUDE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ATTITUDE_DATA {
    type Message = MavMessage;
    const ID: u32 = 30u32;
    const NAME: &'static str = "ATTITUDE";
    const EXTRA_CRC: u8 = 39u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 6"]
#[doc = "Accept / deny control of this MAV."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
    #[doc = "ID of the GCS this message."]
    pub gcs_system_id: u8,
    #[doc = "0: request control of this MAV, 1: Release control of this MAV."]
    pub control_request: u8,
    #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control."]
    pub ack: u8,
}
impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
    pub const ENCODED_LEN: usize = 3usize;
    pub const DEFAULT: Self = Self {
        gcs_system_id: 0_u8,
        control_request: 0_u8,
        ack: 0_u8,
    };
}
impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 6u32;
    const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
    const EXTRA_CRC: u8 = 104u8;
    const ENCODED_LEN: usize = 3usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.gcs_system_id = buf.get_u8();
        __struct.control_request = buf.get_u8();
        __struct.ack = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.gcs_system_id);
        __tmp.put_u8(self.control_request);
        __tmp.put_u8(self.ack);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12915"]
#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length.."]
    pub single_message_size: u8,
    #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9.."]
    pub msg_pack_size: u8,
    #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub messages: [u8; 225],
}
impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
    pub const ENCODED_LEN: usize = 249usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        single_message_size: 0_u8,
        msg_pack_size: 0_u8,
        messages: [0_u8; 225usize],
    };
}
impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 12915u32;
    const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
    const EXTRA_CRC: u8 = 94u8;
    const ENCODED_LEN: usize = 249usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.single_message_size = buf.get_u8();
        __struct.msg_pack_size = buf.get_u8();
        for v in &mut __struct.messages {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.single_message_size);
        __tmp.put_u8(self.msg_pack_size);
        for val in &self.messages {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 127"]
#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_RTK_DATA {
    #[doc = "Time since boot of last baseline message received.."]
    pub time_last_baseline_ms: u32,
    #[doc = "GPS Time of Week of last baseline."]
    pub tow: u32,
    #[doc = "Current baseline in ECEF x or NED north component.."]
    pub baseline_a_mm: i32,
    #[doc = "Current baseline in ECEF y or NED east component.."]
    pub baseline_b_mm: i32,
    #[doc = "Current baseline in ECEF z or NED down component.."]
    pub baseline_c_mm: i32,
    #[doc = "Current estimate of baseline accuracy.."]
    pub accuracy: u32,
    #[doc = "Current number of integer ambiguity hypotheses.."]
    pub iar_num_hypotheses: i32,
    #[doc = "GPS Week Number of last baseline."]
    pub wn: u16,
    #[doc = "Identification of connected RTK receiver.."]
    pub rtk_receiver_id: u8,
    #[doc = "GPS-specific health report for RTK data.."]
    pub rtk_health: u8,
    #[doc = "Rate of baseline messages being received by GPS."]
    pub rtk_rate: u8,
    #[doc = "Current number of sats used for RTK calculation.."]
    pub nsats: u8,
    #[doc = "Coordinate system of baseline."]
    pub baseline_coords_type: RtkBaselineCoordinateSystem,
}
impl GPS_RTK_DATA {
    pub const ENCODED_LEN: usize = 35usize;
    pub const DEFAULT: Self = Self {
        time_last_baseline_ms: 0_u32,
        tow: 0_u32,
        baseline_a_mm: 0_i32,
        baseline_b_mm: 0_i32,
        baseline_c_mm: 0_i32,
        accuracy: 0_u32,
        iar_num_hypotheses: 0_i32,
        wn: 0_u16,
        rtk_receiver_id: 0_u8,
        rtk_health: 0_u8,
        rtk_rate: 0_u8,
        nsats: 0_u8,
        baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
    };
}
impl Default for GPS_RTK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_RTK_DATA {
    type Message = MavMessage;
    const ID: u32 = 127u32;
    const NAME: &'static str = "GPS_RTK";
    const EXTRA_CRC: u8 = 25u8;
    const ENCODED_LEN: usize = 35usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_last_baseline_ms = buf.get_u32_le();
        __struct.tow = buf.get_u32_le();
        __struct.baseline_a_mm = buf.get_i32_le();
        __struct.baseline_b_mm = buf.get_i32_le();
        __struct.baseline_c_mm = buf.get_i32_le();
        __struct.accuracy = buf.get_u32_le();
        __struct.iar_num_hypotheses = buf.get_i32_le();
        __struct.wn = buf.get_u16_le();
        __struct.rtk_receiver_id = buf.get_u8();
        __struct.rtk_health = buf.get_u8();
        __struct.rtk_rate = buf.get_u8();
        __struct.nsats = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.baseline_coords_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "RtkBaselineCoordinateSystem",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_last_baseline_ms);
        __tmp.put_u32_le(self.tow);
        __tmp.put_i32_le(self.baseline_a_mm);
        __tmp.put_i32_le(self.baseline_b_mm);
        __tmp.put_i32_le(self.baseline_c_mm);
        __tmp.put_u32_le(self.accuracy);
        __tmp.put_i32_le(self.iar_num_hypotheses);
        __tmp.put_u16_le(self.wn);
        __tmp.put_u8(self.rtk_receiver_id);
        __tmp.put_u8(self.rtk_health);
        __tmp.put_u8(self.rtk_rate);
        __tmp.put_u8(self.nsats);
        __tmp.put_u8(self.baseline_coords_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 234"]
#[doc = "Message appropriate for high latency connections like Iridium."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIGH_LATENCY_DATA {
    #[doc = "A bitfield for use for autopilot-specific flags.."]
    pub custom_mode: u32,
    #[doc = "Latitude."]
    pub latitude: i32,
    #[doc = "Longitude."]
    pub longitude: i32,
    #[doc = "roll."]
    pub roll: i16,
    #[doc = "pitch."]
    pub pitch: i16,
    #[doc = "heading."]
    pub heading: u16,
    #[doc = "heading setpoint."]
    pub heading_sp: i16,
    #[doc = "Altitude above mean sea level."]
    pub altitude_amsl: i16,
    #[doc = "Altitude setpoint relative to the home position."]
    pub altitude_sp: i16,
    #[doc = "distance to target."]
    pub wp_distance: u16,
    #[doc = "Bitmap of enabled system modes.."]
    pub base_mode: MavModeFlag,
    #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.."]
    pub landed_state: MavLandedState,
    #[doc = "throttle (percentage)."]
    pub throttle: i8,
    #[doc = "airspeed."]
    pub airspeed: u8,
    #[doc = "airspeed setpoint."]
    pub airspeed_sp: u8,
    #[doc = "groundspeed."]
    pub groundspeed: u8,
    #[doc = "climb rate."]
    pub climb_rate: i8,
    #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX."]
    pub gps_nsat: u8,
    #[doc = "GPS Fix type.."]
    pub gps_fix_type: GpsFixType,
    #[doc = "Remaining battery (percentage)."]
    pub battery_remaining: u8,
    #[doc = "Autopilot temperature (degrees C)."]
    pub temperature: i8,
    #[doc = "Air temperature (degrees C) from airspeed sensor."]
    pub temperature_air: i8,
    #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)."]
    pub failsafe: u8,
    #[doc = "current waypoint number."]
    pub wp_num: u8,
}
impl HIGH_LATENCY_DATA {
    pub const ENCODED_LEN: usize = 40usize;
    pub const DEFAULT: Self = Self {
        custom_mode: 0_u32,
        latitude: 0_i32,
        longitude: 0_i32,
        roll: 0_i16,
        pitch: 0_i16,
        heading: 0_u16,
        heading_sp: 0_i16,
        altitude_amsl: 0_i16,
        altitude_sp: 0_i16,
        wp_distance: 0_u16,
        base_mode: MavModeFlag::DEFAULT,
        landed_state: MavLandedState::DEFAULT,
        throttle: 0_i8,
        airspeed: 0_u8,
        airspeed_sp: 0_u8,
        groundspeed: 0_u8,
        climb_rate: 0_i8,
        gps_nsat: 0_u8,
        gps_fix_type: GpsFixType::DEFAULT,
        battery_remaining: 0_u8,
        temperature: 0_i8,
        temperature_air: 0_i8,
        failsafe: 0_u8,
        wp_num: 0_u8,
    };
}
impl Default for HIGH_LATENCY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIGH_LATENCY_DATA {
    type Message = MavMessage;
    const ID: u32 = 234u32;
    const NAME: &'static str = "HIGH_LATENCY";
    const EXTRA_CRC: u8 = 150u8;
    const ENCODED_LEN: usize = 40usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.custom_mode = buf.get_u32_le();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.roll = buf.get_i16_le();
        __struct.pitch = buf.get_i16_le();
        __struct.heading = buf.get_u16_le();
        __struct.heading_sp = buf.get_i16_le();
        __struct.altitude_amsl = buf.get_i16_le();
        __struct.altitude_sp = buf.get_i16_le();
        __struct.wp_distance = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "MavModeFlag",
                value: tmp as u32,
            },
        )?;
        let tmp = buf.get_u8();
        __struct.landed_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavLandedState",
            value: tmp as u32,
        })?;
        __struct.throttle = buf.get_i8();
        __struct.airspeed = buf.get_u8();
        __struct.airspeed_sp = buf.get_u8();
        __struct.groundspeed = buf.get_u8();
        __struct.climb_rate = buf.get_i8();
        __struct.gps_nsat = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.gps_fix_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GpsFixType",
            value: tmp as u32,
        })?;
        __struct.battery_remaining = buf.get_u8();
        __struct.temperature = buf.get_i8();
        __struct.temperature_air = buf.get_i8();
        __struct.failsafe = buf.get_u8();
        __struct.wp_num = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.custom_mode);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_i16_le(self.roll);
        __tmp.put_i16_le(self.pitch);
        __tmp.put_u16_le(self.heading);
        __tmp.put_i16_le(self.heading_sp);
        __tmp.put_i16_le(self.altitude_amsl);
        __tmp.put_i16_le(self.altitude_sp);
        __tmp.put_u16_le(self.wp_distance);
        __tmp.put_u8(self.base_mode.bits());
        __tmp.put_u8(self.landed_state as u8);
        __tmp.put_i8(self.throttle);
        __tmp.put_u8(self.airspeed);
        __tmp.put_u8(self.airspeed_sp);
        __tmp.put_u8(self.groundspeed);
        __tmp.put_i8(self.climb_rate);
        __tmp.put_u8(self.gps_nsat);
        __tmp.put_u8(self.gps_fix_type as u8);
        __tmp.put_u8(self.battery_remaining);
        __tmp.put_i8(self.temperature);
        __tmp.put_i8(self.temperature_air);
        __tmp.put_u8(self.failsafe);
        __tmp.put_u8(self.wp_num);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 162"]
#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct FENCE_STATUS_DATA {
    #[doc = "Time (since boot) of last breach.."]
    pub breach_time: u32,
    #[doc = "Number of fence breaches.."]
    pub breach_count: u16,
    #[doc = "Breach status (0 if currently inside fence, 1 if outside).."]
    pub breach_status: u8,
    #[doc = "Last breach type.."]
    pub breach_type: FenceBreach,
    #[doc = "Active action to prevent fence breach."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub breach_mitigation: FenceMitigate,
}
impl FENCE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 9usize;
    pub const DEFAULT: Self = Self {
        breach_time: 0_u32,
        breach_count: 0_u16,
        breach_status: 0_u8,
        breach_type: FenceBreach::DEFAULT,
        breach_mitigation: FenceMitigate::DEFAULT,
    };
}
impl Default for FENCE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for FENCE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 162u32;
    const NAME: &'static str = "FENCE_STATUS";
    const EXTRA_CRC: u8 = 189u8;
    const ENCODED_LEN: usize = 9usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.breach_time = buf.get_u32_le();
        __struct.breach_count = buf.get_u16_le();
        __struct.breach_status = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.breach_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "FenceBreach",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.breach_mitigation =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "FenceMitigate",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.breach_time);
        __tmp.put_u16_le(self.breach_count);
        __tmp.put_u8(self.breach_status);
        __tmp.put_u8(self.breach_type as u8);
        __tmp.put_u8(self.breach_mitigation as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 323"]
#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_EXT_SET_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Parameter value."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_value: [u8; 128],
    #[doc = "Parameter type.."]
    pub param_type: MavParamExtType,
}
impl PARAM_EXT_SET_DATA {
    pub const ENCODED_LEN: usize = 147usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        param_id: [0_u8; 16usize],
        param_value: [0_u8; 128usize],
        param_type: MavParamExtType::DEFAULT,
    };
}
impl Default for PARAM_EXT_SET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_EXT_SET_DATA {
    type Message = MavMessage;
    const ID: u32 = 323u32;
    const NAME: &'static str = "PARAM_EXT_SET";
    const EXTRA_CRC: u8 = 78u8;
    const ENCODED_LEN: usize = 147usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.param_value {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.param_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavParamExtType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        for val in &self.param_value {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.param_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 266"]
#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOGGING_DATA_DATA {
    #[doc = "sequence number (can wrap)."]
    pub sequence: u16,
    #[doc = "system ID of the target."]
    pub target_system: u8,
    #[doc = "component ID of the target."]
    pub target_component: u8,
    #[doc = "data length."]
    pub length: u8,
    #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists).."]
    pub first_message_offset: u8,
    #[doc = "logged data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 249],
}
impl LOGGING_DATA_DATA {
    pub const ENCODED_LEN: usize = 255usize;
    pub const DEFAULT: Self = Self {
        sequence: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        length: 0_u8,
        first_message_offset: 0_u8,
        data: [0_u8; 249usize],
    };
}
impl Default for LOGGING_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOGGING_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 266u32;
    const NAME: &'static str = "LOGGING_DATA";
    const EXTRA_CRC: u8 = 193u8;
    const ENCODED_LEN: usize = 255usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.sequence = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.length = buf.get_u8();
        __struct.first_message_offset = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.length);
        __tmp.put_u8(self.first_message_offset);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 334"]
#[doc = "Report current used cellular network status."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CELLULAR_STATUS_DATA {
    #[doc = "Mobile country code. If unknown, set to UINT16_MAX."]
    pub mcc: u16,
    #[doc = "Mobile network code. If unknown, set to UINT16_MAX."]
    pub mnc: u16,
    #[doc = "Location area code. If unknown, set to 0."]
    pub lac: u16,
    #[doc = "Cellular modem status."]
    pub status: CellularStatusFlag,
    #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED."]
    pub failure_reason: CellularNetworkFailedReason,
    #[doc = "Cellular network radio type: gsm, cdma, lte...."]
    pub mavtype: CellularNetworkRadioType,
    #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX."]
    pub quality: u8,
}
impl CELLULAR_STATUS_DATA {
    pub const ENCODED_LEN: usize = 10usize;
    pub const DEFAULT: Self = Self {
        mcc: 0_u16,
        mnc: 0_u16,
        lac: 0_u16,
        status: CellularStatusFlag::DEFAULT,
        failure_reason: CellularNetworkFailedReason::DEFAULT,
        mavtype: CellularNetworkRadioType::DEFAULT,
        quality: 0_u8,
    };
}
impl Default for CELLULAR_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CELLULAR_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 334u32;
    const NAME: &'static str = "CELLULAR_STATUS";
    const EXTRA_CRC: u8 = 72u8;
    const ENCODED_LEN: usize = 10usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.mcc = buf.get_u16_le();
        __struct.mnc = buf.get_u16_le();
        __struct.lac = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CellularStatusFlag",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.failure_reason = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CellularNetworkFailedReason",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CellularNetworkRadioType",
            value: tmp as u32,
        })?;
        __struct.quality = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.mcc);
        __tmp.put_u16_le(self.mnc);
        __tmp.put_u16_le(self.lac);
        __tmp.put_u8(self.status as u8);
        __tmp.put_u8(self.failure_reason as u8);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 401"]
#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SUPPORTED_TUNES_DATA {
    #[doc = "Bitfield of supported tune formats.."]
    pub format: TuneFormat,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl SUPPORTED_TUNES_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        format: TuneFormat::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for SUPPORTED_TUNES_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SUPPORTED_TUNES_DATA {
    type Message = MavMessage;
    const ID: u32 = 401u32;
    const NAME: &'static str = "SUPPORTED_TUNES";
    const EXTRA_CRC: u8 = 183u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.format = TuneFormat::from_bits(tmp & TuneFormat::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "TuneFormat",
                value: tmp as u32,
            },
        )?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.format.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 385"]
#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TUNNEL_DATA {
    #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.."]
    pub payload_type: MavTunnelPayloadType,
    #[doc = "System ID (can be 0 for broadcast, but this is discouraged)."]
    pub target_system: u8,
    #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)."]
    pub target_component: u8,
    #[doc = "Length of the data transported in payload."]
    pub payload_length: u8,
    #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub payload: [u8; 128],
}
impl TUNNEL_DATA {
    pub const ENCODED_LEN: usize = 133usize;
    pub const DEFAULT: Self = Self {
        payload_type: MavTunnelPayloadType::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        payload_length: 0_u8,
        payload: [0_u8; 128usize],
    };
}
impl Default for TUNNEL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TUNNEL_DATA {
    type Message = MavMessage;
    const ID: u32 = 385u32;
    const NAME: &'static str = "TUNNEL";
    const EXTRA_CRC: u8 = 147u8;
    const ENCODED_LEN: usize = 133usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u16_le();
        __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavTunnelPayloadType",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.payload_length = buf.get_u8();
        for v in &mut __struct.payload {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.payload_type as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.payload_length);
        for val in &self.payload {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 70"]
#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification.  Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RC_CHANNELS_OVERRIDE_DATA {
    #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan1_raw: u16,
    #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan2_raw: u16,
    #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan3_raw: u16,
    #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan4_raw: u16,
    #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan5_raw: u16,
    #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan6_raw: u16,
    #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan7_raw: u16,
    #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.."]
    pub chan8_raw: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan9_raw: u16,
    #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan10_raw: u16,
    #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan11_raw: u16,
    #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan12_raw: u16,
    #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan13_raw: u16,
    #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan14_raw: u16,
    #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan15_raw: u16,
    #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan16_raw: u16,
    #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan17_raw: u16,
    #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chan18_raw: u16,
}
impl RC_CHANNELS_OVERRIDE_DATA {
    pub const ENCODED_LEN: usize = 38usize;
    pub const DEFAULT: Self = Self {
        chan1_raw: 0_u16,
        chan2_raw: 0_u16,
        chan3_raw: 0_u16,
        chan4_raw: 0_u16,
        chan5_raw: 0_u16,
        chan6_raw: 0_u16,
        chan7_raw: 0_u16,
        chan8_raw: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        chan9_raw: 0_u16,
        chan10_raw: 0_u16,
        chan11_raw: 0_u16,
        chan12_raw: 0_u16,
        chan13_raw: 0_u16,
        chan14_raw: 0_u16,
        chan15_raw: 0_u16,
        chan16_raw: 0_u16,
        chan17_raw: 0_u16,
        chan18_raw: 0_u16,
    };
}
impl Default for RC_CHANNELS_OVERRIDE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
    type Message = MavMessage;
    const ID: u32 = 70u32;
    const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
    const EXTRA_CRC: u8 = 124u8;
    const ENCODED_LEN: usize = 38usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.chan1_raw = buf.get_u16_le();
        __struct.chan2_raw = buf.get_u16_le();
        __struct.chan3_raw = buf.get_u16_le();
        __struct.chan4_raw = buf.get_u16_le();
        __struct.chan5_raw = buf.get_u16_le();
        __struct.chan6_raw = buf.get_u16_le();
        __struct.chan7_raw = buf.get_u16_le();
        __struct.chan8_raw = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.chan9_raw = buf.get_u16_le();
        __struct.chan10_raw = buf.get_u16_le();
        __struct.chan11_raw = buf.get_u16_le();
        __struct.chan12_raw = buf.get_u16_le();
        __struct.chan13_raw = buf.get_u16_le();
        __struct.chan14_raw = buf.get_u16_le();
        __struct.chan15_raw = buf.get_u16_le();
        __struct.chan16_raw = buf.get_u16_le();
        __struct.chan17_raw = buf.get_u16_le();
        __struct.chan18_raw = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.chan1_raw);
        __tmp.put_u16_le(self.chan2_raw);
        __tmp.put_u16_le(self.chan3_raw);
        __tmp.put_u16_le(self.chan4_raw);
        __tmp.put_u16_le(self.chan5_raw);
        __tmp.put_u16_le(self.chan6_raw);
        __tmp.put_u16_le(self.chan7_raw);
        __tmp.put_u16_le(self.chan8_raw);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u16_le(self.chan9_raw);
        __tmp.put_u16_le(self.chan10_raw);
        __tmp.put_u16_le(self.chan11_raw);
        __tmp.put_u16_le(self.chan12_raw);
        __tmp.put_u16_le(self.chan13_raw);
        __tmp.put_u16_le(self.chan14_raw);
        __tmp.put_u16_le(self.chan15_raw);
        __tmp.put_u16_le(self.chan16_raw);
        __tmp.put_u16_le(self.chan17_raw);
        __tmp.put_u16_le(self.chan18_raw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 395"]
#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMPONENT_INFORMATION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "CRC32 of the general metadata file (general_metadata_uri).."]
    pub general_metadata_file_crc: u32,
    #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri).."]
    pub peripherals_metadata_file_crc: u32,
    #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub general_metadata_uri: [u8; 100],
    #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub peripherals_metadata_uri: [u8; 100],
}
impl COMPONENT_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 212usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        general_metadata_file_crc: 0_u32,
        peripherals_metadata_file_crc: 0_u32,
        general_metadata_uri: [0_u8; 100usize],
        peripherals_metadata_uri: [0_u8; 100usize],
    };
}
impl Default for COMPONENT_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMPONENT_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 395u32;
    const NAME: &'static str = "COMPONENT_INFORMATION";
    const EXTRA_CRC: u8 = 0u8;
    const ENCODED_LEN: usize = 212usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.general_metadata_file_crc = buf.get_u32_le();
        __struct.peripherals_metadata_file_crc = buf.get_u32_le();
        for v in &mut __struct.general_metadata_uri {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.peripherals_metadata_uri {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.general_metadata_file_crc);
        __tmp.put_u32_le(self.peripherals_metadata_file_crc);
        for val in &self.general_metadata_uri {
            __tmp.put_u8(*val);
        }
        for val in &self.peripherals_metadata_uri {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50003"]
#[doc = "Herelink Telemetry."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HERELINK_TELEM_DATA {}
impl HERELINK_TELEM_DATA {
    pub const ENCODED_LEN: usize = 0usize;
    pub const DEFAULT: Self = Self {};
}
impl Default for HERELINK_TELEM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HERELINK_TELEM_DATA {
    type Message = MavMessage;
    const ID: u32 = 50003u32;
    const NAME: &'static str = "HERELINK_TELEM";
    const EXTRA_CRC: u8 = 53u8;
    const ENCODED_LEN: usize = 0usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        Ok(Self::default())
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 84"]
#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X Position in NED frame."]
    pub x: f32,
    #[doc = "Y Position in NED frame."]
    pub y: f32,
    #[doc = "Z Position in NED frame (note, altitude is negative in NED)."]
    pub z: f32,
    #[doc = "X velocity in NED frame."]
    pub vx: f32,
    #[doc = "Y velocity in NED frame."]
    pub vy: f32,
    #[doc = "Z velocity in NED frame."]
    pub vz: f32,
    #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afx: f32,
    #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afy: f32,
    #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afz: f32,
    #[doc = "yaw setpoint."]
    pub yaw: f32,
    #[doc = "yaw rate setpoint."]
    pub yaw_rate: f32,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: PositionTargetTypemask,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9."]
    pub coordinate_frame: MavFrame,
}
impl SET_POSITION_TARGET_LOCAL_NED_DATA {
    pub const ENCODED_LEN: usize = 53usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        afx: 0.0_f32,
        afy: 0.0_f32,
        afz: 0.0_f32,
        yaw: 0.0_f32,
        yaw_rate: 0.0_f32,
        type_mask: PositionTargetTypemask::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        coordinate_frame: MavFrame::DEFAULT,
    };
}
impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
    type Message = MavMessage;
    const ID: u32 = 84u32;
    const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
    const EXTRA_CRC: u8 = 143u8;
    const ENCODED_LEN: usize = 53usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.afx = buf.get_f32_le();
        __struct.afy = buf.get_f32_le();
        __struct.afz = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.type_mask = PositionTargetTypemask::from_bits(
            tmp & PositionTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "PositionTargetTypemask",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.coordinate_frame =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavFrame",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.afx);
        __tmp.put_f32_le(self.afy);
        __tmp.put_f32_le(self.afz);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u16_le(self.type_mask.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.coordinate_frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12920"]
#[doc = "Temperature and humidity from hygrometer.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HYGROMETER_SENSOR_DATA {
    #[doc = "Temperature."]
    pub temperature: i16,
    #[doc = "Humidity."]
    pub humidity: u16,
    #[doc = "Hygrometer ID."]
    pub id: u8,
}
impl HYGROMETER_SENSOR_DATA {
    pub const ENCODED_LEN: usize = 5usize;
    pub const DEFAULT: Self = Self {
        temperature: 0_i16,
        humidity: 0_u16,
        id: 0_u8,
    };
}
impl Default for HYGROMETER_SENSOR_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HYGROMETER_SENSOR_DATA {
    type Message = MavMessage;
    const ID: u32 = 12920u32;
    const NAME: &'static str = "HYGROMETER_SENSOR";
    const EXTRA_CRC: u8 = 20u8;
    const ENCODED_LEN: usize = 5usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.temperature = buf.get_i16_le();
        __struct.humidity = buf.get_u16_le();
        __struct.id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_u16_le(self.humidity);
        __tmp.put_u8(self.id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 335"]
#[doc = "Status of the Iridium SBD link.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ISBD_LINK_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub timestamp: u64,
    #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub last_heartbeat: u64,
    #[doc = "Number of failed SBD sessions.."]
    pub failed_sessions: u16,
    #[doc = "Number of successful SBD sessions.."]
    pub successful_sessions: u16,
    #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength.."]
    pub signal_quality: u8,
    #[doc = "1: Ring call pending, 0: No call pending.."]
    pub ring_pending: u8,
    #[doc = "1: Transmission session pending, 0: No transmission session pending.."]
    pub tx_session_pending: u8,
    #[doc = "1: Receiving session pending, 0: No receiving session pending.."]
    pub rx_session_pending: u8,
}
impl ISBD_LINK_STATUS_DATA {
    pub const ENCODED_LEN: usize = 24usize;
    pub const DEFAULT: Self = Self {
        timestamp: 0_u64,
        last_heartbeat: 0_u64,
        failed_sessions: 0_u16,
        successful_sessions: 0_u16,
        signal_quality: 0_u8,
        ring_pending: 0_u8,
        tx_session_pending: 0_u8,
        rx_session_pending: 0_u8,
    };
}
impl Default for ISBD_LINK_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ISBD_LINK_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 335u32;
    const NAME: &'static str = "ISBD_LINK_STATUS";
    const EXTRA_CRC: u8 = 225u8;
    const ENCODED_LEN: usize = 24usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.timestamp = buf.get_u64_le();
        __struct.last_heartbeat = buf.get_u64_le();
        __struct.failed_sessions = buf.get_u16_le();
        __struct.successful_sessions = buf.get_u16_le();
        __struct.signal_quality = buf.get_u8();
        __struct.ring_pending = buf.get_u8();
        __struct.tx_session_pending = buf.get_u8();
        __struct.rx_session_pending = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.timestamp);
        __tmp.put_u64_le(self.last_heartbeat);
        __tmp.put_u16_le(self.failed_sessions);
        __tmp.put_u16_le(self.successful_sessions);
        __tmp.put_u8(self.signal_quality);
        __tmp.put_u8(self.ring_pending);
        __tmp.put_u8(self.tx_session_pending);
        __tmp.put_u8(self.rx_session_pending);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 261"]
#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct STORAGE_INFORMATION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.."]
    pub total_capacity: f32,
    #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.."]
    pub used_capacity: f32,
    #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.."]
    pub available_capacity: f32,
    #[doc = "Read speed.."]
    pub read_speed: f32,
    #[doc = "Write speed.."]
    pub write_speed: f32,
    #[doc = "Storage ID (1 for first, 2 for second, etc.)."]
    pub storage_id: u8,
    #[doc = "Number of storage devices."]
    pub storage_count: u8,
    #[doc = "Status of storage."]
    pub status: StorageStatus,
    #[doc = "Type of storage."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mavtype: StorageType,
    #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 32],
    #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc.         Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported).         This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE.         If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub storage_usage: StorageUsageFlag,
}
impl STORAGE_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 61usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        total_capacity: 0.0_f32,
        used_capacity: 0.0_f32,
        available_capacity: 0.0_f32,
        read_speed: 0.0_f32,
        write_speed: 0.0_f32,
        storage_id: 0_u8,
        storage_count: 0_u8,
        status: StorageStatus::DEFAULT,
        mavtype: StorageType::DEFAULT,
        name: [0_u8; 32usize],
        storage_usage: StorageUsageFlag::DEFAULT,
    };
}
impl Default for STORAGE_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for STORAGE_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 261u32;
    const NAME: &'static str = "STORAGE_INFORMATION";
    const EXTRA_CRC: u8 = 179u8;
    const ENCODED_LEN: usize = 61usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.total_capacity = buf.get_f32_le();
        __struct.used_capacity = buf.get_f32_le();
        __struct.available_capacity = buf.get_f32_le();
        __struct.read_speed = buf.get_f32_le();
        __struct.write_speed = buf.get_f32_le();
        __struct.storage_id = buf.get_u8();
        __struct.storage_count = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "StorageStatus",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "StorageType",
            value: tmp as u32,
        })?;
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.storage_usage = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "StorageUsageFlag",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.total_capacity);
        __tmp.put_f32_le(self.used_capacity);
        __tmp.put_f32_le(self.available_capacity);
        __tmp.put_f32_le(self.read_speed);
        __tmp.put_f32_le(self.write_speed);
        __tmp.put_u8(self.storage_id);
        __tmp.put_u8(self.storage_count);
        __tmp.put_u8(self.status as u8);
        __tmp.put_u8(self.mavtype as u8);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.storage_usage as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 118"]
#[doc = "Reply to LOG_REQUEST_LIST."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_ENTRY_DATA {
    #[doc = "UTC timestamp of log since 1970, or 0 if not available."]
    pub time_utc: u32,
    #[doc = "Size of the log (may be approximate)."]
    pub size: u32,
    #[doc = "Log id."]
    pub id: u16,
    #[doc = "Total number of logs."]
    pub num_logs: u16,
    #[doc = "High log number."]
    pub last_log_num: u16,
}
impl LOG_ENTRY_DATA {
    pub const ENCODED_LEN: usize = 14usize;
    pub const DEFAULT: Self = Self {
        time_utc: 0_u32,
        size: 0_u32,
        id: 0_u16,
        num_logs: 0_u16,
        last_log_num: 0_u16,
    };
}
impl Default for LOG_ENTRY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_ENTRY_DATA {
    type Message = MavMessage;
    const ID: u32 = 118u32;
    const NAME: &'static str = "LOG_ENTRY";
    const EXTRA_CRC: u8 = 56u8;
    const ENCODED_LEN: usize = 14usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_utc = buf.get_u32_le();
        __struct.size = buf.get_u32_le();
        __struct.id = buf.get_u16_le();
        __struct.num_logs = buf.get_u16_le();
        __struct.last_log_num = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_utc);
        __tmp.put_u32_le(self.size);
        __tmp.put_u16_le(self.id);
        __tmp.put_u16_le(self.num_logs);
        __tmp.put_u16_le(self.last_log_num);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 103"]
#[doc = "Speed estimate from a vision source.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VISION_SPEED_ESTIMATE_DATA {
    #[doc = "Timestamp (UNIX time or time since system boot)."]
    pub usec: u64,
    #[doc = "Global X speed."]
    pub x: f32,
    #[doc = "Global Y speed."]
    pub y: f32,
    #[doc = "Global Z speed."]
    pub z: f32,
    #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 9],
    #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub reset_counter: u8,
}
impl VISION_SPEED_ESTIMATE_DATA {
    pub const ENCODED_LEN: usize = 57usize;
    pub const DEFAULT: Self = Self {
        usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        covariance: [0.0_f32; 9usize],
        reset_counter: 0_u8,
    };
}
impl Default for VISION_SPEED_ESTIMATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VISION_SPEED_ESTIMATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 103u32;
    const NAME: &'static str = "VISION_SPEED_ESTIMATE";
    const EXTRA_CRC: u8 = 208u8;
    const ENCODED_LEN: usize = 57usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.reset_counter = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.reset_counter);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 290"]
#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ESC_INFO_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.."]
    pub time_usec: u64,
    #[doc = "Number of reported errors by each ESC since boot.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub error_count: [u32; 4],
    #[doc = "Counter of data packets received.."]
    pub counter: u16,
    #[doc = "Bitmap of ESC failure flags.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub failure_flags: [u16; 4],
    #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub temperature: [i16; 4],
    #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.."]
    pub index: u8,
    #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data.."]
    pub count: u8,
    #[doc = "Connection type protocol for all ESC.."]
    pub connection_type: EscConnectionType,
    #[doc = "Information regarding online/offline status of each ESC.."]
    pub info: u8,
}
impl ESC_INFO_DATA {
    pub const ENCODED_LEN: usize = 46usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        error_count: [0_u32; 4usize],
        counter: 0_u16,
        failure_flags: [0_u16; 4usize],
        temperature: [0_i16; 4usize],
        index: 0_u8,
        count: 0_u8,
        connection_type: EscConnectionType::DEFAULT,
        info: 0_u8,
    };
}
impl Default for ESC_INFO_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ESC_INFO_DATA {
    type Message = MavMessage;
    const ID: u32 = 290u32;
    const NAME: &'static str = "ESC_INFO";
    const EXTRA_CRC: u8 = 251u8;
    const ENCODED_LEN: usize = 46usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.error_count {
            let val = buf.get_u32_le();
            *v = val;
        }
        __struct.counter = buf.get_u16_le();
        for v in &mut __struct.failure_flags {
            let val = buf.get_u16_le();
            *v = val;
        }
        for v in &mut __struct.temperature {
            let val = buf.get_i16_le();
            *v = val;
        }
        __struct.index = buf.get_u8();
        __struct.count = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.connection_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "EscConnectionType",
            value: tmp as u32,
        })?;
        __struct.info = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.error_count {
            __tmp.put_u32_le(*val);
        }
        __tmp.put_u16_le(self.counter);
        for val in &self.failure_flags {
            __tmp.put_u16_le(*val);
        }
        for val in &self.temperature {
            __tmp.put_i16_le(*val);
        }
        __tmp.put_u8(self.index);
        __tmp.put_u8(self.count);
        __tmp.put_u8(self.connection_type as u8);
        __tmp.put_u8(self.info);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 24"]
#[doc = "The global position, as returned by the Global Positioning System (GPS). This is                 NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_RAW_INT_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Latitude (WGS84, EGM96 ellipsoid)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84, EGM96 ellipsoid)."]
    pub lon: i32,
    #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude.."]
    pub alt: i32,
    #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub eph: u16,
    #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub epv: u16,
    #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX."]
    pub vel: u16,
    #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX."]
    pub cog: u16,
    #[doc = "GPS fix type.."]
    pub fix_type: GpsFixType,
    #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX."]
    pub satellites_visible: u8,
    #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub alt_ellipsoid: i32,
    #[doc = "Position uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub h_acc: u32,
    #[doc = "Altitude uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub v_acc: u32,
    #[doc = "Speed uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub vel_acc: u32,
    #[doc = "Heading / track uncertainty."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub hdg_acc: u32,
    #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub yaw: u16,
}
impl GPS_RAW_INT_DATA {
    pub const ENCODED_LEN: usize = 52usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        eph: 0_u16,
        epv: 0_u16,
        vel: 0_u16,
        cog: 0_u16,
        fix_type: GpsFixType::DEFAULT,
        satellites_visible: 0_u8,
        alt_ellipsoid: 0_i32,
        h_acc: 0_u32,
        v_acc: 0_u32,
        vel_acc: 0_u32,
        hdg_acc: 0_u32,
        yaw: 0_u16,
    };
}
impl Default for GPS_RAW_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_RAW_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 24u32;
    const NAME: &'static str = "GPS_RAW_INT";
    const EXTRA_CRC: u8 = 24u8;
    const ENCODED_LEN: usize = 52usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.eph = buf.get_u16_le();
        __struct.epv = buf.get_u16_le();
        __struct.vel = buf.get_u16_le();
        __struct.cog = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.fix_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GpsFixType",
            value: tmp as u32,
        })?;
        __struct.satellites_visible = buf.get_u8();
        __struct.alt_ellipsoid = buf.get_i32_le();
        __struct.h_acc = buf.get_u32_le();
        __struct.v_acc = buf.get_u32_le();
        __struct.vel_acc = buf.get_u32_le();
        __struct.hdg_acc = buf.get_u32_le();
        __struct.yaw = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_u16_le(self.eph);
        __tmp.put_u16_le(self.epv);
        __tmp.put_u16_le(self.vel);
        __tmp.put_u16_le(self.cog);
        __tmp.put_u8(self.fix_type as u8);
        __tmp.put_u8(self.satellites_visible);
        __tmp.put_i32_le(self.alt_ellipsoid);
        __tmp.put_u32_le(self.h_acc);
        __tmp.put_u32_le(self.v_acc);
        __tmp.put_u32_le(self.vel_acc);
        __tmp.put_u32_le(self.hdg_acc);
        __tmp.put_u16_le(self.yaw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12904"]
#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_SYSTEM_DATA {
    #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon).."]
    pub operator_latitude: i32,
    #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon).."]
    pub operator_longitude: i32,
    #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.."]
    pub area_ceiling: f32,
    #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.."]
    pub area_floor: f32,
    #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.."]
    pub operator_altitude_geo: f32,
    #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.."]
    pub timestamp: u32,
    #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.."]
    pub area_count: u16,
    #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.."]
    pub area_radius: u16,
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Specifies the operator location type.."]
    pub operator_location_type: MavOdidOperatorLocationType,
    #[doc = "Specifies the classification type of the UA.."]
    pub classification_type: MavOdidClassificationType,
    #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.."]
    pub category_eu: MavOdidCategoryEu,
    #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.."]
    pub class_eu: MavOdidClassEu,
}
impl OPEN_DRONE_ID_SYSTEM_DATA {
    pub const ENCODED_LEN: usize = 54usize;
    pub const DEFAULT: Self = Self {
        operator_latitude: 0_i32,
        operator_longitude: 0_i32,
        area_ceiling: 0.0_f32,
        area_floor: 0.0_f32,
        operator_altitude_geo: 0.0_f32,
        timestamp: 0_u32,
        area_count: 0_u16,
        area_radius: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        operator_location_type: MavOdidOperatorLocationType::DEFAULT,
        classification_type: MavOdidClassificationType::DEFAULT,
        category_eu: MavOdidCategoryEu::DEFAULT,
        class_eu: MavOdidClassEu::DEFAULT,
    };
}
impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
    type Message = MavMessage;
    const ID: u32 = 12904u32;
    const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
    const EXTRA_CRC: u8 = 77u8;
    const ENCODED_LEN: usize = 54usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.operator_latitude = buf.get_i32_le();
        __struct.operator_longitude = buf.get_i32_le();
        __struct.area_ceiling = buf.get_f32_le();
        __struct.area_floor = buf.get_f32_le();
        __struct.operator_altitude_geo = buf.get_f32_le();
        __struct.timestamp = buf.get_u32_le();
        __struct.area_count = buf.get_u16_le();
        __struct.area_radius = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.operator_location_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidOperatorLocationType",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.classification_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidClassificationType",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.category_eu = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidCategoryEu",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.class_eu = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidClassEu",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.operator_latitude);
        __tmp.put_i32_le(self.operator_longitude);
        __tmp.put_f32_le(self.area_ceiling);
        __tmp.put_f32_le(self.area_floor);
        __tmp.put_f32_le(self.operator_altitude_geo);
        __tmp.put_u32_le(self.timestamp);
        __tmp.put_u16_le(self.area_count);
        __tmp.put_u16_le(self.area_radius);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.operator_location_type as u8);
        __tmp.put_u8(self.classification_type as u8);
        __tmp.put_u8(self.category_eu as u8);
        __tmp.put_u8(self.class_eu as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 132"]
#[doc = "Distance sensor information for an onboard rangefinder.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DISTANCE_SENSOR_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Minimum distance the sensor can measure."]
    pub min_distance: u16,
    #[doc = "Maximum distance the sensor can measure."]
    pub max_distance: u16,
    #[doc = "Current distance reading."]
    pub current_distance: u16,
    #[doc = "Type of distance sensor.."]
    pub mavtype: MavDistanceSensor,
    #[doc = "Onboard ID of the sensor."]
    pub id: u8,
    #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270."]
    pub orientation: MavSensorOrientation,
    #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown.."]
    pub covariance: u8,
    #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub horizontal_fov: f32,
    #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub vertical_fov: f32,
    #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\"."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub quaternion: [f32; 4],
    #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub signal_quality: u8,
}
impl DISTANCE_SENSOR_DATA {
    pub const ENCODED_LEN: usize = 39usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        min_distance: 0_u16,
        max_distance: 0_u16,
        current_distance: 0_u16,
        mavtype: MavDistanceSensor::DEFAULT,
        id: 0_u8,
        orientation: MavSensorOrientation::DEFAULT,
        covariance: 0_u8,
        horizontal_fov: 0.0_f32,
        vertical_fov: 0.0_f32,
        quaternion: [0.0_f32; 4usize],
        signal_quality: 0_u8,
    };
}
impl Default for DISTANCE_SENSOR_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DISTANCE_SENSOR_DATA {
    type Message = MavMessage;
    const ID: u32 = 132u32;
    const NAME: &'static str = "DISTANCE_SENSOR";
    const EXTRA_CRC: u8 = 85u8;
    const ENCODED_LEN: usize = 39usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.min_distance = buf.get_u16_le();
        __struct.max_distance = buf.get_u16_le();
        __struct.current_distance = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavDistanceSensor",
            value: tmp as u32,
        })?;
        __struct.id = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.orientation = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavSensorOrientation",
            value: tmp as u32,
        })?;
        __struct.covariance = buf.get_u8();
        __struct.horizontal_fov = buf.get_f32_le();
        __struct.vertical_fov = buf.get_f32_le();
        for v in &mut __struct.quaternion {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.signal_quality = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u16_le(self.min_distance);
        __tmp.put_u16_le(self.max_distance);
        __tmp.put_u16_le(self.current_distance);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.id);
        __tmp.put_u8(self.orientation as u8);
        __tmp.put_u8(self.covariance);
        __tmp.put_f32_le(self.horizontal_fov);
        __tmp.put_f32_le(self.vertical_fov);
        for val in &self.quaternion {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.signal_quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 331"]
#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (http://www.ros.org/reps/rep-0147.html).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ODOMETRY_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X Position."]
    pub x: f32,
    #[doc = "Y Position."]
    pub y: f32,
    #[doc = "Z Position."]
    pub z: f32,
    #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "X linear speed."]
    pub vx: f32,
    #[doc = "Y linear speed."]
    pub vy: f32,
    #[doc = "Z linear speed."]
    pub vz: f32,
    #[doc = "Roll angular speed."]
    pub rollspeed: f32,
    #[doc = "Pitch angular speed."]
    pub pitchspeed: f32,
    #[doc = "Yaw angular speed."]
    pub yawspeed: f32,
    #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pose_covariance: [f32; 21],
    #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub velocity_covariance: [f32; 21],
    #[doc = "Coordinate frame of reference for the pose data.."]
    pub frame_id: MavFrame,
    #[doc = "Coordinate frame of reference for the velocity in free space (twist) data.."]
    pub child_frame_id: MavFrame,
    #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub reset_counter: u8,
    #[doc = "Type of estimator that is providing the odometry.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub estimator_type: MavEstimatorType,
    #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub quality: i8,
}
impl ODOMETRY_DATA {
    pub const ENCODED_LEN: usize = 233usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        q: [0.0_f32; 4usize],
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
        pose_covariance: [0.0_f32; 21usize],
        velocity_covariance: [0.0_f32; 21usize],
        frame_id: MavFrame::DEFAULT,
        child_frame_id: MavFrame::DEFAULT,
        reset_counter: 0_u8,
        estimator_type: MavEstimatorType::DEFAULT,
        quality: 0_i8,
    };
}
impl Default for ODOMETRY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ODOMETRY_DATA {
    type Message = MavMessage;
    const ID: u32 = 331u32;
    const NAME: &'static str = "ODOMETRY";
    const EXTRA_CRC: u8 = 91u8;
    const ENCODED_LEN: usize = 233usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        for v in &mut __struct.pose_covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.velocity_covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.frame_id = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.child_frame_id = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        __struct.reset_counter = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.estimator_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavEstimatorType",
            value: tmp as u32,
        })?;
        __struct.quality = buf.get_i8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        for val in &self.pose_covariance {
            __tmp.put_f32_le(*val);
        }
        for val in &self.velocity_covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.frame_id as u8);
        __tmp.put_u8(self.child_frame_id as u8);
        __tmp.put_u8(self.reset_counter);
        __tmp.put_u8(self.estimator_type as u8);
        __tmp.put_i8(self.quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 4"]
#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at https://mavlink.io/en/services/ping.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PING_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "PING sequence."]
    pub seq: u32,
    #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system."]
    pub target_system: u8,
    #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component.."]
    pub target_component: u8,
}
impl PING_DATA {
    pub const ENCODED_LEN: usize = 14usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        seq: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for PING_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PING_DATA {
    type Message = MavMessage;
    const ID: u32 = 4u32;
    const NAME: &'static str = "PING";
    const EXTRA_CRC: u8 = 237u8;
    const ENCODED_LEN: usize = 14usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.seq = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.seq);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 300"]
#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PROTOCOL_VERSION_DATA {
    #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.."]
    pub version: u16,
    #[doc = "Minimum MAVLink version supported."]
    pub min_version: u16,
    #[doc = "Maximum MAVLink version supported (set to the same value as version by default)."]
    pub max_version: u16,
    #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub spec_version_hash: [u8; 8],
    #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub library_version_hash: [u8; 8],
}
impl PROTOCOL_VERSION_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        version: 0_u16,
        min_version: 0_u16,
        max_version: 0_u16,
        spec_version_hash: [0_u8; 8usize],
        library_version_hash: [0_u8; 8usize],
    };
}
impl Default for PROTOCOL_VERSION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PROTOCOL_VERSION_DATA {
    type Message = MavMessage;
    const ID: u32 = 300u32;
    const NAME: &'static str = "PROTOCOL_VERSION";
    const EXTRA_CRC: u8 = 217u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.version = buf.get_u16_le();
        __struct.min_version = buf.get_u16_le();
        __struct.max_version = buf.get_u16_le();
        for v in &mut __struct.spec_version_hash {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.library_version_hash {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.version);
        __tmp.put_u16_le(self.min_version);
        __tmp.put_u16_le(self.max_version);
        for val in &self.spec_version_hash {
            __tmp.put_u8(*val);
        }
        for val in &self.library_version_hash {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 146"]
#[doc = "The smoothed, monotonic system state used to feed the control loops of the system.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CONTROL_SYSTEM_STATE_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X acceleration in body frame."]
    pub x_acc: f32,
    #[doc = "Y acceleration in body frame."]
    pub y_acc: f32,
    #[doc = "Z acceleration in body frame."]
    pub z_acc: f32,
    #[doc = "X velocity in body frame."]
    pub x_vel: f32,
    #[doc = "Y velocity in body frame."]
    pub y_vel: f32,
    #[doc = "Z velocity in body frame."]
    pub z_vel: f32,
    #[doc = "X position in local frame."]
    pub x_pos: f32,
    #[doc = "Y position in local frame."]
    pub y_pos: f32,
    #[doc = "Z position in local frame."]
    pub z_pos: f32,
    #[doc = "Airspeed, set to -1 if unknown."]
    pub airspeed: f32,
    #[doc = "Variance of body velocity estimate."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel_variance: [f32; 3],
    #[doc = "Variance in local position."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_variance: [f32; 3],
    #[doc = "The attitude, represented as Quaternion."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Angular rate in roll axis."]
    pub roll_rate: f32,
    #[doc = "Angular rate in pitch axis."]
    pub pitch_rate: f32,
    #[doc = "Angular rate in yaw axis."]
    pub yaw_rate: f32,
}
impl CONTROL_SYSTEM_STATE_DATA {
    pub const ENCODED_LEN: usize = 100usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        x_acc: 0.0_f32,
        y_acc: 0.0_f32,
        z_acc: 0.0_f32,
        x_vel: 0.0_f32,
        y_vel: 0.0_f32,
        z_vel: 0.0_f32,
        x_pos: 0.0_f32,
        y_pos: 0.0_f32,
        z_pos: 0.0_f32,
        airspeed: 0.0_f32,
        vel_variance: [0.0_f32; 3usize],
        pos_variance: [0.0_f32; 3usize],
        q: [0.0_f32; 4usize],
        roll_rate: 0.0_f32,
        pitch_rate: 0.0_f32,
        yaw_rate: 0.0_f32,
    };
}
impl Default for CONTROL_SYSTEM_STATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CONTROL_SYSTEM_STATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 146u32;
    const NAME: &'static str = "CONTROL_SYSTEM_STATE";
    const EXTRA_CRC: u8 = 103u8;
    const ENCODED_LEN: usize = 100usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.x_acc = buf.get_f32_le();
        __struct.y_acc = buf.get_f32_le();
        __struct.z_acc = buf.get_f32_le();
        __struct.x_vel = buf.get_f32_le();
        __struct.y_vel = buf.get_f32_le();
        __struct.z_vel = buf.get_f32_le();
        __struct.x_pos = buf.get_f32_le();
        __struct.y_pos = buf.get_f32_le();
        __struct.z_pos = buf.get_f32_le();
        __struct.airspeed = buf.get_f32_le();
        for v in &mut __struct.vel_variance {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_variance {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.roll_rate = buf.get_f32_le();
        __struct.pitch_rate = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.x_acc);
        __tmp.put_f32_le(self.y_acc);
        __tmp.put_f32_le(self.z_acc);
        __tmp.put_f32_le(self.x_vel);
        __tmp.put_f32_le(self.y_vel);
        __tmp.put_f32_le(self.z_vel);
        __tmp.put_f32_le(self.x_pos);
        __tmp.put_f32_le(self.y_pos);
        __tmp.put_f32_le(self.z_pos);
        __tmp.put_f32_le(self.airspeed);
        for val in &self.vel_variance {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_variance {
            __tmp.put_f32_le(*val);
        }
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.roll_rate);
        __tmp.put_f32_le(self.pitch_rate);
        __tmp.put_f32_le(self.yaw_rate);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 241"]
#[doc = "Vibration levels and accelerometer clipping."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VIBRATION_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Vibration levels on X-axis."]
    pub vibration_x: f32,
    #[doc = "Vibration levels on Y-axis."]
    pub vibration_y: f32,
    #[doc = "Vibration levels on Z-axis."]
    pub vibration_z: f32,
    #[doc = "first accelerometer clipping count."]
    pub clipping_0: u32,
    #[doc = "second accelerometer clipping count."]
    pub clipping_1: u32,
    #[doc = "third accelerometer clipping count."]
    pub clipping_2: u32,
}
impl VIBRATION_DATA {
    pub const ENCODED_LEN: usize = 32usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        vibration_x: 0.0_f32,
        vibration_y: 0.0_f32,
        vibration_z: 0.0_f32,
        clipping_0: 0_u32,
        clipping_1: 0_u32,
        clipping_2: 0_u32,
    };
}
impl Default for VIBRATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VIBRATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 241u32;
    const NAME: &'static str = "VIBRATION";
    const EXTRA_CRC: u8 = 90u8;
    const ENCODED_LEN: usize = 32usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.vibration_x = buf.get_f32_le();
        __struct.vibration_y = buf.get_f32_le();
        __struct.vibration_z = buf.get_f32_le();
        __struct.clipping_0 = buf.get_u32_le();
        __struct.clipping_1 = buf.get_u32_le();
        __struct.clipping_2 = buf.get_u32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.vibration_x);
        __tmp.put_f32_le(self.vibration_y);
        __tmp.put_f32_le(self.vibration_z);
        __tmp.put_u32_le(self.clipping_0);
        __tmp.put_u32_le(self.clipping_1);
        __tmp.put_u32_le(self.clipping_2);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 283"]
#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc..."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_DEVICE_INFORMATION_DATA {
    #[doc = "UID of gimbal hardware (0 if unknown).."]
    pub uid: u64,
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Version of the gimbal firmware, encoded as: (Dev &amp; 0xff) &lt;&lt; 24 | (Patch &amp; 0xff) &lt;&lt; 16 | (Minor &amp; 0xff) &lt;&lt; 8 | (Major &amp; 0xff).."]
    pub firmware_version: u32,
    #[doc = "Version of the gimbal hardware, encoded as: (Dev &amp; 0xff) &lt;&lt; 24 | (Patch &amp; 0xff) &lt;&lt; 16 | (Minor &amp; 0xff) &lt;&lt; 8 | (Major &amp; 0xff).."]
    pub hardware_version: u32,
    #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.."]
    pub roll_min: f32,
    #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown.."]
    pub roll_max: f32,
    #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown.."]
    pub pitch_min: f32,
    #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown.."]
    pub pitch_max: f32,
    #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.."]
    pub yaw_min: f32,
    #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown.."]
    pub yaw_max: f32,
    #[doc = "Bitmap of gimbal capability flags.."]
    pub cap_flags: GimbalDeviceCapFlags,
    #[doc = "Bitmap for use for gimbal-specific capability flags.."]
    pub custom_cap_flags: u16,
    #[doc = "Name of the gimbal vendor.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vendor_name: [u8; 32],
    #[doc = "Name of the gimbal model.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub model_name: [u8; 32],
    #[doc = "Custom name of the gimbal given to it by the user.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub custom_name: [u8; 32],
}
impl GIMBAL_DEVICE_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 144usize;
    pub const DEFAULT: Self = Self {
        uid: 0_u64,
        time_boot_ms: 0_u32,
        firmware_version: 0_u32,
        hardware_version: 0_u32,
        roll_min: 0.0_f32,
        roll_max: 0.0_f32,
        pitch_min: 0.0_f32,
        pitch_max: 0.0_f32,
        yaw_min: 0.0_f32,
        yaw_max: 0.0_f32,
        cap_flags: GimbalDeviceCapFlags::DEFAULT,
        custom_cap_flags: 0_u16,
        vendor_name: [0_u8; 32usize],
        model_name: [0_u8; 32usize],
        custom_name: [0_u8; 32usize],
    };
}
impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 283u32;
    const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
    const EXTRA_CRC: u8 = 74u8;
    const ENCODED_LEN: usize = 144usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.uid = buf.get_u64_le();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.firmware_version = buf.get_u32_le();
        __struct.hardware_version = buf.get_u32_le();
        __struct.roll_min = buf.get_f32_le();
        __struct.roll_max = buf.get_f32_le();
        __struct.pitch_min = buf.get_f32_le();
        __struct.pitch_max = buf.get_f32_le();
        __struct.yaw_min = buf.get_f32_le();
        __struct.yaw_max = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
            tmp & GimbalDeviceCapFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "GimbalDeviceCapFlags",
            value: tmp as u32,
        })?;
        __struct.custom_cap_flags = buf.get_u16_le();
        for v in &mut __struct.vendor_name {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.model_name {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.custom_name {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.uid);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.firmware_version);
        __tmp.put_u32_le(self.hardware_version);
        __tmp.put_f32_le(self.roll_min);
        __tmp.put_f32_le(self.roll_max);
        __tmp.put_f32_le(self.pitch_min);
        __tmp.put_f32_le(self.pitch_max);
        __tmp.put_f32_le(self.yaw_min);
        __tmp.put_f32_le(self.yaw_max);
        __tmp.put_u16_le(self.cap_flags.bits());
        __tmp.put_u16_le(self.custom_cap_flags);
        for val in &self.vendor_name {
            __tmp.put_u8(*val);
        }
        for val in &self.model_name {
            __tmp.put_u8(*val);
        }
        for val in &self.custom_name {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 109"]
#[doc = "Status generated by radio and injected into MAVLink stream.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RADIO_STATUS_DATA {
    #[doc = "Count of radio packet receive errors (since boot).."]
    pub rxerrors: u16,
    #[doc = "Count of error corrected radio packets (since boot).."]
    pub fixed: u16,
    #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub rssi: u8,
    #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub remrssi: u8,
    #[doc = "Remaining free transmitter buffer space.."]
    pub txbuf: u8,
    #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub noise: u8,
    #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub remnoise: u8,
}
impl RADIO_STATUS_DATA {
    pub const ENCODED_LEN: usize = 9usize;
    pub const DEFAULT: Self = Self {
        rxerrors: 0_u16,
        fixed: 0_u16,
        rssi: 0_u8,
        remrssi: 0_u8,
        txbuf: 0_u8,
        noise: 0_u8,
        remnoise: 0_u8,
    };
}
impl Default for RADIO_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RADIO_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 109u32;
    const NAME: &'static str = "RADIO_STATUS";
    const EXTRA_CRC: u8 = 185u8;
    const ENCODED_LEN: usize = 9usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.rxerrors = buf.get_u16_le();
        __struct.fixed = buf.get_u16_le();
        __struct.rssi = buf.get_u8();
        __struct.remrssi = buf.get_u8();
        __struct.txbuf = buf.get_u8();
        __struct.noise = buf.get_u8();
        __struct.remnoise = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.rxerrors);
        __tmp.put_u16_le(self.fixed);
        __tmp.put_u8(self.rssi);
        __tmp.put_u8(self.remrssi);
        __tmp.put_u8(self.txbuf);
        __tmp.put_u8(self.noise);
        __tmp.put_u8(self.remnoise);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12900"]
#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. https://github.com/opendroneid/opendroneid-core-c. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at https://mavlink.io/en/services/opendroneid.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Indicates the format for the uas_id field of this message.."]
    pub id_type: MavOdidIdType,
    #[doc = "Indicates the type of UA (Unmanned Aircraft).."]
    pub ua_type: MavOdidUaType,
    #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uas_id: [u8; 20],
}
impl OPEN_DRONE_ID_BASIC_ID_DATA {
    pub const ENCODED_LEN: usize = 44usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        id_type: MavOdidIdType::DEFAULT,
        ua_type: MavOdidUaType::DEFAULT,
        uas_id: [0_u8; 20usize],
    };
}
impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
    type Message = MavMessage;
    const ID: u32 = 12900u32;
    const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
    const EXTRA_CRC: u8 = 114u8;
    const ENCODED_LEN: usize = 44usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.id_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidIdType",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.ua_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidUaType",
            value: tmp as u32,
        })?;
        for v in &mut __struct.uas_id {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.id_type as u8);
        __tmp.put_u8(self.ua_type as u8);
        for val in &self.uas_id {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 340"]
#[doc = "The global position resulting from GPS and sensor fusion.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct UTM_GLOBAL_POSITION_DATA {
    #[doc = "Time of applicability of position (microseconds since UNIX epoch).."]
    pub time: u64,
    #[doc = "Latitude (WGS84)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84)."]
    pub lon: i32,
    #[doc = "Altitude (WGS84)."]
    pub alt: i32,
    #[doc = "Altitude above ground."]
    pub relative_alt: i32,
    #[doc = "Next waypoint, latitude (WGS84)."]
    pub next_lat: i32,
    #[doc = "Next waypoint, longitude (WGS84)."]
    pub next_lon: i32,
    #[doc = "Next waypoint, altitude (WGS84)."]
    pub next_alt: i32,
    #[doc = "Ground X speed (latitude, positive north)."]
    pub vx: i16,
    #[doc = "Ground Y speed (longitude, positive east)."]
    pub vy: i16,
    #[doc = "Ground Z speed (altitude, positive down)."]
    pub vz: i16,
    #[doc = "Horizontal position uncertainty (standard deviation)."]
    pub h_acc: u16,
    #[doc = "Altitude uncertainty (standard deviation)."]
    pub v_acc: u16,
    #[doc = "Speed uncertainty (standard deviation)."]
    pub vel_acc: u16,
    #[doc = "Time until next update. Set to 0 if unknown or in data driven mode.."]
    pub update_rate: u16,
    #[doc = "Unique UAS ID.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uas_id: [u8; 18],
    #[doc = "Flight state."]
    pub flight_state: UtmFlightState,
    #[doc = "Bitwise OR combination of the data available flags.."]
    pub flags: UtmDataAvailFlags,
}
impl UTM_GLOBAL_POSITION_DATA {
    pub const ENCODED_LEN: usize = 70usize;
    pub const DEFAULT: Self = Self {
        time: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        relative_alt: 0_i32,
        next_lat: 0_i32,
        next_lon: 0_i32,
        next_alt: 0_i32,
        vx: 0_i16,
        vy: 0_i16,
        vz: 0_i16,
        h_acc: 0_u16,
        v_acc: 0_u16,
        vel_acc: 0_u16,
        update_rate: 0_u16,
        uas_id: [0_u8; 18usize],
        flight_state: UtmFlightState::DEFAULT,
        flags: UtmDataAvailFlags::DEFAULT,
    };
}
impl Default for UTM_GLOBAL_POSITION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for UTM_GLOBAL_POSITION_DATA {
    type Message = MavMessage;
    const ID: u32 = 340u32;
    const NAME: &'static str = "UTM_GLOBAL_POSITION";
    const EXTRA_CRC: u8 = 99u8;
    const ENCODED_LEN: usize = 70usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.relative_alt = buf.get_i32_le();
        __struct.next_lat = buf.get_i32_le();
        __struct.next_lon = buf.get_i32_le();
        __struct.next_alt = buf.get_i32_le();
        __struct.vx = buf.get_i16_le();
        __struct.vy = buf.get_i16_le();
        __struct.vz = buf.get_i16_le();
        __struct.h_acc = buf.get_u16_le();
        __struct.v_acc = buf.get_u16_le();
        __struct.vel_acc = buf.get_u16_le();
        __struct.update_rate = buf.get_u16_le();
        for v in &mut __struct.uas_id {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.flight_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "UtmFlightState",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "UtmDataAvailFlags",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i32_le(self.relative_alt);
        __tmp.put_i32_le(self.next_lat);
        __tmp.put_i32_le(self.next_lon);
        __tmp.put_i32_le(self.next_alt);
        __tmp.put_i16_le(self.vx);
        __tmp.put_i16_le(self.vy);
        __tmp.put_i16_le(self.vz);
        __tmp.put_u16_le(self.h_acc);
        __tmp.put_u16_le(self.v_acc);
        __tmp.put_u16_le(self.vel_acc);
        __tmp.put_u16_le(self.update_rate);
        for val in &self.uas_id {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.flight_state as u8);
        __tmp.put_u8(self.flags.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 87"]
#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct POSITION_TARGET_GLOBAL_INT_DATA {
    #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.."]
    pub time_boot_ms: u32,
    #[doc = "X Position in WGS84 frame."]
    pub lat_int: i32,
    #[doc = "Y Position in WGS84 frame."]
    pub lon_int: i32,
    #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)."]
    pub alt: f32,
    #[doc = "X velocity in NED frame."]
    pub vx: f32,
    #[doc = "Y velocity in NED frame."]
    pub vy: f32,
    #[doc = "Z velocity in NED frame."]
    pub vz: f32,
    #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afx: f32,
    #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afy: f32,
    #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afz: f32,
    #[doc = "yaw setpoint."]
    pub yaw: f32,
    #[doc = "yaw rate setpoint."]
    pub yaw_rate: f32,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: PositionTargetTypemask,
    #[doc = "Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11."]
    pub coordinate_frame: MavFrame,
}
impl POSITION_TARGET_GLOBAL_INT_DATA {
    pub const ENCODED_LEN: usize = 51usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        lat_int: 0_i32,
        lon_int: 0_i32,
        alt: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        afx: 0.0_f32,
        afy: 0.0_f32,
        afz: 0.0_f32,
        yaw: 0.0_f32,
        yaw_rate: 0.0_f32,
        type_mask: PositionTargetTypemask::DEFAULT,
        coordinate_frame: MavFrame::DEFAULT,
    };
}
impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 87u32;
    const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
    const EXTRA_CRC: u8 = 150u8;
    const ENCODED_LEN: usize = 51usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.lat_int = buf.get_i32_le();
        __struct.lon_int = buf.get_i32_le();
        __struct.alt = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.afx = buf.get_f32_le();
        __struct.afy = buf.get_f32_le();
        __struct.afz = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.type_mask = PositionTargetTypemask::from_bits(
            tmp & PositionTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "PositionTargetTypemask",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.coordinate_frame =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavFrame",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.lat_int);
        __tmp.put_i32_le(self.lon_int);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.afx);
        __tmp.put_f32_le(self.afy);
        __tmp.put_f32_le(self.afz);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u16_le(self.type_mask.bits());
        __tmp.put_u8(self.coordinate_frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50005"]
#[doc = "offset response to encapsulated data.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
    #[doc = "FW Offset.."]
    pub offset: u32,
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Component ID.."]
    pub target_component: u8,
}
impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        offset: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
    type Message = MavMessage;
    const ID: u32 = 50005u32;
    const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
    const EXTRA_CRC: u8 = 152u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.offset = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.offset);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 31"]
#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ATTITUDE_QUATERNION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Quaternion component 1, w (1 in null-rotation)."]
    pub q1: f32,
    #[doc = "Quaternion component 2, x (0 in null-rotation)."]
    pub q2: f32,
    #[doc = "Quaternion component 3, y (0 in null-rotation)."]
    pub q3: f32,
    #[doc = "Quaternion component 4, z (0 in null-rotation)."]
    pub q4: f32,
    #[doc = "Roll angular speed."]
    pub rollspeed: f32,
    #[doc = "Pitch angular speed."]
    pub pitchspeed: f32,
    #[doc = "Yaw angular speed."]
    pub yawspeed: f32,
    #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub repr_offset_q: [f32; 4],
}
impl ATTITUDE_QUATERNION_DATA {
    pub const ENCODED_LEN: usize = 48usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        q1: 0.0_f32,
        q2: 0.0_f32,
        q3: 0.0_f32,
        q4: 0.0_f32,
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
        repr_offset_q: [0.0_f32; 4usize],
    };
}
impl Default for ATTITUDE_QUATERNION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ATTITUDE_QUATERNION_DATA {
    type Message = MavMessage;
    const ID: u32 = 31u32;
    const NAME: &'static str = "ATTITUDE_QUATERNION";
    const EXTRA_CRC: u8 = 246u8;
    const ENCODED_LEN: usize = 48usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.q1 = buf.get_f32_le();
        __struct.q2 = buf.get_f32_le();
        __struct.q3 = buf.get_f32_le();
        __struct.q4 = buf.get_f32_le();
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        for v in &mut __struct.repr_offset_q {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.q1);
        __tmp.put_f32_le(self.q2);
        __tmp.put_f32_le(self.q3);
        __tmp.put_f32_le(self.q4);
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        for val in &self.repr_offset_q {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 21"]
#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_REQUEST_LIST_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl PARAM_REQUEST_LIST_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for PARAM_REQUEST_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_REQUEST_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 21u32;
    const NAME: &'static str = "PARAM_REQUEST_LIST";
    const EXTRA_CRC: u8 = 159u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 40"]
#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. https://mavlink.io/en/services/mission.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_REQUEST_DATA {
    #[doc = "Sequence."]
    pub seq: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_REQUEST_DATA {
    pub const ENCODED_LEN: usize = 5usize;
    pub const DEFAULT: Self = Self {
        seq: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_REQUEST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_REQUEST_DATA {
    type Message = MavMessage;
    const ID: u32 = 40u32;
    const NAME: &'static str = "MISSION_REQUEST";
    const EXTRA_CRC: u8 = 230u8;
    const ENCODED_LEN: usize = 5usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seq = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 139"]
#[doc = "Set the vehicle attitude and body angular rates.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub controls: [f32; 8],
    #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.."]
    pub group_mlx: u8,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl SET_ACTUATOR_CONTROL_TARGET_DATA {
    pub const ENCODED_LEN: usize = 43usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        controls: [0.0_f32; 8usize],
        group_mlx: 0_u8,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 139u32;
    const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
    const EXTRA_CRC: u8 = 168u8;
    const ENCODED_LEN: usize = 43usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.controls {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.group_mlx = buf.get_u8();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.controls {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.group_mlx);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 235"]
#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIGH_LATENCY2_DATA {
    #[doc = "Timestamp (milliseconds since boot or Unix epoch)."]
    pub timestamp: u32,
    #[doc = "Latitude."]
    pub latitude: i32,
    #[doc = "Longitude."]
    pub longitude: i32,
    #[doc = "A bitfield for use for autopilot-specific flags (2 byte version).."]
    pub custom_mode: u16,
    #[doc = "Altitude above mean sea level."]
    pub altitude: i16,
    #[doc = "Altitude setpoint."]
    pub target_altitude: i16,
    #[doc = "Distance to target waypoint or position."]
    pub target_distance: u16,
    #[doc = "Current waypoint number."]
    pub wp_num: u16,
    #[doc = "Bitmap of failure flags.."]
    pub failure_flags: HlFailureFlag,
    #[doc = "Type of the MAV (quadrotor, helicopter, etc.)."]
    pub mavtype: MavType,
    #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.."]
    pub autopilot: MavAutopilot,
    #[doc = "Heading."]
    pub heading: u8,
    #[doc = "Heading setpoint."]
    pub target_heading: u8,
    #[doc = "Throttle."]
    pub throttle: u8,
    #[doc = "Airspeed."]
    pub airspeed: u8,
    #[doc = "Airspeed setpoint."]
    pub airspeed_sp: u8,
    #[doc = "Groundspeed."]
    pub groundspeed: u8,
    #[doc = "Windspeed."]
    pub windspeed: u8,
    #[doc = "Wind heading."]
    pub wind_heading: u8,
    #[doc = "Maximum error horizontal position since last message."]
    pub eph: u8,
    #[doc = "Maximum error vertical position since last message."]
    pub epv: u8,
    #[doc = "Air temperature from airspeed sensor."]
    pub temperature_air: i8,
    #[doc = "Maximum climb rate magnitude since last message."]
    pub climb_rate: i8,
    #[doc = "Battery level (-1 if field not provided).."]
    pub battery: i8,
    #[doc = "Field for custom payload.."]
    pub custom0: i8,
    #[doc = "Field for custom payload.."]
    pub custom1: i8,
    #[doc = "Field for custom payload.."]
    pub custom2: i8,
}
impl HIGH_LATENCY2_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        timestamp: 0_u32,
        latitude: 0_i32,
        longitude: 0_i32,
        custom_mode: 0_u16,
        altitude: 0_i16,
        target_altitude: 0_i16,
        target_distance: 0_u16,
        wp_num: 0_u16,
        failure_flags: HlFailureFlag::DEFAULT,
        mavtype: MavType::DEFAULT,
        autopilot: MavAutopilot::DEFAULT,
        heading: 0_u8,
        target_heading: 0_u8,
        throttle: 0_u8,
        airspeed: 0_u8,
        airspeed_sp: 0_u8,
        groundspeed: 0_u8,
        windspeed: 0_u8,
        wind_heading: 0_u8,
        eph: 0_u8,
        epv: 0_u8,
        temperature_air: 0_i8,
        climb_rate: 0_i8,
        battery: 0_i8,
        custom0: 0_i8,
        custom1: 0_i8,
        custom2: 0_i8,
    };
}
impl Default for HIGH_LATENCY2_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIGH_LATENCY2_DATA {
    type Message = MavMessage;
    const ID: u32 = 235u32;
    const NAME: &'static str = "HIGH_LATENCY2";
    const EXTRA_CRC: u8 = 179u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.timestamp = buf.get_u32_le();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.custom_mode = buf.get_u16_le();
        __struct.altitude = buf.get_i16_le();
        __struct.target_altitude = buf.get_i16_le();
        __struct.target_distance = buf.get_u16_le();
        __struct.wp_num = buf.get_u16_le();
        let tmp = buf.get_u16_le();
        __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "HlFailureFlag",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavType",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.autopilot = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavAutopilot",
            value: tmp as u32,
        })?;
        __struct.heading = buf.get_u8();
        __struct.target_heading = buf.get_u8();
        __struct.throttle = buf.get_u8();
        __struct.airspeed = buf.get_u8();
        __struct.airspeed_sp = buf.get_u8();
        __struct.groundspeed = buf.get_u8();
        __struct.windspeed = buf.get_u8();
        __struct.wind_heading = buf.get_u8();
        __struct.eph = buf.get_u8();
        __struct.epv = buf.get_u8();
        __struct.temperature_air = buf.get_i8();
        __struct.climb_rate = buf.get_i8();
        __struct.battery = buf.get_i8();
        __struct.custom0 = buf.get_i8();
        __struct.custom1 = buf.get_i8();
        __struct.custom2 = buf.get_i8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.timestamp);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_u16_le(self.custom_mode);
        __tmp.put_i16_le(self.altitude);
        __tmp.put_i16_le(self.target_altitude);
        __tmp.put_u16_le(self.target_distance);
        __tmp.put_u16_le(self.wp_num);
        __tmp.put_u16_le(self.failure_flags.bits());
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.autopilot as u8);
        __tmp.put_u8(self.heading);
        __tmp.put_u8(self.target_heading);
        __tmp.put_u8(self.throttle);
        __tmp.put_u8(self.airspeed);
        __tmp.put_u8(self.airspeed_sp);
        __tmp.put_u8(self.groundspeed);
        __tmp.put_u8(self.windspeed);
        __tmp.put_u8(self.wind_heading);
        __tmp.put_u8(self.eph);
        __tmp.put_u8(self.epv);
        __tmp.put_i8(self.temperature_air);
        __tmp.put_i8(self.climb_rate);
        __tmp.put_i8(self.battery);
        __tmp.put_i8(self.custom0);
        __tmp.put_i8(self.custom1);
        __tmp.put_i8(self.custom2);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 54"]
#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SAFETY_SET_ALLOWED_AREA_DATA {
    #[doc = "x position 1 / Latitude 1."]
    pub p1x: f32,
    #[doc = "y position 1 / Longitude 1."]
    pub p1y: f32,
    #[doc = "z position 1 / Altitude 1."]
    pub p1z: f32,
    #[doc = "x position 2 / Latitude 2."]
    pub p2x: f32,
    #[doc = "y position 2 / Longitude 2."]
    pub p2y: f32,
    #[doc = "z position 2 / Altitude 2."]
    pub p2z: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.."]
    pub frame: MavFrame,
}
impl SAFETY_SET_ALLOWED_AREA_DATA {
    pub const ENCODED_LEN: usize = 27usize;
    pub const DEFAULT: Self = Self {
        p1x: 0.0_f32,
        p1y: 0.0_f32,
        p1z: 0.0_f32,
        p2x: 0.0_f32,
        p2y: 0.0_f32,
        p2z: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        frame: MavFrame::DEFAULT,
    };
}
impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
    type Message = MavMessage;
    const ID: u32 = 54u32;
    const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
    const EXTRA_CRC: u8 = 15u8;
    const ENCODED_LEN: usize = 27usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.p1x = buf.get_f32_le();
        __struct.p1y = buf.get_f32_le();
        __struct.p1z = buf.get_f32_le();
        __struct.p2x = buf.get_f32_le();
        __struct.p2y = buf.get_f32_le();
        __struct.p2z = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.p1x);
        __tmp.put_f32_le(self.p1y);
        __tmp.put_f32_le(self.p1z);
        __tmp.put_f32_le(self.p2x);
        __tmp.put_f32_le(self.p2y);
        __tmp.put_f32_le(self.p2z);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 271"]
#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_FOV_STATUS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Latitude of camera (INT32_MAX if unknown).."]
    pub lat_camera: i32,
    #[doc = "Longitude of camera (INT32_MAX if unknown).."]
    pub lon_camera: i32,
    #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown).."]
    pub alt_camera: i32,
    #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).."]
    pub lat_image: i32,
    #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).."]
    pub lon_image: i32,
    #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).."]
    pub alt_image: i32,
    #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Horizontal field of view (NaN if unknown).."]
    pub hfov: f32,
    #[doc = "Vertical field of view (NaN if unknown).."]
    pub vfov: f32,
}
impl CAMERA_FOV_STATUS_DATA {
    pub const ENCODED_LEN: usize = 52usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        lat_camera: 0_i32,
        lon_camera: 0_i32,
        alt_camera: 0_i32,
        lat_image: 0_i32,
        lon_image: 0_i32,
        alt_image: 0_i32,
        q: [0.0_f32; 4usize],
        hfov: 0.0_f32,
        vfov: 0.0_f32,
    };
}
impl Default for CAMERA_FOV_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_FOV_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 271u32;
    const NAME: &'static str = "CAMERA_FOV_STATUS";
    const EXTRA_CRC: u8 = 22u8;
    const ENCODED_LEN: usize = 52usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.lat_camera = buf.get_i32_le();
        __struct.lon_camera = buf.get_i32_le();
        __struct.alt_camera = buf.get_i32_le();
        __struct.lat_image = buf.get_i32_le();
        __struct.lon_image = buf.get_i32_le();
        __struct.alt_image = buf.get_i32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.hfov = buf.get_f32_le();
        __struct.vfov = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.lat_camera);
        __tmp.put_i32_le(self.lon_camera);
        __tmp.put_i32_le(self.alt_camera);
        __tmp.put_i32_le(self.lat_image);
        __tmp.put_i32_le(self.lon_image);
        __tmp.put_i32_le(self.alt_image);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.hfov);
        __tmp.put_f32_le(self.vfov);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 243"]
#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on.         The position is set automatically by the system during the takeoff (and may also be set using this message).         The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface.         Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach.         The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector.         Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_HOME_POSITION_DATA {
    #[doc = "Latitude (WGS84)."]
    pub latitude: i32,
    #[doc = "Longitude (WGS84)."]
    pub longitude: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub altitude: i32,
    #[doc = "Local X position of this position in the local coordinate frame (NED)."]
    pub x: f32,
    #[doc = "Local Y position of this position in the local coordinate frame (NED)."]
    pub y: f32,
    #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")."]
    pub z: f32,
    #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_x: f32,
    #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_y: f32,
    #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_z: f32,
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub time_usec: u64,
}
impl SET_HOME_POSITION_DATA {
    pub const ENCODED_LEN: usize = 61usize;
    pub const DEFAULT: Self = Self {
        latitude: 0_i32,
        longitude: 0_i32,
        altitude: 0_i32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        q: [0.0_f32; 4usize],
        approach_x: 0.0_f32,
        approach_y: 0.0_f32,
        approach_z: 0.0_f32,
        target_system: 0_u8,
        time_usec: 0_u64,
    };
}
impl Default for SET_HOME_POSITION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_HOME_POSITION_DATA {
    type Message = MavMessage;
    const ID: u32 = 243u32;
    const NAME: &'static str = "SET_HOME_POSITION";
    const EXTRA_CRC: u8 = 85u8;
    const ENCODED_LEN: usize = 61usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.altitude = buf.get_i32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.approach_x = buf.get_f32_le();
        __struct.approach_y = buf.get_f32_le();
        __struct.approach_z = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.time_usec = buf.get_u64_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_i32_le(self.altitude);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.approach_x);
        __tmp.put_f32_le(self.approach_y);
        __tmp.put_f32_le(self.approach_z);
        __tmp.put_u8(self.target_system);
        __tmp.put_u64_le(self.time_usec);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 252"]
#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct NAMED_VALUE_INT_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Signed integer value."]
    pub value: i32,
    #[doc = "Name of the debug variable."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 10],
}
impl NAMED_VALUE_INT_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        value: 0_i32,
        name: [0_u8; 10usize],
    };
}
impl Default for NAMED_VALUE_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for NAMED_VALUE_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 252u32;
    const NAME: &'static str = "NAMED_VALUE_INT";
    const EXTRA_CRC: u8 = 44u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.value = buf.get_i32_le();
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.value);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 287"]
#[doc = "High level message to control a gimbal's pitch and yaw angles. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
    #[doc = "High level gimbal manager flags to use.."]
    pub flags: GimbalManagerFlags,
    #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored).."]
    pub pitch: f32,
    #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored).."]
    pub yaw: f32,
    #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored).."]
    pub pitch_rate: f32,
    #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored).."]
    pub yaw_rate: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).."]
    pub gimbal_device_id: u8,
}
impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
    pub const ENCODED_LEN: usize = 23usize;
    pub const DEFAULT: Self = Self {
        flags: GimbalManagerFlags::DEFAULT,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        pitch_rate: 0.0_f32,
        yaw_rate: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        gimbal_device_id: 0_u8,
    };
}
impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
    type Message = MavMessage;
    const ID: u32 = 287u32;
    const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
    const EXTRA_CRC: u8 = 1u8;
    const ENCODED_LEN: usize = 23usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.flags = FromPrimitive::from_u32(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GimbalManagerFlags",
            value: tmp as u32,
        })?;
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.pitch_rate = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.gimbal_device_id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.flags as u32);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.pitch_rate);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.gimbal_device_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 125"]
#[doc = "Power supply status."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct POWER_STATUS_DATA {
    #[doc = "5V rail voltage.."]
    pub Vcc: u16,
    #[doc = "Servo rail voltage.."]
    pub Vservo: u16,
    #[doc = "Bitmap of power supply status flags.."]
    pub flags: MavPowerStatus,
}
impl POWER_STATUS_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        Vcc: 0_u16,
        Vservo: 0_u16,
        flags: MavPowerStatus::DEFAULT,
    };
}
impl Default for POWER_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for POWER_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 125u32;
    const NAME: &'static str = "POWER_STATUS";
    const EXTRA_CRC: u8 = 203u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.Vcc = buf.get_u16_le();
        __struct.Vservo = buf.get_u16_le();
        let tmp = buf.get_u16_le();
        __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "MavPowerStatus",
                value: tmp as u32,
            },
        )?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.Vcc);
        __tmp.put_u16_le(self.Vservo);
        __tmp.put_u16_le(self.flags.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 339"]
#[doc = "RPM sensor data message.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RAW_RPM_DATA {
    #[doc = "Indicated rate."]
    pub frequency: f32,
    #[doc = "Index of this RPM sensor (0-indexed)."]
    pub index: u8,
}
impl RAW_RPM_DATA {
    pub const ENCODED_LEN: usize = 5usize;
    pub const DEFAULT: Self = Self {
        frequency: 0.0_f32,
        index: 0_u8,
    };
}
impl Default for RAW_RPM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RAW_RPM_DATA {
    type Message = MavMessage;
    const ID: u32 = 339u32;
    const NAME: &'static str = "RAW_RPM";
    const EXTRA_CRC: u8 = 199u8;
    const ENCODED_LEN: usize = 5usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.frequency = buf.get_f32_le();
        __struct.index = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.frequency);
        __tmp.put_u8(self.index);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 333"]
#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X-coordinate of bezier control points. Set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_x: [f32; 5],
    #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_y: [f32; 5],
    #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_z: [f32; 5],
    #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub delta: [f32; 5],
    #[doc = "Yaw. Set to NaN for unchanged."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_yaw: [f32; 5],
    #[doc = "Number of valid control points (up-to 5 points are possible)."]
    pub valid_points: u8,
}
impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
    pub const ENCODED_LEN: usize = 109usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        pos_x: [0.0_f32; 5usize],
        pos_y: [0.0_f32; 5usize],
        pos_z: [0.0_f32; 5usize],
        delta: [0.0_f32; 5usize],
        pos_yaw: [0.0_f32; 5usize],
        valid_points: 0_u8,
    };
}
impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
    type Message = MavMessage;
    const ID: u32 = 333u32;
    const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
    const EXTRA_CRC: u8 = 231u8;
    const ENCODED_LEN: usize = 109usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.pos_x {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_y {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_z {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.delta {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_yaw {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.valid_points = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.pos_x {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_y {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_z {
            __tmp.put_f32_le(*val);
        }
        for val in &self.delta {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_yaw {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.valid_points);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 80"]
#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at https://mavlink.io/en/services/command.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMMAND_CANCEL_DATA {
    #[doc = "Command ID (of command to cancel).."]
    pub command: MavCmd,
    #[doc = "System executing long running command. Should not be broadcast (0).."]
    pub target_system: u8,
    #[doc = "Component executing long running command.."]
    pub target_component: u8,
}
impl COMMAND_CANCEL_DATA {
    pub const ENCODED_LEN: usize = 4usize;
    pub const DEFAULT: Self = Self {
        command: MavCmd::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for COMMAND_CANCEL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMMAND_CANCEL_DATA {
    type Message = MavMessage;
    const ID: u32 = 80u32;
    const NAME: &'static str = "COMMAND_CANCEL";
    const EXTRA_CRC: u8 = 14u8;
    const ENCODED_LEN: usize = 4usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 124"]
#[doc = "Second GPS data.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS2_RAW_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Latitude (WGS84)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84)."]
    pub lon: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub alt: i32,
    #[doc = "Age of DGPS info."]
    pub dgps_age: u32,
    #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub eph: u16,
    #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub epv: u16,
    #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX."]
    pub vel: u16,
    #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX."]
    pub cog: u16,
    #[doc = "GPS fix type.."]
    pub fix_type: GpsFixType,
    #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX."]
    pub satellites_visible: u8,
    #[doc = "Number of DGPS satellites."]
    pub dgps_numch: u8,
    #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub yaw: u16,
    #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub alt_ellipsoid: i32,
    #[doc = "Position uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub h_acc: u32,
    #[doc = "Altitude uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub v_acc: u32,
    #[doc = "Speed uncertainty.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub vel_acc: u32,
    #[doc = "Heading / track uncertainty."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub hdg_acc: u32,
}
impl GPS2_RAW_DATA {
    pub const ENCODED_LEN: usize = 57usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        dgps_age: 0_u32,
        eph: 0_u16,
        epv: 0_u16,
        vel: 0_u16,
        cog: 0_u16,
        fix_type: GpsFixType::DEFAULT,
        satellites_visible: 0_u8,
        dgps_numch: 0_u8,
        yaw: 0_u16,
        alt_ellipsoid: 0_i32,
        h_acc: 0_u32,
        v_acc: 0_u32,
        vel_acc: 0_u32,
        hdg_acc: 0_u32,
    };
}
impl Default for GPS2_RAW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS2_RAW_DATA {
    type Message = MavMessage;
    const ID: u32 = 124u32;
    const NAME: &'static str = "GPS2_RAW";
    const EXTRA_CRC: u8 = 87u8;
    const ENCODED_LEN: usize = 57usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.dgps_age = buf.get_u32_le();
        __struct.eph = buf.get_u16_le();
        __struct.epv = buf.get_u16_le();
        __struct.vel = buf.get_u16_le();
        __struct.cog = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.fix_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GpsFixType",
            value: tmp as u32,
        })?;
        __struct.satellites_visible = buf.get_u8();
        __struct.dgps_numch = buf.get_u8();
        __struct.yaw = buf.get_u16_le();
        __struct.alt_ellipsoid = buf.get_i32_le();
        __struct.h_acc = buf.get_u32_le();
        __struct.v_acc = buf.get_u32_le();
        __struct.vel_acc = buf.get_u32_le();
        __struct.hdg_acc = buf.get_u32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_u32_le(self.dgps_age);
        __tmp.put_u16_le(self.eph);
        __tmp.put_u16_le(self.epv);
        __tmp.put_u16_le(self.vel);
        __tmp.put_u16_le(self.cog);
        __tmp.put_u8(self.fix_type as u8);
        __tmp.put_u8(self.satellites_visible);
        __tmp.put_u8(self.dgps_numch);
        __tmp.put_u16_le(self.yaw);
        __tmp.put_i32_le(self.alt_ellipsoid);
        __tmp.put_u32_le(self.h_acc);
        __tmp.put_u32_le(self.v_acc);
        __tmp.put_u32_le(self.vel_acc);
        __tmp.put_u32_le(self.hdg_acc);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50"]
#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_MAP_RC_DATA {
    #[doc = "Initial parameter value."]
    pub param_value0: f32,
    #[doc = "Scale, maps the RC range [-1, 1] to a parameter value."]
    pub scale: f32,
    #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)."]
    pub param_value_min: f32,
    #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)."]
    pub param_value_max: f32,
    #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.."]
    pub param_index: i16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.."]
    pub parameter_rc_channel_index: u8,
}
impl PARAM_MAP_RC_DATA {
    pub const ENCODED_LEN: usize = 37usize;
    pub const DEFAULT: Self = Self {
        param_value0: 0.0_f32,
        scale: 0.0_f32,
        param_value_min: 0.0_f32,
        param_value_max: 0.0_f32,
        param_index: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        param_id: [0_u8; 16usize],
        parameter_rc_channel_index: 0_u8,
    };
}
impl Default for PARAM_MAP_RC_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_MAP_RC_DATA {
    type Message = MavMessage;
    const ID: u32 = 50u32;
    const NAME: &'static str = "PARAM_MAP_RC";
    const EXTRA_CRC: u8 = 78u8;
    const ENCODED_LEN: usize = 37usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_value0 = buf.get_f32_le();
        __struct.scale = buf.get_f32_le();
        __struct.param_value_min = buf.get_f32_le();
        __struct.param_value_max = buf.get_f32_le();
        __struct.param_index = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.parameter_rc_channel_index = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param_value0);
        __tmp.put_f32_le(self.scale);
        __tmp.put_f32_le(self.param_value_min);
        __tmp.put_f32_le(self.param_value_max);
        __tmp.put_i16_le(self.param_index);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.parameter_rc_channel_index);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 413"]
#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RESPONSE_EVENT_ERROR_DATA {
    #[doc = "Sequence number.."]
    pub sequence: u16,
    #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT.."]
    pub sequence_oldest_available: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Error reason.."]
    pub reason: MavEventErrorReason,
}
impl RESPONSE_EVENT_ERROR_DATA {
    pub const ENCODED_LEN: usize = 7usize;
    pub const DEFAULT: Self = Self {
        sequence: 0_u16,
        sequence_oldest_available: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        reason: MavEventErrorReason::DEFAULT,
    };
}
impl Default for RESPONSE_EVENT_ERROR_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RESPONSE_EVENT_ERROR_DATA {
    type Message = MavMessage;
    const ID: u32 = 413u32;
    const NAME: &'static str = "RESPONSE_EVENT_ERROR";
    const EXTRA_CRC: u8 = 77u8;
    const ENCODED_LEN: usize = 7usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.sequence = buf.get_u16_le();
        __struct.sequence_oldest_available = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.reason = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavEventErrorReason",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u16_le(self.sequence_oldest_available);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.reason as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 36"]
#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SERVO_OUTPUT_RAW_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u32,
    #[doc = "Servo output 1 value."]
    pub servo1_raw: u16,
    #[doc = "Servo output 2 value."]
    pub servo2_raw: u16,
    #[doc = "Servo output 3 value."]
    pub servo3_raw: u16,
    #[doc = "Servo output 4 value."]
    pub servo4_raw: u16,
    #[doc = "Servo output 5 value."]
    pub servo5_raw: u16,
    #[doc = "Servo output 6 value."]
    pub servo6_raw: u16,
    #[doc = "Servo output 7 value."]
    pub servo7_raw: u16,
    #[doc = "Servo output 8 value."]
    pub servo8_raw: u16,
    #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.."]
    pub port: u8,
    #[doc = "Servo output 9 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo9_raw: u16,
    #[doc = "Servo output 10 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo10_raw: u16,
    #[doc = "Servo output 11 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo11_raw: u16,
    #[doc = "Servo output 12 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo12_raw: u16,
    #[doc = "Servo output 13 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo13_raw: u16,
    #[doc = "Servo output 14 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo14_raw: u16,
    #[doc = "Servo output 15 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo15_raw: u16,
    #[doc = "Servo output 16 value."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub servo16_raw: u16,
}
impl SERVO_OUTPUT_RAW_DATA {
    pub const ENCODED_LEN: usize = 37usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u32,
        servo1_raw: 0_u16,
        servo2_raw: 0_u16,
        servo3_raw: 0_u16,
        servo4_raw: 0_u16,
        servo5_raw: 0_u16,
        servo6_raw: 0_u16,
        servo7_raw: 0_u16,
        servo8_raw: 0_u16,
        port: 0_u8,
        servo9_raw: 0_u16,
        servo10_raw: 0_u16,
        servo11_raw: 0_u16,
        servo12_raw: 0_u16,
        servo13_raw: 0_u16,
        servo14_raw: 0_u16,
        servo15_raw: 0_u16,
        servo16_raw: 0_u16,
    };
}
impl Default for SERVO_OUTPUT_RAW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SERVO_OUTPUT_RAW_DATA {
    type Message = MavMessage;
    const ID: u32 = 36u32;
    const NAME: &'static str = "SERVO_OUTPUT_RAW";
    const EXTRA_CRC: u8 = 222u8;
    const ENCODED_LEN: usize = 37usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u32_le();
        __struct.servo1_raw = buf.get_u16_le();
        __struct.servo2_raw = buf.get_u16_le();
        __struct.servo3_raw = buf.get_u16_le();
        __struct.servo4_raw = buf.get_u16_le();
        __struct.servo5_raw = buf.get_u16_le();
        __struct.servo6_raw = buf.get_u16_le();
        __struct.servo7_raw = buf.get_u16_le();
        __struct.servo8_raw = buf.get_u16_le();
        __struct.port = buf.get_u8();
        __struct.servo9_raw = buf.get_u16_le();
        __struct.servo10_raw = buf.get_u16_le();
        __struct.servo11_raw = buf.get_u16_le();
        __struct.servo12_raw = buf.get_u16_le();
        __struct.servo13_raw = buf.get_u16_le();
        __struct.servo14_raw = buf.get_u16_le();
        __struct.servo15_raw = buf.get_u16_le();
        __struct.servo16_raw = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_usec);
        __tmp.put_u16_le(self.servo1_raw);
        __tmp.put_u16_le(self.servo2_raw);
        __tmp.put_u16_le(self.servo3_raw);
        __tmp.put_u16_le(self.servo4_raw);
        __tmp.put_u16_le(self.servo5_raw);
        __tmp.put_u16_le(self.servo6_raw);
        __tmp.put_u16_le(self.servo7_raw);
        __tmp.put_u16_le(self.servo8_raw);
        __tmp.put_u8(self.port);
        __tmp.put_u16_le(self.servo9_raw);
        __tmp.put_u16_le(self.servo10_raw);
        __tmp.put_u16_le(self.servo11_raw);
        __tmp.put_u16_le(self.servo12_raw);
        __tmp.put_u16_le(self.servo13_raw);
        __tmp.put_u16_le(self.servo14_raw);
        __tmp.put_u16_le(self.servo15_raw);
        __tmp.put_u16_le(self.servo16_raw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 61"]
#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ATTITUDE_QUATERNION_COV_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Roll angular speed."]
    pub rollspeed: f32,
    #[doc = "Pitch angular speed."]
    pub pitchspeed: f32,
    #[doc = "Yaw angular speed."]
    pub yawspeed: f32,
    #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 9],
}
impl ATTITUDE_QUATERNION_COV_DATA {
    pub const ENCODED_LEN: usize = 72usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        q: [0.0_f32; 4usize],
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
        covariance: [0.0_f32; 9usize],
    };
}
impl Default for ATTITUDE_QUATERNION_COV_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
    type Message = MavMessage;
    const ID: u32 = 61u32;
    const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
    const EXTRA_CRC: u8 = 167u8;
    const ENCODED_LEN: usize = 72usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 233"]
#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_RTCM_DATA_DATA {
    #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order.."]
    pub flags: u8,
    #[doc = "data length."]
    pub len: u8,
    #[doc = "RTCM message (may be fragmented)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 180],
}
impl GPS_RTCM_DATA_DATA {
    pub const ENCODED_LEN: usize = 182usize;
    pub const DEFAULT: Self = Self {
        flags: 0_u8,
        len: 0_u8,
        data: [0_u8; 180usize],
    };
}
impl Default for GPS_RTCM_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_RTCM_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 233u32;
    const NAME: &'static str = "GPS_RTCM_DATA";
    const EXTRA_CRC: u8 = 35u8;
    const ENCODED_LEN: usize = 182usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.flags = buf.get_u8();
        __struct.len = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.flags);
        __tmp.put_u8(self.len);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 336"]
#[doc = "Configure cellular modems.         This message is re-emitted as an acknowledgement by the modem.         The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CELLULAR_CONFIG_DATA {
    #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.."]
    pub enable_lte: u8,
    #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.."]
    pub enable_pin: u8,
    #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pin: [u8; 16],
    #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub new_pin: [u8; 16],
    #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub apn: [u8; 32],
    #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub puk: [u8; 16],
    #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.."]
    pub roaming: u8,
    #[doc = "Message acceptance response (sent back to GS).."]
    pub response: CellularConfigResponse,
}
impl CELLULAR_CONFIG_DATA {
    pub const ENCODED_LEN: usize = 84usize;
    pub const DEFAULT: Self = Self {
        enable_lte: 0_u8,
        enable_pin: 0_u8,
        pin: [0_u8; 16usize],
        new_pin: [0_u8; 16usize],
        apn: [0_u8; 32usize],
        puk: [0_u8; 16usize],
        roaming: 0_u8,
        response: CellularConfigResponse::DEFAULT,
    };
}
impl Default for CELLULAR_CONFIG_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CELLULAR_CONFIG_DATA {
    type Message = MavMessage;
    const ID: u32 = 336u32;
    const NAME: &'static str = "CELLULAR_CONFIG";
    const EXTRA_CRC: u8 = 245u8;
    const ENCODED_LEN: usize = 84usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.enable_lte = buf.get_u8();
        __struct.enable_pin = buf.get_u8();
        for v in &mut __struct.pin {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.new_pin {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.apn {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.puk {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.roaming = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.response = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CellularConfigResponse",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.enable_lte);
        __tmp.put_u8(self.enable_pin);
        for val in &self.pin {
            __tmp.put_u8(*val);
        }
        for val in &self.new_pin {
            __tmp.put_u8(*val);
        }
        for val in &self.apn {
            __tmp.put_u8(*val);
        }
        for val in &self.puk {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.roaming);
        __tmp.put_u8(self.response as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 231"]
#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct WIND_COV_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Wind in North (NED) direction (NAN if unknown)."]
    pub wind_x: f32,
    #[doc = "Wind in East (NED) direction (NAN if unknown)."]
    pub wind_y: f32,
    #[doc = "Wind in down (NED) direction (NAN if unknown)."]
    pub wind_z: f32,
    #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)."]
    pub var_horiz: f32,
    #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)."]
    pub var_vert: f32,
    #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)."]
    pub wind_alt: f32,
    #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)."]
    pub horiz_accuracy: f32,
    #[doc = "Vertical speed 1-STD accuracy (0 if unknown)."]
    pub vert_accuracy: f32,
}
impl WIND_COV_DATA {
    pub const ENCODED_LEN: usize = 40usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        wind_x: 0.0_f32,
        wind_y: 0.0_f32,
        wind_z: 0.0_f32,
        var_horiz: 0.0_f32,
        var_vert: 0.0_f32,
        wind_alt: 0.0_f32,
        horiz_accuracy: 0.0_f32,
        vert_accuracy: 0.0_f32,
    };
}
impl Default for WIND_COV_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for WIND_COV_DATA {
    type Message = MavMessage;
    const ID: u32 = 231u32;
    const NAME: &'static str = "WIND_COV";
    const EXTRA_CRC: u8 = 105u8;
    const ENCODED_LEN: usize = 40usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.wind_x = buf.get_f32_le();
        __struct.wind_y = buf.get_f32_le();
        __struct.wind_z = buf.get_f32_le();
        __struct.var_horiz = buf.get_f32_le();
        __struct.var_vert = buf.get_f32_le();
        __struct.wind_alt = buf.get_f32_le();
        __struct.horiz_accuracy = buf.get_f32_le();
        __struct.vert_accuracy = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.wind_x);
        __tmp.put_f32_le(self.wind_y);
        __tmp.put_f32_le(self.wind_z);
        __tmp.put_f32_le(self.var_horiz);
        __tmp.put_f32_le(self.var_vert);
        __tmp.put_f32_le(self.wind_alt);
        __tmp.put_f32_le(self.horiz_accuracy);
        __tmp.put_f32_le(self.vert_accuracy);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 22"]
#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_VALUE_DATA {
    #[doc = "Onboard parameter value."]
    pub param_value: f32,
    #[doc = "Total number of onboard parameters."]
    pub param_count: u16,
    #[doc = "Index of this onboard parameter."]
    pub param_index: u16,
    #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Onboard parameter type.."]
    pub param_type: MavParamType,
}
impl PARAM_VALUE_DATA {
    pub const ENCODED_LEN: usize = 25usize;
    pub const DEFAULT: Self = Self {
        param_value: 0.0_f32,
        param_count: 0_u16,
        param_index: 0_u16,
        param_id: [0_u8; 16usize],
        param_type: MavParamType::DEFAULT,
    };
}
impl Default for PARAM_VALUE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_VALUE_DATA {
    type Message = MavMessage;
    const ID: u32 = 22u32;
    const NAME: &'static str = "PARAM_VALUE";
    const EXTRA_CRC: u8 = 220u8;
    const ENCODED_LEN: usize = 25usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_value = buf.get_f32_le();
        __struct.param_count = buf.get_u16_le();
        __struct.param_index = buf.get_u16_le();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.param_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavParamType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param_value);
        __tmp.put_u16_le(self.param_count);
        __tmp.put_u16_le(self.param_index);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.param_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 64"]
#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOCAL_POSITION_NED_COV_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X Position."]
    pub x: f32,
    #[doc = "Y Position."]
    pub y: f32,
    #[doc = "Z Position."]
    pub z: f32,
    #[doc = "X Speed."]
    pub vx: f32,
    #[doc = "Y Speed."]
    pub vy: f32,
    #[doc = "Z Speed."]
    pub vz: f32,
    #[doc = "X Acceleration."]
    pub ax: f32,
    #[doc = "Y Acceleration."]
    pub ay: f32,
    #[doc = "Z Acceleration."]
    pub az: f32,
    #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 45],
    #[doc = "Class id of the estimator this estimate originated from.."]
    pub estimator_type: MavEstimatorType,
}
impl LOCAL_POSITION_NED_COV_DATA {
    pub const ENCODED_LEN: usize = 225usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        ax: 0.0_f32,
        ay: 0.0_f32,
        az: 0.0_f32,
        covariance: [0.0_f32; 45usize],
        estimator_type: MavEstimatorType::DEFAULT,
    };
}
impl Default for LOCAL_POSITION_NED_COV_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOCAL_POSITION_NED_COV_DATA {
    type Message = MavMessage;
    const ID: u32 = 64u32;
    const NAME: &'static str = "LOCAL_POSITION_NED_COV";
    const EXTRA_CRC: u8 = 191u8;
    const ENCODED_LEN: usize = 225usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.ax = buf.get_f32_le();
        __struct.ay = buf.get_f32_le();
        __struct.az = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.estimator_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavEstimatorType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.ax);
        __tmp.put_f32_le(self.ay);
        __tmp.put_f32_le(self.az);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.estimator_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 62"]
#[doc = "The state of the navigation and position controller.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct NAV_CONTROLLER_OUTPUT_DATA {
    #[doc = "Current desired roll."]
    pub nav_roll: f32,
    #[doc = "Current desired pitch."]
    pub nav_pitch: f32,
    #[doc = "Current altitude error."]
    pub alt_error: f32,
    #[doc = "Current airspeed error."]
    pub aspd_error: f32,
    #[doc = "Current crosstrack error on x-y plane."]
    pub xtrack_error: f32,
    #[doc = "Current desired heading."]
    pub nav_bearing: i16,
    #[doc = "Bearing to current waypoint/target."]
    pub target_bearing: i16,
    #[doc = "Distance to active waypoint."]
    pub wp_dist: u16,
}
impl NAV_CONTROLLER_OUTPUT_DATA {
    pub const ENCODED_LEN: usize = 26usize;
    pub const DEFAULT: Self = Self {
        nav_roll: 0.0_f32,
        nav_pitch: 0.0_f32,
        alt_error: 0.0_f32,
        aspd_error: 0.0_f32,
        xtrack_error: 0.0_f32,
        nav_bearing: 0_i16,
        target_bearing: 0_i16,
        wp_dist: 0_u16,
    };
}
impl Default for NAV_CONTROLLER_OUTPUT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
    type Message = MavMessage;
    const ID: u32 = 62u32;
    const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
    const EXTRA_CRC: u8 = 183u8;
    const ENCODED_LEN: usize = 26usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.nav_roll = buf.get_f32_le();
        __struct.nav_pitch = buf.get_f32_le();
        __struct.alt_error = buf.get_f32_le();
        __struct.aspd_error = buf.get_f32_le();
        __struct.xtrack_error = buf.get_f32_le();
        __struct.nav_bearing = buf.get_i16_le();
        __struct.target_bearing = buf.get_i16_le();
        __struct.wp_dist = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.nav_roll);
        __tmp.put_f32_le(self.nav_pitch);
        __tmp.put_f32_le(self.alt_error);
        __tmp.put_f32_le(self.aspd_error);
        __tmp.put_f32_le(self.xtrack_error);
        __tmp.put_i16_le(self.nav_bearing);
        __tmp.put_i16_le(self.target_bearing);
        __tmp.put_u16_le(self.wp_dist);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 91"]
#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_CONTROLS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Control output -1 .. 1."]
    pub roll_ailerons: f32,
    #[doc = "Control output -1 .. 1."]
    pub pitch_elevator: f32,
    #[doc = "Control output -1 .. 1."]
    pub yaw_rudder: f32,
    #[doc = "Throttle 0 .. 1."]
    pub throttle: f32,
    #[doc = "Aux 1, -1 .. 1."]
    pub aux1: f32,
    #[doc = "Aux 2, -1 .. 1."]
    pub aux2: f32,
    #[doc = "Aux 3, -1 .. 1."]
    pub aux3: f32,
    #[doc = "Aux 4, -1 .. 1."]
    pub aux4: f32,
    #[doc = "System mode.."]
    pub mode: MavMode,
    #[doc = "Navigation mode (MAV_NAV_MODE)."]
    pub nav_mode: u8,
}
impl HIL_CONTROLS_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        roll_ailerons: 0.0_f32,
        pitch_elevator: 0.0_f32,
        yaw_rudder: 0.0_f32,
        throttle: 0.0_f32,
        aux1: 0.0_f32,
        aux2: 0.0_f32,
        aux3: 0.0_f32,
        aux4: 0.0_f32,
        mode: MavMode::DEFAULT,
        nav_mode: 0_u8,
    };
}
impl Default for HIL_CONTROLS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_CONTROLS_DATA {
    type Message = MavMessage;
    const ID: u32 = 91u32;
    const NAME: &'static str = "HIL_CONTROLS";
    const EXTRA_CRC: u8 = 63u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.roll_ailerons = buf.get_f32_le();
        __struct.pitch_elevator = buf.get_f32_le();
        __struct.yaw_rudder = buf.get_f32_le();
        __struct.throttle = buf.get_f32_le();
        __struct.aux1 = buf.get_f32_le();
        __struct.aux2 = buf.get_f32_le();
        __struct.aux3 = buf.get_f32_le();
        __struct.aux4 = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.mode = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMode",
            value: tmp as u32,
        })?;
        __struct.nav_mode = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.roll_ailerons);
        __tmp.put_f32_le(self.pitch_elevator);
        __tmp.put_f32_le(self.yaw_rudder);
        __tmp.put_f32_le(self.throttle);
        __tmp.put_f32_le(self.aux1);
        __tmp.put_f32_le(self.aux2);
        __tmp.put_f32_le(self.aux3);
        __tmp.put_f32_le(self.aux4);
        __tmp.put_u8(self.mode as u8);
        __tmp.put_u8(self.nav_mode);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 48"]
#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
    #[doc = "Latitude (WGS84)."]
    pub latitude: i32,
    #[doc = "Longitude (WGS84)."]
    pub longitude: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub altitude: i32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub time_usec: u64,
}
impl SET_GPS_GLOBAL_ORIGIN_DATA {
    pub const ENCODED_LEN: usize = 21usize;
    pub const DEFAULT: Self = Self {
        latitude: 0_i32,
        longitude: 0_i32,
        altitude: 0_i32,
        target_system: 0_u8,
        time_usec: 0_u64,
    };
}
impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
    type Message = MavMessage;
    const ID: u32 = 48u32;
    const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
    const EXTRA_CRC: u8 = 41u8;
    const ENCODED_LEN: usize = 21usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.altitude = buf.get_i32_le();
        __struct.target_system = buf.get_u8();
        __struct.time_usec = buf.get_u64_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_i32_le(self.altitude);
        __tmp.put_u8(self.target_system);
        __tmp.put_u64_le(self.time_usec);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 34"]
#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to UINT16_MAX.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RC_CHANNELS_SCALED_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "RC channel 1 value scaled.."]
    pub chan1_scaled: i16,
    #[doc = "RC channel 2 value scaled.."]
    pub chan2_scaled: i16,
    #[doc = "RC channel 3 value scaled.."]
    pub chan3_scaled: i16,
    #[doc = "RC channel 4 value scaled.."]
    pub chan4_scaled: i16,
    #[doc = "RC channel 5 value scaled.."]
    pub chan5_scaled: i16,
    #[doc = "RC channel 6 value scaled.."]
    pub chan6_scaled: i16,
    #[doc = "RC channel 7 value scaled.."]
    pub chan7_scaled: i16,
    #[doc = "RC channel 8 value scaled.."]
    pub chan8_scaled: i16,
    #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.."]
    pub port: u8,
    #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub rssi: u8,
}
impl RC_CHANNELS_SCALED_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        chan1_scaled: 0_i16,
        chan2_scaled: 0_i16,
        chan3_scaled: 0_i16,
        chan4_scaled: 0_i16,
        chan5_scaled: 0_i16,
        chan6_scaled: 0_i16,
        chan7_scaled: 0_i16,
        chan8_scaled: 0_i16,
        port: 0_u8,
        rssi: 0_u8,
    };
}
impl Default for RC_CHANNELS_SCALED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RC_CHANNELS_SCALED_DATA {
    type Message = MavMessage;
    const ID: u32 = 34u32;
    const NAME: &'static str = "RC_CHANNELS_SCALED";
    const EXTRA_CRC: u8 = 237u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.chan1_scaled = buf.get_i16_le();
        __struct.chan2_scaled = buf.get_i16_le();
        __struct.chan3_scaled = buf.get_i16_le();
        __struct.chan4_scaled = buf.get_i16_le();
        __struct.chan5_scaled = buf.get_i16_le();
        __struct.chan6_scaled = buf.get_i16_le();
        __struct.chan7_scaled = buf.get_i16_le();
        __struct.chan8_scaled = buf.get_i16_le();
        __struct.port = buf.get_u8();
        __struct.rssi = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i16_le(self.chan1_scaled);
        __tmp.put_i16_le(self.chan2_scaled);
        __tmp.put_i16_le(self.chan3_scaled);
        __tmp.put_i16_le(self.chan4_scaled);
        __tmp.put_i16_le(self.chan5_scaled);
        __tmp.put_i16_le(self.chan6_scaled);
        __tmp.put_i16_le(self.chan7_scaled);
        __tmp.put_i16_le(self.chan8_scaled);
        __tmp.put_u8(self.port);
        __tmp.put_u8(self.rssi);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 119"]
#[doc = "Request a chunk of a log."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_REQUEST_DATA_DATA {
    #[doc = "Offset into the log."]
    pub ofs: u32,
    #[doc = "Number of bytes."]
    pub count: u32,
    #[doc = "Log id (from LOG_ENTRY reply)."]
    pub id: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl LOG_REQUEST_DATA_DATA {
    pub const ENCODED_LEN: usize = 12usize;
    pub const DEFAULT: Self = Self {
        ofs: 0_u32,
        count: 0_u32,
        id: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for LOG_REQUEST_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_REQUEST_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 119u32;
    const NAME: &'static str = "LOG_REQUEST_DATA";
    const EXTRA_CRC: u8 = 116u8;
    const ENCODED_LEN: usize = 12usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.ofs = buf.get_u32_le();
        __struct.count = buf.get_u32_le();
        __struct.id = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.ofs);
        __tmp.put_u32_le(self.count);
        __tmp.put_u16_le(self.id);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 284"]
#[doc = "Low level message to control a gimbal device's attitude.  \t  This message is to be sent from the gimbal manager to the gimbal device component.  \t  The quaternion and angular velocities can be set to NaN according to use case.  \t  For the angles encoded in the quaternion and the angular velocities holds:  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame).  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame).  \t  If neither of these flags are set, then (for backwards compatibility) it holds:  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame),  \t  else they are relative to the vehicle heading (vehicle frame).  \t  Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed.  \t  These rules are to ensure backwards compatibility.  \t  New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
    #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored.."]
    pub angular_velocity_x: f32,
    #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored.."]
    pub angular_velocity_y: f32,
    #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored.."]
    pub angular_velocity_z: f32,
    #[doc = "Low level gimbal flags.."]
    pub flags: GimbalDeviceFlags,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
    pub const ENCODED_LEN: usize = 32usize;
    pub const DEFAULT: Self = Self {
        q: [0.0_f32; 4usize],
        angular_velocity_x: 0.0_f32,
        angular_velocity_y: 0.0_f32,
        angular_velocity_z: 0.0_f32,
        flags: GimbalDeviceFlags::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
    type Message = MavMessage;
    const ID: u32 = 284u32;
    const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
    const EXTRA_CRC: u8 = 99u8;
    const ENCODED_LEN: usize = 32usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.angular_velocity_x = buf.get_f32_le();
        __struct.angular_velocity_y = buf.get_f32_le();
        __struct.angular_velocity_z = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "GimbalDeviceFlags",
                value: tmp as u32,
            })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.angular_velocity_x);
        __tmp.put_f32_le(self.angular_velocity_y);
        __tmp.put_f32_le(self.angular_velocity_z);
        __tmp.put_u16_le(self.flags.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 27"]
#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RAW_IMU_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X acceleration (raw)."]
    pub xacc: i16,
    #[doc = "Y acceleration (raw)."]
    pub yacc: i16,
    #[doc = "Z acceleration (raw)."]
    pub zacc: i16,
    #[doc = "Angular speed around X axis (raw)."]
    pub xgyro: i16,
    #[doc = "Angular speed around Y axis (raw)."]
    pub ygyro: i16,
    #[doc = "Angular speed around Z axis (raw)."]
    pub zgyro: i16,
    #[doc = "X Magnetic field (raw)."]
    pub xmag: i16,
    #[doc = "Y Magnetic field (raw)."]
    pub ymag: i16,
    #[doc = "Z Magnetic field (raw)."]
    pub zmag: i16,
    #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub id: u8,
    #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature: i16,
}
impl RAW_IMU_DATA {
    pub const ENCODED_LEN: usize = 29usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
        xgyro: 0_i16,
        ygyro: 0_i16,
        zgyro: 0_i16,
        xmag: 0_i16,
        ymag: 0_i16,
        zmag: 0_i16,
        id: 0_u8,
        temperature: 0_i16,
    };
}
impl Default for RAW_IMU_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RAW_IMU_DATA {
    type Message = MavMessage;
    const ID: u32 = 27u32;
    const NAME: &'static str = "RAW_IMU";
    const EXTRA_CRC: u8 = 144u8;
    const ENCODED_LEN: usize = 29usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        __struct.xgyro = buf.get_i16_le();
        __struct.ygyro = buf.get_i16_le();
        __struct.zgyro = buf.get_i16_le();
        __struct.xmag = buf.get_i16_le();
        __struct.ymag = buf.get_i16_le();
        __struct.zmag = buf.get_i16_le();
        __struct.id = buf.get_u8();
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        __tmp.put_i16_le(self.xgyro);
        __tmp.put_i16_le(self.ygyro);
        __tmp.put_i16_le(self.zgyro);
        __tmp.put_i16_le(self.xmag);
        __tmp.put_i16_le(self.ymag);
        __tmp.put_i16_le(self.zmag);
        __tmp.put_u8(self.id);
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 253"]
#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct STATUSTEXT_DATA {
    #[doc = "Severity of status. Relies on the definitions within RFC-5424.."]
    pub severity: MavSeverity,
    #[doc = "Status text message, without null termination character."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub text: [u8; 50],
    #[doc = "Unique (opaque) identifier for this statustext message.  May be used to reassemble a logical long-statustext message from a sequence of chunks.  A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub id: u16,
    #[doc = "This chunk's sequence number; indexing is from zero.  Any null character in the text field is taken to mean this was the last chunk.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub chunk_seq: u8,
}
impl STATUSTEXT_DATA {
    pub const ENCODED_LEN: usize = 54usize;
    pub const DEFAULT: Self = Self {
        severity: MavSeverity::DEFAULT,
        text: [0_u8; 50usize],
        id: 0_u16,
        chunk_seq: 0_u8,
    };
}
impl Default for STATUSTEXT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for STATUSTEXT_DATA {
    type Message = MavMessage;
    const ID: u32 = 253u32;
    const NAME: &'static str = "STATUSTEXT";
    const EXTRA_CRC: u8 = 83u8;
    const ENCODED_LEN: usize = 54usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u8();
        __struct.severity = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavSeverity",
            value: tmp as u32,
        })?;
        for v in &mut __struct.text {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.id = buf.get_u16_le();
        __struct.chunk_seq = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.severity as u8);
        for val in &self.text {
            __tmp.put_u8(*val);
        }
        __tmp.put_u16_le(self.id);
        __tmp.put_u8(self.chunk_seq);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 225"]
#[doc = "EFI status output."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EFI_STATUS_DATA {
    #[doc = "ECU index."]
    pub ecu_index: f32,
    #[doc = "RPM."]
    pub rpm: f32,
    #[doc = "Fuel consumed."]
    pub fuel_consumed: f32,
    #[doc = "Fuel flow rate."]
    pub fuel_flow: f32,
    #[doc = "Engine load."]
    pub engine_load: f32,
    #[doc = "Throttle position."]
    pub throttle_position: f32,
    #[doc = "Spark dwell time."]
    pub spark_dwell_time: f32,
    #[doc = "Barometric pressure."]
    pub barometric_pressure: f32,
    #[doc = "Intake manifold pressure(."]
    pub intake_manifold_pressure: f32,
    #[doc = "Intake manifold temperature."]
    pub intake_manifold_temperature: f32,
    #[doc = "Cylinder head temperature."]
    pub cylinder_head_temperature: f32,
    #[doc = "Ignition timing (Crank angle degrees)."]
    pub ignition_timing: f32,
    #[doc = "Injection time."]
    pub injection_time: f32,
    #[doc = "Exhaust gas temperature."]
    pub exhaust_gas_temperature: f32,
    #[doc = "Output throttle."]
    pub throttle_out: f32,
    #[doc = "Pressure/temperature compensation."]
    pub pt_compensation: f32,
    #[doc = "EFI health status."]
    pub health: u8,
    #[doc = "Supply voltage to EFI sparking system.  Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub ignition_voltage: f32,
    #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub fuel_pressure: f32,
}
impl EFI_STATUS_DATA {
    pub const ENCODED_LEN: usize = 73usize;
    pub const DEFAULT: Self = Self {
        ecu_index: 0.0_f32,
        rpm: 0.0_f32,
        fuel_consumed: 0.0_f32,
        fuel_flow: 0.0_f32,
        engine_load: 0.0_f32,
        throttle_position: 0.0_f32,
        spark_dwell_time: 0.0_f32,
        barometric_pressure: 0.0_f32,
        intake_manifold_pressure: 0.0_f32,
        intake_manifold_temperature: 0.0_f32,
        cylinder_head_temperature: 0.0_f32,
        ignition_timing: 0.0_f32,
        injection_time: 0.0_f32,
        exhaust_gas_temperature: 0.0_f32,
        throttle_out: 0.0_f32,
        pt_compensation: 0.0_f32,
        health: 0_u8,
        ignition_voltage: 0.0_f32,
        fuel_pressure: 0.0_f32,
    };
}
impl Default for EFI_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for EFI_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 225u32;
    const NAME: &'static str = "EFI_STATUS";
    const EXTRA_CRC: u8 = 208u8;
    const ENCODED_LEN: usize = 73usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.ecu_index = buf.get_f32_le();
        __struct.rpm = buf.get_f32_le();
        __struct.fuel_consumed = buf.get_f32_le();
        __struct.fuel_flow = buf.get_f32_le();
        __struct.engine_load = buf.get_f32_le();
        __struct.throttle_position = buf.get_f32_le();
        __struct.spark_dwell_time = buf.get_f32_le();
        __struct.barometric_pressure = buf.get_f32_le();
        __struct.intake_manifold_pressure = buf.get_f32_le();
        __struct.intake_manifold_temperature = buf.get_f32_le();
        __struct.cylinder_head_temperature = buf.get_f32_le();
        __struct.ignition_timing = buf.get_f32_le();
        __struct.injection_time = buf.get_f32_le();
        __struct.exhaust_gas_temperature = buf.get_f32_le();
        __struct.throttle_out = buf.get_f32_le();
        __struct.pt_compensation = buf.get_f32_le();
        __struct.health = buf.get_u8();
        __struct.ignition_voltage = buf.get_f32_le();
        __struct.fuel_pressure = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.ecu_index);
        __tmp.put_f32_le(self.rpm);
        __tmp.put_f32_le(self.fuel_consumed);
        __tmp.put_f32_le(self.fuel_flow);
        __tmp.put_f32_le(self.engine_load);
        __tmp.put_f32_le(self.throttle_position);
        __tmp.put_f32_le(self.spark_dwell_time);
        __tmp.put_f32_le(self.barometric_pressure);
        __tmp.put_f32_le(self.intake_manifold_pressure);
        __tmp.put_f32_le(self.intake_manifold_temperature);
        __tmp.put_f32_le(self.cylinder_head_temperature);
        __tmp.put_f32_le(self.ignition_timing);
        __tmp.put_f32_le(self.injection_time);
        __tmp.put_f32_le(self.exhaust_gas_temperature);
        __tmp.put_f32_le(self.throttle_out);
        __tmp.put_f32_le(self.pt_compensation);
        __tmp.put_u8(self.health);
        __tmp.put_f32_le(self.ignition_voltage);
        __tmp.put_f32_le(self.fuel_pressure);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 89"]
#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X Position."]
    pub x: f32,
    #[doc = "Y Position."]
    pub y: f32,
    #[doc = "Z Position."]
    pub z: f32,
    #[doc = "Roll."]
    pub roll: f32,
    #[doc = "Pitch."]
    pub pitch: f32,
    #[doc = "Yaw."]
    pub yaw: f32,
}
impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
    };
}
impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
    type Message = MavMessage;
    const ID: u32 = 89u32;
    const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
    const EXTRA_CRC: u8 = 231u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 260"]
#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_SETTINGS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Camera mode."]
    pub mode_id: CameraMode,
    #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub zoomLevel: f32,
    #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub focusLevel: f32,
}
impl CAMERA_SETTINGS_DATA {
    pub const ENCODED_LEN: usize = 13usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        mode_id: CameraMode::DEFAULT,
        zoomLevel: 0.0_f32,
        focusLevel: 0.0_f32,
    };
}
impl Default for CAMERA_SETTINGS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_SETTINGS_DATA {
    type Message = MavMessage;
    const ID: u32 = 260u32;
    const NAME: &'static str = "CAMERA_SETTINGS";
    const EXTRA_CRC: u8 = 146u8;
    const ENCODED_LEN: usize = 13usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        let tmp = buf.get_u8();
        __struct.mode_id = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CameraMode",
            value: tmp as u32,
        })?;
        __struct.zoomLevel = buf.get_f32_le();
        __struct.focusLevel = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u8(self.mode_id as u8);
        __tmp.put_f32_le(self.zoomLevel);
        __tmp.put_f32_le(self.focusLevel);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 129"]
#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_IMU3_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X acceleration."]
    pub xacc: i16,
    #[doc = "Y acceleration."]
    pub yacc: i16,
    #[doc = "Z acceleration."]
    pub zacc: i16,
    #[doc = "Angular speed around X axis."]
    pub xgyro: i16,
    #[doc = "Angular speed around Y axis."]
    pub ygyro: i16,
    #[doc = "Angular speed around Z axis."]
    pub zgyro: i16,
    #[doc = "X Magnetic field."]
    pub xmag: i16,
    #[doc = "Y Magnetic field."]
    pub ymag: i16,
    #[doc = "Z Magnetic field."]
    pub zmag: i16,
    #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature: i16,
}
impl SCALED_IMU3_DATA {
    pub const ENCODED_LEN: usize = 24usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
        xgyro: 0_i16,
        ygyro: 0_i16,
        zgyro: 0_i16,
        xmag: 0_i16,
        ymag: 0_i16,
        zmag: 0_i16,
        temperature: 0_i16,
    };
}
impl Default for SCALED_IMU3_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_IMU3_DATA {
    type Message = MavMessage;
    const ID: u32 = 129u32;
    const NAME: &'static str = "SCALED_IMU3";
    const EXTRA_CRC: u8 = 46u8;
    const ENCODED_LEN: usize = 24usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        __struct.xgyro = buf.get_i16_le();
        __struct.ygyro = buf.get_i16_le();
        __struct.zgyro = buf.get_i16_le();
        __struct.xmag = buf.get_i16_le();
        __struct.ymag = buf.get_i16_le();
        __struct.zmag = buf.get_i16_le();
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        __tmp.put_i16_le(self.xgyro);
        __tmp.put_i16_le(self.ygyro);
        __tmp.put_i16_le(self.zgyro);
        __tmp.put_i16_le(self.xmag);
        __tmp.put_i16_le(self.ymag);
        __tmp.put_i16_le(self.zmag);
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 114"]
#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_OPTICAL_FLOW_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.."]
    pub integration_time_us: u32,
    #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)."]
    pub integrated_x: f32,
    #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)."]
    pub integrated_y: f32,
    #[doc = "RH rotation around X axis."]
    pub integrated_xgyro: f32,
    #[doc = "RH rotation around Y axis."]
    pub integrated_ygyro: f32,
    #[doc = "RH rotation around Z axis."]
    pub integrated_zgyro: f32,
    #[doc = "Time since the distance was sampled.."]
    pub time_delta_distance_us: u32,
    #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.."]
    pub distance: f32,
    #[doc = "Temperature."]
    pub temperature: i16,
    #[doc = "Sensor ID."]
    pub sensor_id: u8,
    #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality."]
    pub quality: u8,
}
impl HIL_OPTICAL_FLOW_DATA {
    pub const ENCODED_LEN: usize = 44usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        integration_time_us: 0_u32,
        integrated_x: 0.0_f32,
        integrated_y: 0.0_f32,
        integrated_xgyro: 0.0_f32,
        integrated_ygyro: 0.0_f32,
        integrated_zgyro: 0.0_f32,
        time_delta_distance_us: 0_u32,
        distance: 0.0_f32,
        temperature: 0_i16,
        sensor_id: 0_u8,
        quality: 0_u8,
    };
}
impl Default for HIL_OPTICAL_FLOW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_OPTICAL_FLOW_DATA {
    type Message = MavMessage;
    const ID: u32 = 114u32;
    const NAME: &'static str = "HIL_OPTICAL_FLOW";
    const EXTRA_CRC: u8 = 237u8;
    const ENCODED_LEN: usize = 44usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.integration_time_us = buf.get_u32_le();
        __struct.integrated_x = buf.get_f32_le();
        __struct.integrated_y = buf.get_f32_le();
        __struct.integrated_xgyro = buf.get_f32_le();
        __struct.integrated_ygyro = buf.get_f32_le();
        __struct.integrated_zgyro = buf.get_f32_le();
        __struct.time_delta_distance_us = buf.get_u32_le();
        __struct.distance = buf.get_f32_le();
        __struct.temperature = buf.get_i16_le();
        __struct.sensor_id = buf.get_u8();
        __struct.quality = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.integration_time_us);
        __tmp.put_f32_le(self.integrated_x);
        __tmp.put_f32_le(self.integrated_y);
        __tmp.put_f32_le(self.integrated_xgyro);
        __tmp.put_f32_le(self.integrated_ygyro);
        __tmp.put_f32_le(self.integrated_zgyro);
        __tmp.put_u32_le(self.time_delta_distance_us);
        __tmp.put_f32_le(self.distance);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_u8(self.sensor_id);
        __tmp.put_u8(self.quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 26"]
#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_IMU_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X acceleration."]
    pub xacc: i16,
    #[doc = "Y acceleration."]
    pub yacc: i16,
    #[doc = "Z acceleration."]
    pub zacc: i16,
    #[doc = "Angular speed around X axis."]
    pub xgyro: i16,
    #[doc = "Angular speed around Y axis."]
    pub ygyro: i16,
    #[doc = "Angular speed around Z axis."]
    pub zgyro: i16,
    #[doc = "X Magnetic field."]
    pub xmag: i16,
    #[doc = "Y Magnetic field."]
    pub ymag: i16,
    #[doc = "Z Magnetic field."]
    pub zmag: i16,
    #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature: i16,
}
impl SCALED_IMU_DATA {
    pub const ENCODED_LEN: usize = 24usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
        xgyro: 0_i16,
        ygyro: 0_i16,
        zgyro: 0_i16,
        xmag: 0_i16,
        ymag: 0_i16,
        zmag: 0_i16,
        temperature: 0_i16,
    };
}
impl Default for SCALED_IMU_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_IMU_DATA {
    type Message = MavMessage;
    const ID: u32 = 26u32;
    const NAME: &'static str = "SCALED_IMU";
    const EXTRA_CRC: u8 = 170u8;
    const ENCODED_LEN: usize = 24usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        __struct.xgyro = buf.get_i16_le();
        __struct.ygyro = buf.get_i16_le();
        __struct.zgyro = buf.get_i16_le();
        __struct.xmag = buf.get_i16_le();
        __struct.ymag = buf.get_i16_le();
        __struct.zmag = buf.get_i16_le();
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        __tmp.put_i16_le(self.xgyro);
        __tmp.put_i16_le(self.ygyro);
        __tmp.put_i16_le(self.zgyro);
        __tmp.put_i16_le(self.xmag);
        __tmp.put_i16_le(self.ymag);
        __tmp.put_i16_le(self.zmag);
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 81"]
#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MANUAL_SETPOINT_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Desired roll rate."]
    pub roll: f32,
    #[doc = "Desired pitch rate."]
    pub pitch: f32,
    #[doc = "Desired yaw rate."]
    pub yaw: f32,
    #[doc = "Collective thrust, normalized to 0 .. 1."]
    pub thrust: f32,
    #[doc = "Flight mode switch position, 0.. 255."]
    pub mode_switch: u8,
    #[doc = "Override mode switch position, 0.. 255."]
    pub manual_override_switch: u8,
}
impl MANUAL_SETPOINT_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        thrust: 0.0_f32,
        mode_switch: 0_u8,
        manual_override_switch: 0_u8,
    };
}
impl Default for MANUAL_SETPOINT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MANUAL_SETPOINT_DATA {
    type Message = MavMessage;
    const ID: u32 = 81u32;
    const NAME: &'static str = "MANUAL_SETPOINT";
    const EXTRA_CRC: u8 = 106u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.thrust = buf.get_f32_le();
        __struct.mode_switch = buf.get_u8();
        __struct.manual_override_switch = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.thrust);
        __tmp.put_u8(self.mode_switch);
        __tmp.put_u8(self.manual_override_switch);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 350"]
#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DEBUG_FLOAT_ARRAY_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Unique ID used to discriminate between arrays."]
    pub array_id: u16,
    #[doc = "Name, for human-friendly display in a Ground Control Station."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 10],
    #[doc = "data."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [f32; 58],
}
impl DEBUG_FLOAT_ARRAY_DATA {
    pub const ENCODED_LEN: usize = 252usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        array_id: 0_u16,
        name: [0_u8; 10usize],
        data: [0.0_f32; 58usize],
    };
}
impl Default for DEBUG_FLOAT_ARRAY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
    type Message = MavMessage;
    const ID: u32 = 350u32;
    const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
    const EXTRA_CRC: u8 = 232u8;
    const ENCODED_LEN: usize = 252usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.array_id = buf.get_u16_le();
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.data {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u16_le(self.array_id);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        for val in &self.data {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 390"]
#[doc = "Hardware status sent by an onboard computer.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ONBOARD_COMPUTER_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Time since system boot.."]
    pub uptime: u32,
    #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.."]
    pub ram_usage: u32,
    #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.."]
    pub ram_total: u32,
    #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub storage_type: [u32; 4],
    #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub storage_usage: [u32; 4],
    #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub storage_total: [u32; 4],
    #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub link_type: [u32; 6],
    #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub link_tx_rate: [u32; 6],
    #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub link_rx_rate: [u32; 6],
    #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub link_tx_max: [u32; 6],
    #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub link_rx_max: [u32; 6],
    #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub fan_speed: [i16; 4],
    #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.."]
    pub mavtype: u8,
    #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub cpu_cores: [u8; 8],
    #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub cpu_combined: [u8; 10],
    #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub gpu_cores: [u8; 4],
    #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub gpu_combined: [u8; 10],
    #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused.."]
    pub temperature_board: i8,
    #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub temperature_core: [i8; 8],
}
impl ONBOARD_COMPUTER_STATUS_DATA {
    pub const ENCODED_LEN: usize = 238usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        uptime: 0_u32,
        ram_usage: 0_u32,
        ram_total: 0_u32,
        storage_type: [0_u32; 4usize],
        storage_usage: [0_u32; 4usize],
        storage_total: [0_u32; 4usize],
        link_type: [0_u32; 6usize],
        link_tx_rate: [0_u32; 6usize],
        link_rx_rate: [0_u32; 6usize],
        link_tx_max: [0_u32; 6usize],
        link_rx_max: [0_u32; 6usize],
        fan_speed: [0_i16; 4usize],
        mavtype: 0_u8,
        cpu_cores: [0_u8; 8usize],
        cpu_combined: [0_u8; 10usize],
        gpu_cores: [0_u8; 4usize],
        gpu_combined: [0_u8; 10usize],
        temperature_board: 0_i8,
        temperature_core: [0_i8; 8usize],
    };
}
impl Default for ONBOARD_COMPUTER_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 390u32;
    const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
    const EXTRA_CRC: u8 = 156u8;
    const ENCODED_LEN: usize = 238usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.uptime = buf.get_u32_le();
        __struct.ram_usage = buf.get_u32_le();
        __struct.ram_total = buf.get_u32_le();
        for v in &mut __struct.storage_type {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.storage_usage {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.storage_total {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.link_type {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.link_tx_rate {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.link_rx_rate {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.link_tx_max {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.link_rx_max {
            let val = buf.get_u32_le();
            *v = val;
        }
        for v in &mut __struct.fan_speed {
            let val = buf.get_i16_le();
            *v = val;
        }
        __struct.mavtype = buf.get_u8();
        for v in &mut __struct.cpu_cores {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.cpu_combined {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.gpu_cores {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.gpu_combined {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.temperature_board = buf.get_i8();
        for v in &mut __struct.temperature_core {
            let val = buf.get_i8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.uptime);
        __tmp.put_u32_le(self.ram_usage);
        __tmp.put_u32_le(self.ram_total);
        for val in &self.storage_type {
            __tmp.put_u32_le(*val);
        }
        for val in &self.storage_usage {
            __tmp.put_u32_le(*val);
        }
        for val in &self.storage_total {
            __tmp.put_u32_le(*val);
        }
        for val in &self.link_type {
            __tmp.put_u32_le(*val);
        }
        for val in &self.link_tx_rate {
            __tmp.put_u32_le(*val);
        }
        for val in &self.link_rx_rate {
            __tmp.put_u32_le(*val);
        }
        for val in &self.link_tx_max {
            __tmp.put_u32_le(*val);
        }
        for val in &self.link_rx_max {
            __tmp.put_u32_le(*val);
        }
        for val in &self.fan_speed {
            __tmp.put_i16_le(*val);
        }
        __tmp.put_u8(self.mavtype);
        for val in &self.cpu_cores {
            __tmp.put_u8(*val);
        }
        for val in &self.cpu_combined {
            __tmp.put_u8(*val);
        }
        for val in &self.gpu_cores {
            __tmp.put_u8(*val);
        }
        for val in &self.gpu_combined {
            __tmp.put_u8(*val);
        }
        __tmp.put_i8(self.temperature_board);
        for val in &self.temperature_core {
            __tmp.put_i8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 360"]
#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ORBIT_EXECUTION_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.."]
    pub radius: f32,
    #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.."]
    pub x: i32,
    #[doc = "Y coordinate of center point.  Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.."]
    pub y: i32,
    #[doc = "Altitude of center point. Coordinate system depends on frame field.."]
    pub z: f32,
    #[doc = "The coordinate system of the fields: x, y, z.."]
    pub frame: MavFrame,
}
impl ORBIT_EXECUTION_STATUS_DATA {
    pub const ENCODED_LEN: usize = 25usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        radius: 0.0_f32,
        x: 0_i32,
        y: 0_i32,
        z: 0.0_f32,
        frame: MavFrame::DEFAULT,
    };
}
impl Default for ORBIT_EXECUTION_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 360u32;
    const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
    const EXTRA_CRC: u8 = 11u8;
    const ENCODED_LEN: usize = 25usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.radius = buf.get_f32_le();
        __struct.x = buf.get_i32_le();
        __struct.y = buf.get_i32_le();
        __struct.z = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.radius);
        __tmp.put_i32_le(self.x);
        __tmp.put_i32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_u8(self.frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 322"]
#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_EXT_VALUE_DATA {
    #[doc = "Total number of parameters."]
    pub param_count: u16,
    #[doc = "Index of this parameter."]
    pub param_index: u16,
    #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Parameter value."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_value: [u8; 128],
    #[doc = "Parameter type.."]
    pub param_type: MavParamExtType,
}
impl PARAM_EXT_VALUE_DATA {
    pub const ENCODED_LEN: usize = 149usize;
    pub const DEFAULT: Self = Self {
        param_count: 0_u16,
        param_index: 0_u16,
        param_id: [0_u8; 16usize],
        param_value: [0_u8; 128usize],
        param_type: MavParamExtType::DEFAULT,
    };
}
impl Default for PARAM_EXT_VALUE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_EXT_VALUE_DATA {
    type Message = MavMessage;
    const ID: u32 = 322u32;
    const NAME: &'static str = "PARAM_EXT_VALUE";
    const EXTRA_CRC: u8 = 243u8;
    const ENCODED_LEN: usize = 149usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_count = buf.get_u16_le();
        __struct.param_index = buf.get_u16_le();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.param_value {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.param_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavParamExtType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.param_count);
        __tmp.put_u16_le(self.param_index);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        for val in &self.param_value {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.param_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 55"]
#[doc = "Read out the safety zone the MAV currently assumes.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SAFETY_ALLOWED_AREA_DATA {
    #[doc = "x position 1 / Latitude 1."]
    pub p1x: f32,
    #[doc = "y position 1 / Longitude 1."]
    pub p1y: f32,
    #[doc = "z position 1 / Altitude 1."]
    pub p1z: f32,
    #[doc = "x position 2 / Latitude 2."]
    pub p2x: f32,
    #[doc = "y position 2 / Longitude 2."]
    pub p2y: f32,
    #[doc = "z position 2 / Altitude 2."]
    pub p2z: f32,
    #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.."]
    pub frame: MavFrame,
}
impl SAFETY_ALLOWED_AREA_DATA {
    pub const ENCODED_LEN: usize = 25usize;
    pub const DEFAULT: Self = Self {
        p1x: 0.0_f32,
        p1y: 0.0_f32,
        p1z: 0.0_f32,
        p2x: 0.0_f32,
        p2y: 0.0_f32,
        p2z: 0.0_f32,
        frame: MavFrame::DEFAULT,
    };
}
impl Default for SAFETY_ALLOWED_AREA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SAFETY_ALLOWED_AREA_DATA {
    type Message = MavMessage;
    const ID: u32 = 55u32;
    const NAME: &'static str = "SAFETY_ALLOWED_AREA";
    const EXTRA_CRC: u8 = 3u8;
    const ENCODED_LEN: usize = 25usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.p1x = buf.get_f32_le();
        __struct.p1y = buf.get_f32_le();
        __struct.p1z = buf.get_f32_le();
        __struct.p2x = buf.get_f32_le();
        __struct.p2y = buf.get_f32_le();
        __struct.p2z = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.p1x);
        __tmp.put_f32_le(self.p1y);
        __tmp.put_f32_le(self.p1z);
        __tmp.put_f32_le(self.p2x);
        __tmp.put_f32_le(self.p2y);
        __tmp.put_f32_le(self.p2z);
        __tmp.put_u8(self.frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 28"]
#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RAW_PRESSURE_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Absolute pressure (raw)."]
    pub press_abs: i16,
    #[doc = "Differential pressure 1 (raw, 0 if nonexistent)."]
    pub press_diff1: i16,
    #[doc = "Differential pressure 2 (raw, 0 if nonexistent)."]
    pub press_diff2: i16,
    #[doc = "Raw Temperature measurement (raw)."]
    pub temperature: i16,
}
impl RAW_PRESSURE_DATA {
    pub const ENCODED_LEN: usize = 16usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        press_abs: 0_i16,
        press_diff1: 0_i16,
        press_diff2: 0_i16,
        temperature: 0_i16,
    };
}
impl Default for RAW_PRESSURE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RAW_PRESSURE_DATA {
    type Message = MavMessage;
    const ID: u32 = 28u32;
    const NAME: &'static str = "RAW_PRESSURE";
    const EXTRA_CRC: u8 = 67u8;
    const ENCODED_LEN: usize = 16usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.press_abs = buf.get_i16_le();
        __struct.press_diff1 = buf.get_i16_le();
        __struct.press_diff2 = buf.get_i16_le();
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i16_le(self.press_abs);
        __tmp.put_i16_le(self.press_diff1);
        __tmp.put_i16_le(self.press_diff2);
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 143"]
#[doc = "Barometer readings for 3rd barometer."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_PRESSURE3_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Absolute pressure."]
    pub press_abs: f32,
    #[doc = "Differential pressure."]
    pub press_diff: f32,
    #[doc = "Absolute pressure temperature."]
    pub temperature: i16,
    #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature_press_diff: i16,
}
impl SCALED_PRESSURE3_DATA {
    pub const ENCODED_LEN: usize = 16usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        press_abs: 0.0_f32,
        press_diff: 0.0_f32,
        temperature: 0_i16,
        temperature_press_diff: 0_i16,
    };
}
impl Default for SCALED_PRESSURE3_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_PRESSURE3_DATA {
    type Message = MavMessage;
    const ID: u32 = 143u32;
    const NAME: &'static str = "SCALED_PRESSURE3";
    const EXTRA_CRC: u8 = 131u8;
    const ENCODED_LEN: usize = 16usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.press_abs = buf.get_f32_le();
        __struct.press_diff = buf.get_f32_le();
        __struct.temperature = buf.get_i16_le();
        __struct.temperature_press_diff = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.press_abs);
        __tmp.put_f32_le(self.press_diff);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_i16_le(self.temperature_press_diff);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12918"]
#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
    #[doc = "Status level indicating if arming is allowed.."]
    pub status: MavOdidArmStatus,
    #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub error: [u8; 50],
}
impl OPEN_DRONE_ID_ARM_STATUS_DATA {
    pub const ENCODED_LEN: usize = 51usize;
    pub const DEFAULT: Self = Self {
        status: MavOdidArmStatus::DEFAULT,
        error: [0_u8; 50usize],
    };
}
impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 12918u32;
    const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
    const EXTRA_CRC: u8 = 139u8;
    const ENCODED_LEN: usize = 51usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u8();
        __struct.status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidArmStatus",
            value: tmp as u32,
        })?;
        for v in &mut __struct.error {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.status as u8);
        for val in &self.error {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 85"]
#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct POSITION_TARGET_LOCAL_NED_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X Position in NED frame."]
    pub x: f32,
    #[doc = "Y Position in NED frame."]
    pub y: f32,
    #[doc = "Z Position in NED frame (note, altitude is negative in NED)."]
    pub z: f32,
    #[doc = "X velocity in NED frame."]
    pub vx: f32,
    #[doc = "Y velocity in NED frame."]
    pub vy: f32,
    #[doc = "Z velocity in NED frame."]
    pub vz: f32,
    #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afx: f32,
    #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afy: f32,
    #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afz: f32,
    #[doc = "yaw setpoint."]
    pub yaw: f32,
    #[doc = "yaw rate setpoint."]
    pub yaw_rate: f32,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: PositionTargetTypemask,
    #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9."]
    pub coordinate_frame: MavFrame,
}
impl POSITION_TARGET_LOCAL_NED_DATA {
    pub const ENCODED_LEN: usize = 51usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        afx: 0.0_f32,
        afy: 0.0_f32,
        afz: 0.0_f32,
        yaw: 0.0_f32,
        yaw_rate: 0.0_f32,
        type_mask: PositionTargetTypemask::DEFAULT,
        coordinate_frame: MavFrame::DEFAULT,
    };
}
impl Default for POSITION_TARGET_LOCAL_NED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
    type Message = MavMessage;
    const ID: u32 = 85u32;
    const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
    const EXTRA_CRC: u8 = 140u8;
    const ENCODED_LEN: usize = 51usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.afx = buf.get_f32_le();
        __struct.afy = buf.get_f32_le();
        __struct.afz = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.type_mask = PositionTargetTypemask::from_bits(
            tmp & PositionTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "PositionTargetTypemask",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.coordinate_frame =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavFrame",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.afx);
        __tmp.put_f32_le(self.afy);
        __tmp.put_f32_le(self.afz);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u16_le(self.type_mask.bits());
        __tmp.put_u8(self.coordinate_frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 134"]
#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: https://mavlink.io/en/services/terrain.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TERRAIN_DATA_DATA {
    #[doc = "Latitude of SW corner of first grid."]
    pub lat: i32,
    #[doc = "Longitude of SW corner of first grid."]
    pub lon: i32,
    #[doc = "Grid spacing."]
    pub grid_spacing: u16,
    #[doc = "Terrain data MSL."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [i16; 16],
    #[doc = "bit within the terrain request mask."]
    pub gridbit: u8,
}
impl TERRAIN_DATA_DATA {
    pub const ENCODED_LEN: usize = 43usize;
    pub const DEFAULT: Self = Self {
        lat: 0_i32,
        lon: 0_i32,
        grid_spacing: 0_u16,
        data: [0_i16; 16usize],
        gridbit: 0_u8,
    };
}
impl Default for TERRAIN_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TERRAIN_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 134u32;
    const NAME: &'static str = "TERRAIN_DATA";
    const EXTRA_CRC: u8 = 229u8;
    const ENCODED_LEN: usize = 43usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.grid_spacing = buf.get_u16_le();
        for v in &mut __struct.data {
            let val = buf.get_i16_le();
            *v = val;
        }
        __struct.gridbit = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_u16_le(self.grid_spacing);
        for val in &self.data {
            __tmp.put_i16_le(*val);
        }
        __tmp.put_u8(self.gridbit);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 133"]
#[doc = "Request for terrain data and terrain status. See terrain protocol docs: https://mavlink.io/en/services/terrain.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TERRAIN_REQUEST_DATA {
    #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)."]
    pub mask: u64,
    #[doc = "Latitude of SW corner of first grid."]
    pub lat: i32,
    #[doc = "Longitude of SW corner of first grid."]
    pub lon: i32,
    #[doc = "Grid spacing."]
    pub grid_spacing: u16,
}
impl TERRAIN_REQUEST_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        mask: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        grid_spacing: 0_u16,
    };
}
impl Default for TERRAIN_REQUEST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TERRAIN_REQUEST_DATA {
    type Message = MavMessage;
    const ID: u32 = 133u32;
    const NAME: &'static str = "TERRAIN_REQUEST";
    const EXTRA_CRC: u8 = 6u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.mask = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.grid_spacing = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.mask);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_u16_le(self.grid_spacing);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 230"]
#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ESTIMATOR_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Velocity innovation test ratio."]
    pub vel_ratio: f32,
    #[doc = "Horizontal position innovation test ratio."]
    pub pos_horiz_ratio: f32,
    #[doc = "Vertical position innovation test ratio."]
    pub pos_vert_ratio: f32,
    #[doc = "Magnetometer innovation test ratio."]
    pub mag_ratio: f32,
    #[doc = "Height above terrain innovation test ratio."]
    pub hagl_ratio: f32,
    #[doc = "True airspeed innovation test ratio."]
    pub tas_ratio: f32,
    #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin."]
    pub pos_horiz_accuracy: f32,
    #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin."]
    pub pos_vert_accuracy: f32,
    #[doc = "Bitmap indicating which EKF outputs are valid.."]
    pub flags: EstimatorStatusFlags,
}
impl ESTIMATOR_STATUS_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        vel_ratio: 0.0_f32,
        pos_horiz_ratio: 0.0_f32,
        pos_vert_ratio: 0.0_f32,
        mag_ratio: 0.0_f32,
        hagl_ratio: 0.0_f32,
        tas_ratio: 0.0_f32,
        pos_horiz_accuracy: 0.0_f32,
        pos_vert_accuracy: 0.0_f32,
        flags: EstimatorStatusFlags::DEFAULT,
    };
}
impl Default for ESTIMATOR_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ESTIMATOR_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 230u32;
    const NAME: &'static str = "ESTIMATOR_STATUS";
    const EXTRA_CRC: u8 = 163u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.vel_ratio = buf.get_f32_le();
        __struct.pos_horiz_ratio = buf.get_f32_le();
        __struct.pos_vert_ratio = buf.get_f32_le();
        __struct.mag_ratio = buf.get_f32_le();
        __struct.hagl_ratio = buf.get_f32_le();
        __struct.tas_ratio = buf.get_f32_le();
        __struct.pos_horiz_accuracy = buf.get_f32_le();
        __struct.pos_vert_accuracy = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "EstimatorStatusFlags",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.vel_ratio);
        __tmp.put_f32_le(self.pos_horiz_ratio);
        __tmp.put_f32_le(self.pos_vert_ratio);
        __tmp.put_f32_le(self.mag_ratio);
        __tmp.put_f32_le(self.hagl_ratio);
        __tmp.put_f32_le(self.tas_ratio);
        __tmp.put_f32_le(self.pos_horiz_accuracy);
        __tmp.put_f32_le(self.pos_vert_accuracy);
        __tmp.put_u16_le(self.flags.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 32"]
#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOCAL_POSITION_NED_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X Position."]
    pub x: f32,
    #[doc = "Y Position."]
    pub y: f32,
    #[doc = "Z Position."]
    pub z: f32,
    #[doc = "X Speed."]
    pub vx: f32,
    #[doc = "Y Speed."]
    pub vy: f32,
    #[doc = "Z Speed."]
    pub vz: f32,
}
impl LOCAL_POSITION_NED_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
    };
}
impl Default for LOCAL_POSITION_NED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOCAL_POSITION_NED_DATA {
    type Message = MavMessage;
    const ID: u32 = 32u32;
    const NAME: &'static str = "LOCAL_POSITION_NED";
    const EXTRA_CRC: u8 = 185u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 33"]
#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It                is designed as scaled integer message since the resolution of float is not sufficient.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GLOBAL_POSITION_INT_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Latitude, expressed."]
    pub lat: i32,
    #[doc = "Longitude, expressed."]
    pub lon: i32,
    #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL.."]
    pub alt: i32,
    #[doc = "Altitude above ground."]
    pub relative_alt: i32,
    #[doc = "Ground X Speed (Latitude, positive north)."]
    pub vx: i16,
    #[doc = "Ground Y Speed (Longitude, positive east)."]
    pub vy: i16,
    #[doc = "Ground Z Speed (Altitude, positive down)."]
    pub vz: i16,
    #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX."]
    pub hdg: u16,
}
impl GLOBAL_POSITION_INT_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        relative_alt: 0_i32,
        vx: 0_i16,
        vy: 0_i16,
        vz: 0_i16,
        hdg: 0_u16,
    };
}
impl Default for GLOBAL_POSITION_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GLOBAL_POSITION_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 33u32;
    const NAME: &'static str = "GLOBAL_POSITION_INT";
    const EXTRA_CRC: u8 = 104u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.relative_alt = buf.get_i32_le();
        __struct.vx = buf.get_i16_le();
        __struct.vy = buf.get_i16_le();
        __struct.vz = buf.get_i16_le();
        __struct.hdg = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i32_le(self.relative_alt);
        __tmp.put_i16_le(self.vx);
        __tmp.put_i16_le(self.vy);
        __tmp.put_i16_le(self.vz);
        __tmp.put_u16_le(self.hdg);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 245"]
#[doc = "Provides state for additional features."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EXTENDED_SYS_STATE_DATA {
    #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.."]
    pub vtol_state: MavVtolState,
    #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.."]
    pub landed_state: MavLandedState,
}
impl EXTENDED_SYS_STATE_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self {
        vtol_state: MavVtolState::DEFAULT,
        landed_state: MavLandedState::DEFAULT,
    };
}
impl Default for EXTENDED_SYS_STATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for EXTENDED_SYS_STATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 245u32;
    const NAME: &'static str = "EXTENDED_SYS_STATE";
    const EXTRA_CRC: u8 = 130u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u8();
        __struct.vtol_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavVtolState",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.landed_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavLandedState",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.vtol_state as u8);
        __tmp.put_u8(self.landed_state as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 244"]
#[doc = "The interval between messages for a particular MAVLink message ID.         This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MESSAGE_INTERVAL_DATA {
    #[doc = "The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, &gt; 0 indicates the interval at which it is sent.."]
    pub interval_us: i32,
    #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages.."]
    pub message_id: u16,
}
impl MESSAGE_INTERVAL_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        interval_us: 0_i32,
        message_id: 0_u16,
    };
}
impl Default for MESSAGE_INTERVAL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MESSAGE_INTERVAL_DATA {
    type Message = MavMessage;
    const ID: u32 = 244u32;
    const NAME: &'static str = "MESSAGE_INTERVAL";
    const EXTRA_CRC: u8 = 95u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.interval_us = buf.get_i32_le();
        __struct.message_id = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.interval_us);
        __tmp.put_u16_le(self.message_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 43"]
#[doc = "Request the overall list of mission items from the system/component.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_REQUEST_LIST_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_REQUEST_LIST_DATA {
    pub const ENCODED_LEN: usize = 3usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_REQUEST_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_REQUEST_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 43u32;
    const NAME: &'static str = "MISSION_REQUEST_LIST";
    const EXTRA_CRC: u8 = 132u8;
    const ENCODED_LEN: usize = 3usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 74"]
#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VFR_HUD_DATA {
    #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed.."]
    pub airspeed: f32,
    #[doc = "Current ground speed.."]
    pub groundspeed: f32,
    #[doc = "Current altitude (MSL).."]
    pub alt: f32,
    #[doc = "Current climb rate.."]
    pub climb: f32,
    #[doc = "Current heading in compass units (0-360, 0=north).."]
    pub heading: i16,
    #[doc = "Current throttle setting (0 to 100).."]
    pub throttle: u16,
}
impl VFR_HUD_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        airspeed: 0.0_f32,
        groundspeed: 0.0_f32,
        alt: 0.0_f32,
        climb: 0.0_f32,
        heading: 0_i16,
        throttle: 0_u16,
    };
}
impl Default for VFR_HUD_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VFR_HUD_DATA {
    type Message = MavMessage;
    const ID: u32 = 74u32;
    const NAME: &'static str = "VFR_HUD";
    const EXTRA_CRC: u8 = 20u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.airspeed = buf.get_f32_le();
        __struct.groundspeed = buf.get_f32_le();
        __struct.alt = buf.get_f32_le();
        __struct.climb = buf.get_f32_le();
        __struct.heading = buf.get_i16_le();
        __struct.throttle = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.airspeed);
        __tmp.put_f32_le(self.groundspeed);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.climb);
        __tmp.put_i16_le(self.heading);
        __tmp.put_u16_le(self.throttle);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 388"]
#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAN_FILTER_MODIFY_DATA {
    #[doc = "filter IDs, length num_ids."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub ids: [u16; 16],
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Component ID.."]
    pub target_component: u8,
    #[doc = "bus number."]
    pub bus: u8,
    #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum.."]
    pub operation: CanFilterOp,
    #[doc = "number of IDs in filter list."]
    pub num_ids: u8,
}
impl CAN_FILTER_MODIFY_DATA {
    pub const ENCODED_LEN: usize = 37usize;
    pub const DEFAULT: Self = Self {
        ids: [0_u16; 16usize],
        target_system: 0_u8,
        target_component: 0_u8,
        bus: 0_u8,
        operation: CanFilterOp::DEFAULT,
        num_ids: 0_u8,
    };
}
impl Default for CAN_FILTER_MODIFY_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAN_FILTER_MODIFY_DATA {
    type Message = MavMessage;
    const ID: u32 = 388u32;
    const NAME: &'static str = "CAN_FILTER_MODIFY";
    const EXTRA_CRC: u8 = 8u8;
    const ENCODED_LEN: usize = 37usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        for v in &mut __struct.ids {
            let val = buf.get_u16_le();
            *v = val;
        }
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.bus = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.operation = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CanFilterOp",
            value: tmp as u32,
        })?;
        __struct.num_ids = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        for val in &self.ids {
            __tmp.put_u16_le(*val);
        }
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.bus);
        __tmp.put_u8(self.operation as u8);
        __tmp.put_u8(self.num_ids);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 122"]
#[doc = "Stop log transfer and resume normal logging."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_REQUEST_END_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl LOG_REQUEST_END_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for LOG_REQUEST_END_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_REQUEST_END_DATA {
    type Message = MavMessage;
    const ID: u32 = 122u32;
    const NAME: &'static str = "LOG_REQUEST_END";
    const EXTRA_CRC: u8 = 203u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 121"]
#[doc = "Erase all logs."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_ERASE_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl LOG_ERASE_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for LOG_ERASE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_ERASE_DATA {
    type Message = MavMessage;
    const ID: u32 = 121u32;
    const NAME: &'static str = "LOG_ERASE";
    const EXTRA_CRC: u8 = 237u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 63"]
#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It  is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GLOBAL_POSITION_INT_COV_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Altitude in meters above MSL."]
    pub alt: i32,
    #[doc = "Altitude above ground."]
    pub relative_alt: i32,
    #[doc = "Ground X Speed (Latitude)."]
    pub vx: f32,
    #[doc = "Ground Y Speed (Longitude)."]
    pub vy: f32,
    #[doc = "Ground Z Speed (Altitude)."]
    pub vz: f32,
    #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 36],
    #[doc = "Class id of the estimator this estimate originated from.."]
    pub estimator_type: MavEstimatorType,
}
impl GLOBAL_POSITION_INT_COV_DATA {
    pub const ENCODED_LEN: usize = 181usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        relative_alt: 0_i32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        covariance: [0.0_f32; 36usize],
        estimator_type: MavEstimatorType::DEFAULT,
    };
}
impl Default for GLOBAL_POSITION_INT_COV_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
    type Message = MavMessage;
    const ID: u32 = 63u32;
    const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
    const EXTRA_CRC: u8 = 119u8;
    const ENCODED_LEN: usize = 181usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.relative_alt = buf.get_i32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.estimator_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavEstimatorType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i32_le(self.relative_alt);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.estimator_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 250"]
#[doc = "To debug something using a named 3D vector.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DEBUG_VECT_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "x."]
    pub x: f32,
    #[doc = "y."]
    pub y: f32,
    #[doc = "z."]
    pub z: f32,
    #[doc = "Name."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 10],
}
impl DEBUG_VECT_DATA {
    pub const ENCODED_LEN: usize = 30usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        name: [0_u8; 10usize],
    };
}
impl Default for DEBUG_VECT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DEBUG_VECT_DATA {
    type Message = MavMessage;
    const ID: u32 = 250u32;
    const NAME: &'static str = "DEBUG_VECT";
    const EXTRA_CRC: u8 = 49u8;
    const ENCODED_LEN: usize = 30usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 117"]
#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_REQUEST_LIST_DATA {
    #[doc = "First log id (0 for first available)."]
    pub start: u16,
    #[doc = "Last log id (0xffff for last available)."]
    pub end: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl LOG_REQUEST_LIST_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        start: 0_u16,
        end: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for LOG_REQUEST_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_REQUEST_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 117u32;
    const NAME: &'static str = "LOG_REQUEST_LIST";
    const EXTRA_CRC: u8 = 128u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.start = buf.get_u16_le();
        __struct.end = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.start);
        __tmp.put_u16_le(self.end);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 102"]
#[doc = "Local position/attitude estimate from a vision source.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VISION_POSITION_ESTIMATE_DATA {
    #[doc = "Timestamp (UNIX time or time since system boot)."]
    pub usec: u64,
    #[doc = "Local X position."]
    pub x: f32,
    #[doc = "Local Y position."]
    pub y: f32,
    #[doc = "Local Z position."]
    pub z: f32,
    #[doc = "Roll angle."]
    pub roll: f32,
    #[doc = "Pitch angle."]
    pub pitch: f32,
    #[doc = "Yaw angle."]
    pub yaw: f32,
    #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 21],
    #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub reset_counter: u8,
}
impl VISION_POSITION_ESTIMATE_DATA {
    pub const ENCODED_LEN: usize = 117usize;
    pub const DEFAULT: Self = Self {
        usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        covariance: [0.0_f32; 21usize],
        reset_counter: 0_u8,
    };
}
impl Default for VISION_POSITION_ESTIMATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VISION_POSITION_ESTIMATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 102u32;
    const NAME: &'static str = "VISION_POSITION_ESTIMATE";
    const EXTRA_CRC: u8 = 158u8;
    const ENCODED_LEN: usize = 117usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.reset_counter = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.reset_counter);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 324"]
#[doc = "Response from a PARAM_EXT_SET message.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_EXT_ACK_DATA {
    #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
    #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_value: [u8; 128],
    #[doc = "Parameter type.."]
    pub param_type: MavParamExtType,
    #[doc = "Result code.."]
    pub param_result: ParamAck,
}
impl PARAM_EXT_ACK_DATA {
    pub const ENCODED_LEN: usize = 146usize;
    pub const DEFAULT: Self = Self {
        param_id: [0_u8; 16usize],
        param_value: [0_u8; 128usize],
        param_type: MavParamExtType::DEFAULT,
        param_result: ParamAck::DEFAULT,
    };
}
impl Default for PARAM_EXT_ACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_EXT_ACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 324u32;
    const NAME: &'static str = "PARAM_EXT_ACK";
    const EXTRA_CRC: u8 = 132u8;
    const ENCODED_LEN: usize = 146usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.param_value {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.param_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavParamExtType",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.param_result = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "ParamAck",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        for val in &self.param_value {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.param_type as u8);
        __tmp.put_u8(self.param_result as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 47"]
#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_ACK_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission result.."]
    pub mavtype: MavMissionResult,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_ACK_DATA {
    pub const ENCODED_LEN: usize = 4usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        mavtype: MavMissionResult::DEFAULT,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_ACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_ACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 47u32;
    const NAME: &'static str = "MISSION_ACK";
    const EXTRA_CRC: u8 = 153u8;
    const ENCODED_LEN: usize = 4usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionResult",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 400"]
#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PLAY_TUNE_V2_DATA {
    #[doc = "Tune format."]
    pub format: TuneFormat,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Tune definition as a NULL-terminated string.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub tune: [u8; 248],
}
impl PLAY_TUNE_V2_DATA {
    pub const ENCODED_LEN: usize = 254usize;
    pub const DEFAULT: Self = Self {
        format: TuneFormat::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        tune: [0_u8; 248usize],
    };
}
impl Default for PLAY_TUNE_V2_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PLAY_TUNE_V2_DATA {
    type Message = MavMessage;
    const ID: u32 = 400u32;
    const NAME: &'static str = "PLAY_TUNE_V2";
    const EXTRA_CRC: u8 = 110u8;
    const ENCODED_LEN: usize = 254usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.format = TuneFormat::from_bits(tmp & TuneFormat::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "TuneFormat",
                value: tmp as u32,
            },
        )?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.tune {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.format.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.tune {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 116"]
#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_IMU2_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "X acceleration."]
    pub xacc: i16,
    #[doc = "Y acceleration."]
    pub yacc: i16,
    #[doc = "Z acceleration."]
    pub zacc: i16,
    #[doc = "Angular speed around X axis."]
    pub xgyro: i16,
    #[doc = "Angular speed around Y axis."]
    pub ygyro: i16,
    #[doc = "Angular speed around Z axis."]
    pub zgyro: i16,
    #[doc = "X Magnetic field."]
    pub xmag: i16,
    #[doc = "Y Magnetic field."]
    pub ymag: i16,
    #[doc = "Z Magnetic field."]
    pub zmag: i16,
    #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature: i16,
}
impl SCALED_IMU2_DATA {
    pub const ENCODED_LEN: usize = 24usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
        xgyro: 0_i16,
        ygyro: 0_i16,
        zgyro: 0_i16,
        xmag: 0_i16,
        ymag: 0_i16,
        zmag: 0_i16,
        temperature: 0_i16,
    };
}
impl Default for SCALED_IMU2_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_IMU2_DATA {
    type Message = MavMessage;
    const ID: u32 = 116u32;
    const NAME: &'static str = "SCALED_IMU2";
    const EXTRA_CRC: u8 = 76u8;
    const ENCODED_LEN: usize = 24usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        __struct.xgyro = buf.get_i16_le();
        __struct.ygyro = buf.get_i16_le();
        __struct.zgyro = buf.get_i16_le();
        __struct.xmag = buf.get_i16_le();
        __struct.ymag = buf.get_i16_le();
        __struct.zmag = buf.get_i16_le();
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        __tmp.put_i16_le(self.xgyro);
        __tmp.put_i16_le(self.ygyro);
        __tmp.put_i16_le(self.zgyro);
        __tmp.put_i16_le(self.xmag);
        __tmp.put_i16_le(self.ymag);
        __tmp.put_i16_le(self.zmag);
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 29"]
#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SCALED_PRESSURE_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Absolute pressure."]
    pub press_abs: f32,
    #[doc = "Differential pressure 1."]
    pub press_diff: f32,
    #[doc = "Absolute pressure temperature."]
    pub temperature: i16,
    #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub temperature_press_diff: i16,
}
impl SCALED_PRESSURE_DATA {
    pub const ENCODED_LEN: usize = 16usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        press_abs: 0.0_f32,
        press_diff: 0.0_f32,
        temperature: 0_i16,
        temperature_press_diff: 0_i16,
    };
}
impl Default for SCALED_PRESSURE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SCALED_PRESSURE_DATA {
    type Message = MavMessage;
    const ID: u32 = 29u32;
    const NAME: &'static str = "SCALED_PRESSURE";
    const EXTRA_CRC: u8 = 115u8;
    const ENCODED_LEN: usize = 16usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.press_abs = buf.get_f32_le();
        __struct.press_diff = buf.get_f32_le();
        __struct.temperature = buf.get_i16_le();
        __struct.temperature_press_diff = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.press_abs);
        __tmp.put_f32_le(self.press_diff);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_i16_le(self.temperature_press_diff);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 77"]
#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at https://mavlink.io/en/services/command.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMMAND_ACK_DATA {
    #[doc = "Command ID (of acknowledged command).."]
    pub command: MavCmd,
    #[doc = "Result of command.."]
    pub result: MavResult,
    #[doc = "Also used as result_param1, it can be set with an enum containing the errors reasons of why the command was denied, or the progress percentage when result is MAV_RESULT_IN_PROGRESS (UINT8_MAX if the progress is unknown).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub progress: u8,
    #[doc = "Additional parameter of the result, example: which parameter of MAV_CMD_NAV_WAYPOINT caused it to be denied.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub result_param2: i32,
    #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_system: u8,
    #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub target_component: u8,
}
impl COMMAND_ACK_DATA {
    pub const ENCODED_LEN: usize = 10usize;
    pub const DEFAULT: Self = Self {
        command: MavCmd::DEFAULT,
        result: MavResult::DEFAULT,
        progress: 0_u8,
        result_param2: 0_i32,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for COMMAND_ACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMMAND_ACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 77u32;
    const NAME: &'static str = "COMMAND_ACK";
    const EXTRA_CRC: u8 = 143u8;
    const ENCODED_LEN: usize = 10usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.result = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavResult",
            value: tmp as u32,
        })?;
        __struct.progress = buf.get_u8();
        __struct.result_param2 = buf.get_i32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.result as u8);
        __tmp.put_u8(self.progress);
        __tmp.put_i32_le(self.result_param2);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 42"]
#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running).         This message should be streamed all the time (nominally at 1Hz).         This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or SET_MISSION_CURRENT.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_CURRENT_DATA {
    #[doc = "Sequence."]
    pub seq: u16,
    #[doc = "Total number of mission items. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub total: u16,
    #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_state: MissionState,
    #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub mission_mode: u8,
}
impl MISSION_CURRENT_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        seq: 0_u16,
        total: 0_u16,
        mission_state: MissionState::DEFAULT,
        mission_mode: 0_u8,
    };
}
impl Default for MISSION_CURRENT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_CURRENT_DATA {
    type Message = MavMessage;
    const ID: u32 = 42u32;
    const NAME: &'static str = "MISSION_CURRENT";
    const EXTRA_CRC: u8 = 28u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seq = buf.get_u16_le();
        __struct.total = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.mission_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MissionState",
            value: tmp as u32,
        })?;
        __struct.mission_mode = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u16_le(self.total);
        __tmp.put_u8(self.mission_state as u8);
        __tmp.put_u8(self.mission_mode);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 25"]
#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_STATUS_DATA {
    #[doc = "Number of satellites visible."]
    pub satellites_visible: u8,
    #[doc = "Global satellite ID."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub satellite_prn: [u8; 20],
    #[doc = "0: Satellite not used, 1: used for localization."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub satellite_used: [u8; 20],
    #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub satellite_elevation: [u8; 20],
    #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub satellite_azimuth: [u8; 20],
    #[doc = "Signal to noise ratio of satellite."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub satellite_snr: [u8; 20],
}
impl GPS_STATUS_DATA {
    pub const ENCODED_LEN: usize = 101usize;
    pub const DEFAULT: Self = Self {
        satellites_visible: 0_u8,
        satellite_prn: [0_u8; 20usize],
        satellite_used: [0_u8; 20usize],
        satellite_elevation: [0_u8; 20usize],
        satellite_azimuth: [0_u8; 20usize],
        satellite_snr: [0_u8; 20usize],
    };
}
impl Default for GPS_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 25u32;
    const NAME: &'static str = "GPS_STATUS";
    const EXTRA_CRC: u8 = 23u8;
    const ENCODED_LEN: usize = 101usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.satellites_visible = buf.get_u8();
        for v in &mut __struct.satellite_prn {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.satellite_used {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.satellite_elevation {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.satellite_azimuth {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.satellite_snr {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.satellites_visible);
        for val in &self.satellite_prn {
            __tmp.put_u8(*val);
        }
        for val in &self.satellite_used {
            __tmp.put_u8(*val);
        }
        for val in &self.satellite_elevation {
            __tmp.put_u8(*val);
        }
        for val in &self.satellite_azimuth {
            __tmp.put_u8(*val);
        }
        for val in &self.satellite_snr {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 269"]
#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VIDEO_STREAM_INFORMATION_DATA {
    #[doc = "Frame rate.."]
    pub framerate: f32,
    #[doc = "Bit rate.."]
    pub bitrate: u32,
    #[doc = "Bitmap of stream status flags.."]
    pub flags: VideoStreamStatusFlags,
    #[doc = "Horizontal resolution.."]
    pub resolution_h: u16,
    #[doc = "Vertical resolution.."]
    pub resolution_v: u16,
    #[doc = "Video image rotation clockwise.."]
    pub rotation: u16,
    #[doc = "Horizontal Field of view.."]
    pub hfov: u16,
    #[doc = "Video Stream ID (1 for first, 2 for second, etc.)."]
    pub stream_id: u8,
    #[doc = "Number of streams available.."]
    pub count: u8,
    #[doc = "Type of stream.."]
    pub mavtype: VideoStreamType,
    #[doc = "Stream name.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 32],
    #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uri: [u8; 160],
}
impl VIDEO_STREAM_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 213usize;
    pub const DEFAULT: Self = Self {
        framerate: 0.0_f32,
        bitrate: 0_u32,
        flags: VideoStreamStatusFlags::DEFAULT,
        resolution_h: 0_u16,
        resolution_v: 0_u16,
        rotation: 0_u16,
        hfov: 0_u16,
        stream_id: 0_u8,
        count: 0_u8,
        mavtype: VideoStreamType::DEFAULT,
        name: [0_u8; 32usize],
        uri: [0_u8; 160usize],
    };
}
impl Default for VIDEO_STREAM_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 269u32;
    const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
    const EXTRA_CRC: u8 = 109u8;
    const ENCODED_LEN: usize = 213usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.framerate = buf.get_f32_le();
        __struct.bitrate = buf.get_u32_le();
        let tmp = buf.get_u16_le();
        __struct.flags = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "VideoStreamStatusFlags",
            value: tmp as u32,
        })?;
        __struct.resolution_h = buf.get_u16_le();
        __struct.resolution_v = buf.get_u16_le();
        __struct.rotation = buf.get_u16_le();
        __struct.hfov = buf.get_u16_le();
        __struct.stream_id = buf.get_u8();
        __struct.count = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "VideoStreamType",
            value: tmp as u32,
        })?;
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.uri {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.framerate);
        __tmp.put_u32_le(self.bitrate);
        __tmp.put_u16_le(self.flags as u16);
        __tmp.put_u16_le(self.resolution_h);
        __tmp.put_u16_le(self.resolution_v);
        __tmp.put_u16_le(self.rotation);
        __tmp.put_u16_le(self.hfov);
        __tmp.put_u8(self.stream_id);
        __tmp.put_u8(self.count);
        __tmp.put_u8(self.mavtype as u8);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        for val in &self.uri {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 311"]
#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at http://uavcan.org.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct UAVCAN_NODE_INFO_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Time since the start-up of the node.."]
    pub uptime_sec: u32,
    #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.."]
    pub sw_vcs_commit: u32,
    #[doc = "Node name string. For example, \"sapog.px4.io\".."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 80],
    #[doc = "Hardware major version number.."]
    pub hw_version_major: u8,
    #[doc = "Hardware minor version number.."]
    pub hw_version_minor: u8,
    #[doc = "Hardware unique 128-bit ID.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub hw_unique_id: [u8; 16],
    #[doc = "Software major version number.."]
    pub sw_version_major: u8,
    #[doc = "Software minor version number.."]
    pub sw_version_minor: u8,
}
impl UAVCAN_NODE_INFO_DATA {
    pub const ENCODED_LEN: usize = 116usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        uptime_sec: 0_u32,
        sw_vcs_commit: 0_u32,
        name: [0_u8; 80usize],
        hw_version_major: 0_u8,
        hw_version_minor: 0_u8,
        hw_unique_id: [0_u8; 16usize],
        sw_version_major: 0_u8,
        sw_version_minor: 0_u8,
    };
}
impl Default for UAVCAN_NODE_INFO_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for UAVCAN_NODE_INFO_DATA {
    type Message = MavMessage;
    const ID: u32 = 311u32;
    const NAME: &'static str = "UAVCAN_NODE_INFO";
    const EXTRA_CRC: u8 = 95u8;
    const ENCODED_LEN: usize = 116usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.uptime_sec = buf.get_u32_le();
        __struct.sw_vcs_commit = buf.get_u32_le();
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.hw_version_major = buf.get_u8();
        __struct.hw_version_minor = buf.get_u8();
        for v in &mut __struct.hw_unique_id {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.sw_version_major = buf.get_u8();
        __struct.sw_version_minor = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.uptime_sec);
        __tmp.put_u32_le(self.sw_vcs_commit);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.hw_version_major);
        __tmp.put_u8(self.hw_version_minor);
        for val in &self.hw_unique_id {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.sw_version_major);
        __tmp.put_u8(self.sw_version_minor);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 8"]
#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LINK_NODE_STATUS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub timestamp: u64,
    #[doc = "Transmit rate."]
    pub tx_rate: u32,
    #[doc = "Receive rate."]
    pub rx_rate: u32,
    #[doc = "Messages sent."]
    pub messages_sent: u32,
    #[doc = "Messages received (estimated from counting seq)."]
    pub messages_received: u32,
    #[doc = "Messages lost (estimated from counting seq)."]
    pub messages_lost: u32,
    #[doc = "Number of bytes that could not be parsed correctly.."]
    pub rx_parse_err: u16,
    #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX."]
    pub tx_overflows: u16,
    #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX."]
    pub rx_overflows: u16,
    #[doc = "Remaining free transmit buffer space."]
    pub tx_buf: u8,
    #[doc = "Remaining free receive buffer space."]
    pub rx_buf: u8,
}
impl LINK_NODE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 36usize;
    pub const DEFAULT: Self = Self {
        timestamp: 0_u64,
        tx_rate: 0_u32,
        rx_rate: 0_u32,
        messages_sent: 0_u32,
        messages_received: 0_u32,
        messages_lost: 0_u32,
        rx_parse_err: 0_u16,
        tx_overflows: 0_u16,
        rx_overflows: 0_u16,
        tx_buf: 0_u8,
        rx_buf: 0_u8,
    };
}
impl Default for LINK_NODE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LINK_NODE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 8u32;
    const NAME: &'static str = "LINK_NODE_STATUS";
    const EXTRA_CRC: u8 = 117u8;
    const ENCODED_LEN: usize = 36usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.timestamp = buf.get_u64_le();
        __struct.tx_rate = buf.get_u32_le();
        __struct.rx_rate = buf.get_u32_le();
        __struct.messages_sent = buf.get_u32_le();
        __struct.messages_received = buf.get_u32_le();
        __struct.messages_lost = buf.get_u32_le();
        __struct.rx_parse_err = buf.get_u16_le();
        __struct.tx_overflows = buf.get_u16_le();
        __struct.rx_overflows = buf.get_u16_le();
        __struct.tx_buf = buf.get_u8();
        __struct.rx_buf = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.timestamp);
        __tmp.put_u32_le(self.tx_rate);
        __tmp.put_u32_le(self.rx_rate);
        __tmp.put_u32_le(self.messages_sent);
        __tmp.put_u32_le(self.messages_received);
        __tmp.put_u32_le(self.messages_lost);
        __tmp.put_u16_le(self.rx_parse_err);
        __tmp.put_u16_le(self.tx_overflows);
        __tmp.put_u16_le(self.rx_overflows);
        __tmp.put_u8(self.tx_buf);
        __tmp.put_u8(self.rx_buf);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 410"]
#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EVENT_DATA {
    #[doc = "Event ID (as defined in the component metadata)."]
    pub id: u32,
    #[doc = "Timestamp (time since system boot when the event happened).."]
    pub event_time_boot_ms: u32,
    #[doc = "Sequence number.."]
    pub sequence: u16,
    #[doc = "Component ID."]
    pub destination_component: u8,
    #[doc = "System ID."]
    pub destination_system: u8,
    #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9."]
    pub log_levels: u8,
    #[doc = "Arguments (depend on event ID).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub arguments: [u8; 40],
}
impl EVENT_DATA {
    pub const ENCODED_LEN: usize = 53usize;
    pub const DEFAULT: Self = Self {
        id: 0_u32,
        event_time_boot_ms: 0_u32,
        sequence: 0_u16,
        destination_component: 0_u8,
        destination_system: 0_u8,
        log_levels: 0_u8,
        arguments: [0_u8; 40usize],
    };
}
impl Default for EVENT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for EVENT_DATA {
    type Message = MavMessage;
    const ID: u32 = 410u32;
    const NAME: &'static str = "EVENT";
    const EXTRA_CRC: u8 = 160u8;
    const ENCODED_LEN: usize = 53usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.id = buf.get_u32_le();
        __struct.event_time_boot_ms = buf.get_u32_le();
        __struct.sequence = buf.get_u16_le();
        __struct.destination_component = buf.get_u8();
        __struct.destination_system = buf.get_u8();
        __struct.log_levels = buf.get_u8();
        for v in &mut __struct.arguments {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.id);
        __tmp.put_u32_le(self.event_time_boot_ms);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u8(self.destination_component);
        __tmp.put_u8(self.destination_system);
        __tmp.put_u8(self.log_levels);
        for val in &self.arguments {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 148"]
#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct AUTOPILOT_VERSION_DATA {
    #[doc = "Bitmap of capabilities."]
    pub capabilities: MavProtocolCapability,
    #[doc = "UID if provided by hardware (see uid2)."]
    pub uid: u64,
    #[doc = "Firmware version number."]
    pub flight_sw_version: u32,
    #[doc = "Middleware version number."]
    pub middleware_sw_version: u32,
    #[doc = "Operating system version number."]
    pub os_sw_version: u32,
    #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt."]
    pub board_version: u32,
    #[doc = "ID of the board vendor."]
    pub vendor_id: u16,
    #[doc = "ID of the product."]
    pub product_id: u16,
    #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub flight_custom_version: [u8; 8],
    #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub middleware_custom_version: [u8; 8],
    #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub os_custom_version: [u8; 8],
    #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uid2: [u8; 18],
}
impl AUTOPILOT_VERSION_DATA {
    pub const ENCODED_LEN: usize = 78usize;
    pub const DEFAULT: Self = Self {
        capabilities: MavProtocolCapability::DEFAULT,
        uid: 0_u64,
        flight_sw_version: 0_u32,
        middleware_sw_version: 0_u32,
        os_sw_version: 0_u32,
        board_version: 0_u32,
        vendor_id: 0_u16,
        product_id: 0_u16,
        flight_custom_version: [0_u8; 8usize],
        middleware_custom_version: [0_u8; 8usize],
        os_custom_version: [0_u8; 8usize],
        uid2: [0_u8; 18usize],
    };
}
impl Default for AUTOPILOT_VERSION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for AUTOPILOT_VERSION_DATA {
    type Message = MavMessage;
    const ID: u32 = 148u32;
    const NAME: &'static str = "AUTOPILOT_VERSION";
    const EXTRA_CRC: u8 = 178u8;
    const ENCODED_LEN: usize = 78usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u64_le();
        __struct.capabilities = MavProtocolCapability::from_bits(
            tmp & MavProtocolCapability::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavProtocolCapability",
            value: tmp as u32,
        })?;
        __struct.uid = buf.get_u64_le();
        __struct.flight_sw_version = buf.get_u32_le();
        __struct.middleware_sw_version = buf.get_u32_le();
        __struct.os_sw_version = buf.get_u32_le();
        __struct.board_version = buf.get_u32_le();
        __struct.vendor_id = buf.get_u16_le();
        __struct.product_id = buf.get_u16_le();
        for v in &mut __struct.flight_custom_version {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.middleware_custom_version {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.os_custom_version {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.uid2 {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.capabilities.bits());
        __tmp.put_u64_le(self.uid);
        __tmp.put_u32_le(self.flight_sw_version);
        __tmp.put_u32_le(self.middleware_sw_version);
        __tmp.put_u32_le(self.os_sw_version);
        __tmp.put_u32_le(self.board_version);
        __tmp.put_u16_le(self.vendor_id);
        __tmp.put_u16_le(self.product_id);
        for val in &self.flight_custom_version {
            __tmp.put_u8(*val);
        }
        for val in &self.middleware_custom_version {
            __tmp.put_u8(*val);
        }
        for val in &self.os_custom_version {
            __tmp.put_u8(*val);
        }
        for val in &self.uid2 {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 108"]
#[doc = "Status of simulation environment, if used."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SIM_STATE_DATA {
    #[doc = "True attitude quaternion component 1, w (1 in null-rotation)."]
    pub q1: f32,
    #[doc = "True attitude quaternion component 2, x (0 in null-rotation)."]
    pub q2: f32,
    #[doc = "True attitude quaternion component 3, y (0 in null-rotation)."]
    pub q3: f32,
    #[doc = "True attitude quaternion component 4, z (0 in null-rotation)."]
    pub q4: f32,
    #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs."]
    pub roll: f32,
    #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs."]
    pub pitch: f32,
    #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs."]
    pub yaw: f32,
    #[doc = "X acceleration."]
    pub xacc: f32,
    #[doc = "Y acceleration."]
    pub yacc: f32,
    #[doc = "Z acceleration."]
    pub zacc: f32,
    #[doc = "Angular speed around X axis."]
    pub xgyro: f32,
    #[doc = "Angular speed around Y axis."]
    pub ygyro: f32,
    #[doc = "Angular speed around Z axis."]
    pub zgyro: f32,
    #[doc = "Latitude (lower precision). Both this and the lat_int field should be set.."]
    pub lat: f32,
    #[doc = "Longitude (lower precision). Both this and the lon_int field should be set.."]
    pub lon: f32,
    #[doc = "Altitude."]
    pub alt: f32,
    #[doc = "Horizontal position standard deviation."]
    pub std_dev_horz: f32,
    #[doc = "Vertical position standard deviation."]
    pub std_dev_vert: f32,
    #[doc = "True velocity in north direction in earth-fixed NED frame."]
    pub vn: f32,
    #[doc = "True velocity in east direction in earth-fixed NED frame."]
    pub ve: f32,
    #[doc = "True velocity in down direction in earth-fixed NED frame."]
    pub vd: f32,
    #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub lat_int: i32,
    #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub lon_int: i32,
}
impl SIM_STATE_DATA {
    pub const ENCODED_LEN: usize = 92usize;
    pub const DEFAULT: Self = Self {
        q1: 0.0_f32,
        q2: 0.0_f32,
        q3: 0.0_f32,
        q4: 0.0_f32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        xacc: 0.0_f32,
        yacc: 0.0_f32,
        zacc: 0.0_f32,
        xgyro: 0.0_f32,
        ygyro: 0.0_f32,
        zgyro: 0.0_f32,
        lat: 0.0_f32,
        lon: 0.0_f32,
        alt: 0.0_f32,
        std_dev_horz: 0.0_f32,
        std_dev_vert: 0.0_f32,
        vn: 0.0_f32,
        ve: 0.0_f32,
        vd: 0.0_f32,
        lat_int: 0_i32,
        lon_int: 0_i32,
    };
}
impl Default for SIM_STATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SIM_STATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 108u32;
    const NAME: &'static str = "SIM_STATE";
    const EXTRA_CRC: u8 = 32u8;
    const ENCODED_LEN: usize = 92usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.q1 = buf.get_f32_le();
        __struct.q2 = buf.get_f32_le();
        __struct.q3 = buf.get_f32_le();
        __struct.q4 = buf.get_f32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.xacc = buf.get_f32_le();
        __struct.yacc = buf.get_f32_le();
        __struct.zacc = buf.get_f32_le();
        __struct.xgyro = buf.get_f32_le();
        __struct.ygyro = buf.get_f32_le();
        __struct.zgyro = buf.get_f32_le();
        __struct.lat = buf.get_f32_le();
        __struct.lon = buf.get_f32_le();
        __struct.alt = buf.get_f32_le();
        __struct.std_dev_horz = buf.get_f32_le();
        __struct.std_dev_vert = buf.get_f32_le();
        __struct.vn = buf.get_f32_le();
        __struct.ve = buf.get_f32_le();
        __struct.vd = buf.get_f32_le();
        __struct.lat_int = buf.get_i32_le();
        __struct.lon_int = buf.get_i32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.q1);
        __tmp.put_f32_le(self.q2);
        __tmp.put_f32_le(self.q3);
        __tmp.put_f32_le(self.q4);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.xacc);
        __tmp.put_f32_le(self.yacc);
        __tmp.put_f32_le(self.zacc);
        __tmp.put_f32_le(self.xgyro);
        __tmp.put_f32_le(self.ygyro);
        __tmp.put_f32_le(self.zgyro);
        __tmp.put_f32_le(self.lat);
        __tmp.put_f32_le(self.lon);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.std_dev_horz);
        __tmp.put_f32_le(self.std_dev_vert);
        __tmp.put_f32_le(self.vn);
        __tmp.put_f32_le(self.ve);
        __tmp.put_f32_le(self.vd);
        __tmp.put_i32_le(self.lat_int);
        __tmp.put_i32_le(self.lon_int);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 257"]
#[doc = "Report button state change.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct BUTTON_CHANGE_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Time of last change of button state.."]
    pub last_change_ms: u32,
    #[doc = "Bitmap for state of buttons.."]
    pub state: u8,
}
impl BUTTON_CHANGE_DATA {
    pub const ENCODED_LEN: usize = 9usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        last_change_ms: 0_u32,
        state: 0_u8,
    };
}
impl Default for BUTTON_CHANGE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for BUTTON_CHANGE_DATA {
    type Message = MavMessage;
    const ID: u32 = 257u32;
    const NAME: &'static str = "BUTTON_CHANGE";
    const EXTRA_CRC: u8 = 131u8;
    const ENCODED_LEN: usize = 9usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.last_change_ms = buf.get_u32_le();
        __struct.state = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.last_change_ms);
        __tmp.put_u8(self.state);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 115"]
#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_STATE_QUATERNION_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub attitude_quaternion: [f32; 4],
    #[doc = "Body frame roll / phi angular speed."]
    pub rollspeed: f32,
    #[doc = "Body frame pitch / theta angular speed."]
    pub pitchspeed: f32,
    #[doc = "Body frame yaw / psi angular speed."]
    pub yawspeed: f32,
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Altitude."]
    pub alt: i32,
    #[doc = "Ground X Speed (Latitude)."]
    pub vx: i16,
    #[doc = "Ground Y Speed (Longitude)."]
    pub vy: i16,
    #[doc = "Ground Z Speed (Altitude)."]
    pub vz: i16,
    #[doc = "Indicated airspeed."]
    pub ind_airspeed: u16,
    #[doc = "True airspeed."]
    pub true_airspeed: u16,
    #[doc = "X acceleration."]
    pub xacc: i16,
    #[doc = "Y acceleration."]
    pub yacc: i16,
    #[doc = "Z acceleration."]
    pub zacc: i16,
}
impl HIL_STATE_QUATERNION_DATA {
    pub const ENCODED_LEN: usize = 64usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        attitude_quaternion: [0.0_f32; 4usize],
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        vx: 0_i16,
        vy: 0_i16,
        vz: 0_i16,
        ind_airspeed: 0_u16,
        true_airspeed: 0_u16,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
    };
}
impl Default for HIL_STATE_QUATERNION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_STATE_QUATERNION_DATA {
    type Message = MavMessage;
    const ID: u32 = 115u32;
    const NAME: &'static str = "HIL_STATE_QUATERNION";
    const EXTRA_CRC: u8 = 4u8;
    const ENCODED_LEN: usize = 64usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.attitude_quaternion {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.vx = buf.get_i16_le();
        __struct.vy = buf.get_i16_le();
        __struct.vz = buf.get_i16_le();
        __struct.ind_airspeed = buf.get_u16_le();
        __struct.true_airspeed = buf.get_u16_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.attitude_quaternion {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i16_le(self.vx);
        __tmp.put_i16_le(self.vy);
        __tmp.put_i16_le(self.vz);
        __tmp.put_u16_le(self.ind_airspeed);
        __tmp.put_u16_le(self.true_airspeed);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12905"]
#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Indicates the type of the operator_id field.."]
    pub operator_id_type: MavOdidOperatorIdType,
    #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub operator_id: [u8; 20],
}
impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
    pub const ENCODED_LEN: usize = 43usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        operator_id_type: MavOdidOperatorIdType::DEFAULT,
        operator_id: [0_u8; 20usize],
    };
}
impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
    type Message = MavMessage;
    const ID: u32 = 12905u32;
    const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
    const EXTRA_CRC: u8 = 49u8;
    const ENCODED_LEN: usize = 43usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.operator_id_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidOperatorIdType",
                value: tmp as u32,
            })?;
        for v in &mut __struct.operator_id {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.operator_id_type as u8);
        for val in &self.operator_id {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 75"]
#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG when sending positional data in params 5 and 6, as it allows for greater precision when sending latitudes/longitudes. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at https://mavlink.io/en/services/command.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMMAND_INT_DATA {
    #[doc = "PARAM1, see MAV_CMD enum."]
    pub param1: f32,
    #[doc = "PARAM2, see MAV_CMD enum."]
    pub param2: f32,
    #[doc = "PARAM3, see MAV_CMD enum."]
    pub param3: f32,
    #[doc = "PARAM4, see MAV_CMD enum."]
    pub param4: f32,
    #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7."]
    pub x: i32,
    #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7."]
    pub y: i32,
    #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).."]
    pub z: f32,
    #[doc = "The scheduled action for the mission item.."]
    pub command: MavCmd,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "The coordinate system of the COMMAND.."]
    pub frame: MavFrame,
    #[doc = "Not used.."]
    pub current: u8,
    #[doc = "Not used (set 0).."]
    pub autocontinue: u8,
}
impl COMMAND_INT_DATA {
    pub const ENCODED_LEN: usize = 35usize;
    pub const DEFAULT: Self = Self {
        param1: 0.0_f32,
        param2: 0.0_f32,
        param3: 0.0_f32,
        param4: 0.0_f32,
        x: 0_i32,
        y: 0_i32,
        z: 0.0_f32,
        command: MavCmd::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        frame: MavFrame::DEFAULT,
        current: 0_u8,
        autocontinue: 0_u8,
    };
}
impl Default for COMMAND_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMMAND_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 75u32;
    const NAME: &'static str = "COMMAND_INT";
    const EXTRA_CRC: u8 = 158u8;
    const ENCODED_LEN: usize = 35usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param1 = buf.get_f32_le();
        __struct.param2 = buf.get_f32_le();
        __struct.param3 = buf.get_f32_le();
        __struct.param4 = buf.get_f32_le();
        __struct.x = buf.get_i32_le();
        __struct.y = buf.get_i32_le();
        __struct.z = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        __struct.current = buf.get_u8();
        __struct.autocontinue = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param1);
        __tmp.put_f32_le(self.param2);
        __tmp.put_f32_le(self.param3);
        __tmp.put_f32_le(self.param4);
        __tmp.put_i32_le(self.x);
        __tmp.put_i32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.frame as u8);
        __tmp.put_u8(self.current);
        __tmp.put_u8(self.autocontinue);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50004"]
#[doc = "Start firmware update with encapsulated data.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
    #[doc = "FW Size.."]
    pub size: u32,
    #[doc = "FW CRC.."]
    pub crc: u32,
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Component ID.."]
    pub target_component: u8,
}
impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
    pub const ENCODED_LEN: usize = 10usize;
    pub const DEFAULT: Self = Self {
        size: 0_u32,
        crc: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
    type Message = MavMessage;
    const ID: u32 = 50004u32;
    const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
    const EXTRA_CRC: u8 = 240u8;
    const ENCODED_LEN: usize = 10usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.size = buf.get_u32_le();
        __struct.crc = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.size);
        __tmp.put_u32_le(self.crc);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 131"]
#[doc = "Data packet for images sent using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ENCAPSULATED_DATA_DATA {
    #[doc = "sequence number (starting with 0 on every transmission)."]
    pub seqnr: u16,
    #[doc = "image data bytes."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 253],
}
impl ENCAPSULATED_DATA_DATA {
    pub const ENCODED_LEN: usize = 255usize;
    pub const DEFAULT: Self = Self {
        seqnr: 0_u16,
        data: [0_u8; 253usize],
    };
}
impl Default for ENCAPSULATED_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ENCAPSULATED_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 131u32;
    const NAME: &'static str = "ENCAPSULATED_DATA";
    const EXTRA_CRC: u8 = 223u8;
    const ENCODED_LEN: usize = 255usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seqnr = buf.get_u16_le();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seqnr);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 265"]
#[doc = "Orientation of a mount."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MOUNT_ORIENTATION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Roll in global frame (set to NaN for invalid).."]
    pub roll: f32,
    #[doc = "Pitch in global frame (set to NaN for invalid).."]
    pub pitch: f32,
    #[doc = "Yaw relative to vehicle (set to NaN for invalid).."]
    pub yaw: f32,
    #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub yaw_absolute: f32,
}
impl MOUNT_ORIENTATION_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        yaw_absolute: 0.0_f32,
    };
}
impl Default for MOUNT_ORIENTATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MOUNT_ORIENTATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 265u32;
    const NAME: &'static str = "MOUNT_ORIENTATION";
    const EXTRA_CRC: u8 = 26u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.yaw_absolute = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.yaw_absolute);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 282"]
#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
    #[doc = "High level gimbal manager flags to use.."]
    pub flags: GimbalManagerFlags,
    #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored.."]
    pub angular_velocity_x: f32,
    #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored.."]
    pub angular_velocity_y: f32,
    #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored.."]
    pub angular_velocity_z: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).."]
    pub gimbal_device_id: u8,
}
impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
    pub const ENCODED_LEN: usize = 35usize;
    pub const DEFAULT: Self = Self {
        flags: GimbalManagerFlags::DEFAULT,
        q: [0.0_f32; 4usize],
        angular_velocity_x: 0.0_f32,
        angular_velocity_y: 0.0_f32,
        angular_velocity_z: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        gimbal_device_id: 0_u8,
    };
}
impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
    type Message = MavMessage;
    const ID: u32 = 282u32;
    const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
    const EXTRA_CRC: u8 = 123u8;
    const ENCODED_LEN: usize = 35usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.flags = FromPrimitive::from_u32(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GimbalManagerFlags",
            value: tmp as u32,
        })?;
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.angular_velocity_x = buf.get_f32_le();
        __struct.angular_velocity_y = buf.get_f32_le();
        __struct.angular_velocity_z = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.gimbal_device_id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.flags as u32);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.angular_velocity_x);
        __tmp.put_f32_le(self.angular_velocity_y);
        __tmp.put_f32_le(self.angular_velocity_z);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.gimbal_device_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 106"]
#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPTICAL_FLOW_RAD_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.."]
    pub integration_time_us: u32,
    #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)."]
    pub integrated_x: f32,
    #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)."]
    pub integrated_y: f32,
    #[doc = "RH rotation around X axis."]
    pub integrated_xgyro: f32,
    #[doc = "RH rotation around Y axis."]
    pub integrated_ygyro: f32,
    #[doc = "RH rotation around Z axis."]
    pub integrated_zgyro: f32,
    #[doc = "Time since the distance was sampled.."]
    pub time_delta_distance_us: u32,
    #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance.."]
    pub distance: f32,
    #[doc = "Temperature."]
    pub temperature: i16,
    #[doc = "Sensor ID."]
    pub sensor_id: u8,
    #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality."]
    pub quality: u8,
}
impl OPTICAL_FLOW_RAD_DATA {
    pub const ENCODED_LEN: usize = 44usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        integration_time_us: 0_u32,
        integrated_x: 0.0_f32,
        integrated_y: 0.0_f32,
        integrated_xgyro: 0.0_f32,
        integrated_ygyro: 0.0_f32,
        integrated_zgyro: 0.0_f32,
        time_delta_distance_us: 0_u32,
        distance: 0.0_f32,
        temperature: 0_i16,
        sensor_id: 0_u8,
        quality: 0_u8,
    };
}
impl Default for OPTICAL_FLOW_RAD_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPTICAL_FLOW_RAD_DATA {
    type Message = MavMessage;
    const ID: u32 = 106u32;
    const NAME: &'static str = "OPTICAL_FLOW_RAD";
    const EXTRA_CRC: u8 = 138u8;
    const ENCODED_LEN: usize = 44usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.integration_time_us = buf.get_u32_le();
        __struct.integrated_x = buf.get_f32_le();
        __struct.integrated_y = buf.get_f32_le();
        __struct.integrated_xgyro = buf.get_f32_le();
        __struct.integrated_ygyro = buf.get_f32_le();
        __struct.integrated_zgyro = buf.get_f32_le();
        __struct.time_delta_distance_us = buf.get_u32_le();
        __struct.distance = buf.get_f32_le();
        __struct.temperature = buf.get_i16_le();
        __struct.sensor_id = buf.get_u8();
        __struct.quality = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.integration_time_us);
        __tmp.put_f32_le(self.integrated_x);
        __tmp.put_f32_le(self.integrated_y);
        __tmp.put_f32_le(self.integrated_xgyro);
        __tmp.put_f32_le(self.integrated_ygyro);
        __tmp.put_f32_le(self.integrated_zgyro);
        __tmp.put_u32_le(self.time_delta_distance_us);
        __tmp.put_f32_le(self.distance);
        __tmp.put_i16_le(self.temperature);
        __tmp.put_u8(self.sensor_id);
        __tmp.put_u8(self.quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 256"]
#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SETUP_SIGNING_DATA {
    #[doc = "initial timestamp."]
    pub initial_timestamp: u64,
    #[doc = "system id of the target."]
    pub target_system: u8,
    #[doc = "component ID of the target."]
    pub target_component: u8,
    #[doc = "signing key."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub secret_key: [u8; 32],
}
impl SETUP_SIGNING_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        initial_timestamp: 0_u64,
        target_system: 0_u8,
        target_component: 0_u8,
        secret_key: [0_u8; 32usize],
    };
}
impl Default for SETUP_SIGNING_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SETUP_SIGNING_DATA {
    type Message = MavMessage;
    const ID: u32 = 256u32;
    const NAME: &'static str = "SETUP_SIGNING";
    const EXTRA_CRC: u8 = 71u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.initial_timestamp = buf.get_u64_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.secret_key {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.initial_timestamp);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.secret_key {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 147"]
#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send SMART_BATTERY_INFO.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct BATTERY_STATUS_DATA {
    #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate."]
    pub current_consumed: i32,
    #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate."]
    pub energy_consumed: i32,
    #[doc = "Temperature of the battery. INT16_MAX for unknown temperature.."]
    pub temperature: i16,
    #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub voltages: [u16; 10],
    #[doc = "Battery current, -1: autopilot does not measure the current."]
    pub current_battery: i16,
    #[doc = "Battery ID."]
    pub id: u8,
    #[doc = "Function of the battery."]
    pub battery_function: MavBatteryFunction,
    #[doc = "Type (chemistry) of the battery."]
    pub mavtype: MavBatteryType,
    #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.."]
    pub battery_remaining: i8,
    #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub time_remaining: i32,
    #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub charge_state: MavBatteryChargeState,
    #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub voltages_ext: [u16; 4],
    #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mode: MavBatteryMode,
    #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported).."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub fault_bitmask: MavBatteryFault,
}
impl BATTERY_STATUS_DATA {
    pub const ENCODED_LEN: usize = 54usize;
    pub const DEFAULT: Self = Self {
        current_consumed: 0_i32,
        energy_consumed: 0_i32,
        temperature: 0_i16,
        voltages: [0_u16; 10usize],
        current_battery: 0_i16,
        id: 0_u8,
        battery_function: MavBatteryFunction::DEFAULT,
        mavtype: MavBatteryType::DEFAULT,
        battery_remaining: 0_i8,
        time_remaining: 0_i32,
        charge_state: MavBatteryChargeState::DEFAULT,
        voltages_ext: [0_u16; 4usize],
        mode: MavBatteryMode::DEFAULT,
        fault_bitmask: MavBatteryFault::DEFAULT,
    };
}
impl Default for BATTERY_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for BATTERY_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 147u32;
    const NAME: &'static str = "BATTERY_STATUS";
    const EXTRA_CRC: u8 = 154u8;
    const ENCODED_LEN: usize = 54usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.current_consumed = buf.get_i32_le();
        __struct.energy_consumed = buf.get_i32_le();
        __struct.temperature = buf.get_i16_le();
        for v in &mut __struct.voltages {
            let val = buf.get_u16_le();
            *v = val;
        }
        __struct.current_battery = buf.get_i16_le();
        __struct.id = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.battery_function =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavBatteryFunction",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavBatteryType",
            value: tmp as u32,
        })?;
        __struct.battery_remaining = buf.get_i8();
        __struct.time_remaining = buf.get_i32_le();
        let tmp = buf.get_u8();
        __struct.charge_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavBatteryChargeState",
            value: tmp as u32,
        })?;
        for v in &mut __struct.voltages_ext {
            let val = buf.get_u16_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.mode = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavBatteryMode",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u32_le();
        __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "MavBatteryFault",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.current_consumed);
        __tmp.put_i32_le(self.energy_consumed);
        __tmp.put_i16_le(self.temperature);
        for val in &self.voltages {
            __tmp.put_u16_le(*val);
        }
        __tmp.put_i16_le(self.current_battery);
        __tmp.put_u8(self.id);
        __tmp.put_u8(self.battery_function as u8);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_i8(self.battery_remaining);
        __tmp.put_i32_le(self.time_remaining);
        __tmp.put_u8(self.charge_state as u8);
        for val in &self.voltages_ext {
            __tmp.put_u16_le(*val);
        }
        __tmp.put_u8(self.mode as u8);
        __tmp.put_u32_le(self.fault_bitmask.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 100"]
#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPTICAL_FLOW_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Flow in x-sensor direction, angular-speed compensated."]
    pub flow_comp_m_x: f32,
    #[doc = "Flow in y-sensor direction, angular-speed compensated."]
    pub flow_comp_m_y: f32,
    #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance."]
    pub ground_distance: f32,
    #[doc = "Flow in x-sensor direction."]
    pub flow_x: i16,
    #[doc = "Flow in y-sensor direction."]
    pub flow_y: i16,
    #[doc = "Sensor ID."]
    pub sensor_id: u8,
    #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality."]
    pub quality: u8,
    #[doc = "Flow rate about X axis."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub flow_rate_x: f32,
    #[doc = "Flow rate about Y axis."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub flow_rate_y: f32,
}
impl OPTICAL_FLOW_DATA {
    pub const ENCODED_LEN: usize = 34usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        flow_comp_m_x: 0.0_f32,
        flow_comp_m_y: 0.0_f32,
        ground_distance: 0.0_f32,
        flow_x: 0_i16,
        flow_y: 0_i16,
        sensor_id: 0_u8,
        quality: 0_u8,
        flow_rate_x: 0.0_f32,
        flow_rate_y: 0.0_f32,
    };
}
impl Default for OPTICAL_FLOW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPTICAL_FLOW_DATA {
    type Message = MavMessage;
    const ID: u32 = 100u32;
    const NAME: &'static str = "OPTICAL_FLOW";
    const EXTRA_CRC: u8 = 175u8;
    const ENCODED_LEN: usize = 34usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.flow_comp_m_x = buf.get_f32_le();
        __struct.flow_comp_m_y = buf.get_f32_le();
        __struct.ground_distance = buf.get_f32_le();
        __struct.flow_x = buf.get_i16_le();
        __struct.flow_y = buf.get_i16_le();
        __struct.sensor_id = buf.get_u8();
        __struct.quality = buf.get_u8();
        __struct.flow_rate_x = buf.get_f32_le();
        __struct.flow_rate_y = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.flow_comp_m_x);
        __tmp.put_f32_le(self.flow_comp_m_y);
        __tmp.put_f32_le(self.ground_distance);
        __tmp.put_i16_le(self.flow_x);
        __tmp.put_i16_le(self.flow_y);
        __tmp.put_u8(self.sensor_id);
        __tmp.put_u8(self.quality);
        __tmp.put_f32_le(self.flow_rate_x);
        __tmp.put_f32_le(self.flow_rate_y);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 11"]
#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_MODE_DATA {
    #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot.."]
    pub custom_mode: u32,
    #[doc = "The system setting the mode."]
    pub target_system: u8,
    #[doc = "The new base mode.."]
    pub base_mode: MavMode,
}
impl SET_MODE_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        custom_mode: 0_u32,
        target_system: 0_u8,
        base_mode: MavMode::DEFAULT,
    };
}
impl Default for SET_MODE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_MODE_DATA {
    type Message = MavMessage;
    const ID: u32 = 11u32;
    const NAME: &'static str = "SET_MODE";
    const EXTRA_CRC: u8 = 89u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.custom_mode = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.base_mode = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMode",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.custom_mode);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.base_mode as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 49"]
#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_GLOBAL_ORIGIN_DATA {
    #[doc = "Latitude (WGS84)."]
    pub latitude: i32,
    #[doc = "Longitude (WGS84)."]
    pub longitude: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub altitude: i32,
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub time_usec: u64,
}
impl GPS_GLOBAL_ORIGIN_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        latitude: 0_i32,
        longitude: 0_i32,
        altitude: 0_i32,
        time_usec: 0_u64,
    };
}
impl Default for GPS_GLOBAL_ORIGIN_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
    type Message = MavMessage;
    const ID: u32 = 49u32;
    const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
    const EXTRA_CRC: u8 = 39u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.altitude = buf.get_i32_le();
        __struct.time_usec = buf.get_u64_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_i32_le(self.altitude);
        __tmp.put_u64_le(self.time_usec);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 45"]
#[doc = "Delete all mission items at once.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_CLEAR_ALL_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_CLEAR_ALL_DATA {
    pub const ENCODED_LEN: usize = 3usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_CLEAR_ALL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_CLEAR_ALL_DATA {
    type Message = MavMessage;
    const ID: u32 = 45u32;
    const NAME: &'static str = "MISSION_CLEAR_ALL";
    const EXTRA_CRC: u8 = 232u8;
    const ENCODED_LEN: usize = 3usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 144"]
#[doc = "Current motion information from a designated system."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct FOLLOW_TARGET_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub timestamp: u64,
    #[doc = "button states or switches of a tracker device."]
    pub custom_state: u64,
    #[doc = "Latitude (WGS84)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84)."]
    pub lon: i32,
    #[doc = "Altitude (MSL)."]
    pub alt: f32,
    #[doc = "target velocity (0,0,0) for unknown."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel: [f32; 3],
    #[doc = "linear target acceleration (0,0,0) for unknown."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub acc: [f32; 3],
    #[doc = "(0 0 0 0 for unknown)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub attitude_q: [f32; 4],
    #[doc = "(0 0 0 for unknown)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub rates: [f32; 3],
    #[doc = "eph epv."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub position_cov: [f32; 3],
    #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)."]
    pub est_capabilities: u8,
}
impl FOLLOW_TARGET_DATA {
    pub const ENCODED_LEN: usize = 93usize;
    pub const DEFAULT: Self = Self {
        timestamp: 0_u64,
        custom_state: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0.0_f32,
        vel: [0.0_f32; 3usize],
        acc: [0.0_f32; 3usize],
        attitude_q: [0.0_f32; 4usize],
        rates: [0.0_f32; 3usize],
        position_cov: [0.0_f32; 3usize],
        est_capabilities: 0_u8,
    };
}
impl Default for FOLLOW_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for FOLLOW_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 144u32;
    const NAME: &'static str = "FOLLOW_TARGET";
    const EXTRA_CRC: u8 = 127u8;
    const ENCODED_LEN: usize = 93usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.timestamp = buf.get_u64_le();
        __struct.custom_state = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_f32_le();
        for v in &mut __struct.vel {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.acc {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.attitude_q {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.rates {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.position_cov {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.est_capabilities = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.timestamp);
        __tmp.put_u64_le(self.custom_state);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_f32_le(self.alt);
        for val in &self.vel {
            __tmp.put_f32_le(*val);
        }
        for val in &self.acc {
            __tmp.put_f32_le(*val);
        }
        for val in &self.attitude_q {
            __tmp.put_f32_le(*val);
        }
        for val in &self.rates {
            __tmp.put_f32_le(*val);
        }
        for val in &self.position_cov {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.est_capabilities);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 397"]
#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE.          This contains the MAVLink FTP URI and CRC for the component's general metadata file.         The file must be hosted on the component, and may be xz compressed.         The file CRC can be used for file caching.          The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet.         For more information see: https://mavlink.io/en/services/component_information.html.          Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMPONENT_METADATA_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "CRC32 of the general metadata file.."]
    pub file_crc: u32,
    #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uri: [u8; 100],
}
impl COMPONENT_METADATA_DATA {
    pub const ENCODED_LEN: usize = 108usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        file_crc: 0_u32,
        uri: [0_u8; 100usize],
    };
}
impl Default for COMPONENT_METADATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMPONENT_METADATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 397u32;
    const NAME: &'static str = "COMPONENT_METADATA";
    const EXTRA_CRC: u8 = 182u8;
    const ENCODED_LEN: usize = 108usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.file_crc = buf.get_u32_le();
        for v in &mut __struct.uri {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.file_crc);
        for val in &self.uri {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 232"]
#[doc = "GPS sensor input message.  This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_INPUT_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "GPS time (from start of GPS week)."]
    pub time_week_ms: u32,
    #[doc = "Latitude (WGS84)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84)."]
    pub lon: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub alt: f32,
    #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX."]
    pub hdop: f32,
    #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX."]
    pub vdop: f32,
    #[doc = "GPS velocity in north direction in earth-fixed NED frame."]
    pub vn: f32,
    #[doc = "GPS velocity in east direction in earth-fixed NED frame."]
    pub ve: f32,
    #[doc = "GPS velocity in down direction in earth-fixed NED frame."]
    pub vd: f32,
    #[doc = "GPS speed accuracy."]
    pub speed_accuracy: f32,
    #[doc = "GPS horizontal accuracy."]
    pub horiz_accuracy: f32,
    #[doc = "GPS vertical accuracy."]
    pub vert_accuracy: f32,
    #[doc = "Bitmap indicating which GPS input flags fields to ignore.  All other fields must be provided.."]
    pub ignore_flags: GpsInputIgnoreFlags,
    #[doc = "GPS week number."]
    pub time_week: u16,
    #[doc = "ID of the GPS for multiple GPS inputs."]
    pub gps_id: u8,
    #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK."]
    pub fix_type: u8,
    #[doc = "Number of satellites visible.."]
    pub satellites_visible: u8,
    #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub yaw: u16,
}
impl GPS_INPUT_DATA {
    pub const ENCODED_LEN: usize = 65usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        time_week_ms: 0_u32,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0.0_f32,
        hdop: 0.0_f32,
        vdop: 0.0_f32,
        vn: 0.0_f32,
        ve: 0.0_f32,
        vd: 0.0_f32,
        speed_accuracy: 0.0_f32,
        horiz_accuracy: 0.0_f32,
        vert_accuracy: 0.0_f32,
        ignore_flags: GpsInputIgnoreFlags::DEFAULT,
        time_week: 0_u16,
        gps_id: 0_u8,
        fix_type: 0_u8,
        satellites_visible: 0_u8,
        yaw: 0_u16,
    };
}
impl Default for GPS_INPUT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_INPUT_DATA {
    type Message = MavMessage;
    const ID: u32 = 232u32;
    const NAME: &'static str = "GPS_INPUT";
    const EXTRA_CRC: u8 = 151u8;
    const ENCODED_LEN: usize = 65usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.time_week_ms = buf.get_u32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_f32_le();
        __struct.hdop = buf.get_f32_le();
        __struct.vdop = buf.get_f32_le();
        __struct.vn = buf.get_f32_le();
        __struct.ve = buf.get_f32_le();
        __struct.vd = buf.get_f32_le();
        __struct.speed_accuracy = buf.get_f32_le();
        __struct.horiz_accuracy = buf.get_f32_le();
        __struct.vert_accuracy = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
            tmp & GpsInputIgnoreFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "GpsInputIgnoreFlags",
            value: tmp as u32,
        })?;
        __struct.time_week = buf.get_u16_le();
        __struct.gps_id = buf.get_u8();
        __struct.fix_type = buf.get_u8();
        __struct.satellites_visible = buf.get_u8();
        __struct.yaw = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.time_week_ms);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.hdop);
        __tmp.put_f32_le(self.vdop);
        __tmp.put_f32_le(self.vn);
        __tmp.put_f32_le(self.ve);
        __tmp.put_f32_le(self.vd);
        __tmp.put_f32_le(self.speed_accuracy);
        __tmp.put_f32_le(self.horiz_accuracy);
        __tmp.put_f32_le(self.vert_accuracy);
        __tmp.put_u16_le(self.ignore_flags.bits());
        __tmp.put_u16_le(self.time_week);
        __tmp.put_u8(self.gps_id);
        __tmp.put_u8(self.fix_type);
        __tmp.put_u8(self.satellites_visible);
        __tmp.put_u16_le(self.yaw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 82"]
#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_ATTITUDE_TARGET_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Body roll rate."]
    pub body_roll_rate: f32,
    #[doc = "Body pitch rate."]
    pub body_pitch_rate: f32,
    #[doc = "Body yaw rate."]
    pub body_yaw_rate: f32,
    #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)."]
    pub thrust: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: AttitudeTargetTypemask,
    #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub thrust_body: [f32; 3],
}
impl SET_ATTITUDE_TARGET_DATA {
    pub const ENCODED_LEN: usize = 51usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        q: [0.0_f32; 4usize],
        body_roll_rate: 0.0_f32,
        body_pitch_rate: 0.0_f32,
        body_yaw_rate: 0.0_f32,
        thrust: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        type_mask: AttitudeTargetTypemask::DEFAULT,
        thrust_body: [0.0_f32; 3usize],
    };
}
impl Default for SET_ATTITUDE_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_ATTITUDE_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 82u32;
    const NAME: &'static str = "SET_ATTITUDE_TARGET";
    const EXTRA_CRC: u8 = 49u8;
    const ENCODED_LEN: usize = 51usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.body_roll_rate = buf.get_f32_le();
        __struct.body_pitch_rate = buf.get_f32_le();
        __struct.body_yaw_rate = buf.get_f32_le();
        __struct.thrust = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.type_mask = AttitudeTargetTypemask::from_bits(
            tmp & AttitudeTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "AttitudeTargetTypemask",
            value: tmp as u32,
        })?;
        for v in &mut __struct.thrust_body {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.body_roll_rate);
        __tmp.put_f32_le(self.body_pitch_rate);
        __tmp.put_f32_le(self.body_yaw_rate);
        __tmp.put_f32_le(self.thrust);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.type_mask.bits());
        for val in &self.thrust_body {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 86"]
#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
    #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.."]
    pub time_boot_ms: u32,
    #[doc = "X Position in WGS84 frame."]
    pub lat_int: i32,
    #[doc = "Y Position in WGS84 frame."]
    pub lon_int: i32,
    #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)."]
    pub alt: f32,
    #[doc = "X velocity in NED frame."]
    pub vx: f32,
    #[doc = "Y velocity in NED frame."]
    pub vy: f32,
    #[doc = "Z velocity in NED frame."]
    pub vz: f32,
    #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afx: f32,
    #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afy: f32,
    #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N."]
    pub afz: f32,
    #[doc = "yaw setpoint."]
    pub yaw: f32,
    #[doc = "yaw rate setpoint."]
    pub yaw_rate: f32,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: PositionTargetTypemask,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11."]
    pub coordinate_frame: MavFrame,
}
impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
    pub const ENCODED_LEN: usize = 53usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        lat_int: 0_i32,
        lon_int: 0_i32,
        alt: 0.0_f32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        afx: 0.0_f32,
        afy: 0.0_f32,
        afz: 0.0_f32,
        yaw: 0.0_f32,
        yaw_rate: 0.0_f32,
        type_mask: PositionTargetTypemask::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        coordinate_frame: MavFrame::DEFAULT,
    };
}
impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 86u32;
    const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
    const EXTRA_CRC: u8 = 5u8;
    const ENCODED_LEN: usize = 53usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.lat_int = buf.get_i32_le();
        __struct.lon_int = buf.get_i32_le();
        __struct.alt = buf.get_f32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.afx = buf.get_f32_le();
        __struct.afy = buf.get_f32_le();
        __struct.afz = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.type_mask = PositionTargetTypemask::from_bits(
            tmp & PositionTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "PositionTargetTypemask",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.coordinate_frame =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavFrame",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_i32_le(self.lat_int);
        __tmp.put_i32_le(self.lon_int);
        __tmp.put_f32_le(self.alt);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_f32_le(self.afx);
        __tmp.put_f32_le(self.afy);
        __tmp.put_f32_le(self.afz);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u16_le(self.type_mask.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.coordinate_frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 247"]
#[doc = "Information about a potential collision."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COLLISION_DATA {
    #[doc = "Unique identifier, domain based on src field."]
    pub id: u32,
    #[doc = "Estimated time until collision occurs."]
    pub time_to_minimum_delta: f32,
    #[doc = "Closest vertical distance between vehicle and object."]
    pub altitude_minimum_delta: f32,
    #[doc = "Closest horizontal distance between vehicle and object."]
    pub horizontal_minimum_delta: f32,
    #[doc = "Collision data source."]
    pub src: MavCollisionSrc,
    #[doc = "Action that is being taken to avoid this collision."]
    pub action: MavCollisionAction,
    #[doc = "How concerned the aircraft is about this collision."]
    pub threat_level: MavCollisionThreatLevel,
}
impl COLLISION_DATA {
    pub const ENCODED_LEN: usize = 19usize;
    pub const DEFAULT: Self = Self {
        id: 0_u32,
        time_to_minimum_delta: 0.0_f32,
        altitude_minimum_delta: 0.0_f32,
        horizontal_minimum_delta: 0.0_f32,
        src: MavCollisionSrc::DEFAULT,
        action: MavCollisionAction::DEFAULT,
        threat_level: MavCollisionThreatLevel::DEFAULT,
    };
}
impl Default for COLLISION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COLLISION_DATA {
    type Message = MavMessage;
    const ID: u32 = 247u32;
    const NAME: &'static str = "COLLISION";
    const EXTRA_CRC: u8 = 81u8;
    const ENCODED_LEN: usize = 19usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.id = buf.get_u32_le();
        __struct.time_to_minimum_delta = buf.get_f32_le();
        __struct.altitude_minimum_delta = buf.get_f32_le();
        __struct.horizontal_minimum_delta = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.src = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCollisionSrc",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.action = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCollisionAction",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.threat_level = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCollisionThreatLevel",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.id);
        __tmp.put_f32_le(self.time_to_minimum_delta);
        __tmp.put_f32_le(self.altitude_minimum_delta);
        __tmp.put_f32_le(self.horizontal_minimum_delta);
        __tmp.put_u8(self.src as u8);
        __tmp.put_u8(self.action as u8);
        __tmp.put_u8(self.threat_level as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 41"]
#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed).         If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items.         Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2).          This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE.         If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission.         If the system is not in mission mode this message must not trigger a switch to mission mode.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_SET_CURRENT_DATA {
    #[doc = "Sequence."]
    pub seq: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl MISSION_SET_CURRENT_DATA {
    pub const ENCODED_LEN: usize = 4usize;
    pub const DEFAULT: Self = Self {
        seq: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for MISSION_SET_CURRENT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_SET_CURRENT_DATA {
    type Message = MavMessage;
    const ID: u32 = 41u32;
    const NAME: &'static str = "MISSION_SET_CURRENT";
    const EXTRA_CRC: u8 = 28u8;
    const ENCODED_LEN: usize = 4usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seq = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 39"]
#[doc = "Message encoding a mission item. This message is emitted to announce                 the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also https://mavlink.io/en/services/mission.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_ITEM_DATA {
    #[doc = "PARAM1, see MAV_CMD enum."]
    pub param1: f32,
    #[doc = "PARAM2, see MAV_CMD enum."]
    pub param2: f32,
    #[doc = "PARAM3, see MAV_CMD enum."]
    pub param3: f32,
    #[doc = "PARAM4, see MAV_CMD enum."]
    pub param4: f32,
    #[doc = "PARAM5 / local: X coordinate, global: latitude."]
    pub x: f32,
    #[doc = "PARAM6 / local: Y coordinate, global: longitude."]
    pub y: f32,
    #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).."]
    pub z: f32,
    #[doc = "Sequence."]
    pub seq: u16,
    #[doc = "The scheduled action for the waypoint.."]
    pub command: MavCmd,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "The coordinate system of the waypoint.."]
    pub frame: MavFrame,
    #[doc = "false:0, true:1."]
    pub current: u8,
    #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes.."]
    pub autocontinue: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_ITEM_DATA {
    pub const ENCODED_LEN: usize = 38usize;
    pub const DEFAULT: Self = Self {
        param1: 0.0_f32,
        param2: 0.0_f32,
        param3: 0.0_f32,
        param4: 0.0_f32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        seq: 0_u16,
        command: MavCmd::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        frame: MavFrame::DEFAULT,
        current: 0_u8,
        autocontinue: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_ITEM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_ITEM_DATA {
    type Message = MavMessage;
    const ID: u32 = 39u32;
    const NAME: &'static str = "MISSION_ITEM";
    const EXTRA_CRC: u8 = 254u8;
    const ENCODED_LEN: usize = 38usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param1 = buf.get_f32_le();
        __struct.param2 = buf.get_f32_le();
        __struct.param3 = buf.get_f32_le();
        __struct.param4 = buf.get_f32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.seq = buf.get_u16_le();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        __struct.current = buf.get_u8();
        __struct.autocontinue = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param1);
        __tmp.put_f32_le(self.param2);
        __tmp.put_f32_le(self.param3);
        __tmp.put_f32_le(self.param4);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.frame as u8);
        __tmp.put_u8(self.current);
        __tmp.put_u8(self.autocontinue);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 20"]
#[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -&gt; value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also https://mavlink.io/en/services/parameter.html for a full documentation of QGroundControl and IMU code.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_REQUEST_READ_DATA {
    #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)."]
    pub param_index: i16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
}
impl PARAM_REQUEST_READ_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        param_index: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        param_id: [0_u8; 16usize],
    };
}
impl Default for PARAM_REQUEST_READ_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_REQUEST_READ_DATA {
    type Message = MavMessage;
    const ID: u32 = 20u32;
    const NAME: &'static str = "PARAM_REQUEST_READ";
    const EXTRA_CRC: u8 = 214u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_index = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.param_index);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 130"]
#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
    #[doc = "total data size (set on ACK only).."]
    pub size: u32,
    #[doc = "Width of a matrix or image.."]
    pub width: u16,
    #[doc = "Height of a matrix or image.."]
    pub height: u16,
    #[doc = "Number of packets being sent (set on ACK only).."]
    pub packets: u16,
    #[doc = "Type of requested/acknowledged data.."]
    pub mavtype: MavlinkDataStreamType,
    #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).."]
    pub payload: u8,
    #[doc = "JPEG quality. Values: [1-100].."]
    pub jpg_quality: u8,
}
impl DATA_TRANSMISSION_HANDSHAKE_DATA {
    pub const ENCODED_LEN: usize = 13usize;
    pub const DEFAULT: Self = Self {
        size: 0_u32,
        width: 0_u16,
        height: 0_u16,
        packets: 0_u16,
        mavtype: MavlinkDataStreamType::DEFAULT,
        payload: 0_u8,
        jpg_quality: 0_u8,
    };
}
impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
    type Message = MavMessage;
    const ID: u32 = 130u32;
    const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
    const EXTRA_CRC: u8 = 29u8;
    const ENCODED_LEN: usize = 13usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.size = buf.get_u32_le();
        __struct.width = buf.get_u16_le();
        __struct.height = buf.get_u16_le();
        __struct.packets = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavlinkDataStreamType",
            value: tmp as u32,
        })?;
        __struct.payload = buf.get_u8();
        __struct.jpg_quality = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.size);
        __tmp.put_u16_le(self.width);
        __tmp.put_u16_le(self.height);
        __tmp.put_u16_le(self.packets);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.payload);
        __tmp.put_u8(self.jpg_quality);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 262"]
#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_CAPTURE_STATUS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Image capture interval."]
    pub image_interval: f32,
    #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.."]
    pub recording_time_ms: u32,
    #[doc = "Available storage capacity.."]
    pub available_capacity: f32,
    #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)."]
    pub image_status: u8,
    #[doc = "Current status of video capturing (0: idle, 1: capture in progress)."]
    pub video_status: u8,
    #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub image_count: i32,
}
impl CAMERA_CAPTURE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        image_interval: 0.0_f32,
        recording_time_ms: 0_u32,
        available_capacity: 0.0_f32,
        image_status: 0_u8,
        video_status: 0_u8,
        image_count: 0_i32,
    };
}
impl Default for CAMERA_CAPTURE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 262u32;
    const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
    const EXTRA_CRC: u8 = 12u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.image_interval = buf.get_f32_le();
        __struct.recording_time_ms = buf.get_u32_le();
        __struct.available_capacity = buf.get_f32_le();
        __struct.image_status = buf.get_u8();
        __struct.video_status = buf.get_u8();
        __struct.image_count = buf.get_i32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.image_interval);
        __tmp.put_u32_le(self.recording_time_ms);
        __tmp.put_f32_le(self.available_capacity);
        __tmp.put_u8(self.image_status);
        __tmp.put_u8(self.video_status);
        __tmp.put_i32_le(self.image_count);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 412"]
#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct REQUEST_EVENT_DATA {
    #[doc = "First sequence number of the requested event.."]
    pub first_sequence: u16,
    #[doc = "Last sequence number of the requested event.."]
    pub last_sequence: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
}
impl REQUEST_EVENT_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        first_sequence: 0_u16,
        last_sequence: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for REQUEST_EVENT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for REQUEST_EVENT_DATA {
    type Message = MavMessage;
    const ID: u32 = 412u32;
    const NAME: &'static str = "REQUEST_EVENT";
    const EXTRA_CRC: u8 = 33u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.first_sequence = buf.get_u16_le();
        __struct.last_sequence = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.first_sequence);
        __tmp.put_u16_le(self.last_sequence);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 128"]
#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS2_RTK_DATA {
    #[doc = "Time since boot of last baseline message received.."]
    pub time_last_baseline_ms: u32,
    #[doc = "GPS Time of Week of last baseline."]
    pub tow: u32,
    #[doc = "Current baseline in ECEF x or NED north component.."]
    pub baseline_a_mm: i32,
    #[doc = "Current baseline in ECEF y or NED east component.."]
    pub baseline_b_mm: i32,
    #[doc = "Current baseline in ECEF z or NED down component.."]
    pub baseline_c_mm: i32,
    #[doc = "Current estimate of baseline accuracy.."]
    pub accuracy: u32,
    #[doc = "Current number of integer ambiguity hypotheses.."]
    pub iar_num_hypotheses: i32,
    #[doc = "GPS Week Number of last baseline."]
    pub wn: u16,
    #[doc = "Identification of connected RTK receiver.."]
    pub rtk_receiver_id: u8,
    #[doc = "GPS-specific health report for RTK data.."]
    pub rtk_health: u8,
    #[doc = "Rate of baseline messages being received by GPS."]
    pub rtk_rate: u8,
    #[doc = "Current number of sats used for RTK calculation.."]
    pub nsats: u8,
    #[doc = "Coordinate system of baseline."]
    pub baseline_coords_type: RtkBaselineCoordinateSystem,
}
impl GPS2_RTK_DATA {
    pub const ENCODED_LEN: usize = 35usize;
    pub const DEFAULT: Self = Self {
        time_last_baseline_ms: 0_u32,
        tow: 0_u32,
        baseline_a_mm: 0_i32,
        baseline_b_mm: 0_i32,
        baseline_c_mm: 0_i32,
        accuracy: 0_u32,
        iar_num_hypotheses: 0_i32,
        wn: 0_u16,
        rtk_receiver_id: 0_u8,
        rtk_health: 0_u8,
        rtk_rate: 0_u8,
        nsats: 0_u8,
        baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
    };
}
impl Default for GPS2_RTK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS2_RTK_DATA {
    type Message = MavMessage;
    const ID: u32 = 128u32;
    const NAME: &'static str = "GPS2_RTK";
    const EXTRA_CRC: u8 = 226u8;
    const ENCODED_LEN: usize = 35usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_last_baseline_ms = buf.get_u32_le();
        __struct.tow = buf.get_u32_le();
        __struct.baseline_a_mm = buf.get_i32_le();
        __struct.baseline_b_mm = buf.get_i32_le();
        __struct.baseline_c_mm = buf.get_i32_le();
        __struct.accuracy = buf.get_u32_le();
        __struct.iar_num_hypotheses = buf.get_i32_le();
        __struct.wn = buf.get_u16_le();
        __struct.rtk_receiver_id = buf.get_u8();
        __struct.rtk_health = buf.get_u8();
        __struct.rtk_rate = buf.get_u8();
        __struct.nsats = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.baseline_coords_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "RtkBaselineCoordinateSystem",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_last_baseline_ms);
        __tmp.put_u32_le(self.tow);
        __tmp.put_i32_le(self.baseline_a_mm);
        __tmp.put_i32_le(self.baseline_b_mm);
        __tmp.put_i32_le(self.baseline_c_mm);
        __tmp.put_u32_le(self.accuracy);
        __tmp.put_i32_le(self.iar_num_hypotheses);
        __tmp.put_u16_le(self.wn);
        __tmp.put_u8(self.rtk_receiver_id);
        __tmp.put_u8(self.rtk_health);
        __tmp.put_u8(self.rtk_rate);
        __tmp.put_u8(self.nsats);
        __tmp.put_u8(self.baseline_coords_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 2"]
#[doc = "The system time is the time of the master clock, typically the computer clock of the main onboard computer.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SYSTEM_TIME_DATA {
    #[doc = "Timestamp (UNIX epoch time).."]
    pub time_unix_usec: u64,
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
}
impl SYSTEM_TIME_DATA {
    pub const ENCODED_LEN: usize = 12usize;
    pub const DEFAULT: Self = Self {
        time_unix_usec: 0_u64,
        time_boot_ms: 0_u32,
    };
}
impl Default for SYSTEM_TIME_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SYSTEM_TIME_DATA {
    type Message = MavMessage;
    const ID: u32 = 2u32;
    const NAME: &'static str = "SYSTEM_TIME";
    const EXTRA_CRC: u8 = 137u8;
    const ENCODED_LEN: usize = 12usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_unix_usec = buf.get_u64_le();
        __struct.time_boot_ms = buf.get_u32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_unix_usec);
        __tmp.put_u32_le(self.time_boot_ms);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 93"]
#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs (replacement for HIL_CONTROLS)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_ACTUATOR_CONTROLS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Flags as bitfield, 1: indicate simulation using lockstep.."]
    pub flags: u64,
    #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub controls: [f32; 16],
    #[doc = "System mode. Includes arming state.."]
    pub mode: MavModeFlag,
}
impl HIL_ACTUATOR_CONTROLS_DATA {
    pub const ENCODED_LEN: usize = 81usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        flags: 0_u64,
        controls: [0.0_f32; 16usize],
        mode: MavModeFlag::DEFAULT,
    };
}
impl Default for HIL_ACTUATOR_CONTROLS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
    type Message = MavMessage;
    const ID: u32 = 93u32;
    const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
    const EXTRA_CRC: u8 = 47u8;
    const ENCODED_LEN: usize = 81usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.flags = buf.get_u64_le();
        for v in &mut __struct.controls {
            let val = buf.get_f32_le();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "MavModeFlag",
                value: tmp as u32,
            },
        )?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u64_le(self.flags);
        for val in &self.controls {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.mode.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 76"]
#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands where param 5 and param 6 contain latitude/longitude data, as sending these in floats can result in a significant loss of precision. COMMAND_LONG is required for commands that mandate float values in params 5 and 6. The command microservice is documented at https://mavlink.io/en/services/command.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct COMMAND_LONG_DATA {
    #[doc = "Parameter 1 (for the specific command).."]
    pub param1: f32,
    #[doc = "Parameter 2 (for the specific command).."]
    pub param2: f32,
    #[doc = "Parameter 3 (for the specific command).."]
    pub param3: f32,
    #[doc = "Parameter 4 (for the specific command).."]
    pub param4: f32,
    #[doc = "Parameter 5 (for the specific command).."]
    pub param5: f32,
    #[doc = "Parameter 6 (for the specific command).."]
    pub param6: f32,
    #[doc = "Parameter 7 (for the specific command).."]
    pub param7: f32,
    #[doc = "Command ID (of command to send).."]
    pub command: MavCmd,
    #[doc = "System which should execute the command."]
    pub target_system: u8,
    #[doc = "Component which should execute the command, 0 for all components."]
    pub target_component: u8,
    #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)."]
    pub confirmation: u8,
}
impl COMMAND_LONG_DATA {
    pub const ENCODED_LEN: usize = 33usize;
    pub const DEFAULT: Self = Self {
        param1: 0.0_f32,
        param2: 0.0_f32,
        param3: 0.0_f32,
        param4: 0.0_f32,
        param5: 0.0_f32,
        param6: 0.0_f32,
        param7: 0.0_f32,
        command: MavCmd::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        confirmation: 0_u8,
    };
}
impl Default for COMMAND_LONG_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for COMMAND_LONG_DATA {
    type Message = MavMessage;
    const ID: u32 = 76u32;
    const NAME: &'static str = "COMMAND_LONG";
    const EXTRA_CRC: u8 = 152u8;
    const ENCODED_LEN: usize = 33usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param1 = buf.get_f32_le();
        __struct.param2 = buf.get_f32_le();
        __struct.param3 = buf.get_f32_le();
        __struct.param4 = buf.get_f32_le();
        __struct.param5 = buf.get_f32_le();
        __struct.param6 = buf.get_f32_le();
        __struct.param7 = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.confirmation = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param1);
        __tmp.put_f32_le(self.param2);
        __tmp.put_f32_le(self.param3);
        __tmp.put_f32_le(self.param4);
        __tmp.put_f32_le(self.param5);
        __tmp.put_f32_le(self.param6);
        __tmp.put_f32_le(self.param7);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.confirmation);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 9005"]
#[doc = "Winch status.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct WINCH_STATUS_DATA {
    #[doc = "Timestamp (synced to UNIX time or since system boot).."]
    pub time_usec: u64,
    #[doc = "Length of line released. NaN if unknown."]
    pub line_length: f32,
    #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown."]
    pub speed: f32,
    #[doc = "Tension on the line. NaN if unknown."]
    pub tension: f32,
    #[doc = "Voltage of the battery supplying the winch. NaN if unknown."]
    pub voltage: f32,
    #[doc = "Current draw from the winch. NaN if unknown."]
    pub current: f32,
    #[doc = "Status flags."]
    pub status: MavWinchStatusFlag,
    #[doc = "Temperature of the motor. INT16_MAX if unknown."]
    pub temperature: i16,
}
impl WINCH_STATUS_DATA {
    pub const ENCODED_LEN: usize = 34usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        line_length: 0.0_f32,
        speed: 0.0_f32,
        tension: 0.0_f32,
        voltage: 0.0_f32,
        current: 0.0_f32,
        status: MavWinchStatusFlag::DEFAULT,
        temperature: 0_i16,
    };
}
impl Default for WINCH_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for WINCH_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 9005u32;
    const NAME: &'static str = "WINCH_STATUS";
    const EXTRA_CRC: u8 = 117u8;
    const ENCODED_LEN: usize = 34usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.line_length = buf.get_f32_le();
        __struct.speed = buf.get_f32_le();
        __struct.tension = buf.get_f32_le();
        __struct.voltage = buf.get_f32_le();
        __struct.current = buf.get_f32_le();
        let tmp = buf.get_u32_le();
        __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "MavWinchStatusFlag",
                value: tmp as u32,
            })?;
        __struct.temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.line_length);
        __tmp.put_f32_le(self.speed);
        __tmp.put_f32_le(self.tension);
        __tmp.put_f32_le(self.voltage);
        __tmp.put_f32_le(self.current);
        __tmp.put_u32_le(self.status.bits());
        __tmp.put_i16_le(self.temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 320"]
#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PARAM_EXT_REQUEST_READ_DATA {
    #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)."]
    pub param_index: i16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub param_id: [u8; 16],
}
impl PARAM_EXT_REQUEST_READ_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        param_index: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        param_id: [0_u8; 16usize],
    };
}
impl Default for PARAM_EXT_REQUEST_READ_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
    type Message = MavMessage;
    const ID: u32 = 320u32;
    const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
    const EXTRA_CRC: u8 = 243u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param_index = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.param_id {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.param_index);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.param_id {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 286"]
#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_us: u64,
    #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Estimated delay of the attitude data. 0 if unknown.."]
    pub q_estimated_delay_us: u32,
    #[doc = "X Speed in NED (North, East, Down). NAN if unknown.."]
    pub vx: f32,
    #[doc = "Y Speed in NED (North, East, Down). NAN if unknown.."]
    pub vy: f32,
    #[doc = "Z Speed in NED (North, East, Down). NAN if unknown.."]
    pub vz: f32,
    #[doc = "Estimated delay of the speed data. 0 if unknown.."]
    pub v_estimated_delay_us: u32,
    #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.."]
    pub feed_forward_angular_velocity_z: f32,
    #[doc = "Bitmap indicating which estimator outputs are valid.."]
    pub estimator_status: EstimatorStatusFlags,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.."]
    pub landed_state: MavLandedState,
    #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub angular_velocity_z: f32,
}
impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
    pub const ENCODED_LEN: usize = 57usize;
    pub const DEFAULT: Self = Self {
        time_boot_us: 0_u64,
        q: [0.0_f32; 4usize],
        q_estimated_delay_us: 0_u32,
        vx: 0.0_f32,
        vy: 0.0_f32,
        vz: 0.0_f32,
        v_estimated_delay_us: 0_u32,
        feed_forward_angular_velocity_z: 0.0_f32,
        estimator_status: EstimatorStatusFlags::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        landed_state: MavLandedState::DEFAULT,
        angular_velocity_z: 0.0_f32,
    };
}
impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
    type Message = MavMessage;
    const ID: u32 = 286u32;
    const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
    const EXTRA_CRC: u8 = 210u8;
    const ENCODED_LEN: usize = 57usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_us = buf.get_u64_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.q_estimated_delay_us = buf.get_u32_le();
        __struct.vx = buf.get_f32_le();
        __struct.vy = buf.get_f32_le();
        __struct.vz = buf.get_f32_le();
        __struct.v_estimated_delay_us = buf.get_u32_le();
        __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.estimator_status = EstimatorStatusFlags::from_bits(
            tmp & EstimatorStatusFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "EstimatorStatusFlags",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.landed_state = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavLandedState",
            value: tmp as u32,
        })?;
        __struct.angular_velocity_z = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_boot_us);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u32_le(self.q_estimated_delay_us);
        __tmp.put_f32_le(self.vx);
        __tmp.put_f32_le(self.vy);
        __tmp.put_f32_le(self.vz);
        __tmp.put_u32_le(self.v_estimated_delay_us);
        __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
        __tmp.put_u16_le(self.estimator_status.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.landed_state as u8);
        __tmp.put_f32_le(self.angular_velocity_z);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50001"]
#[doc = "Raw RC Data."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CUBEPILOT_RAW_RC_DATA {}
impl CUBEPILOT_RAW_RC_DATA {
    pub const ENCODED_LEN: usize = 0usize;
    pub const DEFAULT: Self = Self {};
}
impl Default for CUBEPILOT_RAW_RC_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CUBEPILOT_RAW_RC_DATA {
    type Message = MavMessage;
    const ID: u32 = 50001u32;
    const NAME: &'static str = "CUBEPILOT_RAW_RC";
    const EXTRA_CRC: u8 = 1u8;
    const ENCODED_LEN: usize = 0usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        Ok(Self::default())
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 101"]
#[doc = "Global position/attitude estimate from a vision source.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
    #[doc = "Timestamp (UNIX time or since system boot)."]
    pub usec: u64,
    #[doc = "Global X position."]
    pub x: f32,
    #[doc = "Global Y position."]
    pub y: f32,
    #[doc = "Global Z position."]
    pub z: f32,
    #[doc = "Roll angle."]
    pub roll: f32,
    #[doc = "Pitch angle."]
    pub pitch: f32,
    #[doc = "Yaw angle."]
    pub yaw: f32,
    #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 21],
    #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub reset_counter: u8,
}
impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
    pub const ENCODED_LEN: usize = 117usize;
    pub const DEFAULT: Self = Self {
        usec: 0_u64,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        covariance: [0.0_f32; 21usize],
        reset_counter: 0_u8,
    };
}
impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 101u32;
    const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
    const EXTRA_CRC: u8 = 102u8;
    const ENCODED_LEN: usize = 117usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.usec = buf.get_u64_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.reset_counter = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.usec);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.reset_counter);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 83"]
#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ATTITUDE_TARGET_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Body roll rate."]
    pub body_roll_rate: f32,
    #[doc = "Body pitch rate."]
    pub body_pitch_rate: f32,
    #[doc = "Body yaw rate."]
    pub body_yaw_rate: f32,
    #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)."]
    pub thrust: f32,
    #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle.."]
    pub type_mask: AttitudeTargetTypemask,
}
impl ATTITUDE_TARGET_DATA {
    pub const ENCODED_LEN: usize = 37usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        q: [0.0_f32; 4usize],
        body_roll_rate: 0.0_f32,
        body_pitch_rate: 0.0_f32,
        body_yaw_rate: 0.0_f32,
        thrust: 0.0_f32,
        type_mask: AttitudeTargetTypemask::DEFAULT,
    };
}
impl Default for ATTITUDE_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ATTITUDE_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 83u32;
    const NAME: &'static str = "ATTITUDE_TARGET";
    const EXTRA_CRC: u8 = 22u8;
    const ENCODED_LEN: usize = 37usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.body_roll_rate = buf.get_f32_le();
        __struct.body_pitch_rate = buf.get_f32_le();
        __struct.body_yaw_rate = buf.get_f32_le();
        __struct.thrust = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.type_mask = AttitudeTargetTypemask::from_bits(
            tmp & AttitudeTargetTypemask::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "AttitudeTargetTypemask",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.body_roll_rate);
        __tmp.put_f32_le(self.body_pitch_rate);
        __tmp.put_f32_le(self.body_yaw_rate);
        __tmp.put_f32_le(self.thrust);
        __tmp.put_u8(self.type_mask.bits());
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 105"]
#[doc = "The IMU readings in SI units in NED body frame."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIGHRES_IMU_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X acceleration."]
    pub xacc: f32,
    #[doc = "Y acceleration."]
    pub yacc: f32,
    #[doc = "Z acceleration."]
    pub zacc: f32,
    #[doc = "Angular speed around X axis."]
    pub xgyro: f32,
    #[doc = "Angular speed around Y axis."]
    pub ygyro: f32,
    #[doc = "Angular speed around Z axis."]
    pub zgyro: f32,
    #[doc = "X Magnetic field."]
    pub xmag: f32,
    #[doc = "Y Magnetic field."]
    pub ymag: f32,
    #[doc = "Z Magnetic field."]
    pub zmag: f32,
    #[doc = "Absolute pressure."]
    pub abs_pressure: f32,
    #[doc = "Differential pressure."]
    pub diff_pressure: f32,
    #[doc = "Altitude calculated from pressure."]
    pub pressure_alt: f32,
    #[doc = "Temperature."]
    pub temperature: f32,
    #[doc = "Bitmap for fields that have updated since last message."]
    pub fields_updated: HighresImuUpdatedFlags,
    #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub id: u8,
}
impl HIGHRES_IMU_DATA {
    pub const ENCODED_LEN: usize = 63usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        xacc: 0.0_f32,
        yacc: 0.0_f32,
        zacc: 0.0_f32,
        xgyro: 0.0_f32,
        ygyro: 0.0_f32,
        zgyro: 0.0_f32,
        xmag: 0.0_f32,
        ymag: 0.0_f32,
        zmag: 0.0_f32,
        abs_pressure: 0.0_f32,
        diff_pressure: 0.0_f32,
        pressure_alt: 0.0_f32,
        temperature: 0.0_f32,
        fields_updated: HighresImuUpdatedFlags::DEFAULT,
        id: 0_u8,
    };
}
impl Default for HIGHRES_IMU_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIGHRES_IMU_DATA {
    type Message = MavMessage;
    const ID: u32 = 105u32;
    const NAME: &'static str = "HIGHRES_IMU";
    const EXTRA_CRC: u8 = 93u8;
    const ENCODED_LEN: usize = 63usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.xacc = buf.get_f32_le();
        __struct.yacc = buf.get_f32_le();
        __struct.zacc = buf.get_f32_le();
        __struct.xgyro = buf.get_f32_le();
        __struct.ygyro = buf.get_f32_le();
        __struct.zgyro = buf.get_f32_le();
        __struct.xmag = buf.get_f32_le();
        __struct.ymag = buf.get_f32_le();
        __struct.zmag = buf.get_f32_le();
        __struct.abs_pressure = buf.get_f32_le();
        __struct.diff_pressure = buf.get_f32_le();
        __struct.pressure_alt = buf.get_f32_le();
        __struct.temperature = buf.get_f32_le();
        let tmp = buf.get_u16_le();
        __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
            tmp & HighresImuUpdatedFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "HighresImuUpdatedFlags",
            value: tmp as u32,
        })?;
        __struct.id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.xacc);
        __tmp.put_f32_le(self.yacc);
        __tmp.put_f32_le(self.zacc);
        __tmp.put_f32_le(self.xgyro);
        __tmp.put_f32_le(self.ygyro);
        __tmp.put_f32_le(self.zgyro);
        __tmp.put_f32_le(self.xmag);
        __tmp.put_f32_le(self.ymag);
        __tmp.put_f32_le(self.zmag);
        __tmp.put_f32_le(self.abs_pressure);
        __tmp.put_f32_le(self.diff_pressure);
        __tmp.put_f32_le(self.pressure_alt);
        __tmp.put_f32_le(self.temperature);
        __tmp.put_u16_le(self.fields_updated.bits());
        __tmp.put_u8(self.id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 267"]
#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOGGING_DATA_ACKED_DATA {
    #[doc = "sequence number (can wrap)."]
    pub sequence: u16,
    #[doc = "system ID of the target."]
    pub target_system: u8,
    #[doc = "component ID of the target."]
    pub target_component: u8,
    #[doc = "data length."]
    pub length: u8,
    #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists).."]
    pub first_message_offset: u8,
    #[doc = "logged data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 249],
}
impl LOGGING_DATA_ACKED_DATA {
    pub const ENCODED_LEN: usize = 255usize;
    pub const DEFAULT: Self = Self {
        sequence: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        length: 0_u8,
        first_message_offset: 0_u8,
        data: [0_u8; 249usize],
    };
}
impl Default for LOGGING_DATA_ACKED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOGGING_DATA_ACKED_DATA {
    type Message = MavMessage;
    const ID: u32 = 267u32;
    const NAME: &'static str = "LOGGING_DATA_ACKED";
    const EXTRA_CRC: u8 = 35u8;
    const ENCODED_LEN: usize = 255usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.sequence = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.length = buf.get_u8();
        __struct.first_message_offset = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.length);
        __tmp.put_u8(self.first_message_offset);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 291"]
#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ESC_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.."]
    pub time_usec: u64,
    #[doc = "Reported motor RPM from each ESC (negative for reverse rotation).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub rpm: [i32; 4],
    #[doc = "Voltage measured from each ESC.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub voltage: [f32; 4],
    #[doc = "Current measured from each ESC.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub current: [f32; 4],
    #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.."]
    pub index: u8,
}
impl ESC_STATUS_DATA {
    pub const ENCODED_LEN: usize = 57usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        rpm: [0_i32; 4usize],
        voltage: [0.0_f32; 4usize],
        current: [0.0_f32; 4usize],
        index: 0_u8,
    };
}
impl Default for ESC_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ESC_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 291u32;
    const NAME: &'static str = "ESC_STATUS";
    const EXTRA_CRC: u8 = 10u8;
    const ENCODED_LEN: usize = 57usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.rpm {
            let val = buf.get_i32_le();
            *v = val;
        }
        for v in &mut __struct.voltage {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.current {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.index = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.rpm {
            __tmp.put_i32_le(*val);
        }
        for val in &self.voltage {
            __tmp.put_f32_le(*val);
        }
        for val in &self.current {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.index);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 242"]
#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector.         Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HOME_POSITION_DATA {
    #[doc = "Latitude (WGS84)."]
    pub latitude: i32,
    #[doc = "Longitude (WGS84)."]
    pub longitude: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub altitude: i32,
    #[doc = "Local X position of this position in the local coordinate frame (NED)."]
    pub x: f32,
    #[doc = "Local Y position of this position in the local coordinate frame (NED)."]
    pub y: f32,
    #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")."]
    pub z: f32,
    #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_x: f32,
    #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_y: f32,
    #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.."]
    pub approach_z: f32,
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub time_usec: u64,
}
impl HOME_POSITION_DATA {
    pub const ENCODED_LEN: usize = 60usize;
    pub const DEFAULT: Self = Self {
        latitude: 0_i32,
        longitude: 0_i32,
        altitude: 0_i32,
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        q: [0.0_f32; 4usize],
        approach_x: 0.0_f32,
        approach_y: 0.0_f32,
        approach_z: 0.0_f32,
        time_usec: 0_u64,
    };
}
impl Default for HOME_POSITION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HOME_POSITION_DATA {
    type Message = MavMessage;
    const ID: u32 = 242u32;
    const NAME: &'static str = "HOME_POSITION";
    const EXTRA_CRC: u8 = 104u8;
    const ENCODED_LEN: usize = 60usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.altitude = buf.get_i32_le();
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.approach_x = buf.get_f32_le();
        __struct.approach_y = buf.get_f32_le();
        __struct.approach_z = buf.get_f32_le();
        __struct.time_usec = buf.get_u64_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_i32_le(self.altitude);
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.approach_x);
        __tmp.put_f32_le(self.approach_y);
        __tmp.put_f32_le(self.approach_z);
        __tmp.put_u64_le(self.time_usec);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 270"]
#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct VIDEO_STREAM_STATUS_DATA {
    #[doc = "Frame rate."]
    pub framerate: f32,
    #[doc = "Bit rate."]
    pub bitrate: u32,
    #[doc = "Bitmap of stream status flags."]
    pub flags: VideoStreamStatusFlags,
    #[doc = "Horizontal resolution."]
    pub resolution_h: u16,
    #[doc = "Vertical resolution."]
    pub resolution_v: u16,
    #[doc = "Video image rotation clockwise."]
    pub rotation: u16,
    #[doc = "Horizontal Field of view."]
    pub hfov: u16,
    #[doc = "Video Stream ID (1 for first, 2 for second, etc.)."]
    pub stream_id: u8,
}
impl VIDEO_STREAM_STATUS_DATA {
    pub const ENCODED_LEN: usize = 19usize;
    pub const DEFAULT: Self = Self {
        framerate: 0.0_f32,
        bitrate: 0_u32,
        flags: VideoStreamStatusFlags::DEFAULT,
        resolution_h: 0_u16,
        resolution_v: 0_u16,
        rotation: 0_u16,
        hfov: 0_u16,
        stream_id: 0_u8,
    };
}
impl Default for VIDEO_STREAM_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for VIDEO_STREAM_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 270u32;
    const NAME: &'static str = "VIDEO_STREAM_STATUS";
    const EXTRA_CRC: u8 = 59u8;
    const ENCODED_LEN: usize = 19usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.framerate = buf.get_f32_le();
        __struct.bitrate = buf.get_u32_le();
        let tmp = buf.get_u16_le();
        __struct.flags = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "VideoStreamStatusFlags",
            value: tmp as u32,
        })?;
        __struct.resolution_h = buf.get_u16_le();
        __struct.resolution_v = buf.get_u16_le();
        __struct.rotation = buf.get_u16_le();
        __struct.hfov = buf.get_u16_le();
        __struct.stream_id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.framerate);
        __tmp.put_u32_le(self.bitrate);
        __tmp.put_u16_le(self.flags as u16);
        __tmp.put_u16_le(self.resolution_h);
        __tmp.put_u16_le(self.resolution_v);
        __tmp.put_u16_le(self.rotation);
        __tmp.put_u16_le(self.hfov);
        __tmp.put_u8(self.stream_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 281"]
#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_MANAGER_STATUS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "High level gimbal manager flags currently applied.."]
    pub flags: GimbalManagerFlags,
    #[doc = "Gimbal device ID that this gimbal manager is responsible for.."]
    pub gimbal_device_id: u8,
    #[doc = "System ID of MAVLink component with primary control, 0 for none.."]
    pub primary_control_sysid: u8,
    #[doc = "Component ID of MAVLink component with primary control, 0 for none.."]
    pub primary_control_compid: u8,
    #[doc = "System ID of MAVLink component with secondary control, 0 for none.."]
    pub secondary_control_sysid: u8,
    #[doc = "Component ID of MAVLink component with secondary control, 0 for none.."]
    pub secondary_control_compid: u8,
}
impl GIMBAL_MANAGER_STATUS_DATA {
    pub const ENCODED_LEN: usize = 13usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        flags: GimbalManagerFlags::DEFAULT,
        gimbal_device_id: 0_u8,
        primary_control_sysid: 0_u8,
        primary_control_compid: 0_u8,
        secondary_control_sysid: 0_u8,
        secondary_control_compid: 0_u8,
    };
}
impl Default for GIMBAL_MANAGER_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 281u32;
    const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
    const EXTRA_CRC: u8 = 48u8;
    const ENCODED_LEN: usize = 13usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        let tmp = buf.get_u32_le();
        __struct.flags = FromPrimitive::from_u32(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GimbalManagerFlags",
            value: tmp as u32,
        })?;
        __struct.gimbal_device_id = buf.get_u8();
        __struct.primary_control_sysid = buf.get_u8();
        __struct.primary_control_compid = buf.get_u8();
        __struct.secondary_control_sysid = buf.get_u8();
        __struct.secondary_control_compid = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.flags as u32);
        __tmp.put_u8(self.gimbal_device_id);
        __tmp.put_u8(self.primary_control_sysid);
        __tmp.put_u8(self.primary_control_compid);
        __tmp.put_u8(self.secondary_control_sysid);
        __tmp.put_u8(self.secondary_control_compid);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 90"]
#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_STATE_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Roll angle."]
    pub roll: f32,
    #[doc = "Pitch angle."]
    pub pitch: f32,
    #[doc = "Yaw angle."]
    pub yaw: f32,
    #[doc = "Body frame roll / phi angular speed."]
    pub rollspeed: f32,
    #[doc = "Body frame pitch / theta angular speed."]
    pub pitchspeed: f32,
    #[doc = "Body frame yaw / psi angular speed."]
    pub yawspeed: f32,
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Altitude."]
    pub alt: i32,
    #[doc = "Ground X Speed (Latitude)."]
    pub vx: i16,
    #[doc = "Ground Y Speed (Longitude)."]
    pub vy: i16,
    #[doc = "Ground Z Speed (Altitude)."]
    pub vz: i16,
    #[doc = "X acceleration."]
    pub xacc: i16,
    #[doc = "Y acceleration."]
    pub yacc: i16,
    #[doc = "Z acceleration."]
    pub zacc: i16,
}
impl HIL_STATE_DATA {
    pub const ENCODED_LEN: usize = 56usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        roll: 0.0_f32,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        rollspeed: 0.0_f32,
        pitchspeed: 0.0_f32,
        yawspeed: 0.0_f32,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        vx: 0_i16,
        vy: 0_i16,
        vz: 0_i16,
        xacc: 0_i16,
        yacc: 0_i16,
        zacc: 0_i16,
    };
}
impl Default for HIL_STATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_STATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 90u32;
    const NAME: &'static str = "HIL_STATE";
    const EXTRA_CRC: u8 = 183u8;
    const ENCODED_LEN: usize = 56usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.roll = buf.get_f32_le();
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.rollspeed = buf.get_f32_le();
        __struct.pitchspeed = buf.get_f32_le();
        __struct.yawspeed = buf.get_f32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.vx = buf.get_i16_le();
        __struct.vy = buf.get_i16_le();
        __struct.vz = buf.get_i16_le();
        __struct.xacc = buf.get_i16_le();
        __struct.yacc = buf.get_i16_le();
        __struct.zacc = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_f32_le(self.roll);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.rollspeed);
        __tmp.put_f32_le(self.pitchspeed);
        __tmp.put_f32_le(self.yawspeed);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_i16_le(self.vx);
        __tmp.put_i16_le(self.vy);
        __tmp.put_i16_le(self.vz);
        __tmp.put_i16_le(self.xacc);
        __tmp.put_i16_le(self.yacc);
        __tmp.put_i16_le(self.zacc);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 44"]
#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_COUNT_DATA {
    #[doc = "Number of mission items in the sequence."]
    pub count: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_COUNT_DATA {
    pub const ENCODED_LEN: usize = 5usize;
    pub const DEFAULT: Self = Self {
        count: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_COUNT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_COUNT_DATA {
    type Message = MavMessage;
    const ID: u32 = 44u32;
    const NAME: &'static str = "MISSION_COUNT";
    const EXTRA_CRC: u8 = 221u8;
    const ENCODED_LEN: usize = 5usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.count = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.count);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 386"]
#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAN_FRAME_DATA {
    #[doc = "Frame ID."]
    pub id: u32,
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Component ID.."]
    pub target_component: u8,
    #[doc = "Bus number."]
    pub bus: u8,
    #[doc = "Frame length."]
    pub len: u8,
    #[doc = "Frame data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 8],
}
impl CAN_FRAME_DATA {
    pub const ENCODED_LEN: usize = 16usize;
    pub const DEFAULT: Self = Self {
        id: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
        bus: 0_u8,
        len: 0_u8,
        data: [0_u8; 8usize],
    };
}
impl Default for CAN_FRAME_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAN_FRAME_DATA {
    type Message = MavMessage;
    const ID: u32 = 386u32;
    const NAME: &'static str = "CAN_FRAME";
    const EXTRA_CRC: u8 = 132u8;
    const ENCODED_LEN: usize = 16usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.id = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.bus = buf.get_u8();
        __struct.len = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.id);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.bus);
        __tmp.put_u8(self.len);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 285"]
#[doc = "Message reporting the status of a gimbal device.  \t  This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz).  \t  For the angles encoded in the quaternion and the angular velocities holds:  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame).  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame).  \t  If neither of these flags are set, then (for backwards compatibility) it holds:  \t  If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame),  \t  else they are relative to the vehicle heading (vehicle frame).  \t  Other conditions of the flags are not allowed.  \t  The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as  \t  q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t  If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set,  \t  then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t  New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME,  \t  and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown.."]
    pub angular_velocity_x: f32,
    #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown.."]
    pub angular_velocity_y: f32,
    #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown.."]
    pub angular_velocity_z: f32,
    #[doc = "Failure flags (0 for no failure)."]
    pub failure_flags: GimbalDeviceErrorFlags,
    #[doc = "Current gimbal flags set.."]
    pub flags: GimbalDeviceFlags,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub delta_yaw: f32,
    #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub delta_yaw_velocity: f32,
}
impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 48usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        q: [0.0_f32; 4usize],
        angular_velocity_x: 0.0_f32,
        angular_velocity_y: 0.0_f32,
        angular_velocity_z: 0.0_f32,
        failure_flags: GimbalDeviceErrorFlags::DEFAULT,
        flags: GimbalDeviceFlags::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        delta_yaw: 0.0_f32,
        delta_yaw_velocity: 0.0_f32,
    };
}
impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 285u32;
    const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
    const EXTRA_CRC: u8 = 137u8;
    const ENCODED_LEN: usize = 48usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.angular_velocity_x = buf.get_f32_le();
        __struct.angular_velocity_y = buf.get_f32_le();
        __struct.angular_velocity_z = buf.get_f32_le();
        let tmp = buf.get_u32_le();
        __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
            tmp & GimbalDeviceErrorFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "GimbalDeviceErrorFlags",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u16_le();
        __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
            .ok_or(ParserError::InvalidFlag {
                flag_type: "GimbalDeviceFlags",
                value: tmp as u32,
            })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.delta_yaw = buf.get_f32_le();
        __struct.delta_yaw_velocity = buf.get_f32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.angular_velocity_x);
        __tmp.put_f32_le(self.angular_velocity_y);
        __tmp.put_f32_le(self.angular_velocity_z);
        __tmp.put_u32_le(self.failure_flags.bits());
        __tmp.put_u16_le(self.flags.bits());
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_f32_le(self.delta_yaw);
        __tmp.put_f32_le(self.delta_yaw_velocity);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 38"]
#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
    #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list.."]
    pub start_index: i16,
    #[doc = "End index, equal or greater than start index.."]
    pub end_index: i16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_WRITE_PARTIAL_LIST_DATA {
    pub const ENCODED_LEN: usize = 7usize;
    pub const DEFAULT: Self = Self {
        start_index: 0_i16,
        end_index: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
    type Message = MavMessage;
    const ID: u32 = 38u32;
    const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
    const EXTRA_CRC: u8 = 9u8;
    const ENCODED_LEN: usize = 7usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.start_index = buf.get_i16_le();
        __struct.end_index = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.start_index);
        __tmp.put_i16_le(self.end_index);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 135"]
#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TERRAIN_CHECK_DATA {
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
}
impl TERRAIN_CHECK_DATA {
    pub const ENCODED_LEN: usize = 8usize;
    pub const DEFAULT: Self = Self {
        lat: 0_i32,
        lon: 0_i32,
    };
}
impl Default for TERRAIN_CHECK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TERRAIN_CHECK_DATA {
    type Message = MavMessage;
    const ID: u32 = 135u32;
    const NAME: &'static str = "TERRAIN_CHECK";
    const EXTRA_CRC: u8 = 203u8;
    const ENCODED_LEN: usize = 8usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 73"]
#[doc = "Message encoding a mission item. This message is emitted to announce                 the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also https://mavlink.io/en/services/mission.html.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_ITEM_INT_DATA {
    #[doc = "PARAM1, see MAV_CMD enum."]
    pub param1: f32,
    #[doc = "PARAM2, see MAV_CMD enum."]
    pub param2: f32,
    #[doc = "PARAM3, see MAV_CMD enum."]
    pub param3: f32,
    #[doc = "PARAM4, see MAV_CMD enum."]
    pub param4: f32,
    #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7."]
    pub x: i32,
    #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7."]
    pub y: i32,
    #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.."]
    pub z: f32,
    #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4).."]
    pub seq: u16,
    #[doc = "The scheduled action for the waypoint.."]
    pub command: MavCmd,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "The coordinate system of the waypoint.."]
    pub frame: MavFrame,
    #[doc = "false:0, true:1."]
    pub current: u8,
    #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes.."]
    pub autocontinue: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_ITEM_INT_DATA {
    pub const ENCODED_LEN: usize = 38usize;
    pub const DEFAULT: Self = Self {
        param1: 0.0_f32,
        param2: 0.0_f32,
        param3: 0.0_f32,
        param4: 0.0_f32,
        x: 0_i32,
        y: 0_i32,
        z: 0.0_f32,
        seq: 0_u16,
        command: MavCmd::DEFAULT,
        target_system: 0_u8,
        target_component: 0_u8,
        frame: MavFrame::DEFAULT,
        current: 0_u8,
        autocontinue: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_ITEM_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_ITEM_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 73u32;
    const NAME: &'static str = "MISSION_ITEM_INT";
    const EXTRA_CRC: u8 = 38u8;
    const ENCODED_LEN: usize = 38usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.param1 = buf.get_f32_le();
        __struct.param2 = buf.get_f32_le();
        __struct.param3 = buf.get_f32_le();
        __struct.param4 = buf.get_f32_le();
        __struct.x = buf.get_i32_le();
        __struct.y = buf.get_i32_le();
        __struct.z = buf.get_f32_le();
        __struct.seq = buf.get_u16_le();
        let tmp = buf.get_u16_le();
        __struct.command = FromPrimitive::from_u16(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavCmd",
            value: tmp as u32,
        })?;
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        __struct.current = buf.get_u8();
        __struct.autocontinue = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.param1);
        __tmp.put_f32_le(self.param2);
        __tmp.put_f32_le(self.param3);
        __tmp.put_f32_le(self.param4);
        __tmp.put_i32_le(self.x);
        __tmp.put_i32_le(self.y);
        __tmp.put_f32_le(self.z);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u16_le(self.command as u16);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.frame as u8);
        __tmp.put_u8(self.current);
        __tmp.put_u8(self.autocontinue);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 5"]
#[doc = "Request to control this MAV."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CHANGE_OPERATOR_CONTROL_DATA {
    #[doc = "System the GCS requests control for."]
    pub target_system: u8,
    #[doc = "0: request control of this MAV, 1: Release control of this MAV."]
    pub control_request: u8,
    #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.."]
    pub version: u8,
    #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\"."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub passkey: [u8; 25],
}
impl CHANGE_OPERATOR_CONTROL_DATA {
    pub const ENCODED_LEN: usize = 28usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        control_request: 0_u8,
        version: 0_u8,
        passkey: [0_u8; 25usize],
    };
}
impl Default for CHANGE_OPERATOR_CONTROL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
    type Message = MavMessage;
    const ID: u32 = 5u32;
    const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
    const EXTRA_CRC: u8 = 217u8;
    const ENCODED_LEN: usize = 28usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.control_request = buf.get_u8();
        __struct.version = buf.get_u8();
        for v in &mut __struct.passkey {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.control_request);
        __tmp.put_u8(self.version);
        for val in &self.passkey {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 138"]
#[doc = "Motion capture attitude and position."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ATT_POS_MOCAP_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub q: [f32; 4],
    #[doc = "X position (NED)."]
    pub x: f32,
    #[doc = "Y position (NED)."]
    pub y: f32,
    #[doc = "Z position (NED)."]
    pub z: f32,
    #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub covariance: [f32; 21],
}
impl ATT_POS_MOCAP_DATA {
    pub const ENCODED_LEN: usize = 120usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        q: [0.0_f32; 4usize],
        x: 0.0_f32,
        y: 0.0_f32,
        z: 0.0_f32,
        covariance: [0.0_f32; 21usize],
    };
}
impl Default for ATT_POS_MOCAP_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ATT_POS_MOCAP_DATA {
    type Message = MavMessage;
    const ID: u32 = 138u32;
    const NAME: &'static str = "ATT_POS_MOCAP";
    const EXTRA_CRC: u8 = 109u8;
    const ENCODED_LEN: usize = 120usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.q {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.x = buf.get_f32_le();
        __struct.y = buf.get_f32_le();
        __struct.z = buf.get_f32_le();
        for v in &mut __struct.covariance {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.q {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_f32_le(self.x);
        __tmp.put_f32_le(self.y);
        __tmp.put_f32_le(self.z);
        for val in &self.covariance {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 69"]
#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MANUAL_CONTROL_DATA {
    #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.."]
    pub x: i16,
    #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.."]
    pub y: i16,
    #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.."]
    pub z: i16,
    #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.."]
    pub r: i16,
    #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.."]
    pub buttons: u16,
    #[doc = "The system to be controlled.."]
    pub target: u8,
    #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub buttons2: u16,
    #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub enabled_extensions: u8,
    #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub s: i16,
    #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub t: i16,
}
impl MANUAL_CONTROL_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        x: 0_i16,
        y: 0_i16,
        z: 0_i16,
        r: 0_i16,
        buttons: 0_u16,
        target: 0_u8,
        buttons2: 0_u16,
        enabled_extensions: 0_u8,
        s: 0_i16,
        t: 0_i16,
    };
}
impl Default for MANUAL_CONTROL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MANUAL_CONTROL_DATA {
    type Message = MavMessage;
    const ID: u32 = 69u32;
    const NAME: &'static str = "MANUAL_CONTROL";
    const EXTRA_CRC: u8 = 243u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.x = buf.get_i16_le();
        __struct.y = buf.get_i16_le();
        __struct.z = buf.get_i16_le();
        __struct.r = buf.get_i16_le();
        __struct.buttons = buf.get_u16_le();
        __struct.target = buf.get_u8();
        __struct.buttons2 = buf.get_u16_le();
        __struct.enabled_extensions = buf.get_u8();
        __struct.s = buf.get_i16_le();
        __struct.t = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i16_le(self.x);
        __tmp.put_i16_le(self.y);
        __tmp.put_i16_le(self.z);
        __tmp.put_i16_le(self.r);
        __tmp.put_u16_le(self.buttons);
        __tmp.put_u8(self.target);
        __tmp.put_u16_le(self.buttons2);
        __tmp.put_u8(self.enabled_extensions);
        __tmp.put_i16_le(self.s);
        __tmp.put_i16_le(self.t);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 310"]
#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at http://uavcan.org.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct UAVCAN_NODE_STATUS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Time since the start-up of the node.."]
    pub uptime_sec: u32,
    #[doc = "Vendor-specific status information.."]
    pub vendor_specific_status_code: u16,
    #[doc = "Generalized node health status.."]
    pub health: UavcanNodeHealth,
    #[doc = "Generalized operating mode.."]
    pub mode: UavcanNodeMode,
    #[doc = "Not used currently.."]
    pub sub_mode: u8,
}
impl UAVCAN_NODE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 17usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        uptime_sec: 0_u32,
        vendor_specific_status_code: 0_u16,
        health: UavcanNodeHealth::DEFAULT,
        mode: UavcanNodeMode::DEFAULT,
        sub_mode: 0_u8,
    };
}
impl Default for UAVCAN_NODE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for UAVCAN_NODE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 310u32;
    const NAME: &'static str = "UAVCAN_NODE_STATUS";
    const EXTRA_CRC: u8 = 28u8;
    const ENCODED_LEN: usize = 17usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.uptime_sec = buf.get_u32_le();
        __struct.vendor_specific_status_code = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.health = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "UavcanNodeHealth",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.mode = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "UavcanNodeMode",
            value: tmp as u32,
        })?;
        __struct.sub_mode = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.uptime_sec);
        __tmp.put_u16_le(self.vendor_specific_status_code);
        __tmp.put_u8(self.health as u8);
        __tmp.put_u8(self.mode as u8);
        __tmp.put_u8(self.sub_mode);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 9000"]
#[doc = "Cumulative distance traveled for each reported wheel.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct WHEEL_DISTANCE_DATA {
    #[doc = "Timestamp (synced to UNIX time or since system boot).."]
    pub time_usec: u64,
    #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub distance: [f64; 16],
    #[doc = "Number of wheels reported.."]
    pub count: u8,
}
impl WHEEL_DISTANCE_DATA {
    pub const ENCODED_LEN: usize = 137usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        distance: [0.0_f64; 16usize],
        count: 0_u8,
    };
}
impl Default for WHEEL_DISTANCE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for WHEEL_DISTANCE_DATA {
    type Message = MavMessage;
    const ID: u32 = 9000u32;
    const NAME: &'static str = "WHEEL_DISTANCE";
    const EXTRA_CRC: u8 = 113u8;
    const ENCODED_LEN: usize = 137usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.distance {
            let val = buf.get_f64_le();
            *v = val;
        }
        __struct.count = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.distance {
            __tmp.put_f64_le(*val);
        }
        __tmp.put_u8(self.count);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 51"]
#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. https://mavlink.io/en/services/mission.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_REQUEST_INT_DATA {
    #[doc = "Sequence."]
    pub seq: u16,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Mission type.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mission_type: MavMissionType,
}
impl MISSION_REQUEST_INT_DATA {
    pub const ENCODED_LEN: usize = 5usize;
    pub const DEFAULT: Self = Self {
        seq: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        mission_type: MavMissionType::DEFAULT,
    };
}
impl Default for MISSION_REQUEST_INT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_REQUEST_INT_DATA {
    type Message = MavMessage;
    const ID: u32 = 51u32;
    const NAME: &'static str = "MISSION_REQUEST_INT";
    const EXTRA_CRC: u8 = 196u8;
    const ENCODED_LEN: usize = 5usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seq = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.mission_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavMissionType",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seq);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.mission_type as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12903"]
#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_SELF_ID_DATA {
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Indicates the type of the description field.."]
    pub description_type: MavOdidDescType,
    #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub description: [u8; 23],
}
impl OPEN_DRONE_ID_SELF_ID_DATA {
    pub const ENCODED_LEN: usize = 46usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        description_type: MavOdidDescType::DEFAULT,
        description: [0_u8; 23usize],
    };
}
impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
    type Message = MavMessage;
    const ID: u32 = 12903u32;
    const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
    const EXTRA_CRC: u8 = 249u8;
    const ENCODED_LEN: usize = 46usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.description_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidDescType",
                value: tmp as u32,
            })?;
        for v in &mut __struct.description {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.description_type as u8);
        for val in &self.description {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 251"]
#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct NAMED_VALUE_FLOAT_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Floating point value."]
    pub value: f32,
    #[doc = "Name of the debug variable."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 10],
}
impl NAMED_VALUE_FLOAT_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        value: 0.0_f32,
        name: [0_u8; 10usize],
    };
}
impl Default for NAMED_VALUE_FLOAT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for NAMED_VALUE_FLOAT_DATA {
    type Message = MavMessage;
    const ID: u32 = 251u32;
    const NAME: &'static str = "NAMED_VALUE_FLOAT";
    const EXTRA_CRC: u8 = 170u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.value = buf.get_f32_le();
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.value);
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 35"]
#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RC_CHANNELS_RAW_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "RC channel 1 value.."]
    pub chan1_raw: u16,
    #[doc = "RC channel 2 value.."]
    pub chan2_raw: u16,
    #[doc = "RC channel 3 value.."]
    pub chan3_raw: u16,
    #[doc = "RC channel 4 value.."]
    pub chan4_raw: u16,
    #[doc = "RC channel 5 value.."]
    pub chan5_raw: u16,
    #[doc = "RC channel 6 value.."]
    pub chan6_raw: u16,
    #[doc = "RC channel 7 value.."]
    pub chan7_raw: u16,
    #[doc = "RC channel 8 value.."]
    pub chan8_raw: u16,
    #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.."]
    pub port: u8,
    #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.."]
    pub rssi: u8,
}
impl RC_CHANNELS_RAW_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        chan1_raw: 0_u16,
        chan2_raw: 0_u16,
        chan3_raw: 0_u16,
        chan4_raw: 0_u16,
        chan5_raw: 0_u16,
        chan6_raw: 0_u16,
        chan7_raw: 0_u16,
        chan8_raw: 0_u16,
        port: 0_u8,
        rssi: 0_u8,
    };
}
impl Default for RC_CHANNELS_RAW_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RC_CHANNELS_RAW_DATA {
    type Message = MavMessage;
    const ID: u32 = 35u32;
    const NAME: &'static str = "RC_CHANNELS_RAW";
    const EXTRA_CRC: u8 = 244u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.chan1_raw = buf.get_u16_le();
        __struct.chan2_raw = buf.get_u16_le();
        __struct.chan3_raw = buf.get_u16_le();
        __struct.chan4_raw = buf.get_u16_le();
        __struct.chan5_raw = buf.get_u16_le();
        __struct.chan6_raw = buf.get_u16_le();
        __struct.chan7_raw = buf.get_u16_le();
        __struct.chan8_raw = buf.get_u16_le();
        __struct.port = buf.get_u8();
        __struct.rssi = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u16_le(self.chan1_raw);
        __tmp.put_u16_le(self.chan2_raw);
        __tmp.put_u16_le(self.chan3_raw);
        __tmp.put_u16_le(self.chan4_raw);
        __tmp.put_u16_le(self.chan5_raw);
        __tmp.put_u16_le(self.chan6_raw);
        __tmp.put_u16_le(self.chan7_raw);
        __tmp.put_u16_le(self.chan8_raw);
        __tmp.put_u8(self.port);
        __tmp.put_u8(self.rssi);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 0"]
#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at https://mavlink.io/en/services/heartbeat.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HEARTBEAT_DATA {
    #[doc = "A bitfield for use for autopilot-specific flags."]
    pub custom_mode: u32,
    #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.."]
    pub mavtype: MavType,
    #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.."]
    pub autopilot: MavAutopilot,
    #[doc = "System mode bitmap.."]
    pub base_mode: MavModeFlag,
    #[doc = "System status flag.."]
    pub system_status: MavState,
    #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version."]
    pub mavlink_version: u8,
}
impl HEARTBEAT_DATA {
    pub const ENCODED_LEN: usize = 9usize;
    pub const DEFAULT: Self = Self {
        custom_mode: 0_u32,
        mavtype: MavType::DEFAULT,
        autopilot: MavAutopilot::DEFAULT,
        base_mode: MavModeFlag::DEFAULT,
        system_status: MavState::DEFAULT,
        mavlink_version: 0_u8,
    };
}
impl Default for HEARTBEAT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HEARTBEAT_DATA {
    type Message = MavMessage;
    const ID: u32 = 0u32;
    const NAME: &'static str = "HEARTBEAT";
    const EXTRA_CRC: u8 = 50u8;
    const ENCODED_LEN: usize = 9usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.custom_mode = buf.get_u32_le();
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavType",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.autopilot = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavAutopilot",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "MavModeFlag",
                value: tmp as u32,
            },
        )?;
        let tmp = buf.get_u8();
        __struct.system_status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavState",
            value: tmp as u32,
        })?;
        __struct.mavlink_version = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.custom_mode);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.autopilot as u8);
        __tmp.put_u8(self.base_mode.bits());
        __tmp.put_u8(self.system_status as u8);
        __tmp.put_u8(self.mavlink_version);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 301"]
#[doc = "The location and information of an AIS vessel."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct AIS_VESSEL_DATA {
    #[doc = "Mobile Marine Service Identifier, 9 decimal digits."]
    pub MMSI: u32,
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Course over ground."]
    pub COG: u16,
    #[doc = "True heading."]
    pub heading: u16,
    #[doc = "Speed over ground."]
    pub velocity: u16,
    #[doc = "Distance from lat/lon location to bow."]
    pub dimension_bow: u16,
    #[doc = "Distance from lat/lon location to stern."]
    pub dimension_stern: u16,
    #[doc = "Time since last communication in seconds."]
    pub tslc: u16,
    #[doc = "Bitmask to indicate various statuses including valid data fields."]
    pub flags: AisFlags,
    #[doc = "Turn rate."]
    pub turn_rate: i8,
    #[doc = "Navigational status."]
    pub navigational_status: AisNavStatus,
    #[doc = "Type of vessels."]
    pub mavtype: AisType,
    #[doc = "Distance from lat/lon location to port side."]
    pub dimension_port: u8,
    #[doc = "Distance from lat/lon location to starboard side."]
    pub dimension_starboard: u8,
    #[doc = "The vessel callsign."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub callsign: [u8; 7],
    #[doc = "The vessel name."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub name: [u8; 20],
}
impl AIS_VESSEL_DATA {
    pub const ENCODED_LEN: usize = 58usize;
    pub const DEFAULT: Self = Self {
        MMSI: 0_u32,
        lat: 0_i32,
        lon: 0_i32,
        COG: 0_u16,
        heading: 0_u16,
        velocity: 0_u16,
        dimension_bow: 0_u16,
        dimension_stern: 0_u16,
        tslc: 0_u16,
        flags: AisFlags::DEFAULT,
        turn_rate: 0_i8,
        navigational_status: AisNavStatus::DEFAULT,
        mavtype: AisType::DEFAULT,
        dimension_port: 0_u8,
        dimension_starboard: 0_u8,
        callsign: [0_u8; 7usize],
        name: [0_u8; 20usize],
    };
}
impl Default for AIS_VESSEL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for AIS_VESSEL_DATA {
    type Message = MavMessage;
    const ID: u32 = 301u32;
    const NAME: &'static str = "AIS_VESSEL";
    const EXTRA_CRC: u8 = 243u8;
    const ENCODED_LEN: usize = 58usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.MMSI = buf.get_u32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.COG = buf.get_u16_le();
        __struct.heading = buf.get_u16_le();
        __struct.velocity = buf.get_u16_le();
        __struct.dimension_bow = buf.get_u16_le();
        __struct.dimension_stern = buf.get_u16_le();
        __struct.tslc = buf.get_u16_le();
        let tmp = buf.get_u16_le();
        __struct.flags =
            AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(ParserError::InvalidFlag {
                flag_type: "AisFlags",
                value: tmp as u32,
            })?;
        __struct.turn_rate = buf.get_i8();
        let tmp = buf.get_u8();
        __struct.navigational_status =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "AisNavStatus",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "AisType",
            value: tmp as u32,
        })?;
        __struct.dimension_port = buf.get_u8();
        __struct.dimension_starboard = buf.get_u8();
        for v in &mut __struct.callsign {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.name {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.MMSI);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_u16_le(self.COG);
        __tmp.put_u16_le(self.heading);
        __tmp.put_u16_le(self.velocity);
        __tmp.put_u16_le(self.dimension_bow);
        __tmp.put_u16_le(self.dimension_stern);
        __tmp.put_u16_le(self.tslc);
        __tmp.put_u16_le(self.flags.bits());
        __tmp.put_i8(self.turn_rate);
        __tmp.put_u8(self.navigational_status as u8);
        __tmp.put_u8(self.mavtype as u8);
        __tmp.put_u8(self.dimension_port);
        __tmp.put_u8(self.dimension_starboard);
        for val in &self.callsign {
            __tmp.put_u8(*val);
        }
        for val in &self.name {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 280"]
#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_MANAGER_INFORMATION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Bitmap of gimbal capability flags.."]
    pub cap_flags: GimbalManagerCapFlags,
    #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)."]
    pub roll_min: f32,
    #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)."]
    pub roll_max: f32,
    #[doc = "Minimum pitch angle (positive: up, negative: down)."]
    pub pitch_min: f32,
    #[doc = "Maximum pitch angle (positive: up, negative: down)."]
    pub pitch_max: f32,
    #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)."]
    pub yaw_min: f32,
    #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)."]
    pub yaw_max: f32,
    #[doc = "Gimbal device ID that this gimbal manager is responsible for.."]
    pub gimbal_device_id: u8,
}
impl GIMBAL_MANAGER_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 33usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        cap_flags: GimbalManagerCapFlags::DEFAULT,
        roll_min: 0.0_f32,
        roll_max: 0.0_f32,
        pitch_min: 0.0_f32,
        pitch_max: 0.0_f32,
        yaw_min: 0.0_f32,
        yaw_max: 0.0_f32,
        gimbal_device_id: 0_u8,
    };
}
impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 280u32;
    const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
    const EXTRA_CRC: u8 = 70u8;
    const ENCODED_LEN: usize = 33usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        let tmp = buf.get_u32_le();
        __struct.cap_flags = GimbalManagerCapFlags::from_bits(
            tmp & GimbalManagerCapFlags::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "GimbalManagerCapFlags",
            value: tmp as u32,
        })?;
        __struct.roll_min = buf.get_f32_le();
        __struct.roll_max = buf.get_f32_le();
        __struct.pitch_min = buf.get_f32_le();
        __struct.pitch_max = buf.get_f32_le();
        __struct.yaw_min = buf.get_f32_le();
        __struct.yaw_max = buf.get_f32_le();
        __struct.gimbal_device_id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.cap_flags.bits());
        __tmp.put_f32_le(self.roll_min);
        __tmp.put_f32_le(self.roll_max);
        __tmp.put_f32_le(self.pitch_min);
        __tmp.put_f32_le(self.pitch_max);
        __tmp.put_f32_le(self.yaw_min);
        __tmp.put_f32_le(self.yaw_max);
        __tmp.put_u8(self.gimbal_device_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 259"]
#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_INFORMATION_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "Version of the camera firmware, encoded as: (Dev &amp; 0xff) &lt;&lt; 24 | (Patch &amp; 0xff) &lt;&lt; 16 | (Minor &amp; 0xff) &lt;&lt; 8 | (Major &amp; 0xff)."]
    pub firmware_version: u32,
    #[doc = "Focal length."]
    pub focal_length: f32,
    #[doc = "Image sensor size horizontal."]
    pub sensor_size_h: f32,
    #[doc = "Image sensor size vertical."]
    pub sensor_size_v: f32,
    #[doc = "Bitmap of camera capability flags.."]
    pub flags: CameraCapFlags,
    #[doc = "Horizontal image resolution."]
    pub resolution_h: u16,
    #[doc = "Vertical image resolution."]
    pub resolution_v: u16,
    #[doc = "Camera definition version (iteration)."]
    pub cam_definition_version: u16,
    #[doc = "Name of the camera vendor."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vendor_name: [u8; 32],
    #[doc = "Name of the camera model."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub model_name: [u8; 32],
    #[doc = "Reserved for a lens ID."]
    pub lens_id: u8,
    #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub cam_definition_uri: [u8; 140],
}
impl CAMERA_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 235usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        firmware_version: 0_u32,
        focal_length: 0.0_f32,
        sensor_size_h: 0.0_f32,
        sensor_size_v: 0.0_f32,
        flags: CameraCapFlags::DEFAULT,
        resolution_h: 0_u16,
        resolution_v: 0_u16,
        cam_definition_version: 0_u16,
        vendor_name: [0_u8; 32usize],
        model_name: [0_u8; 32usize],
        lens_id: 0_u8,
        cam_definition_uri: [0_u8; 140usize],
    };
}
impl Default for CAMERA_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 259u32;
    const NAME: &'static str = "CAMERA_INFORMATION";
    const EXTRA_CRC: u8 = 92u8;
    const ENCODED_LEN: usize = 235usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.firmware_version = buf.get_u32_le();
        __struct.focal_length = buf.get_f32_le();
        __struct.sensor_size_h = buf.get_f32_le();
        __struct.sensor_size_v = buf.get_f32_le();
        let tmp = buf.get_u32_le();
        __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "CameraCapFlags",
                value: tmp as u32,
            },
        )?;
        __struct.resolution_h = buf.get_u16_le();
        __struct.resolution_v = buf.get_u16_le();
        __struct.cam_definition_version = buf.get_u16_le();
        for v in &mut __struct.vendor_name {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.model_name {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.lens_id = buf.get_u8();
        for v in &mut __struct.cam_definition_uri {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_u32_le(self.firmware_version);
        __tmp.put_f32_le(self.focal_length);
        __tmp.put_f32_le(self.sensor_size_h);
        __tmp.put_f32_le(self.sensor_size_v);
        __tmp.put_u32_le(self.flags.bits());
        __tmp.put_u16_le(self.resolution_h);
        __tmp.put_u16_le(self.resolution_v);
        __tmp.put_u16_le(self.cam_definition_version);
        for val in &self.vendor_name {
            __tmp.put_u8(*val);
        }
        for val in &self.model_name {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.lens_id);
        for val in &self.cam_definition_uri {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 142"]
#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RESOURCE_REQUEST_DATA {
    #[doc = "Request ID. This ID should be re-used when sending back URI contents."]
    pub request_id: u8,
    #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary."]
    pub uri_type: u8,
    #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uri: [u8; 120],
    #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.."]
    pub transfer_type: u8,
    #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub storage: [u8; 120],
}
impl RESOURCE_REQUEST_DATA {
    pub const ENCODED_LEN: usize = 243usize;
    pub const DEFAULT: Self = Self {
        request_id: 0_u8,
        uri_type: 0_u8,
        uri: [0_u8; 120usize],
        transfer_type: 0_u8,
        storage: [0_u8; 120usize],
    };
}
impl Default for RESOURCE_REQUEST_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for RESOURCE_REQUEST_DATA {
    type Message = MavMessage;
    const ID: u32 = 142u32;
    const NAME: &'static str = "RESOURCE_REQUEST";
    const EXTRA_CRC: u8 = 72u8;
    const ENCODED_LEN: usize = 243usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.request_id = buf.get_u8();
        __struct.uri_type = buf.get_u8();
        for v in &mut __struct.uri {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.transfer_type = buf.get_u8();
        for v in &mut __struct.storage {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.request_id);
        __tmp.put_u8(self.uri_type);
        for val in &self.uri {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.transfer_type);
        for val in &self.storage {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 370"]
#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for smart battery frequent updates.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct SMART_BATTERY_INFO_DATA {
    #[doc = "Capacity when full according to manufacturer, -1: field not provided.."]
    pub capacity_full_specification: i32,
    #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided.."]
    pub capacity_full: i32,
    #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided.."]
    pub cycle_count: u16,
    #[doc = "Battery weight. 0: field not provided.."]
    pub weight: u16,
    #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value.."]
    pub discharge_minimum_voltage: u16,
    #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value.."]
    pub charging_minimum_voltage: u16,
    #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value.."]
    pub resting_minimum_voltage: u16,
    #[doc = "Battery ID."]
    pub id: u8,
    #[doc = "Function of the battery."]
    pub battery_function: MavBatteryFunction,
    #[doc = "Type (chemistry) of the battery."]
    pub mavtype: MavBatteryType,
    #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub serial_number: [u8; 16],
    #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub device_name: [u8; 50],
    #[doc = "Maximum per-cell voltage when charged. 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub charging_maximum_voltage: u16,
    #[doc = "Number of battery cells in series. 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub cells_in_series: u8,
    #[doc = "Maximum pack discharge current. 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub discharge_maximum_current: u32,
    #[doc = "Maximum pack discharge burst current. 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub discharge_maximum_burst_current: u32,
    #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub manufacture_date: [u8; 11],
}
impl SMART_BATTERY_INFO_DATA {
    pub const ENCODED_LEN: usize = 109usize;
    pub const DEFAULT: Self = Self {
        capacity_full_specification: 0_i32,
        capacity_full: 0_i32,
        cycle_count: 0_u16,
        weight: 0_u16,
        discharge_minimum_voltage: 0_u16,
        charging_minimum_voltage: 0_u16,
        resting_minimum_voltage: 0_u16,
        id: 0_u8,
        battery_function: MavBatteryFunction::DEFAULT,
        mavtype: MavBatteryType::DEFAULT,
        serial_number: [0_u8; 16usize],
        device_name: [0_u8; 50usize],
        charging_maximum_voltage: 0_u16,
        cells_in_series: 0_u8,
        discharge_maximum_current: 0_u32,
        discharge_maximum_burst_current: 0_u32,
        manufacture_date: [0_u8; 11usize],
    };
}
impl Default for SMART_BATTERY_INFO_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for SMART_BATTERY_INFO_DATA {
    type Message = MavMessage;
    const ID: u32 = 370u32;
    const NAME: &'static str = "SMART_BATTERY_INFO";
    const EXTRA_CRC: u8 = 75u8;
    const ENCODED_LEN: usize = 109usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.capacity_full_specification = buf.get_i32_le();
        __struct.capacity_full = buf.get_i32_le();
        __struct.cycle_count = buf.get_u16_le();
        __struct.weight = buf.get_u16_le();
        __struct.discharge_minimum_voltage = buf.get_u16_le();
        __struct.charging_minimum_voltage = buf.get_u16_le();
        __struct.resting_minimum_voltage = buf.get_u16_le();
        __struct.id = buf.get_u8();
        let tmp = buf.get_u8();
        __struct.battery_function =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavBatteryFunction",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.mavtype = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavBatteryType",
            value: tmp as u32,
        })?;
        for v in &mut __struct.serial_number {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.device_name {
            let val = buf.get_u8();
            *v = val;
        }
        __struct.charging_maximum_voltage = buf.get_u16_le();
        __struct.cells_in_series = buf.get_u8();
        __struct.discharge_maximum_current = buf.get_u32_le();
        __struct.discharge_maximum_burst_current = buf.get_u32_le();
        for v in &mut __struct.manufacture_date {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.capacity_full_specification);
        __tmp.put_i32_le(self.capacity_full);
        __tmp.put_u16_le(self.cycle_count);
        __tmp.put_u16_le(self.weight);
        __tmp.put_u16_le(self.discharge_minimum_voltage);
        __tmp.put_u16_le(self.charging_minimum_voltage);
        __tmp.put_u16_le(self.resting_minimum_voltage);
        __tmp.put_u8(self.id);
        __tmp.put_u8(self.battery_function as u8);
        __tmp.put_u8(self.mavtype as u8);
        for val in &self.serial_number {
            __tmp.put_u8(*val);
        }
        for val in &self.device_name {
            __tmp.put_u8(*val);
        }
        __tmp.put_u16_le(self.charging_maximum_voltage);
        __tmp.put_u8(self.cells_in_series);
        __tmp.put_u32_le(self.discharge_maximum_current);
        __tmp.put_u32_le(self.discharge_maximum_burst_current);
        for val in &self.manufacture_date {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 46"]
#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MISSION_ITEM_REACHED_DATA {
    #[doc = "Sequence."]
    pub seq: u16,
}
impl MISSION_ITEM_REACHED_DATA {
    pub const ENCODED_LEN: usize = 2usize;
    pub const DEFAULT: Self = Self { seq: 0_u16 };
}
impl Default for MISSION_ITEM_REACHED_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MISSION_ITEM_REACHED_DATA {
    type Message = MavMessage;
    const ID: u32 = 46u32;
    const NAME: &'static str = "MISSION_ITEM_REACHED";
    const EXTRA_CRC: u8 = 11u8;
    const ENCODED_LEN: usize = 2usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.seq = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.seq);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 254"]
#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DEBUG_DATA {
    #[doc = "Timestamp (time since system boot).."]
    pub time_boot_ms: u32,
    #[doc = "DEBUG value."]
    pub value: f32,
    #[doc = "index of debug variable."]
    pub ind: u8,
}
impl DEBUG_DATA {
    pub const ENCODED_LEN: usize = 9usize;
    pub const DEFAULT: Self = Self {
        time_boot_ms: 0_u32,
        value: 0.0_f32,
        ind: 0_u8,
    };
}
impl Default for DEBUG_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DEBUG_DATA {
    type Message = MavMessage;
    const ID: u32 = 254u32;
    const NAME: &'static str = "DEBUG";
    const EXTRA_CRC: u8 = 46u8;
    const ENCODED_LEN: usize = 9usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_boot_ms = buf.get_u32_le();
        __struct.value = buf.get_f32_le();
        __struct.ind = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.time_boot_ms);
        __tmp.put_f32_le(self.value);
        __tmp.put_u8(self.ind);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12919"]
#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
    #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon).."]
    pub operator_latitude: i32,
    #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon).."]
    pub operator_longitude: i32,
    #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.."]
    pub operator_altitude_geo: f32,
    #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.."]
    pub timestamp: u32,
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
}
impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
    pub const ENCODED_LEN: usize = 18usize;
    pub const DEFAULT: Self = Self {
        operator_latitude: 0_i32,
        operator_longitude: 0_i32,
        operator_altitude_geo: 0.0_f32,
        timestamp: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
    type Message = MavMessage;
    const ID: u32 = 12919u32;
    const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
    const EXTRA_CRC: u8 = 7u8;
    const ENCODED_LEN: usize = 18usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.operator_latitude = buf.get_i32_le();
        __struct.operator_longitude = buf.get_i32_le();
        __struct.operator_altitude_geo = buf.get_f32_le();
        __struct.timestamp = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.operator_latitude);
        __tmp.put_i32_le(self.operator_longitude);
        __tmp.put_f32_le(self.operator_altitude_geo);
        __tmp.put_u32_le(self.timestamp);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 67"]
#[doc = "Data stream status information.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DATA_STREAM_DATA {
    #[doc = "The message rate."]
    pub message_rate: u16,
    #[doc = "The ID of the requested data stream."]
    pub stream_id: u8,
    #[doc = "1 stream is enabled, 0 stream is stopped.."]
    pub on_off: u8,
}
impl DATA_STREAM_DATA {
    pub const ENCODED_LEN: usize = 4usize;
    pub const DEFAULT: Self = Self {
        message_rate: 0_u16,
        stream_id: 0_u8,
        on_off: 0_u8,
    };
}
impl Default for DATA_STREAM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for DATA_STREAM_DATA {
    type Message = MavMessage;
    const ID: u32 = 67u32;
    const NAME: &'static str = "DATA_STREAM";
    const EXTRA_CRC: u8 = 21u8;
    const ENCODED_LEN: usize = 4usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.message_rate = buf.get_u16_le();
        __struct.stream_id = buf.get_u8();
        __struct.on_off = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.message_rate);
        __tmp.put_u8(self.stream_id);
        __tmp.put_u8(self.on_off);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 246"]
#[doc = "The location and information of an ADSB vehicle."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ADSB_VEHICLE_DATA {
    #[doc = "ICAO address."]
    pub ICAO_address: u32,
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Altitude(ASL)."]
    pub altitude: i32,
    #[doc = "Course over ground."]
    pub heading: u16,
    #[doc = "The horizontal velocity."]
    pub hor_velocity: u16,
    #[doc = "The vertical velocity. Positive is up."]
    pub ver_velocity: i16,
    #[doc = "Bitmap to indicate various statuses including valid data fields."]
    pub flags: AdsbFlags,
    #[doc = "Squawk code."]
    pub squawk: u16,
    #[doc = "ADSB altitude type.."]
    pub altitude_type: AdsbAltitudeType,
    #[doc = "The callsign, 8+null."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub callsign: [u8; 9],
    #[doc = "ADSB emitter type.."]
    pub emitter_type: AdsbEmitterType,
    #[doc = "Time since last communication in seconds."]
    pub tslc: u8,
}
impl ADSB_VEHICLE_DATA {
    pub const ENCODED_LEN: usize = 38usize;
    pub const DEFAULT: Self = Self {
        ICAO_address: 0_u32,
        lat: 0_i32,
        lon: 0_i32,
        altitude: 0_i32,
        heading: 0_u16,
        hor_velocity: 0_u16,
        ver_velocity: 0_i16,
        flags: AdsbFlags::DEFAULT,
        squawk: 0_u16,
        altitude_type: AdsbAltitudeType::DEFAULT,
        callsign: [0_u8; 9usize],
        emitter_type: AdsbEmitterType::DEFAULT,
        tslc: 0_u8,
    };
}
impl Default for ADSB_VEHICLE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ADSB_VEHICLE_DATA {
    type Message = MavMessage;
    const ID: u32 = 246u32;
    const NAME: &'static str = "ADSB_VEHICLE";
    const EXTRA_CRC: u8 = 184u8;
    const ENCODED_LEN: usize = 38usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.ICAO_address = buf.get_u32_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.altitude = buf.get_i32_le();
        __struct.heading = buf.get_u16_le();
        __struct.hor_velocity = buf.get_u16_le();
        __struct.ver_velocity = buf.get_i16_le();
        let tmp = buf.get_u16_le();
        __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
            ParserError::InvalidFlag {
                flag_type: "AdsbFlags",
                value: tmp as u32,
            },
        )?;
        __struct.squawk = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.altitude_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "AdsbAltitudeType",
            value: tmp as u32,
        })?;
        for v in &mut __struct.callsign {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.emitter_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "AdsbEmitterType",
            value: tmp as u32,
        })?;
        __struct.tslc = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.ICAO_address);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.altitude);
        __tmp.put_u16_le(self.heading);
        __tmp.put_u16_le(self.hor_velocity);
        __tmp.put_i16_le(self.ver_velocity);
        __tmp.put_u16_le(self.flags.bits());
        __tmp.put_u16_le(self.squawk);
        __tmp.put_u8(self.altitude_type as u8);
        for val in &self.callsign {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.emitter_type as u8);
        __tmp.put_u8(self.tslc);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 375"]
#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ACTUATOR_OUTPUT_STATUS_DATA {
    #[doc = "Timestamp (since system boot).."]
    pub time_usec: u64,
    #[doc = "Active outputs."]
    pub active: u32,
    #[doc = "Servo / motor output array values. Zero values indicate unused channels.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub actuator: [f32; 32],
}
impl ACTUATOR_OUTPUT_STATUS_DATA {
    pub const ENCODED_LEN: usize = 140usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        active: 0_u32,
        actuator: [0.0_f32; 32usize],
    };
}
impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 375u32;
    const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
    const EXTRA_CRC: u8 = 251u8;
    const ENCODED_LEN: usize = 140usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.active = buf.get_u32_le();
        for v in &mut __struct.actuator {
            let val = buf.get_f32_le();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_u32_le(self.active);
        for val in &self.actuator {
            __tmp.put_f32_le(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 258"]
#[doc = "Control vehicle tone generation (buzzer).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct PLAY_TUNE_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "tune in board specific format."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub tune: [u8; 30],
    #[doc = "tune extension (appended to tune)."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub tune2: [u8; 200],
}
impl PLAY_TUNE_DATA {
    pub const ENCODED_LEN: usize = 232usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        tune: [0_u8; 30usize],
        tune2: [0_u8; 200usize],
    };
}
impl Default for PLAY_TUNE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for PLAY_TUNE_DATA {
    type Message = MavMessage;
    const ID: u32 = 258u32;
    const NAME: &'static str = "PLAY_TUNE";
    const EXTRA_CRC: u8 = 187u8;
    const ENCODED_LEN: usize = 232usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.tune {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.tune2 {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.tune {
            __tmp.put_u8(*val);
        }
        for val in &self.tune2 {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 113"]
#[doc = "The global position, as returned by the Global Positioning System (GPS). This is                  NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HIL_GPS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Latitude (WGS84)."]
    pub lat: i32,
    #[doc = "Longitude (WGS84)."]
    pub lon: i32,
    #[doc = "Altitude (MSL). Positive for up.."]
    pub alt: i32,
    #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub eph: u16,
    #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX."]
    pub epv: u16,
    #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX."]
    pub vel: u16,
    #[doc = "GPS velocity in north direction in earth-fixed NED frame."]
    pub vn: i16,
    #[doc = "GPS velocity in east direction in earth-fixed NED frame."]
    pub ve: i16,
    #[doc = "GPS velocity in down direction in earth-fixed NED frame."]
    pub vd: i16,
    #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX."]
    pub cog: u16,
    #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.."]
    pub fix_type: u8,
    #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX."]
    pub satellites_visible: u8,
    #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub id: u8,
    #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub yaw: u16,
}
impl HIL_GPS_DATA {
    pub const ENCODED_LEN: usize = 39usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        lat: 0_i32,
        lon: 0_i32,
        alt: 0_i32,
        eph: 0_u16,
        epv: 0_u16,
        vel: 0_u16,
        vn: 0_i16,
        ve: 0_i16,
        vd: 0_i16,
        cog: 0_u16,
        fix_type: 0_u8,
        satellites_visible: 0_u8,
        id: 0_u8,
        yaw: 0_u16,
    };
}
impl Default for HIL_GPS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HIL_GPS_DATA {
    type Message = MavMessage;
    const ID: u32 = 113u32;
    const NAME: &'static str = "HIL_GPS";
    const EXTRA_CRC: u8 = 124u8;
    const ENCODED_LEN: usize = 39usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.alt = buf.get_i32_le();
        __struct.eph = buf.get_u16_le();
        __struct.epv = buf.get_u16_le();
        __struct.vel = buf.get_u16_le();
        __struct.vn = buf.get_i16_le();
        __struct.ve = buf.get_i16_le();
        __struct.vd = buf.get_i16_le();
        __struct.cog = buf.get_u16_le();
        __struct.fix_type = buf.get_u8();
        __struct.satellites_visible = buf.get_u8();
        __struct.id = buf.get_u8();
        __struct.yaw = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_i32_le(self.alt);
        __tmp.put_u16_le(self.eph);
        __tmp.put_u16_le(self.epv);
        __tmp.put_u16_le(self.vel);
        __tmp.put_i16_le(self.vn);
        __tmp.put_i16_le(self.ve);
        __tmp.put_i16_le(self.vd);
        __tmp.put_u16_le(self.cog);
        __tmp.put_u8(self.fix_type);
        __tmp.put_u8(self.satellites_visible);
        __tmp.put_u8(self.id);
        __tmp.put_u16_le(self.yaw);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 373"]
#[doc = "Telemetry of power generation system. Alternator or mechanical generator.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GENERATOR_STATUS_DATA {
    #[doc = "Status flags.."]
    pub status: MavGeneratorStatusFlag,
    #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided.."]
    pub battery_current: f32,
    #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided."]
    pub load_current: f32,
    #[doc = "The power being generated. NaN: field not provided."]
    pub power_generated: f32,
    #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus.."]
    pub bus_voltage: f32,
    #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided."]
    pub bat_current_setpoint: f32,
    #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided.."]
    pub runtime: u32,
    #[doc = "Seconds until this generator requires maintenance.  A negative value indicates maintenance is past-due. INT32_MAX: field not provided.."]
    pub time_until_maintenance: i32,
    #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided.."]
    pub generator_speed: u16,
    #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided.."]
    pub rectifier_temperature: i16,
    #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided.."]
    pub generator_temperature: i16,
}
impl GENERATOR_STATUS_DATA {
    pub const ENCODED_LEN: usize = 42usize;
    pub const DEFAULT: Self = Self {
        status: MavGeneratorStatusFlag::DEFAULT,
        battery_current: 0.0_f32,
        load_current: 0.0_f32,
        power_generated: 0.0_f32,
        bus_voltage: 0.0_f32,
        bat_current_setpoint: 0.0_f32,
        runtime: 0_u32,
        time_until_maintenance: 0_i32,
        generator_speed: 0_u16,
        rectifier_temperature: 0_i16,
        generator_temperature: 0_i16,
    };
}
impl Default for GENERATOR_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GENERATOR_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 373u32;
    const NAME: &'static str = "GENERATOR_STATUS";
    const EXTRA_CRC: u8 = 117u8;
    const ENCODED_LEN: usize = 42usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u64_le();
        __struct.status = MavGeneratorStatusFlag::from_bits(
            tmp & MavGeneratorStatusFlag::all().bits(),
        )
        .ok_or(ParserError::InvalidFlag {
            flag_type: "MavGeneratorStatusFlag",
            value: tmp as u32,
        })?;
        __struct.battery_current = buf.get_f32_le();
        __struct.load_current = buf.get_f32_le();
        __struct.power_generated = buf.get_f32_le();
        __struct.bus_voltage = buf.get_f32_le();
        __struct.bat_current_setpoint = buf.get_f32_le();
        __struct.runtime = buf.get_u32_le();
        __struct.time_until_maintenance = buf.get_i32_le();
        __struct.generator_speed = buf.get_u16_le();
        __struct.rectifier_temperature = buf.get_i16_le();
        __struct.generator_temperature = buf.get_i16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.status.bits());
        __tmp.put_f32_le(self.battery_current);
        __tmp.put_f32_le(self.load_current);
        __tmp.put_f32_le(self.power_generated);
        __tmp.put_f32_le(self.bus_voltage);
        __tmp.put_f32_le(self.bat_current_setpoint);
        __tmp.put_u32_le(self.runtime);
        __tmp.put_i32_le(self.time_until_maintenance);
        __tmp.put_u16_le(self.generator_speed);
        __tmp.put_i16_le(self.rectifier_temperature);
        __tmp.put_i16_le(self.generator_temperature);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 66"]
#[doc = "Request a data stream.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct REQUEST_DATA_STREAM_DATA {
    #[doc = "The requested message rate."]
    pub req_message_rate: u16,
    #[doc = "The target requested to send the message stream.."]
    pub target_system: u8,
    #[doc = "The target requested to send the message stream.."]
    pub target_component: u8,
    #[doc = "The ID of the requested data stream."]
    pub req_stream_id: u8,
    #[doc = "1 to start sending, 0 to stop sending.."]
    pub start_stop: u8,
}
impl REQUEST_DATA_STREAM_DATA {
    pub const ENCODED_LEN: usize = 6usize;
    pub const DEFAULT: Self = Self {
        req_message_rate: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
        req_stream_id: 0_u8,
        start_stop: 0_u8,
    };
}
impl Default for REQUEST_DATA_STREAM_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for REQUEST_DATA_STREAM_DATA {
    type Message = MavMessage;
    const ID: u32 = 66u32;
    const NAME: &'static str = "REQUEST_DATA_STREAM";
    const EXTRA_CRC: u8 = 148u8;
    const ENCODED_LEN: usize = 6usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.req_message_rate = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.req_stream_id = buf.get_u8();
        __struct.start_stop = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.req_message_rate);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.req_stream_id);
        __tmp.put_u8(self.start_stop);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 380"]
#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TIME_ESTIMATE_TO_TARGET_DATA {
    #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.."]
    pub safe_return: i32,
    #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.."]
    pub land: i32,
    #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.."]
    pub mission_next_item: i32,
    #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.."]
    pub mission_end: i32,
    #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.."]
    pub commanded_action: i32,
}
impl TIME_ESTIMATE_TO_TARGET_DATA {
    pub const ENCODED_LEN: usize = 20usize;
    pub const DEFAULT: Self = Self {
        safe_return: 0_i32,
        land: 0_i32,
        mission_next_item: 0_i32,
        mission_end: 0_i32,
        commanded_action: 0_i32,
    };
}
impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 380u32;
    const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
    const EXTRA_CRC: u8 = 232u8;
    const ENCODED_LEN: usize = 20usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.safe_return = buf.get_i32_le();
        __struct.land = buf.get_i32_le();
        __struct.mission_next_item = buf.get_i32_le();
        __struct.mission_end = buf.get_i32_le();
        __struct.commanded_action = buf.get_i32_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.safe_return);
        __tmp.put_i32_le(self.land);
        __tmp.put_i32_le(self.mission_next_item);
        __tmp.put_i32_le(self.mission_end);
        __tmp.put_i32_le(self.commanded_action);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 330"]
#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OBSTACLE_DISTANCE_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub distances: [u16; 72],
    #[doc = "Minimum distance the sensor can measure.."]
    pub min_distance: u16,
    #[doc = "Maximum distance the sensor can measure.."]
    pub max_distance: u16,
    #[doc = "Class id of the distance sensor type.."]
    pub sensor_type: MavDistanceSensor,
    #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero.."]
    pub increment: u8,
    #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub increment_f: f32,
    #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise.."]
    #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
    pub angle_offset: f32,
    #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub frame: MavFrame,
}
impl OBSTACLE_DISTANCE_DATA {
    pub const ENCODED_LEN: usize = 167usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        distances: [0_u16; 72usize],
        min_distance: 0_u16,
        max_distance: 0_u16,
        sensor_type: MavDistanceSensor::DEFAULT,
        increment: 0_u8,
        increment_f: 0.0_f32,
        angle_offset: 0.0_f32,
        frame: MavFrame::DEFAULT,
    };
}
impl Default for OBSTACLE_DISTANCE_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OBSTACLE_DISTANCE_DATA {
    type Message = MavMessage;
    const ID: u32 = 330u32;
    const NAME: &'static str = "OBSTACLE_DISTANCE";
    const EXTRA_CRC: u8 = 23u8;
    const ENCODED_LEN: usize = 167usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.distances {
            let val = buf.get_u16_le();
            *v = val;
        }
        __struct.min_distance = buf.get_u16_le();
        __struct.max_distance = buf.get_u16_le();
        let tmp = buf.get_u8();
        __struct.sensor_type = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavDistanceSensor",
            value: tmp as u32,
        })?;
        __struct.increment = buf.get_u8();
        __struct.increment_f = buf.get_f32_le();
        __struct.angle_offset = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.frame = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavFrame",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.distances {
            __tmp.put_u16_le(*val);
        }
        __tmp.put_u16_le(self.min_distance);
        __tmp.put_u16_le(self.max_distance);
        __tmp.put_u8(self.sensor_type as u8);
        __tmp.put_u8(self.increment);
        __tmp.put_f32_le(self.increment_f);
        __tmp.put_f32_le(self.angle_offset);
        __tmp.put_u8(self.frame as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 275"]
#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
    #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
    pub point_x: f32,
    #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
    pub point_y: f32,
    #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown."]
    pub radius: f32,
    #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
    pub rec_top_x: f32,
    #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
    pub rec_top_y: f32,
    #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
    pub rec_bottom_x: f32,
    #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
    pub rec_bottom_y: f32,
    #[doc = "Current tracking status."]
    pub tracking_status: CameraTrackingStatusFlags,
    #[doc = "Current tracking mode."]
    pub tracking_mode: CameraTrackingMode,
    #[doc = "Defines location of target data."]
    pub target_data: CameraTrackingTargetData,
}
impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
    pub const ENCODED_LEN: usize = 31usize;
    pub const DEFAULT: Self = Self {
        point_x: 0.0_f32,
        point_y: 0.0_f32,
        radius: 0.0_f32,
        rec_top_x: 0.0_f32,
        rec_top_y: 0.0_f32,
        rec_bottom_x: 0.0_f32,
        rec_bottom_y: 0.0_f32,
        tracking_status: CameraTrackingStatusFlags::DEFAULT,
        tracking_mode: CameraTrackingMode::DEFAULT,
        target_data: CameraTrackingTargetData::DEFAULT,
    };
}
impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
    type Message = MavMessage;
    const ID: u32 = 275u32;
    const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
    const EXTRA_CRC: u8 = 126u8;
    const ENCODED_LEN: usize = 31usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.point_x = buf.get_f32_le();
        __struct.point_y = buf.get_f32_le();
        __struct.radius = buf.get_f32_le();
        __struct.rec_top_x = buf.get_f32_le();
        __struct.rec_top_y = buf.get_f32_le();
        __struct.rec_bottom_x = buf.get_f32_le();
        __struct.rec_bottom_y = buf.get_f32_le();
        let tmp = buf.get_u8();
        __struct.tracking_status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CameraTrackingStatusFlags",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.tracking_mode = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CameraTrackingMode",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.target_data = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "CameraTrackingTargetData",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.point_x);
        __tmp.put_f32_le(self.point_y);
        __tmp.put_f32_le(self.radius);
        __tmp.put_f32_le(self.rec_top_x);
        __tmp.put_f32_le(self.rec_top_y);
        __tmp.put_f32_le(self.rec_bottom_x);
        __tmp.put_f32_le(self.rec_bottom_y);
        __tmp.put_u8(self.tracking_status as u8);
        __tmp.put_u8(self.tracking_mode as u8);
        __tmp.put_u8(self.target_data as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 299"]
#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct WIFI_CONFIG_AP_DATA {
    #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub ssid: [u8; 32],
    #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub password: [u8; 64],
    #[doc = "WiFi Mode.."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub mode: WifiConfigApMode,
    #[doc = "Message acceptance response (sent back to GS).."]
    #[cfg_attr(feature = "serde", serde(default))]
    pub response: WifiConfigApResponse,
}
impl WIFI_CONFIG_AP_DATA {
    pub const ENCODED_LEN: usize = 98usize;
    pub const DEFAULT: Self = Self {
        ssid: [0_u8; 32usize],
        password: [0_u8; 64usize],
        mode: WifiConfigApMode::DEFAULT,
        response: WifiConfigApResponse::DEFAULT,
    };
}
impl Default for WIFI_CONFIG_AP_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for WIFI_CONFIG_AP_DATA {
    type Message = MavMessage;
    const ID: u32 = 299u32;
    const NAME: &'static str = "WIFI_CONFIG_AP";
    const EXTRA_CRC: u8 = 19u8;
    const ENCODED_LEN: usize = 98usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        for v in &mut __struct.ssid {
            let val = buf.get_u8();
            *v = val;
        }
        for v in &mut __struct.password {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_i8();
        __struct.mode = FromPrimitive::from_i8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "WifiConfigApMode",
            value: tmp as u32,
        })?;
        let tmp = buf.get_i8();
        __struct.response = FromPrimitive::from_i8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "WifiConfigApResponse",
            value: tmp as u32,
        })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        for val in &self.ssid {
            __tmp.put_u8(*val);
        }
        for val in &self.password {
            __tmp.put_u8(*val);
        }
        __tmp.put_i8(self.mode as i8);
        __tmp.put_i8(self.response as i8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 140"]
#[doc = "Set the vehicle attitude and body angular rates.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ACTUATOR_CONTROL_TARGET_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub controls: [f32; 8],
    #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.."]
    pub group_mlx: u8,
}
impl ACTUATOR_CONTROL_TARGET_DATA {
    pub const ENCODED_LEN: usize = 41usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        controls: [0.0_f32; 8usize],
        group_mlx: 0_u8,
    };
}
impl Default for ACTUATOR_CONTROL_TARGET_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
    type Message = MavMessage;
    const ID: u32 = 140u32;
    const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
    const EXTRA_CRC: u8 = 181u8;
    const ENCODED_LEN: usize = 41usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.controls {
            let val = buf.get_f32_le();
            *v = val;
        }
        __struct.group_mlx = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.controls {
            __tmp.put_f32_le(*val);
        }
        __tmp.put_u8(self.group_mlx);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 268"]
#[doc = "An ack for a LOGGING_DATA_ACKED message."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOGGING_ACK_DATA {
    #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)."]
    pub sequence: u16,
    #[doc = "system ID of the target."]
    pub target_system: u8,
    #[doc = "component ID of the target."]
    pub target_component: u8,
}
impl LOGGING_ACK_DATA {
    pub const ENCODED_LEN: usize = 4usize;
    pub const DEFAULT: Self = Self {
        sequence: 0_u16,
        target_system: 0_u8,
        target_component: 0_u8,
    };
}
impl Default for LOGGING_ACK_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOGGING_ACK_DATA {
    type Message = MavMessage;
    const ID: u32 = 268u32;
    const NAME: &'static str = "LOGGING_ACK";
    const EXTRA_CRC: u8 = 14u8;
    const ENCODED_LEN: usize = 4usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.sequence = buf.get_u16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.sequence);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 50002"]
#[doc = "Information about video stream."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
    #[doc = "Frame rate.."]
    pub framerate: f32,
    #[doc = "Bit rate.."]
    pub bitrate: u32,
    #[doc = "Horizontal resolution.."]
    pub resolution_h: u16,
    #[doc = "Vertical resolution.."]
    pub resolution_v: u16,
    #[doc = "Video image rotation clockwise.."]
    pub rotation: u16,
    #[doc = "Video Stream ID (1 for first, 2 for second, etc.)."]
    pub camera_id: u8,
    #[doc = "Number of streams available.."]
    pub status: u8,
    #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub uri: [u8; 230],
}
impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
    pub const ENCODED_LEN: usize = 246usize;
    pub const DEFAULT: Self = Self {
        framerate: 0.0_f32,
        bitrate: 0_u32,
        resolution_h: 0_u16,
        resolution_v: 0_u16,
        rotation: 0_u16,
        camera_id: 0_u8,
        status: 0_u8,
        uri: [0_u8; 230usize],
    };
}
impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 50002u32;
    const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
    const EXTRA_CRC: u8 = 181u8;
    const ENCODED_LEN: usize = 246usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.framerate = buf.get_f32_le();
        __struct.bitrate = buf.get_u32_le();
        __struct.resolution_h = buf.get_u16_le();
        __struct.resolution_v = buf.get_u16_le();
        __struct.rotation = buf.get_u16_le();
        __struct.camera_id = buf.get_u8();
        __struct.status = buf.get_u8();
        for v in &mut __struct.uri {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_f32_le(self.framerate);
        __tmp.put_u32_le(self.bitrate);
        __tmp.put_u16_le(self.resolution_h);
        __tmp.put_u16_le(self.resolution_v);
        __tmp.put_u16_le(self.rotation);
        __tmp.put_u8(self.camera_id);
        __tmp.put_u8(self.status);
        for val in &self.uri {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 123"]
#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GPS_INJECT_DATA_DATA {
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Data length."]
    pub len: u8,
    #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 110],
}
impl GPS_INJECT_DATA_DATA {
    pub const ENCODED_LEN: usize = 113usize;
    pub const DEFAULT: Self = Self {
        target_system: 0_u8,
        target_component: 0_u8,
        len: 0_u8,
        data: [0_u8; 110usize],
    };
}
impl Default for GPS_INJECT_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GPS_INJECT_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 123u32;
    const NAME: &'static str = "GPS_INJECT_DATA";
    const EXTRA_CRC: u8 = 250u8;
    const ENCODED_LEN: usize = 113usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.len = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.len);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 332"]
#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED).."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
    #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.."]
    pub time_usec: u64,
    #[doc = "X-coordinate of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_x: [f32; 5],
    #[doc = "Y-coordinate of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_y: [f32; 5],
    #[doc = "Z-coordinate of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_z: [f32; 5],
    #[doc = "X-velocity of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel_x: [f32; 5],
    #[doc = "Y-velocity of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel_y: [f32; 5],
    #[doc = "Z-velocity of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel_z: [f32; 5],
    #[doc = "X-acceleration of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub acc_x: [f32; 5],
    #[doc = "Y-acceleration of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub acc_y: [f32; 5],
    #[doc = "Z-acceleration of waypoint, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub acc_z: [f32; 5],
    #[doc = "Yaw angle, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub pos_yaw: [f32; 5],
    #[doc = "Yaw rate, set to NaN if not being used."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub vel_yaw: [f32; 5],
    #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub command: [u16; 5],
    #[doc = "Number of valid points (up-to 5 waypoints are possible)."]
    pub valid_points: u8,
}
impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
    pub const ENCODED_LEN: usize = 239usize;
    pub const DEFAULT: Self = Self {
        time_usec: 0_u64,
        pos_x: [0.0_f32; 5usize],
        pos_y: [0.0_f32; 5usize],
        pos_z: [0.0_f32; 5usize],
        vel_x: [0.0_f32; 5usize],
        vel_y: [0.0_f32; 5usize],
        vel_z: [0.0_f32; 5usize],
        acc_x: [0.0_f32; 5usize],
        acc_y: [0.0_f32; 5usize],
        acc_z: [0.0_f32; 5usize],
        pos_yaw: [0.0_f32; 5usize],
        vel_yaw: [0.0_f32; 5usize],
        command: [0_u16; 5usize],
        valid_points: 0_u8,
    };
}
impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
    type Message = MavMessage;
    const ID: u32 = 332u32;
    const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
    const EXTRA_CRC: u8 = 236u8;
    const ENCODED_LEN: usize = 239usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.time_usec = buf.get_u64_le();
        for v in &mut __struct.pos_x {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_y {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_z {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.vel_x {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.vel_y {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.vel_z {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.acc_x {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.acc_y {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.acc_z {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.pos_yaw {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.vel_yaw {
            let val = buf.get_f32_le();
            *v = val;
        }
        for v in &mut __struct.command {
            let val = buf.get_u16_le();
            *v = val;
        }
        __struct.valid_points = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u64_le(self.time_usec);
        for val in &self.pos_x {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_y {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_z {
            __tmp.put_f32_le(*val);
        }
        for val in &self.vel_x {
            __tmp.put_f32_le(*val);
        }
        for val in &self.vel_y {
            __tmp.put_f32_le(*val);
        }
        for val in &self.vel_z {
            __tmp.put_f32_le(*val);
        }
        for val in &self.acc_x {
            __tmp.put_f32_le(*val);
        }
        for val in &self.acc_y {
            __tmp.put_f32_le(*val);
        }
        for val in &self.acc_z {
            __tmp.put_f32_le(*val);
        }
        for val in &self.pos_yaw {
            __tmp.put_f32_le(*val);
        }
        for val in &self.vel_yaw {
            __tmp.put_f32_le(*val);
        }
        for val in &self.command {
            __tmp.put_u16_le(*val);
        }
        __tmp.put_u8(self.valid_points);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 136"]
#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: https://mavlink.io/en/services/terrain.html."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TERRAIN_REPORT_DATA {
    #[doc = "Latitude."]
    pub lat: i32,
    #[doc = "Longitude."]
    pub lon: i32,
    #[doc = "Terrain height MSL."]
    pub terrain_height: f32,
    #[doc = "Current vehicle height above lat/lon terrain height."]
    pub current_height: f32,
    #[doc = "grid spacing (zero if terrain at this location unavailable)."]
    pub spacing: u16,
    #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk."]
    pub pending: u16,
    #[doc = "Number of 4x4 terrain blocks in memory."]
    pub loaded: u16,
}
impl TERRAIN_REPORT_DATA {
    pub const ENCODED_LEN: usize = 22usize;
    pub const DEFAULT: Self = Self {
        lat: 0_i32,
        lon: 0_i32,
        terrain_height: 0.0_f32,
        current_height: 0.0_f32,
        spacing: 0_u16,
        pending: 0_u16,
        loaded: 0_u16,
    };
}
impl Default for TERRAIN_REPORT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for TERRAIN_REPORT_DATA {
    type Message = MavMessage;
    const ID: u32 = 136u32;
    const NAME: &'static str = "TERRAIN_REPORT";
    const EXTRA_CRC: u8 = 1u8;
    const ENCODED_LEN: usize = 22usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.lat = buf.get_i32_le();
        __struct.lon = buf.get_i32_le();
        __struct.terrain_height = buf.get_f32_le();
        __struct.current_height = buf.get_f32_le();
        __struct.spacing = buf.get_u16_le();
        __struct.pending = buf.get_u16_le();
        __struct.loaded = buf.get_u16_le();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.lat);
        __tmp.put_i32_le(self.lon);
        __tmp.put_f32_le(self.terrain_height);
        __tmp.put_f32_le(self.current_height);
        __tmp.put_u16_le(self.spacing);
        __tmp.put_u16_le(self.pending);
        __tmp.put_u16_le(self.loaded);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 120"]
#[doc = "Reply to LOG_REQUEST_DATA."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct LOG_DATA_DATA {
    #[doc = "Offset into the log."]
    pub ofs: u32,
    #[doc = "Log id (from LOG_ENTRY reply)."]
    pub id: u16,
    #[doc = "Number of bytes (zero for end of log)."]
    pub count: u8,
    #[doc = "log data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 90],
}
impl LOG_DATA_DATA {
    pub const ENCODED_LEN: usize = 97usize;
    pub const DEFAULT: Self = Self {
        ofs: 0_u32,
        id: 0_u16,
        count: 0_u8,
        data: [0_u8; 90usize],
    };
}
impl Default for LOG_DATA_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for LOG_DATA_DATA {
    type Message = MavMessage;
    const ID: u32 = 120u32;
    const NAME: &'static str = "LOG_DATA";
    const EXTRA_CRC: u8 = 134u8;
    const ENCODED_LEN: usize = 97usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.ofs = buf.get_u32_le();
        __struct.id = buf.get_u16_le();
        __struct.count = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.ofs);
        __tmp.put_u16_le(self.id);
        __tmp.put_u8(self.count);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 249"]
#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MEMORY_VECT_DATA {
    #[doc = "Starting address of the debug variables."]
    pub address: u16,
    #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below."]
    pub ver: u8,
    #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14."]
    pub mavtype: u8,
    #[doc = "Memory contents at specified address."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub value: [i8; 32],
}
impl MEMORY_VECT_DATA {
    pub const ENCODED_LEN: usize = 36usize;
    pub const DEFAULT: Self = Self {
        address: 0_u16,
        ver: 0_u8,
        mavtype: 0_u8,
        value: [0_i8; 32usize],
    };
}
impl Default for MEMORY_VECT_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for MEMORY_VECT_DATA {
    type Message = MavMessage;
    const ID: u32 = 249u32;
    const NAME: &'static str = "MEMORY_VECT";
    const EXTRA_CRC: u8 = 204u8;
    const ENCODED_LEN: usize = 36usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.address = buf.get_u16_le();
        __struct.ver = buf.get_u8();
        __struct.mavtype = buf.get_u8();
        for v in &mut __struct.value {
            let val = buf.get_i8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u16_le(self.address);
        __tmp.put_u8(self.ver);
        __tmp.put_u8(self.mavtype);
        for val in &self.value {
            __tmp.put_i8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12902"]
#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
    #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.."]
    pub timestamp: u32,
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Indicates the type of authentication.."]
    pub authentication_type: MavOdidAuthType,
    #[doc = "Allowed range is 0 - 15.."]
    pub data_page: u8,
    #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.."]
    pub last_page_index: u8,
    #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.."]
    pub length: u8,
    #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub authentication_data: [u8; 23],
}
impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
    pub const ENCODED_LEN: usize = 53usize;
    pub const DEFAULT: Self = Self {
        timestamp: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        authentication_type: MavOdidAuthType::DEFAULT,
        data_page: 0_u8,
        last_page_index: 0_u8,
        length: 0_u8,
        authentication_data: [0_u8; 23usize],
    };
}
impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 12902u32;
    const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
    const EXTRA_CRC: u8 = 140u8;
    const ENCODED_LEN: usize = 53usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.timestamp = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.authentication_type =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidAuthType",
                value: tmp as u32,
            })?;
        __struct.data_page = buf.get_u8();
        __struct.last_page_index = buf.get_u8();
        __struct.length = buf.get_u8();
        for v in &mut __struct.authentication_data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.timestamp);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.authentication_type as u8);
        __tmp.put_u8(self.data_page);
        __tmp.put_u8(self.last_page_index);
        __tmp.put_u8(self.length);
        for val in &self.authentication_data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 387"]
#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct CANFD_FRAME_DATA {
    #[doc = "Frame ID."]
    pub id: u32,
    #[doc = "System ID.."]
    pub target_system: u8,
    #[doc = "Component ID.."]
    pub target_component: u8,
    #[doc = "bus number."]
    pub bus: u8,
    #[doc = "Frame length."]
    pub len: u8,
    #[doc = "Frame data."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub data: [u8; 64],
}
impl CANFD_FRAME_DATA {
    pub const ENCODED_LEN: usize = 72usize;
    pub const DEFAULT: Self = Self {
        id: 0_u32,
        target_system: 0_u8,
        target_component: 0_u8,
        bus: 0_u8,
        len: 0_u8,
        data: [0_u8; 64usize],
    };
}
impl Default for CANFD_FRAME_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for CANFD_FRAME_DATA {
    type Message = MavMessage;
    const ID: u32 = 387u32;
    const NAME: &'static str = "CANFD_FRAME";
    const EXTRA_CRC: u8 = 4u8;
    const ENCODED_LEN: usize = 72usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.id = buf.get_u32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.bus = buf.get_u8();
        __struct.len = buf.get_u8();
        for v in &mut __struct.data {
            let val = buf.get_u8();
            *v = val;
        }
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.id);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.bus);
        __tmp.put_u8(self.len);
        for val in &self.data {
            __tmp.put_u8(*val);
        }
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 12901"]
#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct OPEN_DRONE_ID_LOCATION_DATA {
    #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).."]
    pub latitude: i32,
    #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).."]
    pub longitude: i32,
    #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.."]
    pub altitude_barometric: f32,
    #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m.."]
    pub altitude_geodetic: f32,
    #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.."]
    pub height: f32,
    #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.."]
    pub timestamp: f32,
    #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.."]
    pub direction: u16,
    #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.."]
    pub speed_horizontal: u16,
    #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.."]
    pub speed_vertical: i16,
    #[doc = "System ID (0 for broadcast).."]
    pub target_system: u8,
    #[doc = "Component ID (0 for broadcast).."]
    pub target_component: u8,
    #[doc = "Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.."]
    #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
    pub id_or_mac: [u8; 20],
    #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air.."]
    pub status: MavOdidStatus,
    #[doc = "Indicates the reference point for the height field.."]
    pub height_reference: MavOdidHeightRef,
    #[doc = "The accuracy of the horizontal position.."]
    pub horizontal_accuracy: MavOdidHorAcc,
    #[doc = "The accuracy of the vertical position.."]
    pub vertical_accuracy: MavOdidVerAcc,
    #[doc = "The accuracy of the barometric altitude.."]
    pub barometer_accuracy: MavOdidVerAcc,
    #[doc = "The accuracy of the horizontal and vertical speed.."]
    pub speed_accuracy: MavOdidSpeedAcc,
    #[doc = "The accuracy of the timestamps.."]
    pub timestamp_accuracy: MavOdidTimeAcc,
}
impl OPEN_DRONE_ID_LOCATION_DATA {
    pub const ENCODED_LEN: usize = 59usize;
    pub const DEFAULT: Self = Self {
        latitude: 0_i32,
        longitude: 0_i32,
        altitude_barometric: 0.0_f32,
        altitude_geodetic: 0.0_f32,
        height: 0.0_f32,
        timestamp: 0.0_f32,
        direction: 0_u16,
        speed_horizontal: 0_u16,
        speed_vertical: 0_i16,
        target_system: 0_u8,
        target_component: 0_u8,
        id_or_mac: [0_u8; 20usize],
        status: MavOdidStatus::DEFAULT,
        height_reference: MavOdidHeightRef::DEFAULT,
        horizontal_accuracy: MavOdidHorAcc::DEFAULT,
        vertical_accuracy: MavOdidVerAcc::DEFAULT,
        barometer_accuracy: MavOdidVerAcc::DEFAULT,
        speed_accuracy: MavOdidSpeedAcc::DEFAULT,
        timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
    };
}
impl Default for OPEN_DRONE_ID_LOCATION_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
    type Message = MavMessage;
    const ID: u32 = 12901u32;
    const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
    const EXTRA_CRC: u8 = 254u8;
    const ENCODED_LEN: usize = 59usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        __struct.latitude = buf.get_i32_le();
        __struct.longitude = buf.get_i32_le();
        __struct.altitude_barometric = buf.get_f32_le();
        __struct.altitude_geodetic = buf.get_f32_le();
        __struct.height = buf.get_f32_le();
        __struct.timestamp = buf.get_f32_le();
        __struct.direction = buf.get_u16_le();
        __struct.speed_horizontal = buf.get_u16_le();
        __struct.speed_vertical = buf.get_i16_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        for v in &mut __struct.id_or_mac {
            let val = buf.get_u8();
            *v = val;
        }
        let tmp = buf.get_u8();
        __struct.status = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidStatus",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.height_reference =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidHeightRef",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.horizontal_accuracy =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidHorAcc",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.vertical_accuracy =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidVerAcc",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.barometer_accuracy =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidVerAcc",
                value: tmp as u32,
            })?;
        let tmp = buf.get_u8();
        __struct.speed_accuracy = FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "MavOdidSpeedAcc",
            value: tmp as u32,
        })?;
        let tmp = buf.get_u8();
        __struct.timestamp_accuracy =
            FromPrimitive::from_u8(tmp).ok_or(ParserError::InvalidEnum {
                enum_type: "MavOdidTimeAcc",
                value: tmp as u32,
            })?;
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_i32_le(self.latitude);
        __tmp.put_i32_le(self.longitude);
        __tmp.put_f32_le(self.altitude_barometric);
        __tmp.put_f32_le(self.altitude_geodetic);
        __tmp.put_f32_le(self.height);
        __tmp.put_f32_le(self.timestamp);
        __tmp.put_u16_le(self.direction);
        __tmp.put_u16_le(self.speed_horizontal);
        __tmp.put_i16_le(self.speed_vertical);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        for val in &self.id_or_mac {
            __tmp.put_u8(*val);
        }
        __tmp.put_u8(self.status as u8);
        __tmp.put_u8(self.height_reference as u8);
        __tmp.put_u8(self.horizontal_accuracy as u8);
        __tmp.put_u8(self.vertical_accuracy as u8);
        __tmp.put_u8(self.barometer_accuracy as u8);
        __tmp.put_u8(self.speed_accuracy as u8);
        __tmp.put_u8(self.timestamp_accuracy as u8);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[doc = "id: 288"]
#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case.."]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
    #[doc = "High level gimbal manager flags.."]
    pub flags: GimbalManagerFlags,
    #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored).."]
    pub pitch: f32,
    #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored).."]
    pub yaw: f32,
    #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored).."]
    pub pitch_rate: f32,
    #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored).."]
    pub yaw_rate: f32,
    #[doc = "System ID."]
    pub target_system: u8,
    #[doc = "Component ID."]
    pub target_component: u8,
    #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals).."]
    pub gimbal_device_id: u8,
}
impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
    pub const ENCODED_LEN: usize = 23usize;
    pub const DEFAULT: Self = Self {
        flags: GimbalManagerFlags::DEFAULT,
        pitch: 0.0_f32,
        yaw: 0.0_f32,
        pitch_rate: 0.0_f32,
        yaw_rate: 0.0_f32,
        target_system: 0_u8,
        target_component: 0_u8,
        gimbal_device_id: 0_u8,
    };
}
impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
    fn default() -> Self {
        Self::DEFAULT.clone()
    }
}
impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
    type Message = MavMessage;
    const ID: u32 = 288u32;
    const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
    const EXTRA_CRC: u8 = 20u8;
    const ENCODED_LEN: usize = 23usize;
    fn deser(_version: MavlinkVersion, __input: &[u8]) -> Result<Self, ParserError> {
        let avail_len = __input.len();
        let mut payload_buf = [0; Self::ENCODED_LEN];
        let mut buf = if avail_len < Self::ENCODED_LEN {
            payload_buf[0..avail_len].copy_from_slice(__input);
            Bytes::new(&payload_buf)
        } else {
            Bytes::new(__input)
        };
        let mut __struct = Self::default();
        let tmp = buf.get_u32_le();
        __struct.flags = FromPrimitive::from_u32(tmp).ok_or(ParserError::InvalidEnum {
            enum_type: "GimbalManagerFlags",
            value: tmp as u32,
        })?;
        __struct.pitch = buf.get_f32_le();
        __struct.yaw = buf.get_f32_le();
        __struct.pitch_rate = buf.get_f32_le();
        __struct.yaw_rate = buf.get_f32_le();
        __struct.target_system = buf.get_u8();
        __struct.target_component = buf.get_u8();
        __struct.gimbal_device_id = buf.get_u8();
        Ok(__struct)
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        let mut __tmp = BytesMut::new(bytes);
        __tmp.put_u32_le(self.flags as u32);
        __tmp.put_f32_le(self.pitch);
        __tmp.put_f32_le(self.yaw);
        __tmp.put_f32_le(self.pitch_rate);
        __tmp.put_f32_le(self.yaw_rate);
        __tmp.put_u8(self.target_system);
        __tmp.put_u8(self.target_component);
        __tmp.put_u8(self.gimbal_device_id);
        if matches!(version, MavlinkVersion::V2) {
            let len = __tmp.len();
            crate::remove_trailing_zeroes(&bytes[..len])
        } else {
            __tmp.len()
        }
    }
}
#[derive(Clone, PartialEq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type"))]
pub enum MavMessage {
    CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
    PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
    HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
    SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
    CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
    FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
    TIMESYNC(TIMESYNC_DATA),
    SERIAL_CONTROL(SERIAL_CONTROL_DATA),
    VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
    FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
    CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
    MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
    CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
    RC_CHANNELS(RC_CHANNELS_DATA),
    SYS_STATUS(SYS_STATUS_DATA),
    HIL_SENSOR(HIL_SENSOR_DATA),
    MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
    AUTH_KEY(AUTH_KEY_DATA),
    LANDING_TARGET(LANDING_TARGET_DATA),
    PARAM_SET(PARAM_SET_DATA),
    ALTITUDE(ALTITUDE_DATA),
    V2_EXTENSION(V2_EXTENSION_DATA),
    ATTITUDE(ATTITUDE_DATA),
    CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
    OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
    GPS_RTK(GPS_RTK_DATA),
    HIGH_LATENCY(HIGH_LATENCY_DATA),
    FENCE_STATUS(FENCE_STATUS_DATA),
    PARAM_EXT_SET(PARAM_EXT_SET_DATA),
    LOGGING_DATA(LOGGING_DATA_DATA),
    CELLULAR_STATUS(CELLULAR_STATUS_DATA),
    SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
    TUNNEL(TUNNEL_DATA),
    RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
    COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
    HERELINK_TELEM(HERELINK_TELEM_DATA),
    SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
    HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
    ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
    STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
    LOG_ENTRY(LOG_ENTRY_DATA),
    VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
    ESC_INFO(ESC_INFO_DATA),
    GPS_RAW_INT(GPS_RAW_INT_DATA),
    OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
    DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
    ODOMETRY(ODOMETRY_DATA),
    PING(PING_DATA),
    PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
    CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
    VIBRATION(VIBRATION_DATA),
    GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
    RADIO_STATUS(RADIO_STATUS_DATA),
    OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
    UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
    POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
    CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
    ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
    PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
    MISSION_REQUEST(MISSION_REQUEST_DATA),
    SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
    HIGH_LATENCY2(HIGH_LATENCY2_DATA),
    SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
    CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
    SET_HOME_POSITION(SET_HOME_POSITION_DATA),
    NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
    GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
    POWER_STATUS(POWER_STATUS_DATA),
    RAW_RPM(RAW_RPM_DATA),
    TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
    COMMAND_CANCEL(COMMAND_CANCEL_DATA),
    GPS2_RAW(GPS2_RAW_DATA),
    PARAM_MAP_RC(PARAM_MAP_RC_DATA),
    RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
    SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
    ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
    GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
    CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
    WIND_COV(WIND_COV_DATA),
    PARAM_VALUE(PARAM_VALUE_DATA),
    LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
    NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
    HIL_CONTROLS(HIL_CONTROLS_DATA),
    SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
    RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
    LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
    GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
    RAW_IMU(RAW_IMU_DATA),
    STATUSTEXT(STATUSTEXT_DATA),
    EFI_STATUS(EFI_STATUS_DATA),
    LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
    CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
    SCALED_IMU3(SCALED_IMU3_DATA),
    HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
    SCALED_IMU(SCALED_IMU_DATA),
    MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
    DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
    ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
    ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
    PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
    SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
    RAW_PRESSURE(RAW_PRESSURE_DATA),
    SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
    OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
    POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
    TERRAIN_DATA(TERRAIN_DATA_DATA),
    TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
    ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
    LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
    GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
    EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
    MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
    MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
    VFR_HUD(VFR_HUD_DATA),
    CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
    LOG_REQUEST_END(LOG_REQUEST_END_DATA),
    LOG_ERASE(LOG_ERASE_DATA),
    GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
    DEBUG_VECT(DEBUG_VECT_DATA),
    LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
    VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
    PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
    MISSION_ACK(MISSION_ACK_DATA),
    PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
    SCALED_IMU2(SCALED_IMU2_DATA),
    SCALED_PRESSURE(SCALED_PRESSURE_DATA),
    COMMAND_ACK(COMMAND_ACK_DATA),
    MISSION_CURRENT(MISSION_CURRENT_DATA),
    GPS_STATUS(GPS_STATUS_DATA),
    VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
    UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
    LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
    EVENT(EVENT_DATA),
    AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
    SIM_STATE(SIM_STATE_DATA),
    BUTTON_CHANGE(BUTTON_CHANGE_DATA),
    HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
    OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
    COMMAND_INT(COMMAND_INT_DATA),
    CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
    ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
    MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
    GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
    OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
    SETUP_SIGNING(SETUP_SIGNING_DATA),
    BATTERY_STATUS(BATTERY_STATUS_DATA),
    OPTICAL_FLOW(OPTICAL_FLOW_DATA),
    SET_MODE(SET_MODE_DATA),
    GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
    MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
    FOLLOW_TARGET(FOLLOW_TARGET_DATA),
    COMPONENT_METADATA(COMPONENT_METADATA_DATA),
    GPS_INPUT(GPS_INPUT_DATA),
    SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
    SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
    COLLISION(COLLISION_DATA),
    MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
    MISSION_ITEM(MISSION_ITEM_DATA),
    PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
    DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
    CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
    REQUEST_EVENT(REQUEST_EVENT_DATA),
    GPS2_RTK(GPS2_RTK_DATA),
    SYSTEM_TIME(SYSTEM_TIME_DATA),
    HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
    COMMAND_LONG(COMMAND_LONG_DATA),
    WINCH_STATUS(WINCH_STATUS_DATA),
    PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
    AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
    CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
    GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
    ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
    HIGHRES_IMU(HIGHRES_IMU_DATA),
    LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
    ESC_STATUS(ESC_STATUS_DATA),
    HOME_POSITION(HOME_POSITION_DATA),
    VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
    GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
    HIL_STATE(HIL_STATE_DATA),
    MISSION_COUNT(MISSION_COUNT_DATA),
    CAN_FRAME(CAN_FRAME_DATA),
    GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
    MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
    TERRAIN_CHECK(TERRAIN_CHECK_DATA),
    MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
    CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
    ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
    MANUAL_CONTROL(MANUAL_CONTROL_DATA),
    UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
    WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
    MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
    OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
    NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
    RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
    HEARTBEAT(HEARTBEAT_DATA),
    AIS_VESSEL(AIS_VESSEL_DATA),
    GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
    CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
    RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
    SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
    MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
    DEBUG(DEBUG_DATA),
    OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
    DATA_STREAM(DATA_STREAM_DATA),
    ADSB_VEHICLE(ADSB_VEHICLE_DATA),
    ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
    PLAY_TUNE(PLAY_TUNE_DATA),
    HIL_GPS(HIL_GPS_DATA),
    GENERATOR_STATUS(GENERATOR_STATUS_DATA),
    REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
    TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
    OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
    CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
    WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
    ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
    LOGGING_ACK(LOGGING_ACK_DATA),
    HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
    GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
    TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
    TERRAIN_REPORT(TERRAIN_REPORT_DATA),
    LOG_DATA(LOG_DATA_DATA),
    MEMORY_VECT(MEMORY_VECT_DATA),
    OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
    CANFD_FRAME(CANFD_FRAME_DATA),
    OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
    GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
}
impl Message for MavMessage {
    fn parse(version: MavlinkVersion, id: u32, payload: &[u8]) -> Result<Self, ParserError> {
        match id {
            CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
                .map(Self::CURRENT_EVENT_SEQUENCE),
            PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
                .map(Self::PARAM_EXT_REQUEST_LIST),
            HIL_RC_INPUTS_RAW_DATA::ID => {
                HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
            }
            SCALED_PRESSURE2_DATA::ID => {
                SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
            }
            CAMERA_TRIGGER_DATA::ID => {
                CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
            }
            FLIGHT_INFORMATION_DATA::ID => {
                FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
            }
            TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
            SERIAL_CONTROL_DATA::ID => {
                SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
            }
            VICON_POSITION_ESTIMATE_DATA::ID => {
                VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
                    .map(Self::VICON_POSITION_ESTIMATE)
            }
            FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
                .map(Self::FILE_TRANSFER_PROTOCOL),
            CAMERA_IMAGE_CAPTURED_DATA::ID => {
                CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
            }
            MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
                MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
                    .map(Self::MISSION_REQUEST_PARTIAL_LIST)
            }
            CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
                CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
                    .map(Self::CAMERA_TRACKING_GEO_STATUS)
            }
            RC_CHANNELS_DATA::ID => {
                RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
            }
            SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
            HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
            MAG_CAL_REPORT_DATA::ID => {
                MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
            }
            AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
            LANDING_TARGET_DATA::ID => {
                LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
            }
            PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
            ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
            V2_EXTENSION_DATA::ID => {
                V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
            }
            ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
            CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
                CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
                    .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
            }
            OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
                OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
                    .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
            }
            GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
            HIGH_LATENCY_DATA::ID => {
                HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
            }
            FENCE_STATUS_DATA::ID => {
                FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
            }
            PARAM_EXT_SET_DATA::ID => {
                PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
            }
            LOGGING_DATA_DATA::ID => {
                LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
            }
            CELLULAR_STATUS_DATA::ID => {
                CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
            }
            SUPPORTED_TUNES_DATA::ID => {
                SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
            }
            TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
            RC_CHANNELS_OVERRIDE_DATA::ID => {
                RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
            }
            COMPONENT_INFORMATION_DATA::ID => {
                COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
            }
            HERELINK_TELEM_DATA::ID => {
                HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
            }
            SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
                SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
                    .map(Self::SET_POSITION_TARGET_LOCAL_NED)
            }
            HYGROMETER_SENSOR_DATA::ID => {
                HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
            }
            ISBD_LINK_STATUS_DATA::ID => {
                ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
            }
            STORAGE_INFORMATION_DATA::ID => {
                STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
            }
            LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
            VISION_SPEED_ESTIMATE_DATA::ID => {
                VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
            }
            ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
            GPS_RAW_INT_DATA::ID => {
                GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
            }
            OPEN_DRONE_ID_SYSTEM_DATA::ID => {
                OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
            }
            DISTANCE_SENSOR_DATA::ID => {
                DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
            }
            ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
            PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
            PROTOCOL_VERSION_DATA::ID => {
                PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
            }
            CONTROL_SYSTEM_STATE_DATA::ID => {
                CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
            }
            VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
            GIMBAL_DEVICE_INFORMATION_DATA::ID => {
                GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
                    .map(Self::GIMBAL_DEVICE_INFORMATION)
            }
            RADIO_STATUS_DATA::ID => {
                RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
            }
            OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
                .map(Self::OPEN_DRONE_ID_BASIC_ID),
            UTM_GLOBAL_POSITION_DATA::ID => {
                UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
            }
            POSITION_TARGET_GLOBAL_INT_DATA::ID => {
                POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
                    .map(Self::POSITION_TARGET_GLOBAL_INT)
            }
            CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
                CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
                    .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
            }
            ATTITUDE_QUATERNION_DATA::ID => {
                ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
            }
            PARAM_REQUEST_LIST_DATA::ID => {
                PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
            }
            MISSION_REQUEST_DATA::ID => {
                MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
            }
            SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
                SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
                    .map(Self::SET_ACTUATOR_CONTROL_TARGET)
            }
            HIGH_LATENCY2_DATA::ID => {
                HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
            }
            SAFETY_SET_ALLOWED_AREA_DATA::ID => {
                SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
                    .map(Self::SAFETY_SET_ALLOWED_AREA)
            }
            CAMERA_FOV_STATUS_DATA::ID => {
                CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
            }
            SET_HOME_POSITION_DATA::ID => {
                SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
            }
            NAMED_VALUE_INT_DATA::ID => {
                NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
            }
            GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
                GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
                    .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
            }
            POWER_STATUS_DATA::ID => {
                POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
            }
            RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
            TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
                TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
                    .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
            }
            COMMAND_CANCEL_DATA::ID => {
                COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
            }
            GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
            PARAM_MAP_RC_DATA::ID => {
                PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
            }
            RESPONSE_EVENT_ERROR_DATA::ID => {
                RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
            }
            SERVO_OUTPUT_RAW_DATA::ID => {
                SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
            }
            ATTITUDE_QUATERNION_COV_DATA::ID => {
                ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
                    .map(Self::ATTITUDE_QUATERNION_COV)
            }
            GPS_RTCM_DATA_DATA::ID => {
                GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
            }
            CELLULAR_CONFIG_DATA::ID => {
                CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
            }
            WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
            PARAM_VALUE_DATA::ID => {
                PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
            }
            LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
                .map(Self::LOCAL_POSITION_NED_COV),
            NAV_CONTROLLER_OUTPUT_DATA::ID => {
                NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
            }
            HIL_CONTROLS_DATA::ID => {
                HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
            }
            SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
                SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
            }
            RC_CHANNELS_SCALED_DATA::ID => {
                RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
            }
            LOG_REQUEST_DATA_DATA::ID => {
                LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
            }
            GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
                GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
                    .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
            }
            RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
            STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
            EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
            LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
                LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
                    .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
            }
            CAMERA_SETTINGS_DATA::ID => {
                CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
            }
            SCALED_IMU3_DATA::ID => {
                SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
            }
            HIL_OPTICAL_FLOW_DATA::ID => {
                HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
            }
            SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
            MANUAL_SETPOINT_DATA::ID => {
                MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
            }
            DEBUG_FLOAT_ARRAY_DATA::ID => {
                DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
            }
            ONBOARD_COMPUTER_STATUS_DATA::ID => {
                ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
                    .map(Self::ONBOARD_COMPUTER_STATUS)
            }
            ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
                .map(Self::ORBIT_EXECUTION_STATUS),
            PARAM_EXT_VALUE_DATA::ID => {
                PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
            }
            SAFETY_ALLOWED_AREA_DATA::ID => {
                SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
            }
            RAW_PRESSURE_DATA::ID => {
                RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
            }
            SCALED_PRESSURE3_DATA::ID => {
                SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
            }
            OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
                OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
                    .map(Self::OPEN_DRONE_ID_ARM_STATUS)
            }
            POSITION_TARGET_LOCAL_NED_DATA::ID => {
                POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
                    .map(Self::POSITION_TARGET_LOCAL_NED)
            }
            TERRAIN_DATA_DATA::ID => {
                TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
            }
            TERRAIN_REQUEST_DATA::ID => {
                TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
            }
            ESTIMATOR_STATUS_DATA::ID => {
                ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
            }
            LOCAL_POSITION_NED_DATA::ID => {
                LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
            }
            GLOBAL_POSITION_INT_DATA::ID => {
                GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
            }
            EXTENDED_SYS_STATE_DATA::ID => {
                EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
            }
            MESSAGE_INTERVAL_DATA::ID => {
                MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
            }
            MISSION_REQUEST_LIST_DATA::ID => {
                MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
            }
            VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
            CAN_FILTER_MODIFY_DATA::ID => {
                CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
            }
            LOG_REQUEST_END_DATA::ID => {
                LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
            }
            LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
            GLOBAL_POSITION_INT_COV_DATA::ID => {
                GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
                    .map(Self::GLOBAL_POSITION_INT_COV)
            }
            DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
            LOG_REQUEST_LIST_DATA::ID => {
                LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
            }
            VISION_POSITION_ESTIMATE_DATA::ID => {
                VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
                    .map(Self::VISION_POSITION_ESTIMATE)
            }
            PARAM_EXT_ACK_DATA::ID => {
                PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
            }
            MISSION_ACK_DATA::ID => {
                MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
            }
            PLAY_TUNE_V2_DATA::ID => {
                PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
            }
            SCALED_IMU2_DATA::ID => {
                SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
            }
            SCALED_PRESSURE_DATA::ID => {
                SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
            }
            COMMAND_ACK_DATA::ID => {
                COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
            }
            MISSION_CURRENT_DATA::ID => {
                MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
            }
            GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
            VIDEO_STREAM_INFORMATION_DATA::ID => {
                VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
                    .map(Self::VIDEO_STREAM_INFORMATION)
            }
            UAVCAN_NODE_INFO_DATA::ID => {
                UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
            }
            LINK_NODE_STATUS_DATA::ID => {
                LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
            }
            EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
            AUTOPILOT_VERSION_DATA::ID => {
                AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
            }
            SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
            BUTTON_CHANGE_DATA::ID => {
                BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
            }
            HIL_STATE_QUATERNION_DATA::ID => {
                HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
            }
            OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
                OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
                    .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
            }
            COMMAND_INT_DATA::ID => {
                COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
            }
            CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
                CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
                    .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
            }
            ENCAPSULATED_DATA_DATA::ID => {
                ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
            }
            MOUNT_ORIENTATION_DATA::ID => {
                MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
            }
            GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
                GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
                    .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
            }
            OPTICAL_FLOW_RAD_DATA::ID => {
                OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
            }
            SETUP_SIGNING_DATA::ID => {
                SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
            }
            BATTERY_STATUS_DATA::ID => {
                BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
            }
            OPTICAL_FLOW_DATA::ID => {
                OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
            }
            SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
            GPS_GLOBAL_ORIGIN_DATA::ID => {
                GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
            }
            MISSION_CLEAR_ALL_DATA::ID => {
                MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
            }
            FOLLOW_TARGET_DATA::ID => {
                FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
            }
            COMPONENT_METADATA_DATA::ID => {
                COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
            }
            GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
            SET_ATTITUDE_TARGET_DATA::ID => {
                SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
            }
            SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
                SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
                    .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
            }
            COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
            MISSION_SET_CURRENT_DATA::ID => {
                MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
            }
            MISSION_ITEM_DATA::ID => {
                MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
            }
            PARAM_REQUEST_READ_DATA::ID => {
                PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
            }
            DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
                DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
                    .map(Self::DATA_TRANSMISSION_HANDSHAKE)
            }
            CAMERA_CAPTURE_STATUS_DATA::ID => {
                CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
            }
            REQUEST_EVENT_DATA::ID => {
                REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
            }
            GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
            SYSTEM_TIME_DATA::ID => {
                SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
            }
            HIL_ACTUATOR_CONTROLS_DATA::ID => {
                HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
            }
            COMMAND_LONG_DATA::ID => {
                COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
            }
            WINCH_STATUS_DATA::ID => {
                WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
            }
            PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
                .map(Self::PARAM_EXT_REQUEST_READ),
            AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
                AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
                    .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
            }
            CUBEPILOT_RAW_RC_DATA::ID => {
                CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
            }
            GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
                GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
                    .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
            }
            ATTITUDE_TARGET_DATA::ID => {
                ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
            }
            HIGHRES_IMU_DATA::ID => {
                HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
            }
            LOGGING_DATA_ACKED_DATA::ID => {
                LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
            }
            ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
            HOME_POSITION_DATA::ID => {
                HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
            }
            VIDEO_STREAM_STATUS_DATA::ID => {
                VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
            }
            GIMBAL_MANAGER_STATUS_DATA::ID => {
                GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
            }
            HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
            MISSION_COUNT_DATA::ID => {
                MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
            }
            CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
            GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
                GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
                    .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
            }
            MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
                MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
                    .map(Self::MISSION_WRITE_PARTIAL_LIST)
            }
            TERRAIN_CHECK_DATA::ID => {
                TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
            }
            MISSION_ITEM_INT_DATA::ID => {
                MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
            }
            CHANGE_OPERATOR_CONTROL_DATA::ID => {
                CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
                    .map(Self::CHANGE_OPERATOR_CONTROL)
            }
            ATT_POS_MOCAP_DATA::ID => {
                ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
            }
            MANUAL_CONTROL_DATA::ID => {
                MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
            }
            UAVCAN_NODE_STATUS_DATA::ID => {
                UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
            }
            WHEEL_DISTANCE_DATA::ID => {
                WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
            }
            MISSION_REQUEST_INT_DATA::ID => {
                MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
            }
            OPEN_DRONE_ID_SELF_ID_DATA::ID => {
                OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
            }
            NAMED_VALUE_FLOAT_DATA::ID => {
                NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
            }
            RC_CHANNELS_RAW_DATA::ID => {
                RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
            }
            HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
            AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
            GIMBAL_MANAGER_INFORMATION_DATA::ID => {
                GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
                    .map(Self::GIMBAL_MANAGER_INFORMATION)
            }
            CAMERA_INFORMATION_DATA::ID => {
                CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
            }
            RESOURCE_REQUEST_DATA::ID => {
                RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
            }
            SMART_BATTERY_INFO_DATA::ID => {
                SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
            }
            MISSION_ITEM_REACHED_DATA::ID => {
                MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
            }
            DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
            OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
                OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
                    .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
            }
            DATA_STREAM_DATA::ID => {
                DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
            }
            ADSB_VEHICLE_DATA::ID => {
                ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
            }
            ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
                .map(Self::ACTUATOR_OUTPUT_STATUS),
            PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
            HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
            GENERATOR_STATUS_DATA::ID => {
                GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
            }
            REQUEST_DATA_STREAM_DATA::ID => {
                REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
            }
            TIME_ESTIMATE_TO_TARGET_DATA::ID => {
                TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
                    .map(Self::TIME_ESTIMATE_TO_TARGET)
            }
            OBSTACLE_DISTANCE_DATA::ID => {
                OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
            }
            CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
                CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
                    .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
            }
            WIFI_CONFIG_AP_DATA::ID => {
                WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
            }
            ACTUATOR_CONTROL_TARGET_DATA::ID => {
                ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
                    .map(Self::ACTUATOR_CONTROL_TARGET)
            }
            LOGGING_ACK_DATA::ID => {
                LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
            }
            HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
                HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
                    .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
            }
            GPS_INJECT_DATA_DATA::ID => {
                GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
            }
            TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
                TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
                    .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
            }
            TERRAIN_REPORT_DATA::ID => {
                TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
            }
            LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
            MEMORY_VECT_DATA::ID => {
                MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
            }
            OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
                OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
                    .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
            }
            CANFD_FRAME_DATA::ID => {
                CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
            }
            OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
                .map(Self::OPEN_DRONE_ID_LOCATION),
            GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
                GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
                    .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
            }
            _ => Err(ParserError::UnknownMessage { id }),
        }
    }
    fn message_name(&self) -> &'static str {
        match self {
            Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
            Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
            Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
            Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
            Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
            Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
            Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
            Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
            Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
            Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
            Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
            Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
            Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
            Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
            Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
            Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
            Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
            Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
            Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
            Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
            Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
            Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
            Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
            Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
            Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
            Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
            Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
            Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
            Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
            Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
            Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
            Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
            Self::TUNNEL(..) => TUNNEL_DATA::NAME,
            Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
            Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
            Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
            Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
            Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
            Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
            Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
            Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
            Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
            Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
            Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
            Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
            Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
            Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
            Self::PING(..) => PING_DATA::NAME,
            Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
            Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
            Self::VIBRATION(..) => VIBRATION_DATA::NAME,
            Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
            Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
            Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
            Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
            Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
            Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
            Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
            Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
            Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
            Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
            Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
            Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
            Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
            Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
            Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
            Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
            Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
            Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
            Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
                TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
            }
            Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
            Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
            Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
            Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
            Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
            Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
            Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
            Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
            Self::WIND_COV(..) => WIND_COV_DATA::NAME,
            Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
            Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
            Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
            Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
            Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
            Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
            Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
            Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
            Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
            Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
            Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
            Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
                LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
            }
            Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
            Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
            Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
            Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
            Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
            Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
            Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
            Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
            Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
            Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
            Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
            Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
            Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
            Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
            Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
            Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
            Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
            Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
            Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
            Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
            Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
            Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
            Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
            Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
            Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
            Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
            Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
            Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
            Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
            Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
            Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
            Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
            Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
            Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
            Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
            Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
            Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
            Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
            Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
            Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
            Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
            Self::EVENT(..) => EVENT_DATA::NAME,
            Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
            Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
            Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
            Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
            Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
            Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
            Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
            Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
            Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
            Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
            Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
            Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
            Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
            Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
            Self::SET_MODE(..) => SET_MODE_DATA::NAME,
            Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
            Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
            Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
            Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
            Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
            Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
            Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
            Self::COLLISION(..) => COLLISION_DATA::NAME,
            Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
            Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
            Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
            Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
            Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
            Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
            Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
            Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
            Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
            Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
            Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
            Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
            Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
                AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
            }
            Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
            Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
            Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
            Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
            Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
            Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
            Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
            Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
            Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
            Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
            Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
            Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
            Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
            Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
            Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
            Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
            Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
            Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
            Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
            Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
            Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
            Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
            Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
            Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
            Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
            Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
            Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
            Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
            Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
            Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
            Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
            Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
            Self::DEBUG(..) => DEBUG_DATA::NAME,
            Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
            Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
            Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
            Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
            Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
            Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
            Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
            Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
            Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
            Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
            Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
            Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
            Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
            Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
            Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
                HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
            }
            Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
            Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
                TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
            }
            Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
            Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
            Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
            Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
            Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
            Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
            Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
                GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
            }
        }
    }
    fn message_id(&self) -> u32 {
        match self {
            Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
            Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
            Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
            Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
            Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
            Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
            Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
            Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
            Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
            Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
            Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
            Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
            Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
            Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
            Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
            Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
            Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
            Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
            Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
            Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
            Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
            Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
            Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
            Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
            Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
            Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
            Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
            Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
            Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
            Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
            Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
            Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
            Self::TUNNEL(..) => TUNNEL_DATA::ID,
            Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
            Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
            Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
            Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
            Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
            Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
            Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
            Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
            Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
            Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
            Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
            Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
            Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
            Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
            Self::PING(..) => PING_DATA::ID,
            Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
            Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
            Self::VIBRATION(..) => VIBRATION_DATA::ID,
            Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
            Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
            Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
            Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
            Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
            Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
            Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
            Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
            Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
            Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
            Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
            Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
            Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
            Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
            Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
            Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
            Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
            Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
            Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
            Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
            Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
            Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
            Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
            Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
            Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
            Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
            Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
            Self::WIND_COV(..) => WIND_COV_DATA::ID,
            Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
            Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
            Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
            Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
            Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
            Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
            Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
            Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
            Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
            Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
            Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
            Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
                LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
            }
            Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
            Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
            Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
            Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
            Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
            Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
            Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
            Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
            Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
            Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
            Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
            Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
            Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
            Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
            Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
            Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
            Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
            Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
            Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
            Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
            Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
            Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
            Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
            Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
            Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
            Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
            Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
            Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
            Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
            Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
            Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
            Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
            Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
            Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
            Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
            Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
            Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
            Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
            Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
            Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
            Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
            Self::EVENT(..) => EVENT_DATA::ID,
            Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
            Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
            Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
            Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
            Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
            Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
            Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
            Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
            Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
            Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
            Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
            Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
            Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
            Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
            Self::SET_MODE(..) => SET_MODE_DATA::ID,
            Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
            Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
            Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
            Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
            Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
            Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
            Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
            Self::COLLISION(..) => COLLISION_DATA::ID,
            Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
            Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
            Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
            Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
            Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
            Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
            Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
            Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
            Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
            Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
            Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
            Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
            Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
                AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
            }
            Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
            Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
            Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
            Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
            Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
            Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
            Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
            Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
            Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
            Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
            Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
            Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
            Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
            Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
            Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
            Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
            Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
            Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
            Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
            Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
            Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
            Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
            Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
            Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
            Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
            Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
            Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
            Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
            Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
            Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
            Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
            Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
            Self::DEBUG(..) => DEBUG_DATA::ID,
            Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
            Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
            Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
            Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
            Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
            Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
            Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
            Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
            Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
            Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
            Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
            Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
            Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
            Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
            Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
                HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
            }
            Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
            Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
                TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
            }
            Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
            Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
            Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
            Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
            Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
            Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
            Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
                GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
            }
        }
    }
    fn message_id_from_name(name: &str) -> Result<u32, &'static str> {
        match name {
            CURRENT_EVENT_SEQUENCE_DATA::NAME => Ok(CURRENT_EVENT_SEQUENCE_DATA::ID),
            PARAM_EXT_REQUEST_LIST_DATA::NAME => Ok(PARAM_EXT_REQUEST_LIST_DATA::ID),
            HIL_RC_INPUTS_RAW_DATA::NAME => Ok(HIL_RC_INPUTS_RAW_DATA::ID),
            SCALED_PRESSURE2_DATA::NAME => Ok(SCALED_PRESSURE2_DATA::ID),
            CAMERA_TRIGGER_DATA::NAME => Ok(CAMERA_TRIGGER_DATA::ID),
            FLIGHT_INFORMATION_DATA::NAME => Ok(FLIGHT_INFORMATION_DATA::ID),
            TIMESYNC_DATA::NAME => Ok(TIMESYNC_DATA::ID),
            SERIAL_CONTROL_DATA::NAME => Ok(SERIAL_CONTROL_DATA::ID),
            VICON_POSITION_ESTIMATE_DATA::NAME => Ok(VICON_POSITION_ESTIMATE_DATA::ID),
            FILE_TRANSFER_PROTOCOL_DATA::NAME => Ok(FILE_TRANSFER_PROTOCOL_DATA::ID),
            CAMERA_IMAGE_CAPTURED_DATA::NAME => Ok(CAMERA_IMAGE_CAPTURED_DATA::ID),
            MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Ok(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
            CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Ok(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
            RC_CHANNELS_DATA::NAME => Ok(RC_CHANNELS_DATA::ID),
            SYS_STATUS_DATA::NAME => Ok(SYS_STATUS_DATA::ID),
            HIL_SENSOR_DATA::NAME => Ok(HIL_SENSOR_DATA::ID),
            MAG_CAL_REPORT_DATA::NAME => Ok(MAG_CAL_REPORT_DATA::ID),
            AUTH_KEY_DATA::NAME => Ok(AUTH_KEY_DATA::ID),
            LANDING_TARGET_DATA::NAME => Ok(LANDING_TARGET_DATA::ID),
            PARAM_SET_DATA::NAME => Ok(PARAM_SET_DATA::ID),
            ALTITUDE_DATA::NAME => Ok(ALTITUDE_DATA::ID),
            V2_EXTENSION_DATA::NAME => Ok(V2_EXTENSION_DATA::ID),
            ATTITUDE_DATA::NAME => Ok(ATTITUDE_DATA::ID),
            CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Ok(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
            OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Ok(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
            GPS_RTK_DATA::NAME => Ok(GPS_RTK_DATA::ID),
            HIGH_LATENCY_DATA::NAME => Ok(HIGH_LATENCY_DATA::ID),
            FENCE_STATUS_DATA::NAME => Ok(FENCE_STATUS_DATA::ID),
            PARAM_EXT_SET_DATA::NAME => Ok(PARAM_EXT_SET_DATA::ID),
            LOGGING_DATA_DATA::NAME => Ok(LOGGING_DATA_DATA::ID),
            CELLULAR_STATUS_DATA::NAME => Ok(CELLULAR_STATUS_DATA::ID),
            SUPPORTED_TUNES_DATA::NAME => Ok(SUPPORTED_TUNES_DATA::ID),
            TUNNEL_DATA::NAME => Ok(TUNNEL_DATA::ID),
            RC_CHANNELS_OVERRIDE_DATA::NAME => Ok(RC_CHANNELS_OVERRIDE_DATA::ID),
            COMPONENT_INFORMATION_DATA::NAME => Ok(COMPONENT_INFORMATION_DATA::ID),
            HERELINK_TELEM_DATA::NAME => Ok(HERELINK_TELEM_DATA::ID),
            SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => Ok(SET_POSITION_TARGET_LOCAL_NED_DATA::ID),
            HYGROMETER_SENSOR_DATA::NAME => Ok(HYGROMETER_SENSOR_DATA::ID),
            ISBD_LINK_STATUS_DATA::NAME => Ok(ISBD_LINK_STATUS_DATA::ID),
            STORAGE_INFORMATION_DATA::NAME => Ok(STORAGE_INFORMATION_DATA::ID),
            LOG_ENTRY_DATA::NAME => Ok(LOG_ENTRY_DATA::ID),
            VISION_SPEED_ESTIMATE_DATA::NAME => Ok(VISION_SPEED_ESTIMATE_DATA::ID),
            ESC_INFO_DATA::NAME => Ok(ESC_INFO_DATA::ID),
            GPS_RAW_INT_DATA::NAME => Ok(GPS_RAW_INT_DATA::ID),
            OPEN_DRONE_ID_SYSTEM_DATA::NAME => Ok(OPEN_DRONE_ID_SYSTEM_DATA::ID),
            DISTANCE_SENSOR_DATA::NAME => Ok(DISTANCE_SENSOR_DATA::ID),
            ODOMETRY_DATA::NAME => Ok(ODOMETRY_DATA::ID),
            PING_DATA::NAME => Ok(PING_DATA::ID),
            PROTOCOL_VERSION_DATA::NAME => Ok(PROTOCOL_VERSION_DATA::ID),
            CONTROL_SYSTEM_STATE_DATA::NAME => Ok(CONTROL_SYSTEM_STATE_DATA::ID),
            VIBRATION_DATA::NAME => Ok(VIBRATION_DATA::ID),
            GIMBAL_DEVICE_INFORMATION_DATA::NAME => Ok(GIMBAL_DEVICE_INFORMATION_DATA::ID),
            RADIO_STATUS_DATA::NAME => Ok(RADIO_STATUS_DATA::ID),
            OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Ok(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
            UTM_GLOBAL_POSITION_DATA::NAME => Ok(UTM_GLOBAL_POSITION_DATA::ID),
            POSITION_TARGET_GLOBAL_INT_DATA::NAME => Ok(POSITION_TARGET_GLOBAL_INT_DATA::ID),
            CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
                Ok(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
            }
            ATTITUDE_QUATERNION_DATA::NAME => Ok(ATTITUDE_QUATERNION_DATA::ID),
            PARAM_REQUEST_LIST_DATA::NAME => Ok(PARAM_REQUEST_LIST_DATA::ID),
            MISSION_REQUEST_DATA::NAME => Ok(MISSION_REQUEST_DATA::ID),
            SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Ok(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
            HIGH_LATENCY2_DATA::NAME => Ok(HIGH_LATENCY2_DATA::ID),
            SAFETY_SET_ALLOWED_AREA_DATA::NAME => Ok(SAFETY_SET_ALLOWED_AREA_DATA::ID),
            CAMERA_FOV_STATUS_DATA::NAME => Ok(CAMERA_FOV_STATUS_DATA::ID),
            SET_HOME_POSITION_DATA::NAME => Ok(SET_HOME_POSITION_DATA::ID),
            NAMED_VALUE_INT_DATA::NAME => Ok(NAMED_VALUE_INT_DATA::ID),
            GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Ok(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
            POWER_STATUS_DATA::NAME => Ok(POWER_STATUS_DATA::ID),
            RAW_RPM_DATA::NAME => Ok(RAW_RPM_DATA::ID),
            TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
                Ok(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
            }
            COMMAND_CANCEL_DATA::NAME => Ok(COMMAND_CANCEL_DATA::ID),
            GPS2_RAW_DATA::NAME => Ok(GPS2_RAW_DATA::ID),
            PARAM_MAP_RC_DATA::NAME => Ok(PARAM_MAP_RC_DATA::ID),
            RESPONSE_EVENT_ERROR_DATA::NAME => Ok(RESPONSE_EVENT_ERROR_DATA::ID),
            SERVO_OUTPUT_RAW_DATA::NAME => Ok(SERVO_OUTPUT_RAW_DATA::ID),
            ATTITUDE_QUATERNION_COV_DATA::NAME => Ok(ATTITUDE_QUATERNION_COV_DATA::ID),
            GPS_RTCM_DATA_DATA::NAME => Ok(GPS_RTCM_DATA_DATA::ID),
            CELLULAR_CONFIG_DATA::NAME => Ok(CELLULAR_CONFIG_DATA::ID),
            WIND_COV_DATA::NAME => Ok(WIND_COV_DATA::ID),
            PARAM_VALUE_DATA::NAME => Ok(PARAM_VALUE_DATA::ID),
            LOCAL_POSITION_NED_COV_DATA::NAME => Ok(LOCAL_POSITION_NED_COV_DATA::ID),
            NAV_CONTROLLER_OUTPUT_DATA::NAME => Ok(NAV_CONTROLLER_OUTPUT_DATA::ID),
            HIL_CONTROLS_DATA::NAME => Ok(HIL_CONTROLS_DATA::ID),
            SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Ok(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
            RC_CHANNELS_SCALED_DATA::NAME => Ok(RC_CHANNELS_SCALED_DATA::ID),
            LOG_REQUEST_DATA_DATA::NAME => Ok(LOG_REQUEST_DATA_DATA::ID),
            GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Ok(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
            RAW_IMU_DATA::NAME => Ok(RAW_IMU_DATA::ID),
            STATUSTEXT_DATA::NAME => Ok(STATUSTEXT_DATA::ID),
            EFI_STATUS_DATA::NAME => Ok(EFI_STATUS_DATA::ID),
            LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
                Ok(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
            }
            CAMERA_SETTINGS_DATA::NAME => Ok(CAMERA_SETTINGS_DATA::ID),
            SCALED_IMU3_DATA::NAME => Ok(SCALED_IMU3_DATA::ID),
            HIL_OPTICAL_FLOW_DATA::NAME => Ok(HIL_OPTICAL_FLOW_DATA::ID),
            SCALED_IMU_DATA::NAME => Ok(SCALED_IMU_DATA::ID),
            MANUAL_SETPOINT_DATA::NAME => Ok(MANUAL_SETPOINT_DATA::ID),
            DEBUG_FLOAT_ARRAY_DATA::NAME => Ok(DEBUG_FLOAT_ARRAY_DATA::ID),
            ONBOARD_COMPUTER_STATUS_DATA::NAME => Ok(ONBOARD_COMPUTER_STATUS_DATA::ID),
            ORBIT_EXECUTION_STATUS_DATA::NAME => Ok(ORBIT_EXECUTION_STATUS_DATA::ID),
            PARAM_EXT_VALUE_DATA::NAME => Ok(PARAM_EXT_VALUE_DATA::ID),
            SAFETY_ALLOWED_AREA_DATA::NAME => Ok(SAFETY_ALLOWED_AREA_DATA::ID),
            RAW_PRESSURE_DATA::NAME => Ok(RAW_PRESSURE_DATA::ID),
            SCALED_PRESSURE3_DATA::NAME => Ok(SCALED_PRESSURE3_DATA::ID),
            OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Ok(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
            POSITION_TARGET_LOCAL_NED_DATA::NAME => Ok(POSITION_TARGET_LOCAL_NED_DATA::ID),
            TERRAIN_DATA_DATA::NAME => Ok(TERRAIN_DATA_DATA::ID),
            TERRAIN_REQUEST_DATA::NAME => Ok(TERRAIN_REQUEST_DATA::ID),
            ESTIMATOR_STATUS_DATA::NAME => Ok(ESTIMATOR_STATUS_DATA::ID),
            LOCAL_POSITION_NED_DATA::NAME => Ok(LOCAL_POSITION_NED_DATA::ID),
            GLOBAL_POSITION_INT_DATA::NAME => Ok(GLOBAL_POSITION_INT_DATA::ID),
            EXTENDED_SYS_STATE_DATA::NAME => Ok(EXTENDED_SYS_STATE_DATA::ID),
            MESSAGE_INTERVAL_DATA::NAME => Ok(MESSAGE_INTERVAL_DATA::ID),
            MISSION_REQUEST_LIST_DATA::NAME => Ok(MISSION_REQUEST_LIST_DATA::ID),
            VFR_HUD_DATA::NAME => Ok(VFR_HUD_DATA::ID),
            CAN_FILTER_MODIFY_DATA::NAME => Ok(CAN_FILTER_MODIFY_DATA::ID),
            LOG_REQUEST_END_DATA::NAME => Ok(LOG_REQUEST_END_DATA::ID),
            LOG_ERASE_DATA::NAME => Ok(LOG_ERASE_DATA::ID),
            GLOBAL_POSITION_INT_COV_DATA::NAME => Ok(GLOBAL_POSITION_INT_COV_DATA::ID),
            DEBUG_VECT_DATA::NAME => Ok(DEBUG_VECT_DATA::ID),
            LOG_REQUEST_LIST_DATA::NAME => Ok(LOG_REQUEST_LIST_DATA::ID),
            VISION_POSITION_ESTIMATE_DATA::NAME => Ok(VISION_POSITION_ESTIMATE_DATA::ID),
            PARAM_EXT_ACK_DATA::NAME => Ok(PARAM_EXT_ACK_DATA::ID),
            MISSION_ACK_DATA::NAME => Ok(MISSION_ACK_DATA::ID),
            PLAY_TUNE_V2_DATA::NAME => Ok(PLAY_TUNE_V2_DATA::ID),
            SCALED_IMU2_DATA::NAME => Ok(SCALED_IMU2_DATA::ID),
            SCALED_PRESSURE_DATA::NAME => Ok(SCALED_PRESSURE_DATA::ID),
            COMMAND_ACK_DATA::NAME => Ok(COMMAND_ACK_DATA::ID),
            MISSION_CURRENT_DATA::NAME => Ok(MISSION_CURRENT_DATA::ID),
            GPS_STATUS_DATA::NAME => Ok(GPS_STATUS_DATA::ID),
            VIDEO_STREAM_INFORMATION_DATA::NAME => Ok(VIDEO_STREAM_INFORMATION_DATA::ID),
            UAVCAN_NODE_INFO_DATA::NAME => Ok(UAVCAN_NODE_INFO_DATA::ID),
            LINK_NODE_STATUS_DATA::NAME => Ok(LINK_NODE_STATUS_DATA::ID),
            EVENT_DATA::NAME => Ok(EVENT_DATA::ID),
            AUTOPILOT_VERSION_DATA::NAME => Ok(AUTOPILOT_VERSION_DATA::ID),
            SIM_STATE_DATA::NAME => Ok(SIM_STATE_DATA::ID),
            BUTTON_CHANGE_DATA::NAME => Ok(BUTTON_CHANGE_DATA::ID),
            HIL_STATE_QUATERNION_DATA::NAME => Ok(HIL_STATE_QUATERNION_DATA::ID),
            OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Ok(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
            COMMAND_INT_DATA::NAME => Ok(COMMAND_INT_DATA::ID),
            CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
                Ok(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
            }
            ENCAPSULATED_DATA_DATA::NAME => Ok(ENCAPSULATED_DATA_DATA::ID),
            MOUNT_ORIENTATION_DATA::NAME => Ok(MOUNT_ORIENTATION_DATA::ID),
            GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Ok(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
            OPTICAL_FLOW_RAD_DATA::NAME => Ok(OPTICAL_FLOW_RAD_DATA::ID),
            SETUP_SIGNING_DATA::NAME => Ok(SETUP_SIGNING_DATA::ID),
            BATTERY_STATUS_DATA::NAME => Ok(BATTERY_STATUS_DATA::ID),
            OPTICAL_FLOW_DATA::NAME => Ok(OPTICAL_FLOW_DATA::ID),
            SET_MODE_DATA::NAME => Ok(SET_MODE_DATA::ID),
            GPS_GLOBAL_ORIGIN_DATA::NAME => Ok(GPS_GLOBAL_ORIGIN_DATA::ID),
            MISSION_CLEAR_ALL_DATA::NAME => Ok(MISSION_CLEAR_ALL_DATA::ID),
            FOLLOW_TARGET_DATA::NAME => Ok(FOLLOW_TARGET_DATA::ID),
            COMPONENT_METADATA_DATA::NAME => Ok(COMPONENT_METADATA_DATA::ID),
            GPS_INPUT_DATA::NAME => Ok(GPS_INPUT_DATA::ID),
            SET_ATTITUDE_TARGET_DATA::NAME => Ok(SET_ATTITUDE_TARGET_DATA::ID),
            SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
                Ok(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
            }
            COLLISION_DATA::NAME => Ok(COLLISION_DATA::ID),
            MISSION_SET_CURRENT_DATA::NAME => Ok(MISSION_SET_CURRENT_DATA::ID),
            MISSION_ITEM_DATA::NAME => Ok(MISSION_ITEM_DATA::ID),
            PARAM_REQUEST_READ_DATA::NAME => Ok(PARAM_REQUEST_READ_DATA::ID),
            DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Ok(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
            CAMERA_CAPTURE_STATUS_DATA::NAME => Ok(CAMERA_CAPTURE_STATUS_DATA::ID),
            REQUEST_EVENT_DATA::NAME => Ok(REQUEST_EVENT_DATA::ID),
            GPS2_RTK_DATA::NAME => Ok(GPS2_RTK_DATA::ID),
            SYSTEM_TIME_DATA::NAME => Ok(SYSTEM_TIME_DATA::ID),
            HIL_ACTUATOR_CONTROLS_DATA::NAME => Ok(HIL_ACTUATOR_CONTROLS_DATA::ID),
            COMMAND_LONG_DATA::NAME => Ok(COMMAND_LONG_DATA::ID),
            WINCH_STATUS_DATA::NAME => Ok(WINCH_STATUS_DATA::ID),
            PARAM_EXT_REQUEST_READ_DATA::NAME => Ok(PARAM_EXT_REQUEST_READ_DATA::ID),
            AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
                Ok(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
            }
            CUBEPILOT_RAW_RC_DATA::NAME => Ok(CUBEPILOT_RAW_RC_DATA::ID),
            GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
                Ok(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
            }
            ATTITUDE_TARGET_DATA::NAME => Ok(ATTITUDE_TARGET_DATA::ID),
            HIGHRES_IMU_DATA::NAME => Ok(HIGHRES_IMU_DATA::ID),
            LOGGING_DATA_ACKED_DATA::NAME => Ok(LOGGING_DATA_ACKED_DATA::ID),
            ESC_STATUS_DATA::NAME => Ok(ESC_STATUS_DATA::ID),
            HOME_POSITION_DATA::NAME => Ok(HOME_POSITION_DATA::ID),
            VIDEO_STREAM_STATUS_DATA::NAME => Ok(VIDEO_STREAM_STATUS_DATA::ID),
            GIMBAL_MANAGER_STATUS_DATA::NAME => Ok(GIMBAL_MANAGER_STATUS_DATA::ID),
            HIL_STATE_DATA::NAME => Ok(HIL_STATE_DATA::ID),
            MISSION_COUNT_DATA::NAME => Ok(MISSION_COUNT_DATA::ID),
            CAN_FRAME_DATA::NAME => Ok(CAN_FRAME_DATA::ID),
            GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => Ok(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID),
            MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Ok(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
            TERRAIN_CHECK_DATA::NAME => Ok(TERRAIN_CHECK_DATA::ID),
            MISSION_ITEM_INT_DATA::NAME => Ok(MISSION_ITEM_INT_DATA::ID),
            CHANGE_OPERATOR_CONTROL_DATA::NAME => Ok(CHANGE_OPERATOR_CONTROL_DATA::ID),
            ATT_POS_MOCAP_DATA::NAME => Ok(ATT_POS_MOCAP_DATA::ID),
            MANUAL_CONTROL_DATA::NAME => Ok(MANUAL_CONTROL_DATA::ID),
            UAVCAN_NODE_STATUS_DATA::NAME => Ok(UAVCAN_NODE_STATUS_DATA::ID),
            WHEEL_DISTANCE_DATA::NAME => Ok(WHEEL_DISTANCE_DATA::ID),
            MISSION_REQUEST_INT_DATA::NAME => Ok(MISSION_REQUEST_INT_DATA::ID),
            OPEN_DRONE_ID_SELF_ID_DATA::NAME => Ok(OPEN_DRONE_ID_SELF_ID_DATA::ID),
            NAMED_VALUE_FLOAT_DATA::NAME => Ok(NAMED_VALUE_FLOAT_DATA::ID),
            RC_CHANNELS_RAW_DATA::NAME => Ok(RC_CHANNELS_RAW_DATA::ID),
            HEARTBEAT_DATA::NAME => Ok(HEARTBEAT_DATA::ID),
            AIS_VESSEL_DATA::NAME => Ok(AIS_VESSEL_DATA::ID),
            GIMBAL_MANAGER_INFORMATION_DATA::NAME => Ok(GIMBAL_MANAGER_INFORMATION_DATA::ID),
            CAMERA_INFORMATION_DATA::NAME => Ok(CAMERA_INFORMATION_DATA::ID),
            RESOURCE_REQUEST_DATA::NAME => Ok(RESOURCE_REQUEST_DATA::ID),
            SMART_BATTERY_INFO_DATA::NAME => Ok(SMART_BATTERY_INFO_DATA::ID),
            MISSION_ITEM_REACHED_DATA::NAME => Ok(MISSION_ITEM_REACHED_DATA::ID),
            DEBUG_DATA::NAME => Ok(DEBUG_DATA::ID),
            OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Ok(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
            DATA_STREAM_DATA::NAME => Ok(DATA_STREAM_DATA::ID),
            ADSB_VEHICLE_DATA::NAME => Ok(ADSB_VEHICLE_DATA::ID),
            ACTUATOR_OUTPUT_STATUS_DATA::NAME => Ok(ACTUATOR_OUTPUT_STATUS_DATA::ID),
            PLAY_TUNE_DATA::NAME => Ok(PLAY_TUNE_DATA::ID),
            HIL_GPS_DATA::NAME => Ok(HIL_GPS_DATA::ID),
            GENERATOR_STATUS_DATA::NAME => Ok(GENERATOR_STATUS_DATA::ID),
            REQUEST_DATA_STREAM_DATA::NAME => Ok(REQUEST_DATA_STREAM_DATA::ID),
            TIME_ESTIMATE_TO_TARGET_DATA::NAME => Ok(TIME_ESTIMATE_TO_TARGET_DATA::ID),
            OBSTACLE_DISTANCE_DATA::NAME => Ok(OBSTACLE_DISTANCE_DATA::ID),
            CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Ok(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
            WIFI_CONFIG_AP_DATA::NAME => Ok(WIFI_CONFIG_AP_DATA::ID),
            ACTUATOR_CONTROL_TARGET_DATA::NAME => Ok(ACTUATOR_CONTROL_TARGET_DATA::ID),
            LOGGING_ACK_DATA::NAME => Ok(LOGGING_ACK_DATA::ID),
            HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
                Ok(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
            }
            GPS_INJECT_DATA_DATA::NAME => Ok(GPS_INJECT_DATA_DATA::ID),
            TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
                Ok(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
            }
            TERRAIN_REPORT_DATA::NAME => Ok(TERRAIN_REPORT_DATA::ID),
            LOG_DATA_DATA::NAME => Ok(LOG_DATA_DATA::ID),
            MEMORY_VECT_DATA::NAME => Ok(MEMORY_VECT_DATA::ID),
            OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Ok(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
            CANFD_FRAME_DATA::NAME => Ok(CANFD_FRAME_DATA::ID),
            OPEN_DRONE_ID_LOCATION_DATA::NAME => Ok(OPEN_DRONE_ID_LOCATION_DATA::ID),
            GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
                Ok(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
            }
            _ => Err("Invalid message name."),
        }
    }
    fn default_message_from_id(id: u32) -> Result<Self, &'static str> {
        match id {
            CURRENT_EVENT_SEQUENCE_DATA::ID => Ok(Self::CURRENT_EVENT_SEQUENCE(
                CURRENT_EVENT_SEQUENCE_DATA::default(),
            )),
            PARAM_EXT_REQUEST_LIST_DATA::ID => Ok(Self::PARAM_EXT_REQUEST_LIST(
                PARAM_EXT_REQUEST_LIST_DATA::default(),
            )),
            HIL_RC_INPUTS_RAW_DATA::ID => {
                Ok(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
            }
            SCALED_PRESSURE2_DATA::ID => {
                Ok(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
            }
            CAMERA_TRIGGER_DATA::ID => Ok(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
            FLIGHT_INFORMATION_DATA::ID => {
                Ok(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
            }
            TIMESYNC_DATA::ID => Ok(Self::TIMESYNC(TIMESYNC_DATA::default())),
            SERIAL_CONTROL_DATA::ID => Ok(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
            VICON_POSITION_ESTIMATE_DATA::ID => Ok(Self::VICON_POSITION_ESTIMATE(
                VICON_POSITION_ESTIMATE_DATA::default(),
            )),
            FILE_TRANSFER_PROTOCOL_DATA::ID => Ok(Self::FILE_TRANSFER_PROTOCOL(
                FILE_TRANSFER_PROTOCOL_DATA::default(),
            )),
            CAMERA_IMAGE_CAPTURED_DATA::ID => Ok(Self::CAMERA_IMAGE_CAPTURED(
                CAMERA_IMAGE_CAPTURED_DATA::default(),
            )),
            MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Ok(Self::MISSION_REQUEST_PARTIAL_LIST(
                MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
            )),
            CAMERA_TRACKING_GEO_STATUS_DATA::ID => Ok(Self::CAMERA_TRACKING_GEO_STATUS(
                CAMERA_TRACKING_GEO_STATUS_DATA::default(),
            )),
            RC_CHANNELS_DATA::ID => Ok(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
            SYS_STATUS_DATA::ID => Ok(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
            HIL_SENSOR_DATA::ID => Ok(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
            MAG_CAL_REPORT_DATA::ID => Ok(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
            AUTH_KEY_DATA::ID => Ok(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
            LANDING_TARGET_DATA::ID => Ok(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
            PARAM_SET_DATA::ID => Ok(Self::PARAM_SET(PARAM_SET_DATA::default())),
            ALTITUDE_DATA::ID => Ok(Self::ALTITUDE(ALTITUDE_DATA::default())),
            V2_EXTENSION_DATA::ID => Ok(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
            ATTITUDE_DATA::ID => Ok(Self::ATTITUDE(ATTITUDE_DATA::default())),
            CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Ok(Self::CHANGE_OPERATOR_CONTROL_ACK(
                CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
            )),
            OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Ok(Self::OPEN_DRONE_ID_MESSAGE_PACK(
                OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
            )),
            GPS_RTK_DATA::ID => Ok(Self::GPS_RTK(GPS_RTK_DATA::default())),
            HIGH_LATENCY_DATA::ID => Ok(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
            FENCE_STATUS_DATA::ID => Ok(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
            PARAM_EXT_SET_DATA::ID => Ok(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
            LOGGING_DATA_DATA::ID => Ok(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
            CELLULAR_STATUS_DATA::ID => Ok(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default())),
            SUPPORTED_TUNES_DATA::ID => Ok(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default())),
            TUNNEL_DATA::ID => Ok(Self::TUNNEL(TUNNEL_DATA::default())),
            RC_CHANNELS_OVERRIDE_DATA::ID => Ok(Self::RC_CHANNELS_OVERRIDE(
                RC_CHANNELS_OVERRIDE_DATA::default(),
            )),
            COMPONENT_INFORMATION_DATA::ID => Ok(Self::COMPONENT_INFORMATION(
                COMPONENT_INFORMATION_DATA::default(),
            )),
            HERELINK_TELEM_DATA::ID => Ok(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
            SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Ok(Self::SET_POSITION_TARGET_LOCAL_NED(
                SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
            )),
            HYGROMETER_SENSOR_DATA::ID => {
                Ok(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
            }
            ISBD_LINK_STATUS_DATA::ID => {
                Ok(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
            }
            STORAGE_INFORMATION_DATA::ID => Ok(Self::STORAGE_INFORMATION(
                STORAGE_INFORMATION_DATA::default(),
            )),
            LOG_ENTRY_DATA::ID => Ok(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
            VISION_SPEED_ESTIMATE_DATA::ID => Ok(Self::VISION_SPEED_ESTIMATE(
                VISION_SPEED_ESTIMATE_DATA::default(),
            )),
            ESC_INFO_DATA::ID => Ok(Self::ESC_INFO(ESC_INFO_DATA::default())),
            GPS_RAW_INT_DATA::ID => Ok(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
            OPEN_DRONE_ID_SYSTEM_DATA::ID => Ok(Self::OPEN_DRONE_ID_SYSTEM(
                OPEN_DRONE_ID_SYSTEM_DATA::default(),
            )),
            DISTANCE_SENSOR_DATA::ID => Ok(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default())),
            ODOMETRY_DATA::ID => Ok(Self::ODOMETRY(ODOMETRY_DATA::default())),
            PING_DATA::ID => Ok(Self::PING(PING_DATA::default())),
            PROTOCOL_VERSION_DATA::ID => {
                Ok(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
            }
            CONTROL_SYSTEM_STATE_DATA::ID => Ok(Self::CONTROL_SYSTEM_STATE(
                CONTROL_SYSTEM_STATE_DATA::default(),
            )),
            VIBRATION_DATA::ID => Ok(Self::VIBRATION(VIBRATION_DATA::default())),
            GIMBAL_DEVICE_INFORMATION_DATA::ID => Ok(Self::GIMBAL_DEVICE_INFORMATION(
                GIMBAL_DEVICE_INFORMATION_DATA::default(),
            )),
            RADIO_STATUS_DATA::ID => Ok(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
            OPEN_DRONE_ID_BASIC_ID_DATA::ID => Ok(Self::OPEN_DRONE_ID_BASIC_ID(
                OPEN_DRONE_ID_BASIC_ID_DATA::default(),
            )),
            UTM_GLOBAL_POSITION_DATA::ID => Ok(Self::UTM_GLOBAL_POSITION(
                UTM_GLOBAL_POSITION_DATA::default(),
            )),
            POSITION_TARGET_GLOBAL_INT_DATA::ID => Ok(Self::POSITION_TARGET_GLOBAL_INT(
                POSITION_TARGET_GLOBAL_INT_DATA::default(),
            )),
            CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Ok(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
                CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
            )),
            ATTITUDE_QUATERNION_DATA::ID => Ok(Self::ATTITUDE_QUATERNION(
                ATTITUDE_QUATERNION_DATA::default(),
            )),
            PARAM_REQUEST_LIST_DATA::ID => {
                Ok(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
            }
            MISSION_REQUEST_DATA::ID => Ok(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default())),
            SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Ok(Self::SET_ACTUATOR_CONTROL_TARGET(
                SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
            )),
            HIGH_LATENCY2_DATA::ID => Ok(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
            SAFETY_SET_ALLOWED_AREA_DATA::ID => Ok(Self::SAFETY_SET_ALLOWED_AREA(
                SAFETY_SET_ALLOWED_AREA_DATA::default(),
            )),
            CAMERA_FOV_STATUS_DATA::ID => {
                Ok(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
            }
            SET_HOME_POSITION_DATA::ID => {
                Ok(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
            }
            NAMED_VALUE_INT_DATA::ID => Ok(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default())),
            GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Ok(Self::GIMBAL_MANAGER_SET_PITCHYAW(
                GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
            )),
            POWER_STATUS_DATA::ID => Ok(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
            RAW_RPM_DATA::ID => Ok(Self::RAW_RPM(RAW_RPM_DATA::default())),
            TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
                Ok(Self::TRAJECTORY_REPRESENTATION_BEZIER(
                    TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
                ))
            }
            COMMAND_CANCEL_DATA::ID => Ok(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
            GPS2_RAW_DATA::ID => Ok(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
            PARAM_MAP_RC_DATA::ID => Ok(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
            RESPONSE_EVENT_ERROR_DATA::ID => Ok(Self::RESPONSE_EVENT_ERROR(
                RESPONSE_EVENT_ERROR_DATA::default(),
            )),
            SERVO_OUTPUT_RAW_DATA::ID => {
                Ok(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
            }
            ATTITUDE_QUATERNION_COV_DATA::ID => Ok(Self::ATTITUDE_QUATERNION_COV(
                ATTITUDE_QUATERNION_COV_DATA::default(),
            )),
            GPS_RTCM_DATA_DATA::ID => Ok(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
            CELLULAR_CONFIG_DATA::ID => Ok(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default())),
            WIND_COV_DATA::ID => Ok(Self::WIND_COV(WIND_COV_DATA::default())),
            PARAM_VALUE_DATA::ID => Ok(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
            LOCAL_POSITION_NED_COV_DATA::ID => Ok(Self::LOCAL_POSITION_NED_COV(
                LOCAL_POSITION_NED_COV_DATA::default(),
            )),
            NAV_CONTROLLER_OUTPUT_DATA::ID => Ok(Self::NAV_CONTROLLER_OUTPUT(
                NAV_CONTROLLER_OUTPUT_DATA::default(),
            )),
            HIL_CONTROLS_DATA::ID => Ok(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
            SET_GPS_GLOBAL_ORIGIN_DATA::ID => Ok(Self::SET_GPS_GLOBAL_ORIGIN(
                SET_GPS_GLOBAL_ORIGIN_DATA::default(),
            )),
            RC_CHANNELS_SCALED_DATA::ID => {
                Ok(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
            }
            LOG_REQUEST_DATA_DATA::ID => {
                Ok(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
            }
            GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Ok(Self::GIMBAL_DEVICE_SET_ATTITUDE(
                GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
            )),
            RAW_IMU_DATA::ID => Ok(Self::RAW_IMU(RAW_IMU_DATA::default())),
            STATUSTEXT_DATA::ID => Ok(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
            EFI_STATUS_DATA::ID => Ok(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
            LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
                Ok(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
                    LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
                ))
            }
            CAMERA_SETTINGS_DATA::ID => Ok(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default())),
            SCALED_IMU3_DATA::ID => Ok(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
            HIL_OPTICAL_FLOW_DATA::ID => {
                Ok(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
            }
            SCALED_IMU_DATA::ID => Ok(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
            MANUAL_SETPOINT_DATA::ID => Ok(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default())),
            DEBUG_FLOAT_ARRAY_DATA::ID => {
                Ok(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
            }
            ONBOARD_COMPUTER_STATUS_DATA::ID => Ok(Self::ONBOARD_COMPUTER_STATUS(
                ONBOARD_COMPUTER_STATUS_DATA::default(),
            )),
            ORBIT_EXECUTION_STATUS_DATA::ID => Ok(Self::ORBIT_EXECUTION_STATUS(
                ORBIT_EXECUTION_STATUS_DATA::default(),
            )),
            PARAM_EXT_VALUE_DATA::ID => Ok(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default())),
            SAFETY_ALLOWED_AREA_DATA::ID => Ok(Self::SAFETY_ALLOWED_AREA(
                SAFETY_ALLOWED_AREA_DATA::default(),
            )),
            RAW_PRESSURE_DATA::ID => Ok(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
            SCALED_PRESSURE3_DATA::ID => {
                Ok(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
            }
            OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Ok(Self::OPEN_DRONE_ID_ARM_STATUS(
                OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
            )),
            POSITION_TARGET_LOCAL_NED_DATA::ID => Ok(Self::POSITION_TARGET_LOCAL_NED(
                POSITION_TARGET_LOCAL_NED_DATA::default(),
            )),
            TERRAIN_DATA_DATA::ID => Ok(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
            TERRAIN_REQUEST_DATA::ID => Ok(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default())),
            ESTIMATOR_STATUS_DATA::ID => {
                Ok(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
            }
            LOCAL_POSITION_NED_DATA::ID => {
                Ok(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
            }
            GLOBAL_POSITION_INT_DATA::ID => Ok(Self::GLOBAL_POSITION_INT(
                GLOBAL_POSITION_INT_DATA::default(),
            )),
            EXTENDED_SYS_STATE_DATA::ID => {
                Ok(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
            }
            MESSAGE_INTERVAL_DATA::ID => {
                Ok(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
            }
            MISSION_REQUEST_LIST_DATA::ID => Ok(Self::MISSION_REQUEST_LIST(
                MISSION_REQUEST_LIST_DATA::default(),
            )),
            VFR_HUD_DATA::ID => Ok(Self::VFR_HUD(VFR_HUD_DATA::default())),
            CAN_FILTER_MODIFY_DATA::ID => {
                Ok(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
            }
            LOG_REQUEST_END_DATA::ID => Ok(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default())),
            LOG_ERASE_DATA::ID => Ok(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
            GLOBAL_POSITION_INT_COV_DATA::ID => Ok(Self::GLOBAL_POSITION_INT_COV(
                GLOBAL_POSITION_INT_COV_DATA::default(),
            )),
            DEBUG_VECT_DATA::ID => Ok(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
            LOG_REQUEST_LIST_DATA::ID => {
                Ok(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
            }
            VISION_POSITION_ESTIMATE_DATA::ID => Ok(Self::VISION_POSITION_ESTIMATE(
                VISION_POSITION_ESTIMATE_DATA::default(),
            )),
            PARAM_EXT_ACK_DATA::ID => Ok(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
            MISSION_ACK_DATA::ID => Ok(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
            PLAY_TUNE_V2_DATA::ID => Ok(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
            SCALED_IMU2_DATA::ID => Ok(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
            SCALED_PRESSURE_DATA::ID => Ok(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default())),
            COMMAND_ACK_DATA::ID => Ok(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
            MISSION_CURRENT_DATA::ID => Ok(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default())),
            GPS_STATUS_DATA::ID => Ok(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
            VIDEO_STREAM_INFORMATION_DATA::ID => Ok(Self::VIDEO_STREAM_INFORMATION(
                VIDEO_STREAM_INFORMATION_DATA::default(),
            )),
            UAVCAN_NODE_INFO_DATA::ID => {
                Ok(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
            }
            LINK_NODE_STATUS_DATA::ID => {
                Ok(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
            }
            EVENT_DATA::ID => Ok(Self::EVENT(EVENT_DATA::default())),
            AUTOPILOT_VERSION_DATA::ID => {
                Ok(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
            }
            SIM_STATE_DATA::ID => Ok(Self::SIM_STATE(SIM_STATE_DATA::default())),
            BUTTON_CHANGE_DATA::ID => Ok(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
            HIL_STATE_QUATERNION_DATA::ID => Ok(Self::HIL_STATE_QUATERNION(
                HIL_STATE_QUATERNION_DATA::default(),
            )),
            OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Ok(Self::OPEN_DRONE_ID_OPERATOR_ID(
                OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
            )),
            COMMAND_INT_DATA::ID => Ok(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
            CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => Ok(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
                CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
            )),
            ENCAPSULATED_DATA_DATA::ID => {
                Ok(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
            }
            MOUNT_ORIENTATION_DATA::ID => {
                Ok(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
            }
            GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Ok(Self::GIMBAL_MANAGER_SET_ATTITUDE(
                GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
            )),
            OPTICAL_FLOW_RAD_DATA::ID => {
                Ok(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
            }
            SETUP_SIGNING_DATA::ID => Ok(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
            BATTERY_STATUS_DATA::ID => Ok(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
            OPTICAL_FLOW_DATA::ID => Ok(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
            SET_MODE_DATA::ID => Ok(Self::SET_MODE(SET_MODE_DATA::default())),
            GPS_GLOBAL_ORIGIN_DATA::ID => {
                Ok(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
            }
            MISSION_CLEAR_ALL_DATA::ID => {
                Ok(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
            }
            FOLLOW_TARGET_DATA::ID => Ok(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
            COMPONENT_METADATA_DATA::ID => {
                Ok(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
            }
            GPS_INPUT_DATA::ID => Ok(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
            SET_ATTITUDE_TARGET_DATA::ID => Ok(Self::SET_ATTITUDE_TARGET(
                SET_ATTITUDE_TARGET_DATA::default(),
            )),
            SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Ok(Self::SET_POSITION_TARGET_GLOBAL_INT(
                SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
            )),
            COLLISION_DATA::ID => Ok(Self::COLLISION(COLLISION_DATA::default())),
            MISSION_SET_CURRENT_DATA::ID => Ok(Self::MISSION_SET_CURRENT(
                MISSION_SET_CURRENT_DATA::default(),
            )),
            MISSION_ITEM_DATA::ID => Ok(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
            PARAM_REQUEST_READ_DATA::ID => {
                Ok(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
            }
            DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Ok(Self::DATA_TRANSMISSION_HANDSHAKE(
                DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
            )),
            CAMERA_CAPTURE_STATUS_DATA::ID => Ok(Self::CAMERA_CAPTURE_STATUS(
                CAMERA_CAPTURE_STATUS_DATA::default(),
            )),
            REQUEST_EVENT_DATA::ID => Ok(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
            GPS2_RTK_DATA::ID => Ok(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
            SYSTEM_TIME_DATA::ID => Ok(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
            HIL_ACTUATOR_CONTROLS_DATA::ID => Ok(Self::HIL_ACTUATOR_CONTROLS(
                HIL_ACTUATOR_CONTROLS_DATA::default(),
            )),
            COMMAND_LONG_DATA::ID => Ok(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
            WINCH_STATUS_DATA::ID => Ok(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
            PARAM_EXT_REQUEST_READ_DATA::ID => Ok(Self::PARAM_EXT_REQUEST_READ(
                PARAM_EXT_REQUEST_READ_DATA::default(),
            )),
            AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
                Ok(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
                    AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
                ))
            }
            CUBEPILOT_RAW_RC_DATA::ID => {
                Ok(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
            }
            GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => Ok(Self::GLOBAL_VISION_POSITION_ESTIMATE(
                GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
            )),
            ATTITUDE_TARGET_DATA::ID => Ok(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default())),
            HIGHRES_IMU_DATA::ID => Ok(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
            LOGGING_DATA_ACKED_DATA::ID => {
                Ok(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
            }
            ESC_STATUS_DATA::ID => Ok(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
            HOME_POSITION_DATA::ID => Ok(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
            VIDEO_STREAM_STATUS_DATA::ID => Ok(Self::VIDEO_STREAM_STATUS(
                VIDEO_STREAM_STATUS_DATA::default(),
            )),
            GIMBAL_MANAGER_STATUS_DATA::ID => Ok(Self::GIMBAL_MANAGER_STATUS(
                GIMBAL_MANAGER_STATUS_DATA::default(),
            )),
            HIL_STATE_DATA::ID => Ok(Self::HIL_STATE(HIL_STATE_DATA::default())),
            MISSION_COUNT_DATA::ID => Ok(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
            CAN_FRAME_DATA::ID => Ok(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
            GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Ok(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
                GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
            )),
            MISSION_WRITE_PARTIAL_LIST_DATA::ID => Ok(Self::MISSION_WRITE_PARTIAL_LIST(
                MISSION_WRITE_PARTIAL_LIST_DATA::default(),
            )),
            TERRAIN_CHECK_DATA::ID => Ok(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
            MISSION_ITEM_INT_DATA::ID => {
                Ok(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
            }
            CHANGE_OPERATOR_CONTROL_DATA::ID => Ok(Self::CHANGE_OPERATOR_CONTROL(
                CHANGE_OPERATOR_CONTROL_DATA::default(),
            )),
            ATT_POS_MOCAP_DATA::ID => Ok(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
            MANUAL_CONTROL_DATA::ID => Ok(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
            UAVCAN_NODE_STATUS_DATA::ID => {
                Ok(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
            }
            WHEEL_DISTANCE_DATA::ID => Ok(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
            MISSION_REQUEST_INT_DATA::ID => Ok(Self::MISSION_REQUEST_INT(
                MISSION_REQUEST_INT_DATA::default(),
            )),
            OPEN_DRONE_ID_SELF_ID_DATA::ID => Ok(Self::OPEN_DRONE_ID_SELF_ID(
                OPEN_DRONE_ID_SELF_ID_DATA::default(),
            )),
            NAMED_VALUE_FLOAT_DATA::ID => {
                Ok(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
            }
            RC_CHANNELS_RAW_DATA::ID => Ok(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default())),
            HEARTBEAT_DATA::ID => Ok(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
            AIS_VESSEL_DATA::ID => Ok(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
            GIMBAL_MANAGER_INFORMATION_DATA::ID => Ok(Self::GIMBAL_MANAGER_INFORMATION(
                GIMBAL_MANAGER_INFORMATION_DATA::default(),
            )),
            CAMERA_INFORMATION_DATA::ID => {
                Ok(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
            }
            RESOURCE_REQUEST_DATA::ID => {
                Ok(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
            }
            SMART_BATTERY_INFO_DATA::ID => {
                Ok(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
            }
            MISSION_ITEM_REACHED_DATA::ID => Ok(Self::MISSION_ITEM_REACHED(
                MISSION_ITEM_REACHED_DATA::default(),
            )),
            DEBUG_DATA::ID => Ok(Self::DEBUG(DEBUG_DATA::default())),
            OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Ok(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
                OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
            )),
            DATA_STREAM_DATA::ID => Ok(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
            ADSB_VEHICLE_DATA::ID => Ok(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
            ACTUATOR_OUTPUT_STATUS_DATA::ID => Ok(Self::ACTUATOR_OUTPUT_STATUS(
                ACTUATOR_OUTPUT_STATUS_DATA::default(),
            )),
            PLAY_TUNE_DATA::ID => Ok(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
            HIL_GPS_DATA::ID => Ok(Self::HIL_GPS(HIL_GPS_DATA::default())),
            GENERATOR_STATUS_DATA::ID => {
                Ok(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
            }
            REQUEST_DATA_STREAM_DATA::ID => Ok(Self::REQUEST_DATA_STREAM(
                REQUEST_DATA_STREAM_DATA::default(),
            )),
            TIME_ESTIMATE_TO_TARGET_DATA::ID => Ok(Self::TIME_ESTIMATE_TO_TARGET(
                TIME_ESTIMATE_TO_TARGET_DATA::default(),
            )),
            OBSTACLE_DISTANCE_DATA::ID => {
                Ok(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
            }
            CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Ok(Self::CAMERA_TRACKING_IMAGE_STATUS(
                CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
            )),
            WIFI_CONFIG_AP_DATA::ID => Ok(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
            ACTUATOR_CONTROL_TARGET_DATA::ID => Ok(Self::ACTUATOR_CONTROL_TARGET(
                ACTUATOR_CONTROL_TARGET_DATA::default(),
            )),
            LOGGING_ACK_DATA::ID => Ok(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
            HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
                Ok(Self::HERELINK_VIDEO_STREAM_INFORMATION(
                    HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
                ))
            }
            GPS_INJECT_DATA_DATA::ID => Ok(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default())),
            TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
                Ok(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
                    TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
                ))
            }
            TERRAIN_REPORT_DATA::ID => Ok(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
            LOG_DATA_DATA::ID => Ok(Self::LOG_DATA(LOG_DATA_DATA::default())),
            MEMORY_VECT_DATA::ID => Ok(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
            OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Ok(Self::OPEN_DRONE_ID_AUTHENTICATION(
                OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
            )),
            CANFD_FRAME_DATA::ID => Ok(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
            OPEN_DRONE_ID_LOCATION_DATA::ID => Ok(Self::OPEN_DRONE_ID_LOCATION(
                OPEN_DRONE_ID_LOCATION_DATA::default(),
            )),
            GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
                Ok(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
                    GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
                ))
            }
            _ => Err("Invalid message id."),
        }
    }
    fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
        match self {
            Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
            Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
            Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
            Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
            Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
            Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
            Self::TIMESYNC(body) => body.ser(version, bytes),
            Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
            Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
            Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
            Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
            Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
            Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
            Self::RC_CHANNELS(body) => body.ser(version, bytes),
            Self::SYS_STATUS(body) => body.ser(version, bytes),
            Self::HIL_SENSOR(body) => body.ser(version, bytes),
            Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
            Self::AUTH_KEY(body) => body.ser(version, bytes),
            Self::LANDING_TARGET(body) => body.ser(version, bytes),
            Self::PARAM_SET(body) => body.ser(version, bytes),
            Self::ALTITUDE(body) => body.ser(version, bytes),
            Self::V2_EXTENSION(body) => body.ser(version, bytes),
            Self::ATTITUDE(body) => body.ser(version, bytes),
            Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
            Self::GPS_RTK(body) => body.ser(version, bytes),
            Self::HIGH_LATENCY(body) => body.ser(version, bytes),
            Self::FENCE_STATUS(body) => body.ser(version, bytes),
            Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
            Self::LOGGING_DATA(body) => body.ser(version, bytes),
            Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
            Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
            Self::TUNNEL(body) => body.ser(version, bytes),
            Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
            Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
            Self::HERELINK_TELEM(body) => body.ser(version, bytes),
            Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
            Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
            Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
            Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
            Self::LOG_ENTRY(body) => body.ser(version, bytes),
            Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
            Self::ESC_INFO(body) => body.ser(version, bytes),
            Self::GPS_RAW_INT(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
            Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
            Self::ODOMETRY(body) => body.ser(version, bytes),
            Self::PING(body) => body.ser(version, bytes),
            Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
            Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
            Self::VIBRATION(body) => body.ser(version, bytes),
            Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
            Self::RADIO_STATUS(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
            Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
            Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
            Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
            Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
            Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
            Self::MISSION_REQUEST(body) => body.ser(version, bytes),
            Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
            Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
            Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
            Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
            Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
            Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
            Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
            Self::POWER_STATUS(body) => body.ser(version, bytes),
            Self::RAW_RPM(body) => body.ser(version, bytes),
            Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
            Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
            Self::GPS2_RAW(body) => body.ser(version, bytes),
            Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
            Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
            Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
            Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
            Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
            Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
            Self::WIND_COV(body) => body.ser(version, bytes),
            Self::PARAM_VALUE(body) => body.ser(version, bytes),
            Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
            Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
            Self::HIL_CONTROLS(body) => body.ser(version, bytes),
            Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
            Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
            Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
            Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
            Self::RAW_IMU(body) => body.ser(version, bytes),
            Self::STATUSTEXT(body) => body.ser(version, bytes),
            Self::EFI_STATUS(body) => body.ser(version, bytes),
            Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
            Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
            Self::SCALED_IMU3(body) => body.ser(version, bytes),
            Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
            Self::SCALED_IMU(body) => body.ser(version, bytes),
            Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
            Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
            Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
            Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
            Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
            Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
            Self::RAW_PRESSURE(body) => body.ser(version, bytes),
            Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
            Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
            Self::TERRAIN_DATA(body) => body.ser(version, bytes),
            Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
            Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
            Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
            Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
            Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
            Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
            Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
            Self::VFR_HUD(body) => body.ser(version, bytes),
            Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
            Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
            Self::LOG_ERASE(body) => body.ser(version, bytes),
            Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
            Self::DEBUG_VECT(body) => body.ser(version, bytes),
            Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
            Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
            Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
            Self::MISSION_ACK(body) => body.ser(version, bytes),
            Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
            Self::SCALED_IMU2(body) => body.ser(version, bytes),
            Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
            Self::COMMAND_ACK(body) => body.ser(version, bytes),
            Self::MISSION_CURRENT(body) => body.ser(version, bytes),
            Self::GPS_STATUS(body) => body.ser(version, bytes),
            Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
            Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
            Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
            Self::EVENT(body) => body.ser(version, bytes),
            Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
            Self::SIM_STATE(body) => body.ser(version, bytes),
            Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
            Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
            Self::COMMAND_INT(body) => body.ser(version, bytes),
            Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
            Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
            Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
            Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
            Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
            Self::SETUP_SIGNING(body) => body.ser(version, bytes),
            Self::BATTERY_STATUS(body) => body.ser(version, bytes),
            Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
            Self::SET_MODE(body) => body.ser(version, bytes),
            Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
            Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
            Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
            Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
            Self::GPS_INPUT(body) => body.ser(version, bytes),
            Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
            Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
            Self::COLLISION(body) => body.ser(version, bytes),
            Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
            Self::MISSION_ITEM(body) => body.ser(version, bytes),
            Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
            Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
            Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
            Self::REQUEST_EVENT(body) => body.ser(version, bytes),
            Self::GPS2_RTK(body) => body.ser(version, bytes),
            Self::SYSTEM_TIME(body) => body.ser(version, bytes),
            Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
            Self::COMMAND_LONG(body) => body.ser(version, bytes),
            Self::WINCH_STATUS(body) => body.ser(version, bytes),
            Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
            Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
            Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
            Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
            Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
            Self::HIGHRES_IMU(body) => body.ser(version, bytes),
            Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
            Self::ESC_STATUS(body) => body.ser(version, bytes),
            Self::HOME_POSITION(body) => body.ser(version, bytes),
            Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
            Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
            Self::HIL_STATE(body) => body.ser(version, bytes),
            Self::MISSION_COUNT(body) => body.ser(version, bytes),
            Self::CAN_FRAME(body) => body.ser(version, bytes),
            Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
            Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
            Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
            Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
            Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
            Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
            Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
            Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
            Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
            Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
            Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
            Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
            Self::HEARTBEAT(body) => body.ser(version, bytes),
            Self::AIS_VESSEL(body) => body.ser(version, bytes),
            Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
            Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
            Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
            Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
            Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
            Self::DEBUG(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
            Self::DATA_STREAM(body) => body.ser(version, bytes),
            Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
            Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
            Self::PLAY_TUNE(body) => body.ser(version, bytes),
            Self::HIL_GPS(body) => body.ser(version, bytes),
            Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
            Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
            Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
            Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
            Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
            Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
            Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
            Self::LOGGING_ACK(body) => body.ser(version, bytes),
            Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
            Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
            Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
            Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
            Self::LOG_DATA(body) => body.ser(version, bytes),
            Self::MEMORY_VECT(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
            Self::CANFD_FRAME(body) => body.ser(version, bytes),
            Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
            Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
        }
    }
    fn extra_crc(id: u32) -> u8 {
        match id {
            CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
            PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
            HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
            SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
            CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
            FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
            TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
            SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
            VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
            FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
            CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
            MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
            CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
            RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
            SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
            HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
            MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
            AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
            LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
            PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
            ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
            V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
            ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
            CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
            GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
            HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
            FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
            PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
            LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
            CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
            SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
            TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
            RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
            COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
            HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
            SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
            HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
            ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
            STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
            LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
            VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
            ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
            GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
            DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
            ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
            PING_DATA::ID => PING_DATA::EXTRA_CRC,
            PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
            CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
            VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
            GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
            RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
            UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
            POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
            CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
                CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
            }
            ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
            PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
            MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
            SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
            HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
            SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
            CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
            SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
            NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
            GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
            POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
            RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
            TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
                TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
            }
            COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
            GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
            PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
            RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
            SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
            ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
            GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
            CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
            WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
            PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
            LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
            NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
            HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
            SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
            RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
            LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
            GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
            RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
            STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
            EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
            LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
                LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
            }
            CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
            SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
            HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
            SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
            MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
            DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
            ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
            ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
            PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
            SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
            RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
            SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
            POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
            TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
            TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
            ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
            LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
            GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
            EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
            MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
            MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
            VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
            CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
            LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
            LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
            GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
            DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
            LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
            VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
            PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
            MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
            PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
            SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
            SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
            COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
            MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
            GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
            VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
            UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
            LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
            EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
            AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
            SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
            BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
            HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
            COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
            CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
                CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
            }
            ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
            MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
            GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
            OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
            SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
            BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
            OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
            SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
            GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
            MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
            FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
            COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
            GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
            SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
            SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
                SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
            }
            COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
            MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
            MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
            PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
            DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
            CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
            REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
            GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
            SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
            HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
            COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
            WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
            PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
            AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
                AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
            }
            CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
            GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
                GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
            }
            ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
            HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
            LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
            ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
            HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
            VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
            GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
            HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
            MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
            CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
            GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
            MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
            TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
            MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
            CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
            ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
            MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
            UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
            WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
            MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
            NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
            RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
            HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
            AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
            GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
            CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
            RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
            SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
            MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
            DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
            DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
            ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
            ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
            PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
            HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
            GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
            REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
            TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
            OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
            CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
            WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
            ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
            LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
            HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
                HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
            }
            GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
            TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
                TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
            }
            TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
            LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
            MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
            CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
            OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
            GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
                GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
            }
            _ => 0,
        }
    }
}