rustyfit 0.10.0

The #![no_std] Rust implementation of The Flexible and Interoperable Data Transfer (FIT) Protocol for decoding and encoding Garmin FIT files, supporting FIT Protocol V2.
Documentation
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
// Code generated by fitgen/main.go. DO NOT EDIT.

// Copyright 2025 The RustyFIT Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

use crate::profile::ProfileType;
use crate::profile::typedef::{FitBaseType, MesgNum};

pub(crate) const MAX_COMPONENT_BITS: usize = 240;

/// Messages eligible for accumulation:
/// - `record`: distance
/// - `record`: cycles
/// - `record`: total_cycles
/// - `record`: compressed_accumulated_power
/// - `record`: accumulated_power
/// - `hr`: event_timestamp
/// - `hr`: event_timestamp_12
pub(crate) const TOTAL_ACCUMULATE: usize = 7;

/// FieldReference acts as a representation of a field as defined in the Global FIT Profile.
#[derive(Debug, Clone, Copy)]
pub struct FieldReference<'a> {
    /// Defined in the Global FIT profile for the specified FIT message, otherwise
    /// its a manufaturer specific name (defined by manufacturer).
    pub name: Name,
    /// The base of the Value's type. Value of `u32` and `Vec<u32>` have the same base type `FitBaseType::Uint32`.
    pub base_type: FitBaseType,
    /// Serves as an abstraction layer above base type, e.g. DateTime is a time representation in uint32.
    pub profile_type: ProfileType,
    /// Flag whether the value of this field is an array
    pub array: bool,
    /// Flag to indicate if the value of the field is accumulable.
    pub accumulate: bool,
    /// A scale or offset specified in the FIT profile for binary fields (sint/uint etc.) only.
    /// The binary quantity is divided by the scale factor and then the offset is subtracted. (default: 1)
    pub scale: f64,
    /// A scale or offset specified in the FIT profile for binary fields (sint/uint etc.) only.
    /// The binary quantity is divided by the scale factor and then the offset is subtracted. (default: 0)
    pub offset: f64,
    /// Units of the value, such as m (meter), m/s (meter per second), s (second), etc.
    pub units: Unit,
    /// List of component
    pub components: &'a [Component],
    /// List of sub-field
    pub sub_fields: &'a [SubField<'a>],
}

/// Component is a way of compressing one or more fields into a bit field expressed in a single containing field.
/// The component can be expanded as a main Field in a Message or to update the value of the destination main Field.
#[derive(Debug)]
pub struct Component {
    /// Refer to Field's Number.
    pub field_num: u8,
    /// A flag whether this component should be accumulated.
    pub accumulate: bool,
    /// The size of data of this component in bits  
    pub bits: u8,
    /// Similar to FieldReference's scale, but for this component.
    pub scale: f64,
    /// Similar to FieldReference's offset, but for this component.
    pub offset: f64,
}

/// SubField is a dynamic interpretation of the main Field in a Message when the SubFieldMap mapping match. See SubFieldMap's docs.
#[derive(Debug)]
pub struct SubField<'a> {
    /// Name
    pub name: Name,
    /// The base of the Value's type. Value of `u32` and `Vec<u32>` have the same base type `FitBaseType::Uint32`.
    pub base_type: FitBaseType,
    /// Serves as an abstraction layer above base type, e.g. DateTime is a time representation in uint32.
    pub profile_type: ProfileType,
    /// Scale
    pub scale: f64,
    /// Offset
    pub offset: f64,
    /// Units
    pub units: Unit,
    /// List of SubFieldMap
    pub maps: &'a [SubFieldMap],
    /// List of Component
    pub components: &'a [Component],
}

/// SubFieldMap is the mapping between SubField and the corresponding main Field in a Message.
/// When any Field in a Message has Field.Num == RefFieldNum and Field.Value == RefFieldValue, then the SubField containing
/// this mapping can be interpreted as the main Field's properties (name, scale, type etc.)
#[derive(Debug)]
pub struct SubFieldMap {
    /// Mapping reference to targeted Field's Number.
    pub ref_field_num: u8,
    /// Mapping reference to targeted Field's Value.
    pub ref_field_value: i64,
}

// Skip default formatting, fitgen formats the code for fewer LoC while keeping it readable.
// In general, the rule is one line per struct. If it contains slices, one line per slice's item.

#[rustfmt::skip]
const FR_DEF: FieldReference = FieldReference { name: Name::Empty, base_type: FitBaseType(u8::MAX), profile_type: ProfileType::Invalid, array: false, accumulate: false, scale: 1.0, offset: 0.0, units: Unit::Empty, components: &[], sub_fields: &[] };
#[rustfmt::skip]
const SF_DEF: SubField = SubField { name: Name::Empty, base_type: FitBaseType(u8::MAX), profile_type: ProfileType::Invalid, scale: 1.0, offset: 0.0, units: Unit::Empty, components: &[], maps: &[] };

/// Find FieldReference defined in the Global Profile (Profile.xlsx).
#[rustfmt::skip]
pub const fn field_reference<'a>(mesg_num: MesgNum, field_num: u8) -> Option<FieldReference<'a>> {
    match mesg_num {
        MesgNum::FILE_ID => { match field_num {
            0 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::File, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Product, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::FaveroProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::FaveroProduct, maps: &[
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 263 /* favero_electronics */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GarminProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::GarminProduct, maps: &[
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 1 /* garmin */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 15 /* dynastream */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 13 /* dynastream_oem */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 89 /* tacx */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::SerialNumber, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::Uint32z, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimeCreated, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Number, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::ProductName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::FILE_CREATOR => { match field_num {
            0 => Some(FieldReference { name: Name::SoftwareVersion, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HardwareVersion, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TIMESTAMP_CORRELATION => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::FractionalTimestamp, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 32768.0, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SystemTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::FractionalSystemTimestamp, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 32768.0, units: Unit::Second, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::LocalTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, units: Unit::Second, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::SystemTimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SOFTWARE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Version, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::PartNumber, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SLAVE_DEVICE => { match field_num {
            0 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Product, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::FaveroProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::FaveroProduct, maps: &[
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 263 /* favero_electronics */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GarminProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::GarminProduct, maps: &[
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 1 /* garmin */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 15 /* dynastream */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 13 /* dynastream_oem */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 89 /* tacx */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CAPABILITIES => { match field_num {
            0 => Some(FieldReference { name: Name::Languages, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, array: true /* [N] */, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Sports, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::SportBits0, array: true /* [N] */, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::WorkoutsSupported, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::WorkoutCapabilities, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::ConnectivitySupported, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::ConnectivityCapabilities, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::FILE_CAPABILITIES => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::File, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Flags, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::FileFlags, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Directory, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::MaxCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::MaxSize, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Bytes, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MESG_CAPABILITIES => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::File, base_type: FitBaseType::ENUM, profile_type: ProfileType::File, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MesgNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::CountType, base_type: FitBaseType::ENUM, profile_type: ProfileType::MesgCount, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Count, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::NumPerFile, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, maps: &[
                        SubFieldMap { ref_field_num: 2 /* count_type */, ref_field_value: 0 /* num_per_file */ },
                    ], ..SF_DEF },
                    SubField { name: Name::MaxPerFile, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, maps: &[
                        SubFieldMap { ref_field_num: 2 /* count_type */, ref_field_value: 1 /* max_per_file */ },
                    ], ..SF_DEF },
                    SubField { name: Name::MaxPerFileType, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, maps: &[
                        SubFieldMap { ref_field_num: 2 /* count_type */, ref_field_value: 2 /* max_per_file_type */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::FIELD_CAPABILITIES => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::File, base_type: FitBaseType::ENUM, profile_type: ProfileType::File, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MesgNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::FieldNum, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Count, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DEVICE_SETTINGS => { match field_num {
            0 => Some(FieldReference { name: Name::ActiveTimeZone, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::UtcOffset, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::TimeOffset, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, units: Unit::Second, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimeMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::TimeMode, array: true /* [N] */, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::TimeZoneOffset, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, array: true /* [N] */, scale: 4.0, units: Unit::Hour, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::BacklightMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::BacklightMode, ..FR_DEF }),
            36 => Some(FieldReference { name: Name::ActivityTrackerEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::ClockTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            40 => Some(FieldReference { name: Name::PagesEnabled, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, ..FR_DEF }),
            46 => Some(FieldReference { name: Name::MoveAlertEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::DateMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::DateMode, ..FR_DEF }),
            55 => Some(FieldReference { name: Name::DisplayOrientation, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayOrientation, ..FR_DEF }),
            56 => Some(FieldReference { name: Name::MountingSide, base_type: FitBaseType::ENUM, profile_type: ProfileType::Side, ..FR_DEF }),
            57 => Some(FieldReference { name: Name::DefaultPage, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, ..FR_DEF }),
            58 => Some(FieldReference { name: Name::AutosyncMinSteps, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Step, ..FR_DEF }),
            59 => Some(FieldReference { name: Name::AutosyncMinTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Minute, ..FR_DEF }),
            80 => Some(FieldReference { name: Name::LactateThresholdAutodetectEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            86 => Some(FieldReference { name: Name::BleAutoUploadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            89 => Some(FieldReference { name: Name::AutoSyncFrequency, base_type: FitBaseType::ENUM, profile_type: ProfileType::AutoSyncFrequency, ..FR_DEF }),
            90 => Some(FieldReference { name: Name::AutoActivityDetect, base_type: FitBaseType::UINT32, profile_type: ProfileType::AutoActivityDetect, ..FR_DEF }),
            94 => Some(FieldReference { name: Name::NumberOfScreens, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            95 => Some(FieldReference { name: Name::SmartNotificationDisplayOrientation, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayOrientation, ..FR_DEF }),
            134 => Some(FieldReference { name: Name::TapInterface, base_type: FitBaseType::ENUM, profile_type: ProfileType::Switch, ..FR_DEF }),
            174 => Some(FieldReference { name: Name::TapSensitivity, base_type: FitBaseType::ENUM, profile_type: ProfileType::TapSensitivity, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::USER_PROFILE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::FriendlyName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Gender, base_type: FitBaseType::ENUM, profile_type: ProfileType::Gender, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Age, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Year, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Height, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Weight, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Kilogram, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Language, base_type: FitBaseType::ENUM, profile_type: ProfileType::Language, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::ElevSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::WeightSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::RestingHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::DefaultMaxRunningHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::DefaultMaxBikingHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::DefaultMaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::HrSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayHeart, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::SpeedSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::DistSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::PowerSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayPower, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::ActivityClass, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityClass, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::PositionSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayPosition, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::TemperatureSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::LocalId, base_type: FitBaseType::UINT16, profile_type: ProfileType::UserLocalId, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::GlobalId, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [6] */, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::WakeTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocaltimeIntoDay, ..FR_DEF }),
            29 => Some(FieldReference { name: Name::SleepTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocaltimeIntoDay, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::HeightSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            31 => Some(FieldReference { name: Name::UserRunningStepLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::UserWalkingStepLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::DepthSetting, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            49 => Some(FieldReference { name: Name::DiveCount, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HRM_PROFILE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HrmAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::LogHrv, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::HrmAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SDM_PROFILE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SdmAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::SdmCalFactor, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Odometer, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::SpeedSource, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::SdmAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::OdometerRollover, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::BIKE_PROFILE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Odometer, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::BikeSpdAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::BikeCadAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::BikeSpdcadAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::BikePowerAntId, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CustomWheelsize, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::AutoWheelsize, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::BikeWeight, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Kilogram, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::PowerCalFactor, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::AutoWheelCal, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::AutoPowerZero, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::Id, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::SpdEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::CadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::SpdcadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::PowerEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::CrankLength, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, offset: -110.0,units: Unit::Millimeter, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::BikeSpdAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::BikeCadAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::BikeSpdcadAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::BikePowerAntIdTransType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            37 => Some(FieldReference { name: Name::OdometerRollover, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            38 => Some(FieldReference { name: Name::FrontGearNum, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::FrontGear, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, array: true /* [N] */, ..FR_DEF }),
            40 => Some(FieldReference { name: Name::RearGearNum, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            41 => Some(FieldReference { name: Name::RearGear, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, array: true /* [N] */, ..FR_DEF }),
            44 => Some(FieldReference { name: Name::ShimanoDi2Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CONNECTIVITY => { match field_num {
            0 => Some(FieldReference { name: Name::BluetoothEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::BluetoothLeEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AntEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::LiveTrackingEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::WeatherConditionsEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::WeatherAlertsEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::AutoActivityUploadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CourseDownloadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::WorkoutDownloadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::GpsEphemerisDownloadEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::IncidentDetectionEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::GrouptrackEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WATCHFACE_SETTINGS => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Mode, base_type: FitBaseType::ENUM, profile_type: ProfileType::WatchfaceMode, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Layout, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, sub_fields: &[
                    SubField { name: Name::DigitalLayout, base_type: FitBaseType::BYTE, profile_type: ProfileType::DigitalWatchfaceLayout, maps: &[
                        SubFieldMap { ref_field_num: 0 /* mode */, ref_field_value: 0 /* digital */ },
                    ], ..SF_DEF },
                    SubField { name: Name::AnalogLayout, base_type: FitBaseType::BYTE, profile_type: ProfileType::AnalogWatchfaceLayout, maps: &[
                        SubFieldMap { ref_field_num: 0 /* mode */, ref_field_value: 1 /* analog */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::OHR_SETTINGS => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Switch, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TIME_IN_ZONE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ReferenceMesg, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ReferenceIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::TimeInHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TimeInSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimeInCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::TimeInPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::HrZoneHighBoundary, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::BeatsPerMinute, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::SpeedZoneHighBoundary, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CadenceZoneHighBoundary, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::PowerZoneHighBoundary, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::HrCalcType, base_type: FitBaseType::ENUM, profile_type: ProfileType::HrZoneCalc, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::RestingHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::ThresholdHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::PwrCalcType, base_type: FitBaseType::ENUM, profile_type: ProfileType::PwrZoneCalc, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::FunctionalThresholdPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ZONES_TARGET => { match field_num {
            1 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ThresholdHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::FunctionalThresholdPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::HrCalcType, base_type: FitBaseType::ENUM, profile_type: ProfileType::HrZoneCalc, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::PwrCalcType, base_type: FitBaseType::ENUM, profile_type: ProfileType::PwrZoneCalc, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SPORT => { match field_num {
            0 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HR_ZONE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HighBpm, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SPEED_ZONE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::HighValue, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CADENCE_ZONE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::HighValue, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::POWER_ZONE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HighValue, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MET_ZONE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HighBpm, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Calories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::KilocaloriesPerMinute, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::FatCalories, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, units: Unit::KilocaloriesPerMinute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TRAINING_SETTINGS => { match field_num {
            31 => Some(FieldReference { name: Name::TargetDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::TargetSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::TargetTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            153 => Some(FieldReference { name: Name::PreciseTargetSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DIVE_SETTINGS => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Model, base_type: FitBaseType::ENUM, profile_type: ProfileType::TissueModelType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::GfLow, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::GfHigh, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::WaterType, base_type: FitBaseType::ENUM, profile_type: ProfileType::WaterType, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::WaterDensity, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KilogramsPerCubicMeter, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Po2Warn, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Po2Critical, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Po2Deco, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::SafetyStopEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::BottomDepth, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::BottomTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::ApneaCountdownEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::ApneaCountdownTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::BacklightMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::DiveBacklightMode, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::BacklightBrightness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::BacklightTimeout, base_type: FitBaseType::UINT8, profile_type: ProfileType::BacklightTimeout, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::RepeatDiveInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::SafetyStopTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::HeartRateSourceType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SourceType, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::HeartRateSource, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, sub_fields: &[
                    SubField { name: Name::HeartRateAntplusDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::AntplusDeviceType, maps: &[
                        SubFieldMap { ref_field_num: 19 /* heart_rate_source_type */, ref_field_value: 1 /* antplus */ },
                    ], ..SF_DEF },
                    SubField { name: Name::HeartRateLocalDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::LocalDeviceType, maps: &[
                        SubFieldMap { ref_field_num: 19 /* heart_rate_source_type */, ref_field_value: 5 /* local */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            21 => Some(FieldReference { name: Name::TravelGas, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::CcrLowSetpointSwitchMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::CcrSetpointSwitchMode, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::CcrLowSetpoint, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::CcrLowSetpointDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::CcrHighSetpointSwitchMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::CcrSetpointSwitchMode, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::CcrHighSetpoint, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::CcrHighSetpointDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            29 => Some(FieldReference { name: Name::GasConsumptionDisplay, base_type: FitBaseType::ENUM, profile_type: ProfileType::GasConsumptionRateType, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::UpKeyEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            35 => Some(FieldReference { name: Name::DiveSounds, base_type: FitBaseType::ENUM, profile_type: ProfileType::Tone, ..FR_DEF }),
            36 => Some(FieldReference { name: Name::LastStopMultiple, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, ..FR_DEF }),
            37 => Some(FieldReference { name: Name::NoFlyTimeMode, base_type: FitBaseType::ENUM, profile_type: ProfileType::NoFlyTimeMode, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DIVE_ALARM => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Depth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Second, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::AlarmType, base_type: FitBaseType::ENUM, profile_type: ProfileType::DiveAlarmType, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Sound, base_type: FitBaseType::ENUM, profile_type: ProfileType::Tone, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::DiveTypes, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, array: true /* [N] */, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Id, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::PopupEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TriggerOnDescent, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TriggerOnAscent, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Repeating, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::Speed, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DIVE_APNEA_ALARM => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Depth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Second, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::AlarmType, base_type: FitBaseType::ENUM, profile_type: ProfileType::DiveAlarmType, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Sound, base_type: FitBaseType::ENUM, profile_type: ProfileType::Tone, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::DiveTypes, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, array: true /* [N] */, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Id, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::PopupEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TriggerOnDescent, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TriggerOnAscent, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Repeating, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::Speed, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DIVE_GAS => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::HeliumContent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::OxygenContent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Status, base_type: FitBaseType::ENUM, profile_type: ProfileType::DiveGasStatus, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Mode, base_type: FitBaseType::ENUM, profile_type: ProfileType::DiveGasMode, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::GOAL => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartDate, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::EndDate, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::Goal, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Value, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Repeat, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::TargetValue, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Recurrence, base_type: FitBaseType::ENUM, profile_type: ProfileType::GoalRecurrence, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::RecurrenceValue, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::Source, base_type: FitBaseType::ENUM, profile_type: ProfileType::GoalSource, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ACTIVITY => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::NumSessions, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::Activity, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::LocalTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SESSION => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::StartPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::StartPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::TotalElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TotalDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::TotalCycles, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Cycle, sub_fields: &[
                    SubField { name: Name::TotalStrides, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Stride, maps: &[
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 1 /* running */ },
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 11 /* walking */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TotalStrokes, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Stroke, maps: &[
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 2 /* cycling */ },
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 5 /* swimming */ },
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 15 /* rowing */ },
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 37 /* stand_up_paddleboarding */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            11 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::TotalFatCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 124 /* enhanced_avg_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            15 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 125 /* enhanced_max_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            16 => Some(FieldReference { name: Name::AvgHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::AvgCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, sub_fields: &[
                    SubField { name: Name::AvgRunningCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::StridesPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 1 /* running */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            19 => Some(FieldReference { name: Name::MaxCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, sub_fields: &[
                    SubField { name: Name::MaxRunningCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::StridesPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 5 /* sport */, ref_field_value: 1 /* running */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            20 => Some(FieldReference { name: Name::AvgPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::MaxPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::TotalAscent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::TotalDescent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::TotalTrainingEffect, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::FirstLapIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::NumLaps, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::Trigger, base_type: FitBaseType::ENUM, profile_type: ProfileType::SessionTrigger, ..FR_DEF }),
            29 => Some(FieldReference { name: Name::NecLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::NecLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            31 => Some(FieldReference { name: Name::SwcLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::SwcLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::NumLengths, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Length, ..FR_DEF }),
            34 => Some(FieldReference { name: Name::NormalizedPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            35 => Some(FieldReference { name: Name::TrainingStressScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::TrainingStressScore, ..FR_DEF }),
            36 => Some(FieldReference { name: Name::IntensityFactor, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::IntensityFactor, ..FR_DEF }),
            37 => Some(FieldReference { name: Name::LeftRightBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::LeftRightBalance100, ..FR_DEF }),
            38 => Some(FieldReference { name: Name::EndPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::EndPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            41 => Some(FieldReference { name: Name::AvgStrokeCount, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 10.0, units: Unit::StrokePerLap, ..FR_DEF }),
            42 => Some(FieldReference { name: Name::AvgStrokeDistance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            43 => Some(FieldReference { name: Name::SwimStroke, base_type: FitBaseType::ENUM, profile_type: ProfileType::SwimStroke, units: Unit::SwimStroke, ..FR_DEF }),
            44 => Some(FieldReference { name: Name::PoolLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            45 => Some(FieldReference { name: Name::ThresholdPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            46 => Some(FieldReference { name: Name::PoolLengthUnit, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::NumActiveLengths, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Length, ..FR_DEF }),
            48 => Some(FieldReference { name: Name::TotalWork, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Joule, ..FR_DEF }),
            49 => Some(FieldReference { name: Name::AvgAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 126 /* enhanced_avg_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            50 => Some(FieldReference { name: Name::MaxAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 128 /* enhanced_max_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            51 => Some(FieldReference { name: Name::GpsAccuracy, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Meter, ..FR_DEF }),
            52 => Some(FieldReference { name: Name::AvgGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            53 => Some(FieldReference { name: Name::AvgPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            54 => Some(FieldReference { name: Name::AvgNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            55 => Some(FieldReference { name: Name::MaxPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            56 => Some(FieldReference { name: Name::MaxNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            57 => Some(FieldReference { name: Name::AvgTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            58 => Some(FieldReference { name: Name::MaxTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            59 => Some(FieldReference { name: Name::TotalMovingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            60 => Some(FieldReference { name: Name::AvgPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            61 => Some(FieldReference { name: Name::AvgNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            62 => Some(FieldReference { name: Name::MaxPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            63 => Some(FieldReference { name: Name::MaxNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            64 => Some(FieldReference { name: Name::MinHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            65 => Some(FieldReference { name: Name::TimeInHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            66 => Some(FieldReference { name: Name::TimeInSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            67 => Some(FieldReference { name: Name::TimeInCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            68 => Some(FieldReference { name: Name::TimeInPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            69 => Some(FieldReference { name: Name::AvgLapTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            70 => Some(FieldReference { name: Name::BestLapIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            71 => Some(FieldReference { name: Name::MinAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 127 /* enhanced_min_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            78 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            82 => Some(FieldReference { name: Name::PlayerScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            83 => Some(FieldReference { name: Name::OpponentScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            84 => Some(FieldReference { name: Name::OpponentName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            85 => Some(FieldReference { name: Name::StrokeCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            86 => Some(FieldReference { name: Name::ZoneCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            87 => Some(FieldReference { name: Name::MaxBallSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            88 => Some(FieldReference { name: Name::AvgBallSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            89 => Some(FieldReference { name: Name::AvgVerticalOscillation, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            90 => Some(FieldReference { name: Name::AvgStanceTimePercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            91 => Some(FieldReference { name: Name::AvgStanceTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millisecond, ..FR_DEF }),
            92 => Some(FieldReference { name: Name::AvgFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            93 => Some(FieldReference { name: Name::MaxFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            94 => Some(FieldReference { name: Name::TotalFractionalCycles, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::Cycle, ..FR_DEF }),
            95 => Some(FieldReference { name: Name::AvgTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            96 => Some(FieldReference { name: Name::MinTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            97 => Some(FieldReference { name: Name::MaxTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            98 => Some(FieldReference { name: Name::AvgSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            99 => Some(FieldReference { name: Name::MinSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            100 => Some(FieldReference { name: Name::MaxSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            101 => Some(FieldReference { name: Name::AvgLeftTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            102 => Some(FieldReference { name: Name::AvgRightTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            103 => Some(FieldReference { name: Name::AvgLeftPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            104 => Some(FieldReference { name: Name::AvgRightPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            105 => Some(FieldReference { name: Name::AvgCombinedPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            110 => Some(FieldReference { name: Name::SportProfileName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            111 => Some(FieldReference { name: Name::SportIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            112 => Some(FieldReference { name: Name::TimeStanding, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            113 => Some(FieldReference { name: Name::StandCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            114 => Some(FieldReference { name: Name::AvgLeftPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            115 => Some(FieldReference { name: Name::AvgRightPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            116 => Some(FieldReference { name: Name::AvgLeftPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            117 => Some(FieldReference { name: Name::AvgLeftPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            118 => Some(FieldReference { name: Name::AvgRightPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            119 => Some(FieldReference { name: Name::AvgRightPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            120 => Some(FieldReference { name: Name::AvgPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            121 => Some(FieldReference { name: Name::MaxPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            122 => Some(FieldReference { name: Name::AvgCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            123 => Some(FieldReference { name: Name::MaxCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            124 => Some(FieldReference { name: Name::EnhancedAvgSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            125 => Some(FieldReference { name: Name::EnhancedMaxSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            126 => Some(FieldReference { name: Name::EnhancedAvgAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            127 => Some(FieldReference { name: Name::EnhancedMinAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            128 => Some(FieldReference { name: Name::EnhancedMaxAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            129 => Some(FieldReference { name: Name::AvgLevMotorPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            130 => Some(FieldReference { name: Name::MaxLevMotorPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            131 => Some(FieldReference { name: Name::LevBatteryConsumption, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            132 => Some(FieldReference { name: Name::AvgVerticalRatio, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            133 => Some(FieldReference { name: Name::AvgStanceTimeBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            134 => Some(FieldReference { name: Name::AvgStepLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            137 => Some(FieldReference { name: Name::TotalAnaerobicTrainingEffect, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, ..FR_DEF }),
            139 => Some(FieldReference { name: Name::AvgVam, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            140 => Some(FieldReference { name: Name::AvgDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            141 => Some(FieldReference { name: Name::MaxDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            142 => Some(FieldReference { name: Name::SurfaceInterval, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            143 => Some(FieldReference { name: Name::StartCns, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            144 => Some(FieldReference { name: Name::EndCns, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            145 => Some(FieldReference { name: Name::StartN2, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Percent, ..FR_DEF }),
            146 => Some(FieldReference { name: Name::EndN2, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Percent, ..FR_DEF }),
            147 => Some(FieldReference { name: Name::AvgRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 169 /* enhanced_avg_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            148 => Some(FieldReference { name: Name::MaxRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 170 /* enhanced_max_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            149 => Some(FieldReference { name: Name::MinRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 180 /* enhanced_min_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            150 => Some(FieldReference { name: Name::MinTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            155 => Some(FieldReference { name: Name::O2Toxicity, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::OxygenToxicityUnit, ..FR_DEF }),
            156 => Some(FieldReference { name: Name::DiveNumber, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            168 => Some(FieldReference { name: Name::TrainingLoadPeak, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 65536.0, ..FR_DEF }),
            169 => Some(FieldReference { name: Name::EnhancedAvgRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            170 => Some(FieldReference { name: Name::EnhancedMaxRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            180 => Some(FieldReference { name: Name::EnhancedMinRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, ..FR_DEF }),
            181 => Some(FieldReference { name: Name::TotalGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            182 => Some(FieldReference { name: Name::TotalFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            183 => Some(FieldReference { name: Name::JumpCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            186 => Some(FieldReference { name: Name::AvgGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            187 => Some(FieldReference { name: Name::AvgFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            192 => Some(FieldReference { name: Name::WorkoutFeel, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            193 => Some(FieldReference { name: Name::WorkoutRpe, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            194 => Some(FieldReference { name: Name::AvgSpo2, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            195 => Some(FieldReference { name: Name::AvgStress, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            196 => Some(FieldReference { name: Name::MetabolicCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            197 => Some(FieldReference { name: Name::SdrrHrv, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Millisecond, ..FR_DEF }),
            198 => Some(FieldReference { name: Name::RmssdHrv, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Millisecond, ..FR_DEF }),
            199 => Some(FieldReference { name: Name::TotalFractionalAscent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            200 => Some(FieldReference { name: Name::TotalFractionalDescent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            208 => Some(FieldReference { name: Name::AvgCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            209 => Some(FieldReference { name: Name::MinCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            210 => Some(FieldReference { name: Name::MaxCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::LAP => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::StartPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::StartPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::EndPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::EndPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::TotalElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TotalDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::TotalCycles, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Cycle, sub_fields: &[
                    SubField { name: Name::TotalStrides, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Stride, maps: &[
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 1 /* running */ },
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 11 /* walking */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TotalStrokes, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Stroke, maps: &[
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 2 /* cycling */ },
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 5 /* swimming */ },
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 15 /* rowing */ },
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 37 /* stand_up_paddleboarding */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            11 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::TotalFatCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 110 /* enhanced_avg_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            14 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 111 /* enhanced_max_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            15 => Some(FieldReference { name: Name::AvgHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::AvgCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, sub_fields: &[
                    SubField { name: Name::AvgRunningCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::StridesPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 1 /* running */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            18 => Some(FieldReference { name: Name::MaxCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, sub_fields: &[
                    SubField { name: Name::MaxRunningCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::StridesPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 25 /* sport */, ref_field_value: 1 /* running */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            19 => Some(FieldReference { name: Name::AvgPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::MaxPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::TotalAscent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::TotalDescent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::Intensity, base_type: FitBaseType::ENUM, profile_type: ProfileType::Intensity, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::LapTrigger, base_type: FitBaseType::ENUM, profile_type: ProfileType::LapTrigger, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::NumLengths, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Length, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::NormalizedPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            34 => Some(FieldReference { name: Name::LeftRightBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::LeftRightBalance100, ..FR_DEF }),
            35 => Some(FieldReference { name: Name::FirstLengthIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            37 => Some(FieldReference { name: Name::AvgStrokeDistance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            38 => Some(FieldReference { name: Name::SwimStroke, base_type: FitBaseType::ENUM, profile_type: ProfileType::SwimStroke, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            40 => Some(FieldReference { name: Name::NumActiveLengths, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Length, ..FR_DEF }),
            41 => Some(FieldReference { name: Name::TotalWork, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Joule, ..FR_DEF }),
            42 => Some(FieldReference { name: Name::AvgAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 112 /* enhanced_avg_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            43 => Some(FieldReference { name: Name::MaxAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 114 /* enhanced_max_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            44 => Some(FieldReference { name: Name::GpsAccuracy, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Meter, ..FR_DEF }),
            45 => Some(FieldReference { name: Name::AvgGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            46 => Some(FieldReference { name: Name::AvgPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::AvgNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            48 => Some(FieldReference { name: Name::MaxPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            49 => Some(FieldReference { name: Name::MaxNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            50 => Some(FieldReference { name: Name::AvgTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            51 => Some(FieldReference { name: Name::MaxTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            52 => Some(FieldReference { name: Name::TotalMovingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            53 => Some(FieldReference { name: Name::AvgPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            54 => Some(FieldReference { name: Name::AvgNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            55 => Some(FieldReference { name: Name::MaxPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            56 => Some(FieldReference { name: Name::MaxNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            57 => Some(FieldReference { name: Name::TimeInHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            58 => Some(FieldReference { name: Name::TimeInSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            59 => Some(FieldReference { name: Name::TimeInCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            60 => Some(FieldReference { name: Name::TimeInPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            61 => Some(FieldReference { name: Name::RepetitionNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            62 => Some(FieldReference { name: Name::MinAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 113 /* enhanced_min_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            63 => Some(FieldReference { name: Name::MinHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            70 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            71 => Some(FieldReference { name: Name::WktStepIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            74 => Some(FieldReference { name: Name::OpponentScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            75 => Some(FieldReference { name: Name::StrokeCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            76 => Some(FieldReference { name: Name::ZoneCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            77 => Some(FieldReference { name: Name::AvgVerticalOscillation, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            78 => Some(FieldReference { name: Name::AvgStanceTimePercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            79 => Some(FieldReference { name: Name::AvgStanceTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millisecond, ..FR_DEF }),
            80 => Some(FieldReference { name: Name::AvgFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            81 => Some(FieldReference { name: Name::MaxFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            82 => Some(FieldReference { name: Name::TotalFractionalCycles, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::Cycle, ..FR_DEF }),
            83 => Some(FieldReference { name: Name::PlayerScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            84 => Some(FieldReference { name: Name::AvgTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            85 => Some(FieldReference { name: Name::MinTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            86 => Some(FieldReference { name: Name::MaxTotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            87 => Some(FieldReference { name: Name::AvgSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            88 => Some(FieldReference { name: Name::MinSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            89 => Some(FieldReference { name: Name::MaxSaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            91 => Some(FieldReference { name: Name::AvgLeftTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            92 => Some(FieldReference { name: Name::AvgRightTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            93 => Some(FieldReference { name: Name::AvgLeftPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            94 => Some(FieldReference { name: Name::AvgRightPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            95 => Some(FieldReference { name: Name::AvgCombinedPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            98 => Some(FieldReference { name: Name::TimeStanding, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            99 => Some(FieldReference { name: Name::StandCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            100 => Some(FieldReference { name: Name::AvgLeftPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            101 => Some(FieldReference { name: Name::AvgRightPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            102 => Some(FieldReference { name: Name::AvgLeftPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            103 => Some(FieldReference { name: Name::AvgLeftPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            104 => Some(FieldReference { name: Name::AvgRightPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            105 => Some(FieldReference { name: Name::AvgRightPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            106 => Some(FieldReference { name: Name::AvgPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            107 => Some(FieldReference { name: Name::MaxPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            108 => Some(FieldReference { name: Name::AvgCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            109 => Some(FieldReference { name: Name::MaxCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            110 => Some(FieldReference { name: Name::EnhancedAvgSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            111 => Some(FieldReference { name: Name::EnhancedMaxSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            112 => Some(FieldReference { name: Name::EnhancedAvgAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            113 => Some(FieldReference { name: Name::EnhancedMinAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            114 => Some(FieldReference { name: Name::EnhancedMaxAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            115 => Some(FieldReference { name: Name::AvgLevMotorPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            116 => Some(FieldReference { name: Name::MaxLevMotorPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            117 => Some(FieldReference { name: Name::LevBatteryConsumption, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            118 => Some(FieldReference { name: Name::AvgVerticalRatio, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            119 => Some(FieldReference { name: Name::AvgStanceTimeBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            120 => Some(FieldReference { name: Name::AvgStepLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            121 => Some(FieldReference { name: Name::AvgVam, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            122 => Some(FieldReference { name: Name::AvgDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            123 => Some(FieldReference { name: Name::MaxDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            124 => Some(FieldReference { name: Name::MinTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            136 => Some(FieldReference { name: Name::EnhancedAvgRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            137 => Some(FieldReference { name: Name::EnhancedMaxRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            147 => Some(FieldReference { name: Name::AvgRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 136 /* enhanced_avg_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            148 => Some(FieldReference { name: Name::MaxRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 137 /* enhanced_max_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            149 => Some(FieldReference { name: Name::TotalGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            150 => Some(FieldReference { name: Name::TotalFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            151 => Some(FieldReference { name: Name::JumpCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            153 => Some(FieldReference { name: Name::AvgGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            154 => Some(FieldReference { name: Name::AvgFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            156 => Some(FieldReference { name: Name::TotalFractionalAscent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            157 => Some(FieldReference { name: Name::TotalFractionalDescent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            158 => Some(FieldReference { name: Name::AvgCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            159 => Some(FieldReference { name: Name::MinCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            160 => Some(FieldReference { name: Name::MaxCoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::LENGTH => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TotalElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::TotalStrokes, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Stroke, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::SwimStroke, base_type: FitBaseType::ENUM, profile_type: ProfileType::SwimStroke, units: Unit::SwimStroke, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::AvgSwimmingCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::StrokesPerMinute, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::LengthType, base_type: FitBaseType::ENUM, profile_type: ProfileType::LengthType, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::PlayerScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::OpponentScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::StrokeCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::ZoneCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::EnhancedAvgRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::EnhancedMaxRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::AvgRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 22 /* enhanced_avg_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            25 => Some(FieldReference { name: Name::MaxRespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, components: &[
                    Component { field_num: 23 /* enhanced_max_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::RECORD => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Altitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 78 /* enhanced_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::HeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Cadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, accumulate: true, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Speed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 73 /* enhanced_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Power, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CompressedSpeedDistance, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [3] */, units: Unit::MetersPerSecondAndMeter, components: &[
                    Component { field_num: 6 /* speed */, scale: 100.0, offset: 0.0, accumulate: false, bits: 12 },
                    Component { field_num: 5 /* distance */, scale: 16.0, offset: 0.0, accumulate: true, bits: 12 }
                ], ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Grade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Resistance, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::TimeFromCourse, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::CycleLength, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::Temperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::Speed1S, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 16.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::Cycles, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, accumulate: true, units: Unit::Cycle, components: &[
                    Component { field_num: 19 /* total_cycles */, scale: 1.0, offset: 0.0, accumulate: true, bits: 8 }
                ], ..FR_DEF }),
            19 => Some(FieldReference { name: Name::TotalCycles, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, accumulate: true, units: Unit::Cycle, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::CompressedAccumulatedPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, accumulate: true, units: Unit::Watt, components: &[
                    Component { field_num: 29 /* accumulated_power */, scale: 1.0, offset: 0.0, accumulate: true, bits: 16 }
                ], ..FR_DEF }),
            29 => Some(FieldReference { name: Name::AccumulatedPower, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, accumulate: true, units: Unit::Watt, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::LeftRightBalance, base_type: FitBaseType::UINT8, profile_type: ProfileType::LeftRightBalance, ..FR_DEF }),
            31 => Some(FieldReference { name: Name::GpsAccuracy, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Meter, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::VerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::Calories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::VerticalOscillation, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            40 => Some(FieldReference { name: Name::StanceTimePercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            41 => Some(FieldReference { name: Name::StanceTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millisecond, ..FR_DEF }),
            42 => Some(FieldReference { name: Name::ActivityType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityType, ..FR_DEF }),
            43 => Some(FieldReference { name: Name::LeftTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            44 => Some(FieldReference { name: Name::RightTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            45 => Some(FieldReference { name: Name::LeftPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            46 => Some(FieldReference { name: Name::RightPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::CombinedPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            48 => Some(FieldReference { name: Name::Time128, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::Second, ..FR_DEF }),
            49 => Some(FieldReference { name: Name::StrokeType, base_type: FitBaseType::ENUM, profile_type: ProfileType::StrokeType, ..FR_DEF }),
            50 => Some(FieldReference { name: Name::Zone, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            51 => Some(FieldReference { name: Name::BallSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            52 => Some(FieldReference { name: Name::Cadence256, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 256.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            53 => Some(FieldReference { name: Name::FractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            54 => Some(FieldReference { name: Name::TotalHemoglobinConc, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            55 => Some(FieldReference { name: Name::TotalHemoglobinConcMin, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            56 => Some(FieldReference { name: Name::TotalHemoglobinConcMax, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::GramPerDeciliter, ..FR_DEF }),
            57 => Some(FieldReference { name: Name::SaturatedHemoglobinPercent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            58 => Some(FieldReference { name: Name::SaturatedHemoglobinPercentMin, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            59 => Some(FieldReference { name: Name::SaturatedHemoglobinPercentMax, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Percent, ..FR_DEF }),
            62 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
            67 => Some(FieldReference { name: Name::LeftPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            68 => Some(FieldReference { name: Name::RightPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            69 => Some(FieldReference { name: Name::LeftPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            70 => Some(FieldReference { name: Name::LeftPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            71 => Some(FieldReference { name: Name::RightPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            72 => Some(FieldReference { name: Name::RightPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            73 => Some(FieldReference { name: Name::EnhancedSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            78 => Some(FieldReference { name: Name::EnhancedAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            81 => Some(FieldReference { name: Name::BatterySoc, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            82 => Some(FieldReference { name: Name::MotorPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            83 => Some(FieldReference { name: Name::VerticalRatio, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            84 => Some(FieldReference { name: Name::StanceTimeBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            85 => Some(FieldReference { name: Name::StepLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::Millimeter, ..FR_DEF }),
            87 => Some(FieldReference { name: Name::CycleLength16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            91 => Some(FieldReference { name: Name::AbsolutePressure, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Pascal, ..FR_DEF }),
            92 => Some(FieldReference { name: Name::Depth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            93 => Some(FieldReference { name: Name::NextStopDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            94 => Some(FieldReference { name: Name::NextStopTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            95 => Some(FieldReference { name: Name::TimeToSurface, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            96 => Some(FieldReference { name: Name::NdlTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            97 => Some(FieldReference { name: Name::CnsLoad, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            98 => Some(FieldReference { name: Name::N2Load, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Percent, ..FR_DEF }),
            99 => Some(FieldReference { name: Name::RespirationRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Second, components: &[
                    Component { field_num: 108 /* enhanced_respiration_rate */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            108 => Some(FieldReference { name: Name::EnhancedRespirationRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
            114 => Some(FieldReference { name: Name::Grit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            115 => Some(FieldReference { name: Name::Flow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            116 => Some(FieldReference { name: Name::CurrentStress, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, ..FR_DEF }),
            117 => Some(FieldReference { name: Name::EbikeTravelRange, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilometer, ..FR_DEF }),
            118 => Some(FieldReference { name: Name::EbikeBatteryLevel, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            119 => Some(FieldReference { name: Name::EbikeAssistMode, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::DependsOnSensor, ..FR_DEF }),
            120 => Some(FieldReference { name: Name::EbikeAssistLevelPercent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            123 => Some(FieldReference { name: Name::AirTimeRemaining, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            124 => Some(FieldReference { name: Name::PressureSac, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BarPerMinute, ..FR_DEF }),
            125 => Some(FieldReference { name: Name::VolumeSac, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::LiterPerMinute, ..FR_DEF }),
            126 => Some(FieldReference { name: Name::Rmv, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::LiterPerMinute, ..FR_DEF }),
            127 => Some(FieldReference { name: Name::AscentRate, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            129 => Some(FieldReference { name: Name::Po2, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            139 => Some(FieldReference { name: Name::CoreTemperature, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::EVENT => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Data16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, components: &[
                    Component { field_num: 3 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::TimerTrigger, base_type: FitBaseType::UINT32, profile_type: ProfileType::TimerTrigger, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 0 /* timer */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CoursePointIndex, base_type: FitBaseType::UINT32, profile_type: ProfileType::MessageIndex, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 10 /* course_point */ },
                    ], ..SF_DEF },
                    SubField { name: Name::BatteryLevel, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::Voltage, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 11 /* battery */ },
                    ], ..SF_DEF },
                    SubField { name: Name::VirtualPartnerSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 12 /* virtual_partner_pace */ },
                    ], ..SF_DEF },
                    SubField { name: Name::HrHighAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 13 /* hr_high_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::HrLowAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 14 /* hr_low_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SpeedHighAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 15 /* speed_high_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SpeedLowAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 16 /* speed_low_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CadHighAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 17 /* cad_high_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CadLowAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 18 /* cad_low_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::PowerHighAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, units: Unit::Watt, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 19 /* power_high_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::PowerLowAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, units: Unit::Watt, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 20 /* power_low_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TimeDurationAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 23 /* time_duration_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DistanceDurationAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 24 /* distance_duration_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CalorieDurationAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Calorie, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 25 /* calorie_duration_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::FitnessEquipmentState, base_type: FitBaseType::UINT32, profile_type: ProfileType::FitnessEquipmentState, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 27 /* fitness_equipment */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SportPoint, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, components: &[
                        Component { field_num: 7 /* score */, scale: 1.0, offset: 0.0, accumulate: false, bits: 16 },
                        Component { field_num: 8 /* opponent_score */, scale: 1.0, offset: 0.0, accumulate: false, bits: 16 }
                    ], maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 33 /* sport_point */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GearChangeData, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, components: &[
                        Component { field_num: 11 /* rear_gear_num */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 12 /* rear_gear */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 9 /* front_gear_num */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 10 /* front_gear */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                    ], maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 42 /* front_gear_change */ },
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 43 /* rear_gear_change */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RiderPosition, base_type: FitBaseType::UINT32, profile_type: ProfileType::RiderPositionType, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 44 /* rider_position_change */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CommTimeout, base_type: FitBaseType::UINT32, profile_type: ProfileType::CommTimeoutType, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 47 /* comm_timeout */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DiveAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::DiveAlert, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 56 /* dive_alert */ },
                    ], ..SF_DEF },
                    SubField { name: Name::AutoActivityDetectDuration, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint16, units: Unit::Minute, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 54 /* auto_activity_detect */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RadarThreatAlert, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, components: &[
                        Component { field_num: 21 /* radar_threat_level_max */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 22 /* radar_threat_count */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 23 /* radar_threat_avg_approach_speed */, scale: 10.0, offset: 0.0, accumulate: false, bits: 8 },
                        Component { field_num: 24 /* radar_threat_max_approach_speed */, scale: 10.0, offset: 0.0, accumulate: false, bits: 8 }
                    ], maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 75 /* radar_threat_alert */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            4 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Score, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::OpponentScore, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::FrontGearNum, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::FrontGear, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::RearGearNum, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::RearGear, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::ActivityType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityType, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::StartTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, sub_fields: &[
                    SubField { name: Name::AutoActivityDetectStartTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, maps: &[
                        SubFieldMap { ref_field_num: 0 /* event */, ref_field_value: 54 /* auto_activity_detect */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            21 => Some(FieldReference { name: Name::RadarThreatLevelMax, base_type: FitBaseType::ENUM, profile_type: ProfileType::RadarThreatLevelType, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::RadarThreatCount, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::RadarThreatAvgApproachSpeed, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::RadarThreatMaxApproachSpeed, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DEVICE_INFO => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::DeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, sub_fields: &[
                    SubField { name: Name::BleDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::BleDeviceType, maps: &[
                        SubFieldMap { ref_field_num: 25 /* source_type */, ref_field_value: 3 /* bluetooth_low_energy */ },
                    ], ..SF_DEF },
                    SubField { name: Name::AntplusDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::AntplusDeviceType, maps: &[
                        SubFieldMap { ref_field_num: 25 /* source_type */, ref_field_value: 1 /* antplus */ },
                    ], ..SF_DEF },
                    SubField { name: Name::AntDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, maps: &[
                        SubFieldMap { ref_field_num: 25 /* source_type */, ref_field_value: 0 /* ant */ },
                    ], ..SF_DEF },
                    SubField { name: Name::LocalDeviceType, base_type: FitBaseType::UINT8, profile_type: ProfileType::LocalDeviceType, maps: &[
                        SubFieldMap { ref_field_num: 25 /* source_type */, ref_field_value: 5 /* local */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::SerialNumber, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::Uint32z, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Product, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::FaveroProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::FaveroProduct, maps: &[
                        SubFieldMap { ref_field_num: 2 /* manufacturer */, ref_field_value: 263 /* favero_electronics */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GarminProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::GarminProduct, maps: &[
                        SubFieldMap { ref_field_num: 2 /* manufacturer */, ref_field_value: 1 /* garmin */ },
                        SubFieldMap { ref_field_num: 2 /* manufacturer */, ref_field_value: 15 /* dynastream */ },
                        SubFieldMap { ref_field_num: 2 /* manufacturer */, ref_field_value: 13 /* dynastream_oem */ },
                        SubFieldMap { ref_field_num: 2 /* manufacturer */, ref_field_value: 89 /* tacx */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            5 => Some(FieldReference { name: Name::SoftwareVersion, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::HardwareVersion, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::CumOperatingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::BatteryVoltage, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 256.0, units: Unit::Voltage, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::BatteryStatus, base_type: FitBaseType::UINT8, profile_type: ProfileType::BatteryStatus, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::SensorPosition, base_type: FitBaseType::ENUM, profile_type: ProfileType::BodyLocation, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::Descriptor, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::AntTransmissionType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::AntDeviceNumber, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::AntNetwork, base_type: FitBaseType::ENUM, profile_type: ProfileType::AntNetwork, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::SourceType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SourceType, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::ProductName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::BatteryLevel, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DEVICE_AUX_BATTERY_INFO => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::BatteryVoltage, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 256.0, units: Unit::Voltage, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::BatteryStatus, base_type: FitBaseType::UINT8, profile_type: ProfileType::BatteryStatus, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::BatteryIdentifier, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TRAINING_FILE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::File, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Product, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::FaveroProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::FaveroProduct, maps: &[
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 263 /* favero_electronics */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GarminProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::GarminProduct, maps: &[
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 1 /* garmin */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 15 /* dynastream */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 13 /* dynastream_oem */ },
                        SubFieldMap { ref_field_num: 1 /* manufacturer */, ref_field_value: 89 /* tacx */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::SerialNumber, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::Uint32z, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimeCreated, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WEATHER_CONDITIONS => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::WeatherReport, base_type: FitBaseType::ENUM, profile_type: ProfileType::WeatherReport, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Temperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Condition, base_type: FitBaseType::ENUM, profile_type: ProfileType::WeatherStatus, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::WindDirection, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Degree, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::WindSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::PrecipitationProbability, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::TemperatureFeelsLike, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::RelativeHumidity, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Location, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::ObservedAtTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::ObservedLocationLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::ObservedLocationLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::DayOfWeek, base_type: FitBaseType::ENUM, profile_type: ProfileType::DayOfWeek, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::HighTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::LowTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WEATHER_ALERT => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ReportId, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::IssueTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ExpireTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Severity, base_type: FitBaseType::ENUM, profile_type: ProfileType::WeatherSeverity, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::WeatherSevereType, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::GPS_METADATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::EnhancedAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::EnhancedSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Heading, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Degree, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::UtcTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Velocity, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [3] */, scale: 100.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CAMERA_EVENT => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::CameraEventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::CameraEventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::CameraFileUuid, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::CameraOrientation, base_type: FitBaseType::ENUM, profile_type: ProfileType::CameraOrientationType, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::GYROSCOPE_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SampleTimeOffset, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::GyroX, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::GyroY, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::GyroZ, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::CalibratedGyroX, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::DegreesPerSecond, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::CalibratedGyroY, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::DegreesPerSecond, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::CalibratedGyroZ, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::DegreesPerSecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ACCELEROMETER_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SampleTimeOffset, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AccelX, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::AccelY, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::AccelZ, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::CalibratedAccelX, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gee, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::CalibratedAccelY, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gee, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::CalibratedAccelZ, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gee, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CompressedCalibratedAccelX, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, units: Unit::Milligee, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::CompressedCalibratedAccelY, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, units: Unit::Milligee, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::CompressedCalibratedAccelZ, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, units: Unit::Milligee, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MAGNETOMETER_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SampleTimeOffset, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::MagX, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::MagY, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::MagZ, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Count, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::CalibratedMagX, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gauss, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::CalibratedMagY, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gauss, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::CalibratedMagZ, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, array: true /* [N] */, units: Unit::Gauss, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::BAROMETER_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SampleTimeOffset, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::BaroPres, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, units: Unit::Pascal, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::THREE_D_SENSOR_CALIBRATION => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SensorType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SensorType, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::CalibrationFactor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::AccelCalFactor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Gee, maps: &[
                        SubFieldMap { ref_field_num: 0 /* sensor_type */, ref_field_value: 0 /* accelerometer */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GyroCalFactor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::DegreesPerSecond, maps: &[
                        SubFieldMap { ref_field_num: 0 /* sensor_type */, ref_field_value: 1 /* gyroscope */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::CalibrationDivisor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Count, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::LevelShift, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::OffsetCal, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, array: true /* [3] */, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::OrientationMatrix, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, array: true /* [9] */, scale: 65535.0, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ONE_D_SENSOR_CALIBRATION => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SensorType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SensorType, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::CalibrationFactor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::BaroCalFactor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Pascal, maps: &[
                        SubFieldMap { ref_field_num: 0 /* sensor_type */, ref_field_value: 3 /* barometer */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::CalibrationDivisor, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Count, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::LevelShift, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::OffsetCal, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::VIDEO_FRAME => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::FrameNumber, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::OBDII_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::TimeOffset, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Pid, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::RawData, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::PidDataSize, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::SystemTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::StartTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::StartTimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::NMEA_SENTENCE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Sentence, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::AVIATION_ATTITUDE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SystemTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Pitch, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 10430.38, units: Unit::Radian, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Roll, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 10430.38, units: Unit::Radian, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::AccelLateral, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 100.0, units: Unit::MetersPerSecondSquared, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::AccelNormal, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 100.0, units: Unit::MetersPerSecondSquared, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::TurnRate, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 1024.0, units: Unit::RadiansPerSecond, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Stage, base_type: FitBaseType::ENUM, profile_type: ProfileType::AttitudeStage, array: true /* [N] */, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::AttitudeStageComplete, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::Percent, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Track, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 10430.38, units: Unit::Radian, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Validity, base_type: FitBaseType::UINT16, profile_type: ProfileType::AttitudeValidity, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::VIDEO => { match field_num {
            0 => Some(FieldReference { name: Name::Url, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::HostingProvider, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Duration, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::VIDEO_TITLE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::MessageCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Text, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::VIDEO_DESCRIPTION => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::MessageCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Text, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::VIDEO_CLIP => { match field_num {
            0 => Some(FieldReference { name: Name::ClipNumber, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::StartTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartTimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::EndTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::EndTimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::ClipStart, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Millisecond, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::ClipEnd, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SET => { match field_num {
            254 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Duration, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Repetitions, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Weight, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 16.0, units: Unit::Kilogram, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::SetType, base_type: FitBaseType::UINT8, profile_type: ProfileType::SetType, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Category, base_type: FitBaseType::UINT16, profile_type: ProfileType::ExerciseCategory, array: true /* [N] */, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::CategorySubtype, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::WeightDisplayUnit, base_type: FitBaseType::UINT16, profile_type: ProfileType::FitBaseUnit, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::WktStepIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::JUMP => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Meter, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Height, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Meter, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Rotations, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::HangTime, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Second, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Score, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Speed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, components: &[
                    Component { field_num: 8 /* enhanced_speed */, scale: 1000.0, offset: 0.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            8 => Some(FieldReference { name: Name::EnhancedSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SPLIT => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SplitType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SplitType, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::TotalElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TotalDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::TotalAscent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::TotalDescent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::StartPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::StartPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::EndPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::EndPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::AvgVertSpeed, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::EndTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Kilocalorie, ..FR_DEF }),
            74 => Some(FieldReference { name: Name::StartElevation, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            78 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            110 => Some(FieldReference { name: Name::TotalMovingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SPLIT_SUMMARY => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SplitType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SplitType, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::NumSplits, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::TotalDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TotalAscent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TotalDescent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::AvgHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::AvgVertSpeed, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Kilocalorie, ..FR_DEF }),
            65 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            77 => Some(FieldReference { name: Name::TotalMovingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CLIMB_PRO => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ClimbProEvent, base_type: FitBaseType::ENUM, profile_type: ProfileType::ClimbProEvent, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ClimbNumber, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::ClimbCategory, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::CurrentDist, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Meter, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::FIELD_DESCRIPTION => { match field_num {
            0 => Some(FieldReference { name: Name::DeveloperDataIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::FieldDefinitionNumber, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::FitBaseTypeId, base_type: FitBaseType::UINT8, profile_type: ProfileType::FitBaseType, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::FieldName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, array: true /* [N] */, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Array, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Components, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Scale, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Offset, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Units, base_type: FitBaseType::STRING, profile_type: ProfileType::String, array: true /* [N] */, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Bits, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Accumulate, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::FitBaseUnitId, base_type: FitBaseType::UINT16, profile_type: ProfileType::FitBaseUnit, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::NativeMesgNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::NativeFieldNum, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DEVELOPER_DATA_ID => { match field_num {
            0 => Some(FieldReference { name: Name::DeveloperId, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ApplicationId, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ManufacturerId, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::DeveloperDataIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::ApplicationVersion, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::COURSE => { match field_num {
            4 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Capabilities, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::CourseCapabilities, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::COURSE_POINT => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::CoursePoint, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Favorite, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SEGMENT_ID => { match field_num {
            0 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Uuid, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::UserProfilePrimaryKey, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::DeviceId, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::DefaultRaceLeader, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::DeleteStatus, base_type: FitBaseType::ENUM, profile_type: ProfileType::SegmentDeleteStatus, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::SelectionType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SegmentSelectionType, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SEGMENT_LEADERBOARD_ENTRY => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::SegmentLeaderboardType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::GroupPrimaryKey, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ActivityId, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::SegmentTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::ActivityIdString, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SEGMENT_POINT => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::PositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::PositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Altitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 6 /* enhanced_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            5 => Some(FieldReference { name: Name::LeaderTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::EnhancedAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SEGMENT_LAP => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Event, base_type: FitBaseType::ENUM, profile_type: ProfileType::Event, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EventType, base_type: FitBaseType::ENUM, profile_type: ProfileType::EventType, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::StartPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::StartPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::EndPositionLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::EndPositionLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::TotalElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::TotalTimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::TotalDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::TotalCycles, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Cycle, sub_fields: &[
                    SubField { name: Name::TotalStrokes, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Stroke, maps: &[
                        SubFieldMap { ref_field_num: 23 /* sport */, ref_field_value: 2 /* cycling */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            11 => Some(FieldReference { name: Name::TotalCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::TotalFatCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::AvgHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::MaxHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::AvgCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            18 => Some(FieldReference { name: Name::MaxCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::AvgPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::MaxPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            21 => Some(FieldReference { name: Name::TotalAscent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::TotalDescent, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Meter, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::EventGroup, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::NecLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::NecLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::SwcLat, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::SwcLong, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, units: Unit::Semicircle, ..FR_DEF }),
            29 => Some(FieldReference { name: Name::Name, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::NormalizedPower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Watt, ..FR_DEF }),
            31 => Some(FieldReference { name: Name::LeftRightBalance, base_type: FitBaseType::UINT16, profile_type: ProfileType::LeftRightBalance100, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::TotalWork, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Joule, ..FR_DEF }),
            34 => Some(FieldReference { name: Name::AvgAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 91 /* enhanced_avg_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            35 => Some(FieldReference { name: Name::MaxAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 92 /* enhanced_max_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            36 => Some(FieldReference { name: Name::GpsAccuracy, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Meter, ..FR_DEF }),
            37 => Some(FieldReference { name: Name::AvgGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            38 => Some(FieldReference { name: Name::AvgPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            39 => Some(FieldReference { name: Name::AvgNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            40 => Some(FieldReference { name: Name::MaxPosGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            41 => Some(FieldReference { name: Name::MaxNegGrade, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            42 => Some(FieldReference { name: Name::AvgTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            43 => Some(FieldReference { name: Name::MaxTemperature, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Celcius, ..FR_DEF }),
            44 => Some(FieldReference { name: Name::TotalMovingTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            45 => Some(FieldReference { name: Name::AvgPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            46 => Some(FieldReference { name: Name::AvgNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            47 => Some(FieldReference { name: Name::MaxPosVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            48 => Some(FieldReference { name: Name::MaxNegVerticalSpeed, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            49 => Some(FieldReference { name: Name::TimeInHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            50 => Some(FieldReference { name: Name::TimeInSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            51 => Some(FieldReference { name: Name::TimeInCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            52 => Some(FieldReference { name: Name::TimeInPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            53 => Some(FieldReference { name: Name::RepetitionNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            54 => Some(FieldReference { name: Name::MinAltitude, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 5.0, offset: 500.0,units: Unit::Meter, components: &[
                    Component { field_num: 93 /* enhanced_min_altitude */, scale: 5.0, offset: 500.0, accumulate: false, bits: 16 }
                ], ..FR_DEF }),
            55 => Some(FieldReference { name: Name::MinHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            56 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            57 => Some(FieldReference { name: Name::WktStepIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            58 => Some(FieldReference { name: Name::SportEvent, base_type: FitBaseType::ENUM, profile_type: ProfileType::SportEvent, ..FR_DEF }),
            59 => Some(FieldReference { name: Name::AvgLeftTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            60 => Some(FieldReference { name: Name::AvgRightTorqueEffectiveness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            61 => Some(FieldReference { name: Name::AvgLeftPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            62 => Some(FieldReference { name: Name::AvgRightPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            63 => Some(FieldReference { name: Name::AvgCombinedPedalSmoothness, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 2.0, units: Unit::Percent, ..FR_DEF }),
            64 => Some(FieldReference { name: Name::Status, base_type: FitBaseType::ENUM, profile_type: ProfileType::SegmentLapStatus, ..FR_DEF }),
            65 => Some(FieldReference { name: Name::Uuid, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            66 => Some(FieldReference { name: Name::AvgFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            67 => Some(FieldReference { name: Name::MaxFractionalCadence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            68 => Some(FieldReference { name: Name::TotalFractionalCycles, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 128.0, units: Unit::Cycle, ..FR_DEF }),
            69 => Some(FieldReference { name: Name::FrontGearShiftCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            70 => Some(FieldReference { name: Name::RearGearShiftCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            71 => Some(FieldReference { name: Name::TimeStanding, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            72 => Some(FieldReference { name: Name::StandCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            73 => Some(FieldReference { name: Name::AvgLeftPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            74 => Some(FieldReference { name: Name::AvgRightPco, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, units: Unit::Millimeter, ..FR_DEF }),
            75 => Some(FieldReference { name: Name::AvgLeftPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            76 => Some(FieldReference { name: Name::AvgLeftPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            77 => Some(FieldReference { name: Name::AvgRightPowerPhase, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            78 => Some(FieldReference { name: Name::AvgRightPowerPhasePeak, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, scale: 0.7111111, units: Unit::Degree, ..FR_DEF }),
            79 => Some(FieldReference { name: Name::AvgPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            80 => Some(FieldReference { name: Name::MaxPowerPosition, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Watt, ..FR_DEF }),
            81 => Some(FieldReference { name: Name::AvgCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            82 => Some(FieldReference { name: Name::MaxCadencePosition, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::RevolutionPerMinute, ..FR_DEF }),
            83 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            84 => Some(FieldReference { name: Name::TotalGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            85 => Some(FieldReference { name: Name::TotalFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            86 => Some(FieldReference { name: Name::AvgGrit, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::KGrit, ..FR_DEF }),
            87 => Some(FieldReference { name: Name::AvgFlow, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, units: Unit::Flow, ..FR_DEF }),
            89 => Some(FieldReference { name: Name::TotalFractionalAscent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            90 => Some(FieldReference { name: Name::TotalFractionalDescent, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            91 => Some(FieldReference { name: Name::EnhancedAvgAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            92 => Some(FieldReference { name: Name::EnhancedMaxAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
            93 => Some(FieldReference { name: Name::EnhancedMinAltitude, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 5.0, offset: 500.0,units: Unit::Meter, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SEGMENT_FILE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::FileUuid, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Enabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::UserProfilePrimaryKey, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::LeaderType, base_type: FitBaseType::ENUM, profile_type: ProfileType::SegmentLeaderboardType, array: true /* [N] */, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::LeaderGroupPrimaryKey, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::LeaderActivityId, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::LeaderActivityIdString, base_type: FitBaseType::STRING, profile_type: ProfileType::String, array: true /* [N] */, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::DefaultRaceLeader, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WORKOUT => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Capabilities, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::WorkoutCapabilities, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::NumValidSteps, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::WktName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::PoolLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::PoolLengthUnit, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::WktDescription, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WORKOUT_SESSION => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::NumValidSteps, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::FirstStepIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::PoolLength, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::PoolLengthUnit, base_type: FitBaseType::ENUM, profile_type: ProfileType::DisplayMeasure, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WORKOUT_STEP => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::WktStepName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::DurationType, base_type: FitBaseType::ENUM, profile_type: ProfileType::WktStepDuration, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::DurationValue, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::DurationTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 0 /* time */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 28 /* repetition_time */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 1 /* distance */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationHr, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 2 /* hr_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 3 /* hr_greater_than */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationCalories, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Calorie, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 4 /* calories */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationStep, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 6 /* repeat_until_steps_cmplt */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 7 /* repeat_until_time */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 8 /* repeat_until_distance */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 9 /* repeat_until_calories */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 10 /* repeat_until_hr_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 11 /* repeat_until_hr_greater_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 12 /* repeat_until_power_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 13 /* repeat_until_power_greater_than */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationPower, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 14 /* power_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 15 /* power_greater_than */ },
                    ], ..SF_DEF },
                    SubField { name: Name::DurationReps, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 29 /* reps */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TargetType, base_type: FitBaseType::ENUM, profile_type: ProfileType::WktStepTarget, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TargetValue, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::TargetSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TargetHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TargetCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TargetPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatSteps, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 6 /* repeat_until_steps_cmplt */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 7 /* repeat_until_time */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatDistance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 8 /* repeat_until_distance */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatCalories, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Calorie, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 9 /* repeat_until_calories */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatHr, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 10 /* repeat_until_hr_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 11 /* repeat_until_hr_greater_than */ },
                    ], ..SF_DEF },
                    SubField { name: Name::RepeatPower, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 12 /* repeat_until_power_less_than */ },
                        SubFieldMap { ref_field_num: 1 /* duration_type */, ref_field_value: 13 /* repeat_until_power_greater_than */ },
                    ], ..SF_DEF },
                    SubField { name: Name::TargetStrokeType, base_type: FitBaseType::UINT32, profile_type: ProfileType::SwimStroke, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 11 /* swim_stroke */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            5 => Some(FieldReference { name: Name::CustomTargetValueLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::CustomTargetSpeedLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetHeartRateLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetCadenceLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetPowerLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            6 => Some(FieldReference { name: Name::CustomTargetValueHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::CustomTargetSpeedHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetHeartRateHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetCadenceHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::CustomTargetPowerHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 3 /* target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            7 => Some(FieldReference { name: Name::Intensity, base_type: FitBaseType::ENUM, profile_type: ProfileType::Intensity, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Notes, base_type: FitBaseType::STRING, profile_type: ProfileType::String, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Equipment, base_type: FitBaseType::ENUM, profile_type: ProfileType::WorkoutEquipment, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::ExerciseCategory, base_type: FitBaseType::UINT16, profile_type: ProfileType::ExerciseCategory, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::ExerciseName, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::ExerciseWeight, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Kilogram, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::WeightDisplayUnit, base_type: FitBaseType::UINT16, profile_type: ProfileType::FitBaseUnit, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::SecondaryTargetType, base_type: FitBaseType::ENUM, profile_type: ProfileType::WktStepTarget, ..FR_DEF }),
            20 => Some(FieldReference { name: Name::SecondaryTargetValue, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::SecondaryTargetSpeedZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryTargetHrZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryTargetCadenceZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryTargetPowerZone, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryTargetStrokeType, base_type: FitBaseType::UINT32, profile_type: ProfileType::SwimStroke, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 11 /* swim_stroke */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            21 => Some(FieldReference { name: Name::SecondaryCustomTargetValueLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::SecondaryCustomTargetSpeedLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetHeartRateLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetCadenceLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetPowerLow, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            22 => Some(FieldReference { name: Name::SecondaryCustomTargetValueHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, sub_fields: &[
                    SubField { name: Name::SecondaryCustomTargetSpeedHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 0 /* speed */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetHeartRateHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutHr, units: Unit::PercentOrBeatsPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 1 /* heart_rate */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetCadenceHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::RevolutionPerMinute, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 3 /* cadence */ },
                    ], ..SF_DEF },
                    SubField { name: Name::SecondaryCustomTargetPowerHigh, base_type: FitBaseType::UINT32, profile_type: ProfileType::WorkoutPower, units: Unit::PercentOrWatts, maps: &[
                        SubFieldMap { ref_field_num: 19 /* secondary_target_type */, ref_field_value: 4 /* power */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::EXERCISE_TITLE => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ExerciseCategory, base_type: FitBaseType::UINT16, profile_type: ProfileType::ExerciseCategory, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ExerciseName, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::WktStepName, base_type: FitBaseType::STRING, profile_type: ProfileType::String, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SCHEDULE => { match field_num {
            0 => Some(FieldReference { name: Name::Manufacturer, base_type: FitBaseType::UINT16, profile_type: ProfileType::Manufacturer, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Product, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, sub_fields: &[
                    SubField { name: Name::FaveroProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::FaveroProduct, maps: &[
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 263 /* favero_electronics */ },
                    ], ..SF_DEF },
                    SubField { name: Name::GarminProduct, base_type: FitBaseType::UINT16, profile_type: ProfileType::GarminProduct, maps: &[
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 1 /* garmin */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 15 /* dynastream */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 13 /* dynastream_oem */ },
                        SubFieldMap { ref_field_num: 0 /* manufacturer */, ref_field_value: 89 /* tacx */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::SerialNumber, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::Uint32z, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TimeCreated, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Completed, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Type, base_type: FitBaseType::ENUM, profile_type: ProfileType::Schedule, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::ScheduledTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TOTALS => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimerTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Meter, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Calories, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Kilocalorie, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::ElapsedTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Sessions, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::SportIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::WEIGHT_SCALE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Weight, base_type: FitBaseType::UINT16, profile_type: ProfileType::Weight, scale: 100.0, units: Unit::Kilogram, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::PercentFat, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::PercentHydration, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Percent, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::VisceralFatMass, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Kilogram, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::BoneMass, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Kilogram, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::MuscleMass, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Kilogram, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::BasalMet, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 4.0, units: Unit::KilocaloriesPerDay, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::PhysiqueRating, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::ActiveMet, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 4.0, units: Unit::KilocaloriesPerDay, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::MetabolicAge, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Year, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::VisceralFatRating, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::UserProfileIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::Bmi, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::KilogramsPerSquareMeter, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::BLOOD_PRESSURE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SystolicPressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::DiastolicPressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::MeanArterialPressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Map3SampleMean, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::MapMorningValues, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::MapEveningValues, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::MillimetersOfMercury, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::HeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::HeartRateType, base_type: FitBaseType::ENUM, profile_type: ProfileType::HrType, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Status, base_type: FitBaseType::ENUM, profile_type: ProfileType::BpStatus, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::UserProfileIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MONITORING_INFO => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::LocalTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ActivityType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityType, array: true /* [N] */, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::CyclesToDistance, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 5000.0, units: Unit::MetersPerCycle, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::CyclesToCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 5000.0, units: Unit::KilocaloriesPerCycle, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::RestingMetabolicRate, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::KilocaloriesPerDay, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MONITORING => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Calories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Distance, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Meter, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Cycles, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 2.0, units: Unit::Cycle, sub_fields: &[
                    SubField { name: Name::Steps, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Step, maps: &[
                        SubFieldMap { ref_field_num: 5 /* activity_type */, ref_field_value: 6 /* walking */ },
                        SubFieldMap { ref_field_num: 5 /* activity_type */, ref_field_value: 1 /* running */ },
                    ], ..SF_DEF },
                    SubField { name: Name::Strokes, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 2.0, units: Unit::Stroke, maps: &[
                        SubFieldMap { ref_field_num: 5 /* activity_type */, ref_field_value: 2 /* cycling */ },
                        SubFieldMap { ref_field_num: 5 /* activity_type */, ref_field_value: 5 /* swimming */ },
                    ], ..SF_DEF }
                ], ..FR_DEF }),
            4 => Some(FieldReference { name: Name::ActiveTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::ActivityType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityType, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::ActivitySubtype, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivitySubtype, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::ActivityLevel, base_type: FitBaseType::ENUM, profile_type: ProfileType::ActivityLevel, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::Distance16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Hectometer, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Cycles16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::TwoCyclesSteps, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::ActiveTime16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::LocalTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::Temperature, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::TemperatureMin, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::TemperatureMax, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::Celcius, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::ActivityTime, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [8] */, units: Unit::Minute, ..FR_DEF }),
            19 => Some(FieldReference { name: Name::ActiveCalories, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Kilocalorie, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::CurrentActivityTypeIntensity, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, components: &[
                    Component { field_num: 5 /* activity_type */, scale: 1.0, offset: 0.0, accumulate: false, bits: 5 },
                    Component { field_num: 28 /* intensity */, scale: 1.0, offset: 0.0, accumulate: false, bits: 3 }
                ], ..FR_DEF }),
            25 => Some(FieldReference { name: Name::TimestampMin8, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Minute, ..FR_DEF }),
            26 => Some(FieldReference { name: Name::Timestamp16, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            27 => Some(FieldReference { name: Name::HeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            28 => Some(FieldReference { name: Name::Intensity, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 10.0, ..FR_DEF }),
            29 => Some(FieldReference { name: Name::DurationMin, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Minute, ..FR_DEF }),
            30 => Some(FieldReference { name: Name::Duration, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            31 => Some(FieldReference { name: Name::Ascent, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            32 => Some(FieldReference { name: Name::Descent, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            33 => Some(FieldReference { name: Name::ModerateActivityMinutes, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Minute, ..FR_DEF }),
            34 => Some(FieldReference { name: Name::VigorousActivityMinutes, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Minute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MONITORING_HR_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::RestingHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::CurrentDayRestingHeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::BeatsPerMinute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SPO2_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ReadingSpo2, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ReadingConfidence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Mode, base_type: FitBaseType::ENUM, profile_type: ProfileType::Spo2MeasurementType, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HR => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::FractionalTimestamp, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 32768.0, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Time256, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, scale: 256.0, units: Unit::Second, components: &[
                    Component { field_num: 0 /* fractional_timestamp */, scale: 256.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            6 => Some(FieldReference { name: Name::FilteredBpm, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::BeatsPerMinute, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::EventTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, accumulate: true, scale: 1024.0, units: Unit::Second, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::EventTimestamp12, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, accumulate: true, units: Unit::Second, components: &[
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 },
                    Component { field_num: 9 /* event_timestamp */, scale: 1024.0, offset: 0.0, accumulate: true, bits: 12 }
                ], ..FR_DEF }),
           _ => None,
        }},
        MesgNum::STRESS_LEVEL => { match field_num {
            0 => Some(FieldReference { name: Name::StressLevelValue, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::StressLevelTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MAX_MET_DATA => { match field_num {
            0 => Some(FieldReference { name: Name::UpdateTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Vo2Max, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 10.0, units: Unit::MillilitersPerKilogramPerMinute, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Sport, base_type: FitBaseType::ENUM, profile_type: ProfileType::Sport, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::SubSport, base_type: FitBaseType::ENUM, profile_type: ProfileType::SubSport, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::MaxMetCategory, base_type: FitBaseType::ENUM, profile_type: ProfileType::MaxMetCategory, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::CalibratedData, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::HrSource, base_type: FitBaseType::ENUM, profile_type: ProfileType::MaxMetHeartRateSource, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::SpeedSource, base_type: FitBaseType::ENUM, profile_type: ProfileType::MaxMetSpeedSource, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_BODY_BATTERY_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Level, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, array: true /* [N] */, units: Unit::Percent, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Charged, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Uncharged, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_EVENT => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::EventId, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_ACCELEROMETER_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SamplingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AccelX, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 1.024, units: Unit::Milligee, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::AccelY, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 1.024, units: Unit::Milligee, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::AccelZ, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 1.024, units: Unit::Milligee, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Timestamp32K, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_GYROSCOPE_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::SamplingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::OnePer32768Seconds, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::GyroX, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 28.57143, units: Unit::DegreesPerSecond, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::GyroY, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 28.57143, units: Unit::DegreesPerSecond, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::GyroZ, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 28.57143, units: Unit::DegreesPerSecond, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Timestamp32K, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::OnePer32768Seconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_STEP_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Steps, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, array: true /* [N] */, units: Unit::Step, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_SPO2_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ReadingSpo2, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::Percent, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Confidence, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_STRESS_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::StressLevel, base_type: FitBaseType::SINT8, profile_type: ProfileType::Sint8, array: true /* [N] */, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_RESPIRATION_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::RespirationRate, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, array: true /* [N] */, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_HEART_RATE_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Status, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::HeartRate, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, units: Unit::BeatsPerMinute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_CONFIGURATION_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::DataSize, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HSA_WRIST_TEMPERATURE_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ProcessingInterval, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Value, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 1000.0, units: Unit::Celcius, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::MEMO_GLOB => { match field_num {
            250 => Some(FieldReference { name: Name::PartIndex, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Memo, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MesgNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ParentIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::FieldNum, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SLEEP_LEVEL => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::SleepLevel, base_type: FitBaseType::ENUM, profile_type: ProfileType::SleepLevel, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ANT_CHANNEL_ID => { match field_num {
            0 => Some(FieldReference { name: Name::ChannelNumber, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::DeviceType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::DeviceNumber, base_type: FitBaseType::UINT16Z, profile_type: ProfileType::Uint16z, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::TransmissionType, base_type: FitBaseType::UINT8Z, profile_type: ProfileType::Uint8z, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::DeviceIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::DeviceIndex, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ANT_RX => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::FractionalTimestamp, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 32768.0, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MesgId, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::MesgData, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, components: &[
                    Component { field_num: 3 /* channel_number */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ChannelNumber, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::ANT_TX => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::FractionalTimestamp, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 32768.0, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MesgId, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::MesgData, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, components: &[
                    Component { field_num: 3 /* channel_number */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 },
                    Component { field_num: 4 /* data */, scale: 1.0, offset: 0.0, accumulate: false, bits: 8 }
                ], ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ChannelNumber, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::EXD_SCREEN_CONFIGURATION => { match field_num {
            0 => Some(FieldReference { name: Name::ScreenIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::FieldCount, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Layout, base_type: FitBaseType::ENUM, profile_type: ProfileType::ExdLayout, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ScreenEnabled, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::EXD_DATA_FIELD_CONFIGURATION => { match field_num {
            0 => Some(FieldReference { name: Name::ScreenIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ConceptField, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, components: &[
                    Component { field_num: 2 /* field_id */, scale: 1.0, offset: 0.0, accumulate: false, bits: 4 },
                    Component { field_num: 3 /* concept_count */, scale: 1.0, offset: 0.0, accumulate: false, bits: 4 }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::FieldId, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ConceptCount, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::DisplayType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ExdDisplayType, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::Title, base_type: FitBaseType::STRING, profile_type: ProfileType::String, array: true /* [32] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::EXD_DATA_CONCEPT_CONFIGURATION => { match field_num {
            0 => Some(FieldReference { name: Name::ScreenIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ConceptField, base_type: FitBaseType::BYTE, profile_type: ProfileType::Byte, components: &[
                    Component { field_num: 2 /* field_id */, scale: 1.0, offset: 0.0, accumulate: false, bits: 4 },
                    Component { field_num: 3 /* concept_index */, scale: 1.0, offset: 0.0, accumulate: false, bits: 4 }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::FieldId, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ConceptIndex, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::DataPage, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::ConceptKey, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Scaling, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::DataUnits, base_type: FitBaseType::ENUM, profile_type: ProfileType::ExdDataUnits, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::Qualifier, base_type: FitBaseType::ENUM, profile_type: ProfileType::ExdQualifiers, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::Descriptor, base_type: FitBaseType::ENUM, profile_type: ProfileType::ExdDescriptors, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::IsSigned, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::DIVE_SUMMARY => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ReferenceMesg, base_type: FitBaseType::UINT16, profile_type: ProfileType::MesgNum, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ReferenceIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AvgDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::MaxDepth, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Meter, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::SurfaceInterval, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, units: Unit::Second, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::StartCns, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::EndCns, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, units: Unit::Percent, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::StartN2, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Percent, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::EndN2, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Percent, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::O2Toxicity, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::OxygenToxicityUnit, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::DiveNumber, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::BottomTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            12 => Some(FieldReference { name: Name::AvgPressureSac, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::BarPerMinute, ..FR_DEF }),
            13 => Some(FieldReference { name: Name::AvgVolumeSac, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::LiterPerMinute, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::AvgRmv, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::LiterPerMinute, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::DescentTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            16 => Some(FieldReference { name: Name::AscentTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
            17 => Some(FieldReference { name: Name::AvgAscentRate, base_type: FitBaseType::SINT32, profile_type: ProfileType::Sint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            22 => Some(FieldReference { name: Name::AvgDescentRate, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            23 => Some(FieldReference { name: Name::MaxAscentRate, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            24 => Some(FieldReference { name: Name::MaxDescentRate, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            25 => Some(FieldReference { name: Name::HangTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::AAD_ACCEL_FEATURES => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::EnergyTotal, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::ZeroCrossCnt, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Instance, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::TimeAboveThreshold, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 25.0, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HRV => { match field_num {
            0 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, scale: 1000.0, units: Unit::Second, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::BEAT_INTERVALS => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HRV_STATUS_SUMMARY => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::WeeklyAverage, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::LastNightAverage, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::LastNight5MinHigh, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::BaselineLowUpper, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::BaselineBalancedLower, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::BaselineBalancedUpper, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Status, base_type: FitBaseType::ENUM, profile_type: ProfileType::HrvStatus, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::HRV_VALUE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Value, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 128.0, units: Unit::Millisecond, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::RAW_BBI => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::TimestampMs, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, units: Unit::Millisecond, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Data, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, components: &[
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 2 /* time */, scale: 1.0, offset: 0.0, accumulate: false, bits: 14 },
                    Component { field_num: 3 /* quality */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 },
                    Component { field_num: 4 /* gap */, scale: 1.0, offset: 0.0, accumulate: false, bits: 1 }
                ], ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Time, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, array: true /* [N] */, units: Unit::Millisecond, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::Quality, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Gap, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, array: true /* [N] */, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::RESPIRATION_RATE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::RespirationRate, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, scale: 100.0, units: Unit::BreathsPerMinute, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CHRONO_SHOT_SESSION => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::MinSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::MaxSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AvgSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::ShotCount, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::ProjectileType, base_type: FitBaseType::ENUM, profile_type: ProfileType::ProjectileType, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::GrainWeight, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 10.0, units: Unit::Gram, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::StandardDeviation, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::CHRONO_SHOT_DATA => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::ShotSpeed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 1000.0, units: Unit::MetersPerSeconds, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::ShotNum, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TANK_UPDATE => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Sensor, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::AntChannelId, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::Pressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Bar, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::TANK_SUMMARY => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Sensor, base_type: FitBaseType::UINT32Z, profile_type: ProfileType::AntChannelId, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::StartPressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Bar, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::EndPressure, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, units: Unit::Bar, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::VolumeUsed, base_type: FitBaseType::UINT32, profile_type: ProfileType::Uint32, scale: 100.0, units: Unit::Liter, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SLEEP_ASSESSMENT => { match field_num {
            0 => Some(FieldReference { name: Name::CombinedAwakeScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::AwakeTimeScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::AwakeningsCountScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::DeepSleepScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::SleepDurationScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::LightSleepScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::OverallSleepScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::SleepQualityScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            8 => Some(FieldReference { name: Name::SleepRecoveryScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            9 => Some(FieldReference { name: Name::RemSleepScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            10 => Some(FieldReference { name: Name::SleepRestlessnessScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            11 => Some(FieldReference { name: Name::AwakeningsCount, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            14 => Some(FieldReference { name: Name::InterruptionsScore, base_type: FitBaseType::UINT8, profile_type: ProfileType::Uint8, ..FR_DEF }),
            15 => Some(FieldReference { name: Name::AverageStressDuringSleep, base_type: FitBaseType::UINT16, profile_type: ProfileType::Uint16, scale: 100.0, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SLEEP_DISRUPTION_SEVERITY_PERIOD => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Severity, base_type: FitBaseType::ENUM, profile_type: ProfileType::SleepDisruptionSeverity, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SLEEP_DISRUPTION_OVERNIGHT_SEVERITY => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::Severity, base_type: FitBaseType::ENUM, profile_type: ProfileType::SleepDisruptionSeverity, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::NAP_EVENT => { match field_num {
            254 => Some(FieldReference { name: Name::MessageIndex, base_type: FitBaseType::UINT16, profile_type: ProfileType::MessageIndex, ..FR_DEF }),
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::StartTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::StartTimezoneOffset, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, units: Unit::Minute, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::EndTime, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, units: Unit::Second, ..FR_DEF }),
            3 => Some(FieldReference { name: Name::EndTimezoneOffset, base_type: FitBaseType::SINT16, profile_type: ProfileType::Sint16, units: Unit::Minute, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::Feedback, base_type: FitBaseType::ENUM, profile_type: ProfileType::NapPeriodFeedback, ..FR_DEF }),
            5 => Some(FieldReference { name: Name::IsDeleted, base_type: FitBaseType::ENUM, profile_type: ProfileType::Bool, ..FR_DEF }),
            6 => Some(FieldReference { name: Name::Source, base_type: FitBaseType::ENUM, profile_type: ProfileType::NapSource, ..FR_DEF }),
            7 => Some(FieldReference { name: Name::UpdateTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
           _ => None,
        }},
        MesgNum::SKIN_TEMP_OVERNIGHT => { match field_num {
            253 => Some(FieldReference { name: Name::Timestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::DateTime, ..FR_DEF }),
            0 => Some(FieldReference { name: Name::LocalTimestamp, base_type: FitBaseType::UINT32, profile_type: ProfileType::LocalDateTime, ..FR_DEF }),
            1 => Some(FieldReference { name: Name::AverageDeviation, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            2 => Some(FieldReference { name: Name::Average7DayDeviation, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
            4 => Some(FieldReference { name: Name::NightlyValue, base_type: FitBaseType::FLOAT32, profile_type: ProfileType::Float32, ..FR_DEF }),
           _ => None,
        }},
        _ => None
    }
}

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Name {
    /// "absolute_pressure"
    AbsolutePressure,
    /// "accel_cal_factor"
    AccelCalFactor,
    /// "accel_lateral"
    AccelLateral,
    /// "accel_normal"
    AccelNormal,
    /// "accel_x"
    AccelX,
    /// "accel_y"
    AccelY,
    /// "accel_z"
    AccelZ,
    /// "accumulate"
    Accumulate,
    /// "accumulated_power"
    AccumulatedPower,
    /// "active_calories"
    ActiveCalories,
    /// "active_met"
    ActiveMet,
    /// "active_time"
    ActiveTime,
    /// "active_time_16"
    ActiveTime16,
    /// "active_time_zone"
    ActiveTimeZone,
    /// "activity_class"
    ActivityClass,
    /// "activity_id"
    ActivityId,
    /// "activity_id_string"
    ActivityIdString,
    /// "activity_level"
    ActivityLevel,
    /// "activity_subtype"
    ActivitySubtype,
    /// "activity_time"
    ActivityTime,
    /// "activity_tracker_enabled"
    ActivityTrackerEnabled,
    /// "activity_type"
    ActivityType,
    /// "age"
    Age,
    /// "air_time_remaining"
    AirTimeRemaining,
    /// "alarm_type"
    AlarmType,
    /// "altitude"
    Altitude,
    /// "analog_layout"
    AnalogLayout,
    /// "ant_device_number"
    AntDeviceNumber,
    /// "ant_device_type"
    AntDeviceType,
    /// "ant_enabled"
    AntEnabled,
    /// "ant_network"
    AntNetwork,
    /// "ant_transmission_type"
    AntTransmissionType,
    /// "antplus_device_type"
    AntplusDeviceType,
    /// "apnea_countdown_enabled"
    ApneaCountdownEnabled,
    /// "apnea_countdown_time"
    ApneaCountdownTime,
    /// "application_id"
    ApplicationId,
    /// "application_version"
    ApplicationVersion,
    /// "array"
    Array,
    /// "ascent"
    Ascent,
    /// "ascent_rate"
    AscentRate,
    /// "ascent_time"
    AscentTime,
    /// "attitude_stage_complete"
    AttitudeStageComplete,
    /// "auto_activity_detect"
    AutoActivityDetect,
    /// "auto_activity_detect_duration"
    AutoActivityDetectDuration,
    /// "auto_activity_detect_start_timestamp"
    AutoActivityDetectStartTimestamp,
    /// "auto_activity_upload_enabled"
    AutoActivityUploadEnabled,
    /// "auto_power_zero"
    AutoPowerZero,
    /// "auto_sync_frequency"
    AutoSyncFrequency,
    /// "auto_wheel_cal"
    AutoWheelCal,
    /// "auto_wheelsize"
    AutoWheelsize,
    /// "autosync_min_steps"
    AutosyncMinSteps,
    /// "autosync_min_time"
    AutosyncMinTime,
    /// "average_7_day_deviation"
    Average7DayDeviation,
    /// "average_deviation"
    AverageDeviation,
    /// "average_stress_during_sleep"
    AverageStressDuringSleep,
    /// "avg_altitude"
    AvgAltitude,
    /// "avg_ascent_rate"
    AvgAscentRate,
    /// "avg_ball_speed"
    AvgBallSpeed,
    /// "avg_cadence"
    AvgCadence,
    /// "avg_cadence_position"
    AvgCadencePosition,
    /// "avg_combined_pedal_smoothness"
    AvgCombinedPedalSmoothness,
    /// "avg_core_temperature"
    AvgCoreTemperature,
    /// "avg_depth"
    AvgDepth,
    /// "avg_descent_rate"
    AvgDescentRate,
    /// "avg_flow"
    AvgFlow,
    /// "avg_fractional_cadence"
    AvgFractionalCadence,
    /// "avg_grade"
    AvgGrade,
    /// "avg_grit"
    AvgGrit,
    /// "avg_heart_rate"
    AvgHeartRate,
    /// "avg_lap_time"
    AvgLapTime,
    /// "avg_left_pco"
    AvgLeftPco,
    /// "avg_left_pedal_smoothness"
    AvgLeftPedalSmoothness,
    /// "avg_left_power_phase"
    AvgLeftPowerPhase,
    /// "avg_left_power_phase_peak"
    AvgLeftPowerPhasePeak,
    /// "avg_left_torque_effectiveness"
    AvgLeftTorqueEffectiveness,
    /// "avg_lev_motor_power"
    AvgLevMotorPower,
    /// "avg_neg_grade"
    AvgNegGrade,
    /// "avg_neg_vertical_speed"
    AvgNegVerticalSpeed,
    /// "avg_pos_grade"
    AvgPosGrade,
    /// "avg_pos_vertical_speed"
    AvgPosVerticalSpeed,
    /// "avg_power"
    AvgPower,
    /// "avg_power_position"
    AvgPowerPosition,
    /// "avg_pressure_sac"
    AvgPressureSac,
    /// "avg_respiration_rate"
    AvgRespirationRate,
    /// "avg_right_pco"
    AvgRightPco,
    /// "avg_right_pedal_smoothness"
    AvgRightPedalSmoothness,
    /// "avg_right_power_phase"
    AvgRightPowerPhase,
    /// "avg_right_power_phase_peak"
    AvgRightPowerPhasePeak,
    /// "avg_right_torque_effectiveness"
    AvgRightTorqueEffectiveness,
    /// "avg_rmv"
    AvgRmv,
    /// "avg_running_cadence"
    AvgRunningCadence,
    /// "avg_saturated_hemoglobin_percent"
    AvgSaturatedHemoglobinPercent,
    /// "avg_speed"
    AvgSpeed,
    /// "avg_spo2"
    AvgSpo2,
    /// "avg_stance_time"
    AvgStanceTime,
    /// "avg_stance_time_balance"
    AvgStanceTimeBalance,
    /// "avg_stance_time_percent"
    AvgStanceTimePercent,
    /// "avg_step_length"
    AvgStepLength,
    /// "avg_stress"
    AvgStress,
    /// "avg_stroke_count"
    AvgStrokeCount,
    /// "avg_stroke_distance"
    AvgStrokeDistance,
    /// "avg_swimming_cadence"
    AvgSwimmingCadence,
    /// "avg_temperature"
    AvgTemperature,
    /// "avg_total_hemoglobin_conc"
    AvgTotalHemoglobinConc,
    /// "avg_vam"
    AvgVam,
    /// "avg_vert_speed"
    AvgVertSpeed,
    /// "avg_vertical_oscillation"
    AvgVerticalOscillation,
    /// "avg_vertical_ratio"
    AvgVerticalRatio,
    /// "avg_volume_sac"
    AvgVolumeSac,
    /// "awake_time_score"
    AwakeTimeScore,
    /// "awakenings_count"
    AwakeningsCount,
    /// "awakenings_count_score"
    AwakeningsCountScore,
    /// "backlight_brightness"
    BacklightBrightness,
    /// "backlight_mode"
    BacklightMode,
    /// "backlight_timeout"
    BacklightTimeout,
    /// "ball_speed"
    BallSpeed,
    /// "baro_cal_factor"
    BaroCalFactor,
    /// "baro_pres"
    BaroPres,
    /// "basal_met"
    BasalMet,
    /// "baseline_balanced_lower"
    BaselineBalancedLower,
    /// "baseline_balanced_upper"
    BaselineBalancedUpper,
    /// "baseline_low_upper"
    BaselineLowUpper,
    /// "battery_identifier"
    BatteryIdentifier,
    /// "battery_level"
    BatteryLevel,
    /// "battery_soc"
    BatterySoc,
    /// "battery_status"
    BatteryStatus,
    /// "battery_voltage"
    BatteryVoltage,
    /// "best_lap_index"
    BestLapIndex,
    /// "bike_cad_ant_id"
    BikeCadAntId,
    /// "bike_cad_ant_id_trans_type"
    BikeCadAntIdTransType,
    /// "bike_power_ant_id"
    BikePowerAntId,
    /// "bike_power_ant_id_trans_type"
    BikePowerAntIdTransType,
    /// "bike_spd_ant_id"
    BikeSpdAntId,
    /// "bike_spd_ant_id_trans_type"
    BikeSpdAntIdTransType,
    /// "bike_spdcad_ant_id"
    BikeSpdcadAntId,
    /// "bike_spdcad_ant_id_trans_type"
    BikeSpdcadAntIdTransType,
    /// "bike_weight"
    BikeWeight,
    /// "bits"
    Bits,
    /// "ble_auto_upload_enabled"
    BleAutoUploadEnabled,
    /// "ble_device_type"
    BleDeviceType,
    /// "bluetooth_enabled"
    BluetoothEnabled,
    /// "bluetooth_le_enabled"
    BluetoothLeEnabled,
    /// "bmi"
    Bmi,
    /// "bone_mass"
    BoneMass,
    /// "bottom_depth"
    BottomDepth,
    /// "bottom_time"
    BottomTime,
    /// "cad_enabled"
    CadEnabled,
    /// "cad_high_alert"
    CadHighAlert,
    /// "cad_low_alert"
    CadLowAlert,
    /// "cadence"
    Cadence,
    /// "cadence256"
    Cadence256,
    /// "cadence_zone_high_boundary"
    CadenceZoneHighBoundary,
    /// "calibrated_accel_x"
    CalibratedAccelX,
    /// "calibrated_accel_y"
    CalibratedAccelY,
    /// "calibrated_accel_z"
    CalibratedAccelZ,
    /// "calibrated_data"
    CalibratedData,
    /// "calibrated_gyro_x"
    CalibratedGyroX,
    /// "calibrated_gyro_y"
    CalibratedGyroY,
    /// "calibrated_gyro_z"
    CalibratedGyroZ,
    /// "calibrated_mag_x"
    CalibratedMagX,
    /// "calibrated_mag_y"
    CalibratedMagY,
    /// "calibrated_mag_z"
    CalibratedMagZ,
    /// "calibration_divisor"
    CalibrationDivisor,
    /// "calibration_factor"
    CalibrationFactor,
    /// "calorie_duration_alert"
    CalorieDurationAlert,
    /// "calories"
    Calories,
    /// "camera_event_type"
    CameraEventType,
    /// "camera_file_uuid"
    CameraFileUuid,
    /// "camera_orientation"
    CameraOrientation,
    /// "capabilities"
    Capabilities,
    /// "category"
    Category,
    /// "category_subtype"
    CategorySubtype,
    /// "ccr_high_setpoint"
    CcrHighSetpoint,
    /// "ccr_high_setpoint_depth"
    CcrHighSetpointDepth,
    /// "ccr_high_setpoint_switch_mode"
    CcrHighSetpointSwitchMode,
    /// "ccr_low_setpoint"
    CcrLowSetpoint,
    /// "ccr_low_setpoint_depth"
    CcrLowSetpointDepth,
    /// "ccr_low_setpoint_switch_mode"
    CcrLowSetpointSwitchMode,
    /// "channel_number"
    ChannelNumber,
    /// "charged"
    Charged,
    /// "climb_category"
    ClimbCategory,
    /// "climb_number"
    ClimbNumber,
    /// "climb_pro_event"
    ClimbProEvent,
    /// "clip_end"
    ClipEnd,
    /// "clip_number"
    ClipNumber,
    /// "clip_start"
    ClipStart,
    /// "clock_time"
    ClockTime,
    /// "cns_load"
    CnsLoad,
    /// "combined_awake_score"
    CombinedAwakeScore,
    /// "combined_pedal_smoothness"
    CombinedPedalSmoothness,
    /// "comm_timeout"
    CommTimeout,
    /// "completed"
    Completed,
    /// "components"
    Components,
    /// "compressed_accumulated_power"
    CompressedAccumulatedPower,
    /// "compressed_calibrated_accel_x"
    CompressedCalibratedAccelX,
    /// "compressed_calibrated_accel_y"
    CompressedCalibratedAccelY,
    /// "compressed_calibrated_accel_z"
    CompressedCalibratedAccelZ,
    /// "compressed_speed_distance"
    CompressedSpeedDistance,
    /// "concept_count"
    ConceptCount,
    /// "concept_field"
    ConceptField,
    /// "concept_index"
    ConceptIndex,
    /// "concept_key"
    ConceptKey,
    /// "condition"
    Condition,
    /// "confidence"
    Confidence,
    /// "connectivity_supported"
    ConnectivitySupported,
    /// "core_temperature"
    CoreTemperature,
    /// "count"
    Count,
    /// "count_type"
    CountType,
    /// "course_download_enabled"
    CourseDownloadEnabled,
    /// "course_point_index"
    CoursePointIndex,
    /// "crank_length"
    CrankLength,
    /// "cum_operating_time"
    CumOperatingTime,
    /// "current_activity_type_intensity"
    CurrentActivityTypeIntensity,
    /// "current_day_resting_heart_rate"
    CurrentDayRestingHeartRate,
    /// "current_dist"
    CurrentDist,
    /// "current_stress"
    CurrentStress,
    /// "custom_target_cadence_high"
    CustomTargetCadenceHigh,
    /// "custom_target_cadence_low"
    CustomTargetCadenceLow,
    /// "custom_target_heart_rate_high"
    CustomTargetHeartRateHigh,
    /// "custom_target_heart_rate_low"
    CustomTargetHeartRateLow,
    /// "custom_target_power_high"
    CustomTargetPowerHigh,
    /// "custom_target_power_low"
    CustomTargetPowerLow,
    /// "custom_target_speed_high"
    CustomTargetSpeedHigh,
    /// "custom_target_speed_low"
    CustomTargetSpeedLow,
    /// "custom_target_value_high"
    CustomTargetValueHigh,
    /// "custom_target_value_low"
    CustomTargetValueLow,
    /// "custom_wheelsize"
    CustomWheelsize,
    /// "cycle_length"
    CycleLength,
    /// "cycle_length16"
    CycleLength16,
    /// "cycles"
    Cycles,
    /// "cycles_16"
    Cycles16,
    /// "cycles_to_calories"
    CyclesToCalories,
    /// "cycles_to_distance"
    CyclesToDistance,
    /// "data"
    Data,
    /// "data16"
    Data16,
    /// "data_page"
    DataPage,
    /// "data_size"
    DataSize,
    /// "data_units"
    DataUnits,
    /// "date_mode"
    DateMode,
    /// "day_of_week"
    DayOfWeek,
    /// "deep_sleep_score"
    DeepSleepScore,
    /// "default_max_biking_heart_rate"
    DefaultMaxBikingHeartRate,
    /// "default_max_heart_rate"
    DefaultMaxHeartRate,
    /// "default_max_running_heart_rate"
    DefaultMaxRunningHeartRate,
    /// "default_page"
    DefaultPage,
    /// "default_race_leader"
    DefaultRaceLeader,
    /// "delete_status"
    DeleteStatus,
    /// "depth"
    Depth,
    /// "depth_setting"
    DepthSetting,
    /// "descent"
    Descent,
    /// "descent_time"
    DescentTime,
    /// "descriptor"
    Descriptor,
    /// "developer_data_index"
    DeveloperDataIndex,
    /// "developer_id"
    DeveloperId,
    /// "device_id"
    DeviceId,
    /// "device_index"
    DeviceIndex,
    /// "device_number"
    DeviceNumber,
    /// "device_type"
    DeviceType,
    /// "diastolic_pressure"
    DiastolicPressure,
    /// "digital_layout"
    DigitalLayout,
    /// "directory"
    Directory,
    /// "display_orientation"
    DisplayOrientation,
    /// "display_type"
    DisplayType,
    /// "dist_setting"
    DistSetting,
    /// "distance"
    Distance,
    /// "distance_16"
    Distance16,
    /// "distance_duration_alert"
    DistanceDurationAlert,
    /// "dive_alert"
    DiveAlert,
    /// "dive_count"
    DiveCount,
    /// "dive_number"
    DiveNumber,
    /// "dive_sounds"
    DiveSounds,
    /// "dive_types"
    DiveTypes,
    /// "duration"
    Duration,
    /// "duration_calories"
    DurationCalories,
    /// "duration_distance"
    DurationDistance,
    /// "duration_hr"
    DurationHr,
    /// "duration_min"
    DurationMin,
    /// "duration_power"
    DurationPower,
    /// "duration_reps"
    DurationReps,
    /// "duration_step"
    DurationStep,
    /// "duration_time"
    DurationTime,
    /// "duration_type"
    DurationType,
    /// "duration_value"
    DurationValue,
    /// "ebike_assist_level_percent"
    EbikeAssistLevelPercent,
    /// "ebike_assist_mode"
    EbikeAssistMode,
    /// "ebike_battery_level"
    EbikeBatteryLevel,
    /// "ebike_travel_range"
    EbikeTravelRange,
    /// "elapsed_time"
    ElapsedTime,
    /// "elev_setting"
    ElevSetting,

    Empty,
    /// "enabled"
    Enabled,
    /// "end_cns"
    EndCns,
    /// "end_date"
    EndDate,
    /// "end_n2"
    EndN2,
    /// "end_position_lat"
    EndPositionLat,
    /// "end_position_long"
    EndPositionLong,
    /// "end_pressure"
    EndPressure,
    /// "end_time"
    EndTime,
    /// "end_timestamp"
    EndTimestamp,
    /// "end_timestamp_ms"
    EndTimestampMs,
    /// "end_timezone_offset"
    EndTimezoneOffset,
    /// "energy_total"
    EnergyTotal,
    /// "enhanced_altitude"
    EnhancedAltitude,
    /// "enhanced_avg_altitude"
    EnhancedAvgAltitude,
    /// "enhanced_avg_respiration_rate"
    EnhancedAvgRespirationRate,
    /// "enhanced_avg_speed"
    EnhancedAvgSpeed,
    /// "enhanced_max_altitude"
    EnhancedMaxAltitude,
    /// "enhanced_max_respiration_rate"
    EnhancedMaxRespirationRate,
    /// "enhanced_max_speed"
    EnhancedMaxSpeed,
    /// "enhanced_min_altitude"
    EnhancedMinAltitude,
    /// "enhanced_min_respiration_rate"
    EnhancedMinRespirationRate,
    /// "enhanced_respiration_rate"
    EnhancedRespirationRate,
    /// "enhanced_speed"
    EnhancedSpeed,
    /// "equipment"
    Equipment,
    /// "event"
    Event,
    /// "event_group"
    EventGroup,
    /// "event_id"
    EventId,
    /// "event_timestamp"
    EventTimestamp,
    /// "event_timestamp_12"
    EventTimestamp12,
    /// "event_type"
    EventType,
    /// "exercise_category"
    ExerciseCategory,
    /// "exercise_name"
    ExerciseName,
    /// "exercise_weight"
    ExerciseWeight,
    /// "expire_time"
    ExpireTime,
    /// "fat_calories"
    FatCalories,
    /// "favero_product"
    FaveroProduct,
    /// "favorite"
    Favorite,
    /// "feedback"
    Feedback,
    /// "field_count"
    FieldCount,
    /// "field_definition_number"
    FieldDefinitionNumber,
    /// "field_id"
    FieldId,
    /// "field_name"
    FieldName,
    /// "field_num"
    FieldNum,
    /// "file"
    File,
    /// "file_uuid"
    FileUuid,
    /// "filtered_bpm"
    FilteredBpm,
    /// "first_lap_index"
    FirstLapIndex,
    /// "first_length_index"
    FirstLengthIndex,
    /// "first_step_index"
    FirstStepIndex,
    /// "fit_base_type_id"
    FitBaseTypeId,
    /// "fit_base_unit_id"
    FitBaseUnitId,
    /// "fitness_equipment_state"
    FitnessEquipmentState,
    /// "flags"
    Flags,
    /// "flow"
    Flow,
    /// "fractional_cadence"
    FractionalCadence,
    /// "fractional_system_timestamp"
    FractionalSystemTimestamp,
    /// "fractional_timestamp"
    FractionalTimestamp,
    /// "frame_number"
    FrameNumber,
    /// "friendly_name"
    FriendlyName,
    /// "front_gear"
    FrontGear,
    /// "front_gear_num"
    FrontGearNum,
    /// "front_gear_shift_count"
    FrontGearShiftCount,
    /// "functional_threshold_power"
    FunctionalThresholdPower,
    /// "gap"
    Gap,
    /// "garmin_product"
    GarminProduct,
    /// "gas_consumption_display"
    GasConsumptionDisplay,
    /// "gear_change_data"
    GearChangeData,
    /// "gender"
    Gender,
    /// "gf_high"
    GfHigh,
    /// "gf_low"
    GfLow,
    /// "global_id"
    GlobalId,
    /// "gps_accuracy"
    GpsAccuracy,
    /// "gps_ephemeris_download_enabled"
    GpsEphemerisDownloadEnabled,
    /// "grade"
    Grade,
    /// "grain_weight"
    GrainWeight,
    /// "grit"
    Grit,
    /// "group_primary_key"
    GroupPrimaryKey,
    /// "grouptrack_enabled"
    GrouptrackEnabled,
    /// "gyro_cal_factor"
    GyroCalFactor,
    /// "gyro_x"
    GyroX,
    /// "gyro_y"
    GyroY,
    /// "gyro_z"
    GyroZ,
    /// "hang_time"
    HangTime,
    /// "hardware_version"
    HardwareVersion,
    /// "heading"
    Heading,
    /// "heart_rate"
    HeartRate,
    /// "heart_rate_antplus_device_type"
    HeartRateAntplusDeviceType,
    /// "heart_rate_local_device_type"
    HeartRateLocalDeviceType,
    /// "heart_rate_source"
    HeartRateSource,
    /// "heart_rate_source_type"
    HeartRateSourceType,
    /// "heart_rate_type"
    HeartRateType,
    /// "height"
    Height,
    /// "height_setting"
    HeightSetting,
    /// "helium_content"
    HeliumContent,
    /// "high_bpm"
    HighBpm,
    /// "high_temperature"
    HighTemperature,
    /// "high_value"
    HighValue,
    /// "hosting_provider"
    HostingProvider,
    /// "hr_calc_type"
    HrCalcType,
    /// "hr_high_alert"
    HrHighAlert,
    /// "hr_low_alert"
    HrLowAlert,
    /// "hr_setting"
    HrSetting,
    /// "hr_source"
    HrSource,
    /// "hr_zone_high_boundary"
    HrZoneHighBoundary,
    /// "hrm_ant_id"
    HrmAntId,
    /// "hrm_ant_id_trans_type"
    HrmAntIdTransType,
    /// "id"
    Id,
    /// "incident_detection_enabled"
    IncidentDetectionEnabled,
    /// "instance"
    Instance,
    /// "intensity"
    Intensity,
    /// "intensity_factor"
    IntensityFactor,
    /// "interruptions_score"
    InterruptionsScore,
    /// "is_deleted"
    IsDeleted,
    /// "is_signed"
    IsSigned,
    /// "issue_time"
    IssueTime,
    /// "jump_count"
    JumpCount,
    /// "lactate_threshold_autodetect_enabled"
    LactateThresholdAutodetectEnabled,
    /// "language"
    Language,
    /// "languages"
    Languages,
    /// "lap_trigger"
    LapTrigger,
    /// "last_night_5_min_high"
    LastNight5MinHigh,
    /// "last_night_average"
    LastNightAverage,
    /// "last_stop_multiple"
    LastStopMultiple,
    /// "layout"
    Layout,
    /// "leader_activity_id"
    LeaderActivityId,
    /// "leader_activity_id_string"
    LeaderActivityIdString,
    /// "leader_group_primary_key"
    LeaderGroupPrimaryKey,
    /// "leader_time"
    LeaderTime,
    /// "leader_type"
    LeaderType,
    /// "left_pco"
    LeftPco,
    /// "left_pedal_smoothness"
    LeftPedalSmoothness,
    /// "left_power_phase"
    LeftPowerPhase,
    /// "left_power_phase_peak"
    LeftPowerPhasePeak,
    /// "left_right_balance"
    LeftRightBalance,
    /// "left_torque_effectiveness"
    LeftTorqueEffectiveness,
    /// "length_type"
    LengthType,
    /// "lev_battery_consumption"
    LevBatteryConsumption,
    /// "level"
    Level,
    /// "level_shift"
    LevelShift,
    /// "light_sleep_score"
    LightSleepScore,
    /// "live_tracking_enabled"
    LiveTrackingEnabled,
    /// "local_device_type"
    LocalDeviceType,
    /// "local_id"
    LocalId,
    /// "local_timestamp"
    LocalTimestamp,
    /// "location"
    Location,
    /// "log_hrv"
    LogHrv,
    /// "low_temperature"
    LowTemperature,
    /// "mag_x"
    MagX,
    /// "mag_y"
    MagY,
    /// "mag_z"
    MagZ,
    /// "manufacturer"
    Manufacturer,
    /// "manufacturer_id"
    ManufacturerId,
    /// "map_3_sample_mean"
    Map3SampleMean,
    /// "map_evening_values"
    MapEveningValues,
    /// "map_morning_values"
    MapMorningValues,
    /// "max_altitude"
    MaxAltitude,
    /// "max_ascent_rate"
    MaxAscentRate,
    /// "max_ball_speed"
    MaxBallSpeed,
    /// "max_cadence"
    MaxCadence,
    /// "max_cadence_position"
    MaxCadencePosition,
    /// "max_core_temperature"
    MaxCoreTemperature,
    /// "max_count"
    MaxCount,
    /// "max_depth"
    MaxDepth,
    /// "max_descent_rate"
    MaxDescentRate,
    /// "max_fractional_cadence"
    MaxFractionalCadence,
    /// "max_heart_rate"
    MaxHeartRate,
    /// "max_lev_motor_power"
    MaxLevMotorPower,
    /// "max_met_category"
    MaxMetCategory,
    /// "max_neg_grade"
    MaxNegGrade,
    /// "max_neg_vertical_speed"
    MaxNegVerticalSpeed,
    /// "max_per_file"
    MaxPerFile,
    /// "max_per_file_type"
    MaxPerFileType,
    /// "max_pos_grade"
    MaxPosGrade,
    /// "max_pos_vertical_speed"
    MaxPosVerticalSpeed,
    /// "max_power"
    MaxPower,
    /// "max_power_position"
    MaxPowerPosition,
    /// "max_respiration_rate"
    MaxRespirationRate,
    /// "max_running_cadence"
    MaxRunningCadence,
    /// "max_saturated_hemoglobin_percent"
    MaxSaturatedHemoglobinPercent,
    /// "max_size"
    MaxSize,
    /// "max_speed"
    MaxSpeed,
    /// "max_temperature"
    MaxTemperature,
    /// "max_total_hemoglobin_conc"
    MaxTotalHemoglobinConc,
    /// "mean_arterial_pressure"
    MeanArterialPressure,
    /// "memo"
    Memo,
    /// "mesg_data"
    MesgData,
    /// "mesg_id"
    MesgId,
    /// "mesg_num"
    MesgNum,
    /// "message_count"
    MessageCount,
    /// "message_index"
    MessageIndex,
    /// "metabolic_age"
    MetabolicAge,
    /// "metabolic_calories"
    MetabolicCalories,
    /// "min_altitude"
    MinAltitude,
    /// "min_core_temperature"
    MinCoreTemperature,
    /// "min_heart_rate"
    MinHeartRate,
    /// "min_respiration_rate"
    MinRespirationRate,
    /// "min_saturated_hemoglobin_percent"
    MinSaturatedHemoglobinPercent,
    /// "min_speed"
    MinSpeed,
    /// "min_temperature"
    MinTemperature,
    /// "min_total_hemoglobin_conc"
    MinTotalHemoglobinConc,
    /// "mode"
    Mode,
    /// "model"
    Model,
    /// "moderate_activity_minutes"
    ModerateActivityMinutes,
    /// "motor_power"
    MotorPower,
    /// "mounting_side"
    MountingSide,
    /// "move_alert_enabled"
    MoveAlertEnabled,
    /// "muscle_mass"
    MuscleMass,
    /// "n2_load"
    N2Load,
    /// "name"
    Name,
    /// "native_field_num"
    NativeFieldNum,
    /// "native_mesg_num"
    NativeMesgNum,
    /// "ndl_time"
    NdlTime,
    /// "nec_lat"
    NecLat,
    /// "nec_long"
    NecLong,
    /// "next_stop_depth"
    NextStopDepth,
    /// "next_stop_time"
    NextStopTime,
    /// "nightly_value"
    NightlyValue,
    /// "no_fly_time_mode"
    NoFlyTimeMode,
    /// "normalized_power"
    NormalizedPower,
    /// "notes"
    Notes,
    /// "num_active_lengths"
    NumActiveLengths,
    /// "num_laps"
    NumLaps,
    /// "num_lengths"
    NumLengths,
    /// "num_per_file"
    NumPerFile,
    /// "num_sessions"
    NumSessions,
    /// "num_splits"
    NumSplits,
    /// "num_valid_steps"
    NumValidSteps,
    /// "number"
    Number,
    /// "number_of_screens"
    NumberOfScreens,
    /// "o2_toxicity"
    O2Toxicity,
    /// "observed_at_time"
    ObservedAtTime,
    /// "observed_location_lat"
    ObservedLocationLat,
    /// "observed_location_long"
    ObservedLocationLong,
    /// "odometer"
    Odometer,
    /// "odometer_rollover"
    OdometerRollover,
    /// "offset"
    Offset,
    /// "offset_cal"
    OffsetCal,
    /// "opponent_name"
    OpponentName,
    /// "opponent_score"
    OpponentScore,
    /// "orientation_matrix"
    OrientationMatrix,
    /// "overall_sleep_score"
    OverallSleepScore,
    /// "oxygen_content"
    OxygenContent,
    /// "pages_enabled"
    PagesEnabled,
    /// "parent_index"
    ParentIndex,
    /// "part_index"
    PartIndex,
    /// "part_number"
    PartNumber,
    /// "percent_fat"
    PercentFat,
    /// "percent_hydration"
    PercentHydration,
    /// "physique_rating"
    PhysiqueRating,
    /// "pid"
    Pid,
    /// "pid_data_size"
    PidDataSize,
    /// "pitch"
    Pitch,
    /// "player_score"
    PlayerScore,
    /// "po2"
    Po2,
    /// "po2_critical"
    Po2Critical,
    /// "po2_deco"
    Po2Deco,
    /// "po2_warn"
    Po2Warn,
    /// "pool_length"
    PoolLength,
    /// "pool_length_unit"
    PoolLengthUnit,
    /// "popup_enabled"
    PopupEnabled,
    /// "position_lat"
    PositionLat,
    /// "position_long"
    PositionLong,
    /// "position_setting"
    PositionSetting,
    /// "power"
    Power,
    /// "power_cal_factor"
    PowerCalFactor,
    /// "power_enabled"
    PowerEnabled,
    /// "power_high_alert"
    PowerHighAlert,
    /// "power_low_alert"
    PowerLowAlert,
    /// "power_setting"
    PowerSetting,
    /// "power_zone_high_boundary"
    PowerZoneHighBoundary,
    /// "precipitation_probability"
    PrecipitationProbability,
    /// "precise_target_speed"
    PreciseTargetSpeed,
    /// "pressure"
    Pressure,
    /// "pressure_sac"
    PressureSac,
    /// "processing_interval"
    ProcessingInterval,
    /// "product"
    Product,
    /// "product_name"
    ProductName,
    /// "projectile_type"
    ProjectileType,
    /// "pwr_calc_type"
    PwrCalcType,
    /// "qualifier"
    Qualifier,
    /// "quality"
    Quality,
    /// "radar_threat_alert"
    RadarThreatAlert,
    /// "radar_threat_avg_approach_speed"
    RadarThreatAvgApproachSpeed,
    /// "radar_threat_count"
    RadarThreatCount,
    /// "radar_threat_level_max"
    RadarThreatLevelMax,
    /// "radar_threat_max_approach_speed"
    RadarThreatMaxApproachSpeed,
    /// "raw_data"
    RawData,
    /// "reading_confidence"
    ReadingConfidence,
    /// "reading_spo2"
    ReadingSpo2,
    /// "rear_gear"
    RearGear,
    /// "rear_gear_num"
    RearGearNum,
    /// "rear_gear_shift_count"
    RearGearShiftCount,
    /// "recurrence"
    Recurrence,
    /// "recurrence_value"
    RecurrenceValue,
    /// "reference_index"
    ReferenceIndex,
    /// "reference_mesg"
    ReferenceMesg,
    /// "relative_humidity"
    RelativeHumidity,
    /// "rem_sleep_score"
    RemSleepScore,
    /// "repeat"
    Repeat,
    /// "repeat_calories"
    RepeatCalories,
    /// "repeat_distance"
    RepeatDistance,
    /// "repeat_dive_interval"
    RepeatDiveInterval,
    /// "repeat_hr"
    RepeatHr,
    /// "repeat_power"
    RepeatPower,
    /// "repeat_steps"
    RepeatSteps,
    /// "repeat_time"
    RepeatTime,
    /// "repeating"
    Repeating,
    /// "repetition_num"
    RepetitionNum,
    /// "repetitions"
    Repetitions,
    /// "report_id"
    ReportId,
    /// "resistance"
    Resistance,
    /// "respiration_rate"
    RespirationRate,
    /// "resting_heart_rate"
    RestingHeartRate,
    /// "resting_metabolic_rate"
    RestingMetabolicRate,
    /// "rider_position"
    RiderPosition,
    /// "right_pco"
    RightPco,
    /// "right_pedal_smoothness"
    RightPedalSmoothness,
    /// "right_power_phase"
    RightPowerPhase,
    /// "right_power_phase_peak"
    RightPowerPhasePeak,
    /// "right_torque_effectiveness"
    RightTorqueEffectiveness,
    /// "rmssd_hrv"
    RmssdHrv,
    /// "rmv"
    Rmv,
    /// "roll"
    Roll,
    /// "rotations"
    Rotations,
    /// "safety_stop_enabled"
    SafetyStopEnabled,
    /// "safety_stop_time"
    SafetyStopTime,
    /// "sample_time_offset"
    SampleTimeOffset,
    /// "sampling_interval"
    SamplingInterval,
    /// "saturated_hemoglobin_percent"
    SaturatedHemoglobinPercent,
    /// "saturated_hemoglobin_percent_max"
    SaturatedHemoglobinPercentMax,
    /// "saturated_hemoglobin_percent_min"
    SaturatedHemoglobinPercentMin,
    /// "scale"
    Scale,
    /// "scaling"
    Scaling,
    /// "scheduled_time"
    ScheduledTime,
    /// "score"
    Score,
    /// "screen_enabled"
    ScreenEnabled,
    /// "screen_index"
    ScreenIndex,
    /// "sdm_ant_id"
    SdmAntId,
    /// "sdm_ant_id_trans_type"
    SdmAntIdTransType,
    /// "sdm_cal_factor"
    SdmCalFactor,
    /// "sdrr_hrv"
    SdrrHrv,
    /// "secondary_custom_target_cadence_high"
    SecondaryCustomTargetCadenceHigh,
    /// "secondary_custom_target_cadence_low"
    SecondaryCustomTargetCadenceLow,
    /// "secondary_custom_target_heart_rate_high"
    SecondaryCustomTargetHeartRateHigh,
    /// "secondary_custom_target_heart_rate_low"
    SecondaryCustomTargetHeartRateLow,
    /// "secondary_custom_target_power_high"
    SecondaryCustomTargetPowerHigh,
    /// "secondary_custom_target_power_low"
    SecondaryCustomTargetPowerLow,
    /// "secondary_custom_target_speed_high"
    SecondaryCustomTargetSpeedHigh,
    /// "secondary_custom_target_speed_low"
    SecondaryCustomTargetSpeedLow,
    /// "secondary_custom_target_value_high"
    SecondaryCustomTargetValueHigh,
    /// "secondary_custom_target_value_low"
    SecondaryCustomTargetValueLow,
    /// "secondary_target_cadence_zone"
    SecondaryTargetCadenceZone,
    /// "secondary_target_hr_zone"
    SecondaryTargetHrZone,
    /// "secondary_target_power_zone"
    SecondaryTargetPowerZone,
    /// "secondary_target_speed_zone"
    SecondaryTargetSpeedZone,
    /// "secondary_target_stroke_type"
    SecondaryTargetStrokeType,
    /// "secondary_target_type"
    SecondaryTargetType,
    /// "secondary_target_value"
    SecondaryTargetValue,
    /// "segment_time"
    SegmentTime,
    /// "selection_type"
    SelectionType,
    /// "sensor"
    Sensor,
    /// "sensor_position"
    SensorPosition,
    /// "sensor_type"
    SensorType,
    /// "sentence"
    Sentence,
    /// "serial_number"
    SerialNumber,
    /// "sessions"
    Sessions,
    /// "set_type"
    SetType,
    /// "severity"
    Severity,
    /// "shimano_di2_enabled"
    ShimanoDi2Enabled,
    /// "shot_count"
    ShotCount,
    /// "shot_num"
    ShotNum,
    /// "shot_speed"
    ShotSpeed,
    /// "sleep_duration_score"
    SleepDurationScore,
    /// "sleep_level"
    SleepLevel,
    /// "sleep_quality_score"
    SleepQualityScore,
    /// "sleep_recovery_score"
    SleepRecoveryScore,
    /// "sleep_restlessness_score"
    SleepRestlessnessScore,
    /// "sleep_time"
    SleepTime,
    /// "smart_notification_display_orientation"
    SmartNotificationDisplayOrientation,
    /// "software_version"
    SoftwareVersion,
    /// "sound"
    Sound,
    /// "source"
    Source,
    /// "source_type"
    SourceType,
    /// "spd_enabled"
    SpdEnabled,
    /// "spdcad_enabled"
    SpdcadEnabled,
    /// "speed"
    Speed,
    /// "speed_1s"
    Speed1S,
    /// "speed_high_alert"
    SpeedHighAlert,
    /// "speed_low_alert"
    SpeedLowAlert,
    /// "speed_setting"
    SpeedSetting,
    /// "speed_source"
    SpeedSource,
    /// "speed_zone_high_boundary"
    SpeedZoneHighBoundary,
    /// "split_type"
    SplitType,
    /// "sport"
    Sport,
    /// "sport_event"
    SportEvent,
    /// "sport_index"
    SportIndex,
    /// "sport_point"
    SportPoint,
    /// "sport_profile_name"
    SportProfileName,
    /// "sports"
    Sports,
    /// "stage"
    Stage,
    /// "stance_time"
    StanceTime,
    /// "stance_time_balance"
    StanceTimeBalance,
    /// "stance_time_percent"
    StanceTimePercent,
    /// "stand_count"
    StandCount,
    /// "standard_deviation"
    StandardDeviation,
    /// "start_cns"
    StartCns,
    /// "start_date"
    StartDate,
    /// "start_elevation"
    StartElevation,
    /// "start_n2"
    StartN2,
    /// "start_position_lat"
    StartPositionLat,
    /// "start_position_long"
    StartPositionLong,
    /// "start_pressure"
    StartPressure,
    /// "start_time"
    StartTime,
    /// "start_timestamp"
    StartTimestamp,
    /// "start_timestamp_ms"
    StartTimestampMs,
    /// "start_timezone_offset"
    StartTimezoneOffset,
    /// "status"
    Status,
    /// "step_length"
    StepLength,
    /// "steps"
    Steps,
    /// "stress_level"
    StressLevel,
    /// "stress_level_time"
    StressLevelTime,
    /// "stress_level_value"
    StressLevelValue,
    /// "stroke_count"
    StrokeCount,
    /// "stroke_type"
    StrokeType,
    /// "strokes"
    Strokes,
    /// "sub_sport"
    SubSport,
    /// "surface_interval"
    SurfaceInterval,
    /// "swc_lat"
    SwcLat,
    /// "swc_long"
    SwcLong,
    /// "swim_stroke"
    SwimStroke,
    /// "system_time"
    SystemTime,
    /// "system_timestamp"
    SystemTimestamp,
    /// "system_timestamp_ms"
    SystemTimestampMs,
    /// "systolic_pressure"
    SystolicPressure,
    /// "tap_interface"
    TapInterface,
    /// "tap_sensitivity"
    TapSensitivity,
    /// "target_cadence_zone"
    TargetCadenceZone,
    /// "target_distance"
    TargetDistance,
    /// "target_hr_zone"
    TargetHrZone,
    /// "target_power_zone"
    TargetPowerZone,
    /// "target_speed"
    TargetSpeed,
    /// "target_speed_zone"
    TargetSpeedZone,
    /// "target_stroke_type"
    TargetStrokeType,
    /// "target_time"
    TargetTime,
    /// "target_type"
    TargetType,
    /// "target_value"
    TargetValue,
    /// "temperature"
    Temperature,
    /// "temperature_feels_like"
    TemperatureFeelsLike,
    /// "temperature_max"
    TemperatureMax,
    /// "temperature_min"
    TemperatureMin,
    /// "temperature_setting"
    TemperatureSetting,
    /// "text"
    Text,
    /// "threshold_heart_rate"
    ThresholdHeartRate,
    /// "threshold_power"
    ThresholdPower,
    /// "time"
    Time,
    /// "time128"
    Time128,
    /// "time256"
    Time256,
    /// "time_above_threshold"
    TimeAboveThreshold,
    /// "time_created"
    TimeCreated,
    /// "time_duration_alert"
    TimeDurationAlert,
    /// "time_from_course"
    TimeFromCourse,
    /// "time_in_cadence_zone"
    TimeInCadenceZone,
    /// "time_in_hr_zone"
    TimeInHrZone,
    /// "time_in_power_zone"
    TimeInPowerZone,
    /// "time_in_speed_zone"
    TimeInSpeedZone,
    /// "time_mode"
    TimeMode,
    /// "time_offset"
    TimeOffset,
    /// "time_standing"
    TimeStanding,
    /// "time_to_surface"
    TimeToSurface,
    /// "time_zone_offset"
    TimeZoneOffset,
    /// "timer_time"
    TimerTime,
    /// "timer_trigger"
    TimerTrigger,
    /// "timestamp"
    Timestamp,
    /// "timestamp_16"
    Timestamp16,
    /// "timestamp_32k"
    Timestamp32K,
    /// "timestamp_min_8"
    TimestampMin8,
    /// "timestamp_ms"
    TimestampMs,
    /// "title"
    Title,
    /// "total_anaerobic_training_effect"
    TotalAnaerobicTrainingEffect,
    /// "total_ascent"
    TotalAscent,
    /// "total_calories"
    TotalCalories,
    /// "total_cycles"
    TotalCycles,
    /// "total_descent"
    TotalDescent,
    /// "total_distance"
    TotalDistance,
    /// "total_elapsed_time"
    TotalElapsedTime,
    /// "total_fat_calories"
    TotalFatCalories,
    /// "total_flow"
    TotalFlow,
    /// "total_fractional_ascent"
    TotalFractionalAscent,
    /// "total_fractional_cycles"
    TotalFractionalCycles,
    /// "total_fractional_descent"
    TotalFractionalDescent,
    /// "total_grit"
    TotalGrit,
    /// "total_hemoglobin_conc"
    TotalHemoglobinConc,
    /// "total_hemoglobin_conc_max"
    TotalHemoglobinConcMax,
    /// "total_hemoglobin_conc_min"
    TotalHemoglobinConcMin,
    /// "total_moving_time"
    TotalMovingTime,
    /// "total_strides"
    TotalStrides,
    /// "total_strokes"
    TotalStrokes,
    /// "total_timer_time"
    TotalTimerTime,
    /// "total_training_effect"
    TotalTrainingEffect,
    /// "total_work"
    TotalWork,
    /// "track"
    Track,
    /// "training_load_peak"
    TrainingLoadPeak,
    /// "training_stress_score"
    TrainingStressScore,
    /// "transmission_type"
    TransmissionType,
    /// "travel_gas"
    TravelGas,
    /// "trigger"
    Trigger,
    /// "trigger_on_ascent"
    TriggerOnAscent,
    /// "trigger_on_descent"
    TriggerOnDescent,
    /// "turn_rate"
    TurnRate,
    /// "type"
    Type,
    /// "uncharged"
    Uncharged,
    /// "units"
    Units,
    /// "up_key_enabled"
    UpKeyEnabled,
    /// "update_time"
    UpdateTime,
    /// "update_timestamp"
    UpdateTimestamp,
    /// "url"
    Url,
    /// "user_profile_index"
    UserProfileIndex,
    /// "user_profile_primary_key"
    UserProfilePrimaryKey,
    /// "user_running_step_length"
    UserRunningStepLength,
    /// "user_walking_step_length"
    UserWalkingStepLength,
    /// "utc_offset"
    UtcOffset,
    /// "utc_timestamp"
    UtcTimestamp,
    /// "uuid"
    Uuid,
    /// "validity"
    Validity,
    /// "value"
    Value,
    /// "velocity"
    Velocity,
    /// "version"
    Version,
    /// "vertical_oscillation"
    VerticalOscillation,
    /// "vertical_ratio"
    VerticalRatio,
    /// "vertical_speed"
    VerticalSpeed,
    /// "vigorous_activity_minutes"
    VigorousActivityMinutes,
    /// "virtual_partner_speed"
    VirtualPartnerSpeed,
    /// "visceral_fat_mass"
    VisceralFatMass,
    /// "visceral_fat_rating"
    VisceralFatRating,
    /// "vo2_max"
    Vo2Max,
    /// "volume_sac"
    VolumeSac,
    /// "volume_used"
    VolumeUsed,
    /// "wake_time"
    WakeTime,
    /// "water_density"
    WaterDensity,
    /// "water_type"
    WaterType,
    /// "weather_alerts_enabled"
    WeatherAlertsEnabled,
    /// "weather_conditions_enabled"
    WeatherConditionsEnabled,
    /// "weather_report"
    WeatherReport,
    /// "weekly_average"
    WeeklyAverage,
    /// "weight"
    Weight,
    /// "weight_display_unit"
    WeightDisplayUnit,
    /// "weight_setting"
    WeightSetting,
    /// "wind_direction"
    WindDirection,
    /// "wind_speed"
    WindSpeed,
    /// "wkt_description"
    WktDescription,
    /// "wkt_name"
    WktName,
    /// "wkt_step_index"
    WktStepIndex,
    /// "wkt_step_name"
    WktStepName,
    /// "workout_download_enabled"
    WorkoutDownloadEnabled,
    /// "workout_feel"
    WorkoutFeel,
    /// "workout_rpe"
    WorkoutRpe,
    /// "workouts_supported"
    WorkoutsSupported,
    /// "zero_cross_cnt"
    ZeroCrossCnt,
    /// "zone"
    Zone,
    /// "zone_count"
    ZoneCount,
}

impl Name {
    pub fn as_str(self) -> &'static str {
        match self {
            Self::AbsolutePressure => "absolute_pressure",
            Self::AccelCalFactor => "accel_cal_factor",
            Self::AccelLateral => "accel_lateral",
            Self::AccelNormal => "accel_normal",
            Self::AccelX => "accel_x",
            Self::AccelY => "accel_y",
            Self::AccelZ => "accel_z",
            Self::Accumulate => "accumulate",
            Self::AccumulatedPower => "accumulated_power",
            Self::ActiveCalories => "active_calories",
            Self::ActiveMet => "active_met",
            Self::ActiveTime => "active_time",
            Self::ActiveTime16 => "active_time_16",
            Self::ActiveTimeZone => "active_time_zone",
            Self::ActivityClass => "activity_class",
            Self::ActivityId => "activity_id",
            Self::ActivityIdString => "activity_id_string",
            Self::ActivityLevel => "activity_level",
            Self::ActivitySubtype => "activity_subtype",
            Self::ActivityTime => "activity_time",
            Self::ActivityTrackerEnabled => "activity_tracker_enabled",
            Self::ActivityType => "activity_type",
            Self::Age => "age",
            Self::AirTimeRemaining => "air_time_remaining",
            Self::AlarmType => "alarm_type",
            Self::Altitude => "altitude",
            Self::AnalogLayout => "analog_layout",
            Self::AntDeviceNumber => "ant_device_number",
            Self::AntDeviceType => "ant_device_type",
            Self::AntEnabled => "ant_enabled",
            Self::AntNetwork => "ant_network",
            Self::AntTransmissionType => "ant_transmission_type",
            Self::AntplusDeviceType => "antplus_device_type",
            Self::ApneaCountdownEnabled => "apnea_countdown_enabled",
            Self::ApneaCountdownTime => "apnea_countdown_time",
            Self::ApplicationId => "application_id",
            Self::ApplicationVersion => "application_version",
            Self::Array => "array",
            Self::Ascent => "ascent",
            Self::AscentRate => "ascent_rate",
            Self::AscentTime => "ascent_time",
            Self::AttitudeStageComplete => "attitude_stage_complete",
            Self::AutoActivityDetect => "auto_activity_detect",
            Self::AutoActivityDetectDuration => "auto_activity_detect_duration",
            Self::AutoActivityDetectStartTimestamp => "auto_activity_detect_start_timestamp",
            Self::AutoActivityUploadEnabled => "auto_activity_upload_enabled",
            Self::AutoPowerZero => "auto_power_zero",
            Self::AutoSyncFrequency => "auto_sync_frequency",
            Self::AutoWheelCal => "auto_wheel_cal",
            Self::AutoWheelsize => "auto_wheelsize",
            Self::AutosyncMinSteps => "autosync_min_steps",
            Self::AutosyncMinTime => "autosync_min_time",
            Self::Average7DayDeviation => "average_7_day_deviation",
            Self::AverageDeviation => "average_deviation",
            Self::AverageStressDuringSleep => "average_stress_during_sleep",
            Self::AvgAltitude => "avg_altitude",
            Self::AvgAscentRate => "avg_ascent_rate",
            Self::AvgBallSpeed => "avg_ball_speed",
            Self::AvgCadence => "avg_cadence",
            Self::AvgCadencePosition => "avg_cadence_position",
            Self::AvgCombinedPedalSmoothness => "avg_combined_pedal_smoothness",
            Self::AvgCoreTemperature => "avg_core_temperature",
            Self::AvgDepth => "avg_depth",
            Self::AvgDescentRate => "avg_descent_rate",
            Self::AvgFlow => "avg_flow",
            Self::AvgFractionalCadence => "avg_fractional_cadence",
            Self::AvgGrade => "avg_grade",
            Self::AvgGrit => "avg_grit",
            Self::AvgHeartRate => "avg_heart_rate",
            Self::AvgLapTime => "avg_lap_time",
            Self::AvgLeftPco => "avg_left_pco",
            Self::AvgLeftPedalSmoothness => "avg_left_pedal_smoothness",
            Self::AvgLeftPowerPhase => "avg_left_power_phase",
            Self::AvgLeftPowerPhasePeak => "avg_left_power_phase_peak",
            Self::AvgLeftTorqueEffectiveness => "avg_left_torque_effectiveness",
            Self::AvgLevMotorPower => "avg_lev_motor_power",
            Self::AvgNegGrade => "avg_neg_grade",
            Self::AvgNegVerticalSpeed => "avg_neg_vertical_speed",
            Self::AvgPosGrade => "avg_pos_grade",
            Self::AvgPosVerticalSpeed => "avg_pos_vertical_speed",
            Self::AvgPower => "avg_power",
            Self::AvgPowerPosition => "avg_power_position",
            Self::AvgPressureSac => "avg_pressure_sac",
            Self::AvgRespirationRate => "avg_respiration_rate",
            Self::AvgRightPco => "avg_right_pco",
            Self::AvgRightPedalSmoothness => "avg_right_pedal_smoothness",
            Self::AvgRightPowerPhase => "avg_right_power_phase",
            Self::AvgRightPowerPhasePeak => "avg_right_power_phase_peak",
            Self::AvgRightTorqueEffectiveness => "avg_right_torque_effectiveness",
            Self::AvgRmv => "avg_rmv",
            Self::AvgRunningCadence => "avg_running_cadence",
            Self::AvgSaturatedHemoglobinPercent => "avg_saturated_hemoglobin_percent",
            Self::AvgSpeed => "avg_speed",
            Self::AvgSpo2 => "avg_spo2",
            Self::AvgStanceTime => "avg_stance_time",
            Self::AvgStanceTimeBalance => "avg_stance_time_balance",
            Self::AvgStanceTimePercent => "avg_stance_time_percent",
            Self::AvgStepLength => "avg_step_length",
            Self::AvgStress => "avg_stress",
            Self::AvgStrokeCount => "avg_stroke_count",
            Self::AvgStrokeDistance => "avg_stroke_distance",
            Self::AvgSwimmingCadence => "avg_swimming_cadence",
            Self::AvgTemperature => "avg_temperature",
            Self::AvgTotalHemoglobinConc => "avg_total_hemoglobin_conc",
            Self::AvgVam => "avg_vam",
            Self::AvgVertSpeed => "avg_vert_speed",
            Self::AvgVerticalOscillation => "avg_vertical_oscillation",
            Self::AvgVerticalRatio => "avg_vertical_ratio",
            Self::AvgVolumeSac => "avg_volume_sac",
            Self::AwakeTimeScore => "awake_time_score",
            Self::AwakeningsCount => "awakenings_count",
            Self::AwakeningsCountScore => "awakenings_count_score",
            Self::BacklightBrightness => "backlight_brightness",
            Self::BacklightMode => "backlight_mode",
            Self::BacklightTimeout => "backlight_timeout",
            Self::BallSpeed => "ball_speed",
            Self::BaroCalFactor => "baro_cal_factor",
            Self::BaroPres => "baro_pres",
            Self::BasalMet => "basal_met",
            Self::BaselineBalancedLower => "baseline_balanced_lower",
            Self::BaselineBalancedUpper => "baseline_balanced_upper",
            Self::BaselineLowUpper => "baseline_low_upper",
            Self::BatteryIdentifier => "battery_identifier",
            Self::BatteryLevel => "battery_level",
            Self::BatterySoc => "battery_soc",
            Self::BatteryStatus => "battery_status",
            Self::BatteryVoltage => "battery_voltage",
            Self::BestLapIndex => "best_lap_index",
            Self::BikeCadAntId => "bike_cad_ant_id",
            Self::BikeCadAntIdTransType => "bike_cad_ant_id_trans_type",
            Self::BikePowerAntId => "bike_power_ant_id",
            Self::BikePowerAntIdTransType => "bike_power_ant_id_trans_type",
            Self::BikeSpdAntId => "bike_spd_ant_id",
            Self::BikeSpdAntIdTransType => "bike_spd_ant_id_trans_type",
            Self::BikeSpdcadAntId => "bike_spdcad_ant_id",
            Self::BikeSpdcadAntIdTransType => "bike_spdcad_ant_id_trans_type",
            Self::BikeWeight => "bike_weight",
            Self::Bits => "bits",
            Self::BleAutoUploadEnabled => "ble_auto_upload_enabled",
            Self::BleDeviceType => "ble_device_type",
            Self::BluetoothEnabled => "bluetooth_enabled",
            Self::BluetoothLeEnabled => "bluetooth_le_enabled",
            Self::Bmi => "bmi",
            Self::BoneMass => "bone_mass",
            Self::BottomDepth => "bottom_depth",
            Self::BottomTime => "bottom_time",
            Self::CadEnabled => "cad_enabled",
            Self::CadHighAlert => "cad_high_alert",
            Self::CadLowAlert => "cad_low_alert",
            Self::Cadence => "cadence",
            Self::Cadence256 => "cadence256",
            Self::CadenceZoneHighBoundary => "cadence_zone_high_boundary",
            Self::CalibratedAccelX => "calibrated_accel_x",
            Self::CalibratedAccelY => "calibrated_accel_y",
            Self::CalibratedAccelZ => "calibrated_accel_z",
            Self::CalibratedData => "calibrated_data",
            Self::CalibratedGyroX => "calibrated_gyro_x",
            Self::CalibratedGyroY => "calibrated_gyro_y",
            Self::CalibratedGyroZ => "calibrated_gyro_z",
            Self::CalibratedMagX => "calibrated_mag_x",
            Self::CalibratedMagY => "calibrated_mag_y",
            Self::CalibratedMagZ => "calibrated_mag_z",
            Self::CalibrationDivisor => "calibration_divisor",
            Self::CalibrationFactor => "calibration_factor",
            Self::CalorieDurationAlert => "calorie_duration_alert",
            Self::Calories => "calories",
            Self::CameraEventType => "camera_event_type",
            Self::CameraFileUuid => "camera_file_uuid",
            Self::CameraOrientation => "camera_orientation",
            Self::Capabilities => "capabilities",
            Self::Category => "category",
            Self::CategorySubtype => "category_subtype",
            Self::CcrHighSetpoint => "ccr_high_setpoint",
            Self::CcrHighSetpointDepth => "ccr_high_setpoint_depth",
            Self::CcrHighSetpointSwitchMode => "ccr_high_setpoint_switch_mode",
            Self::CcrLowSetpoint => "ccr_low_setpoint",
            Self::CcrLowSetpointDepth => "ccr_low_setpoint_depth",
            Self::CcrLowSetpointSwitchMode => "ccr_low_setpoint_switch_mode",
            Self::ChannelNumber => "channel_number",
            Self::Charged => "charged",
            Self::ClimbCategory => "climb_category",
            Self::ClimbNumber => "climb_number",
            Self::ClimbProEvent => "climb_pro_event",
            Self::ClipEnd => "clip_end",
            Self::ClipNumber => "clip_number",
            Self::ClipStart => "clip_start",
            Self::ClockTime => "clock_time",
            Self::CnsLoad => "cns_load",
            Self::CombinedAwakeScore => "combined_awake_score",
            Self::CombinedPedalSmoothness => "combined_pedal_smoothness",
            Self::CommTimeout => "comm_timeout",
            Self::Completed => "completed",
            Self::Components => "components",
            Self::CompressedAccumulatedPower => "compressed_accumulated_power",
            Self::CompressedCalibratedAccelX => "compressed_calibrated_accel_x",
            Self::CompressedCalibratedAccelY => "compressed_calibrated_accel_y",
            Self::CompressedCalibratedAccelZ => "compressed_calibrated_accel_z",
            Self::CompressedSpeedDistance => "compressed_speed_distance",
            Self::ConceptCount => "concept_count",
            Self::ConceptField => "concept_field",
            Self::ConceptIndex => "concept_index",
            Self::ConceptKey => "concept_key",
            Self::Condition => "condition",
            Self::Confidence => "confidence",
            Self::ConnectivitySupported => "connectivity_supported",
            Self::CoreTemperature => "core_temperature",
            Self::Count => "count",
            Self::CountType => "count_type",
            Self::CourseDownloadEnabled => "course_download_enabled",
            Self::CoursePointIndex => "course_point_index",
            Self::CrankLength => "crank_length",
            Self::CumOperatingTime => "cum_operating_time",
            Self::CurrentActivityTypeIntensity => "current_activity_type_intensity",
            Self::CurrentDayRestingHeartRate => "current_day_resting_heart_rate",
            Self::CurrentDist => "current_dist",
            Self::CurrentStress => "current_stress",
            Self::CustomTargetCadenceHigh => "custom_target_cadence_high",
            Self::CustomTargetCadenceLow => "custom_target_cadence_low",
            Self::CustomTargetHeartRateHigh => "custom_target_heart_rate_high",
            Self::CustomTargetHeartRateLow => "custom_target_heart_rate_low",
            Self::CustomTargetPowerHigh => "custom_target_power_high",
            Self::CustomTargetPowerLow => "custom_target_power_low",
            Self::CustomTargetSpeedHigh => "custom_target_speed_high",
            Self::CustomTargetSpeedLow => "custom_target_speed_low",
            Self::CustomTargetValueHigh => "custom_target_value_high",
            Self::CustomTargetValueLow => "custom_target_value_low",
            Self::CustomWheelsize => "custom_wheelsize",
            Self::CycleLength => "cycle_length",
            Self::CycleLength16 => "cycle_length16",
            Self::Cycles => "cycles",
            Self::Cycles16 => "cycles_16",
            Self::CyclesToCalories => "cycles_to_calories",
            Self::CyclesToDistance => "cycles_to_distance",
            Self::Data => "data",
            Self::Data16 => "data16",
            Self::DataPage => "data_page",
            Self::DataSize => "data_size",
            Self::DataUnits => "data_units",
            Self::DateMode => "date_mode",
            Self::DayOfWeek => "day_of_week",
            Self::DeepSleepScore => "deep_sleep_score",
            Self::DefaultMaxBikingHeartRate => "default_max_biking_heart_rate",
            Self::DefaultMaxHeartRate => "default_max_heart_rate",
            Self::DefaultMaxRunningHeartRate => "default_max_running_heart_rate",
            Self::DefaultPage => "default_page",
            Self::DefaultRaceLeader => "default_race_leader",
            Self::DeleteStatus => "delete_status",
            Self::Depth => "depth",
            Self::DepthSetting => "depth_setting",
            Self::Descent => "descent",
            Self::DescentTime => "descent_time",
            Self::Descriptor => "descriptor",
            Self::DeveloperDataIndex => "developer_data_index",
            Self::DeveloperId => "developer_id",
            Self::DeviceId => "device_id",
            Self::DeviceIndex => "device_index",
            Self::DeviceNumber => "device_number",
            Self::DeviceType => "device_type",
            Self::DiastolicPressure => "diastolic_pressure",
            Self::DigitalLayout => "digital_layout",
            Self::Directory => "directory",
            Self::DisplayOrientation => "display_orientation",
            Self::DisplayType => "display_type",
            Self::DistSetting => "dist_setting",
            Self::Distance => "distance",
            Self::Distance16 => "distance_16",
            Self::DistanceDurationAlert => "distance_duration_alert",
            Self::DiveAlert => "dive_alert",
            Self::DiveCount => "dive_count",
            Self::DiveNumber => "dive_number",
            Self::DiveSounds => "dive_sounds",
            Self::DiveTypes => "dive_types",
            Self::Duration => "duration",
            Self::DurationCalories => "duration_calories",
            Self::DurationDistance => "duration_distance",
            Self::DurationHr => "duration_hr",
            Self::DurationMin => "duration_min",
            Self::DurationPower => "duration_power",
            Self::DurationReps => "duration_reps",
            Self::DurationStep => "duration_step",
            Self::DurationTime => "duration_time",
            Self::DurationType => "duration_type",
            Self::DurationValue => "duration_value",
            Self::EbikeAssistLevelPercent => "ebike_assist_level_percent",
            Self::EbikeAssistMode => "ebike_assist_mode",
            Self::EbikeBatteryLevel => "ebike_battery_level",
            Self::EbikeTravelRange => "ebike_travel_range",
            Self::ElapsedTime => "elapsed_time",
            Self::ElevSetting => "elev_setting",
            Self::Empty => "",
            Self::Enabled => "enabled",
            Self::EndCns => "end_cns",
            Self::EndDate => "end_date",
            Self::EndN2 => "end_n2",
            Self::EndPositionLat => "end_position_lat",
            Self::EndPositionLong => "end_position_long",
            Self::EndPressure => "end_pressure",
            Self::EndTime => "end_time",
            Self::EndTimestamp => "end_timestamp",
            Self::EndTimestampMs => "end_timestamp_ms",
            Self::EndTimezoneOffset => "end_timezone_offset",
            Self::EnergyTotal => "energy_total",
            Self::EnhancedAltitude => "enhanced_altitude",
            Self::EnhancedAvgAltitude => "enhanced_avg_altitude",
            Self::EnhancedAvgRespirationRate => "enhanced_avg_respiration_rate",
            Self::EnhancedAvgSpeed => "enhanced_avg_speed",
            Self::EnhancedMaxAltitude => "enhanced_max_altitude",
            Self::EnhancedMaxRespirationRate => "enhanced_max_respiration_rate",
            Self::EnhancedMaxSpeed => "enhanced_max_speed",
            Self::EnhancedMinAltitude => "enhanced_min_altitude",
            Self::EnhancedMinRespirationRate => "enhanced_min_respiration_rate",
            Self::EnhancedRespirationRate => "enhanced_respiration_rate",
            Self::EnhancedSpeed => "enhanced_speed",
            Self::Equipment => "equipment",
            Self::Event => "event",
            Self::EventGroup => "event_group",
            Self::EventId => "event_id",
            Self::EventTimestamp => "event_timestamp",
            Self::EventTimestamp12 => "event_timestamp_12",
            Self::EventType => "event_type",
            Self::ExerciseCategory => "exercise_category",
            Self::ExerciseName => "exercise_name",
            Self::ExerciseWeight => "exercise_weight",
            Self::ExpireTime => "expire_time",
            Self::FatCalories => "fat_calories",
            Self::FaveroProduct => "favero_product",
            Self::Favorite => "favorite",
            Self::Feedback => "feedback",
            Self::FieldCount => "field_count",
            Self::FieldDefinitionNumber => "field_definition_number",
            Self::FieldId => "field_id",
            Self::FieldName => "field_name",
            Self::FieldNum => "field_num",
            Self::File => "file",
            Self::FileUuid => "file_uuid",
            Self::FilteredBpm => "filtered_bpm",
            Self::FirstLapIndex => "first_lap_index",
            Self::FirstLengthIndex => "first_length_index",
            Self::FirstStepIndex => "first_step_index",
            Self::FitBaseTypeId => "fit_base_type_id",
            Self::FitBaseUnitId => "fit_base_unit_id",
            Self::FitnessEquipmentState => "fitness_equipment_state",
            Self::Flags => "flags",
            Self::Flow => "flow",
            Self::FractionalCadence => "fractional_cadence",
            Self::FractionalSystemTimestamp => "fractional_system_timestamp",
            Self::FractionalTimestamp => "fractional_timestamp",
            Self::FrameNumber => "frame_number",
            Self::FriendlyName => "friendly_name",
            Self::FrontGear => "front_gear",
            Self::FrontGearNum => "front_gear_num",
            Self::FrontGearShiftCount => "front_gear_shift_count",
            Self::FunctionalThresholdPower => "functional_threshold_power",
            Self::Gap => "gap",
            Self::GarminProduct => "garmin_product",
            Self::GasConsumptionDisplay => "gas_consumption_display",
            Self::GearChangeData => "gear_change_data",
            Self::Gender => "gender",
            Self::GfHigh => "gf_high",
            Self::GfLow => "gf_low",
            Self::GlobalId => "global_id",
            Self::GpsAccuracy => "gps_accuracy",
            Self::GpsEphemerisDownloadEnabled => "gps_ephemeris_download_enabled",
            Self::Grade => "grade",
            Self::GrainWeight => "grain_weight",
            Self::Grit => "grit",
            Self::GroupPrimaryKey => "group_primary_key",
            Self::GrouptrackEnabled => "grouptrack_enabled",
            Self::GyroCalFactor => "gyro_cal_factor",
            Self::GyroX => "gyro_x",
            Self::GyroY => "gyro_y",
            Self::GyroZ => "gyro_z",
            Self::HangTime => "hang_time",
            Self::HardwareVersion => "hardware_version",
            Self::Heading => "heading",
            Self::HeartRate => "heart_rate",
            Self::HeartRateAntplusDeviceType => "heart_rate_antplus_device_type",
            Self::HeartRateLocalDeviceType => "heart_rate_local_device_type",
            Self::HeartRateSource => "heart_rate_source",
            Self::HeartRateSourceType => "heart_rate_source_type",
            Self::HeartRateType => "heart_rate_type",
            Self::Height => "height",
            Self::HeightSetting => "height_setting",
            Self::HeliumContent => "helium_content",
            Self::HighBpm => "high_bpm",
            Self::HighTemperature => "high_temperature",
            Self::HighValue => "high_value",
            Self::HostingProvider => "hosting_provider",
            Self::HrCalcType => "hr_calc_type",
            Self::HrHighAlert => "hr_high_alert",
            Self::HrLowAlert => "hr_low_alert",
            Self::HrSetting => "hr_setting",
            Self::HrSource => "hr_source",
            Self::HrZoneHighBoundary => "hr_zone_high_boundary",
            Self::HrmAntId => "hrm_ant_id",
            Self::HrmAntIdTransType => "hrm_ant_id_trans_type",
            Self::Id => "id",
            Self::IncidentDetectionEnabled => "incident_detection_enabled",
            Self::Instance => "instance",
            Self::Intensity => "intensity",
            Self::IntensityFactor => "intensity_factor",
            Self::InterruptionsScore => "interruptions_score",
            Self::IsDeleted => "is_deleted",
            Self::IsSigned => "is_signed",
            Self::IssueTime => "issue_time",
            Self::JumpCount => "jump_count",
            Self::LactateThresholdAutodetectEnabled => "lactate_threshold_autodetect_enabled",
            Self::Language => "language",
            Self::Languages => "languages",
            Self::LapTrigger => "lap_trigger",
            Self::LastNight5MinHigh => "last_night_5_min_high",
            Self::LastNightAverage => "last_night_average",
            Self::LastStopMultiple => "last_stop_multiple",
            Self::Layout => "layout",
            Self::LeaderActivityId => "leader_activity_id",
            Self::LeaderActivityIdString => "leader_activity_id_string",
            Self::LeaderGroupPrimaryKey => "leader_group_primary_key",
            Self::LeaderTime => "leader_time",
            Self::LeaderType => "leader_type",
            Self::LeftPco => "left_pco",
            Self::LeftPedalSmoothness => "left_pedal_smoothness",
            Self::LeftPowerPhase => "left_power_phase",
            Self::LeftPowerPhasePeak => "left_power_phase_peak",
            Self::LeftRightBalance => "left_right_balance",
            Self::LeftTorqueEffectiveness => "left_torque_effectiveness",
            Self::LengthType => "length_type",
            Self::LevBatteryConsumption => "lev_battery_consumption",
            Self::Level => "level",
            Self::LevelShift => "level_shift",
            Self::LightSleepScore => "light_sleep_score",
            Self::LiveTrackingEnabled => "live_tracking_enabled",
            Self::LocalDeviceType => "local_device_type",
            Self::LocalId => "local_id",
            Self::LocalTimestamp => "local_timestamp",
            Self::Location => "location",
            Self::LogHrv => "log_hrv",
            Self::LowTemperature => "low_temperature",
            Self::MagX => "mag_x",
            Self::MagY => "mag_y",
            Self::MagZ => "mag_z",
            Self::Manufacturer => "manufacturer",
            Self::ManufacturerId => "manufacturer_id",
            Self::Map3SampleMean => "map_3_sample_mean",
            Self::MapEveningValues => "map_evening_values",
            Self::MapMorningValues => "map_morning_values",
            Self::MaxAltitude => "max_altitude",
            Self::MaxAscentRate => "max_ascent_rate",
            Self::MaxBallSpeed => "max_ball_speed",
            Self::MaxCadence => "max_cadence",
            Self::MaxCadencePosition => "max_cadence_position",
            Self::MaxCoreTemperature => "max_core_temperature",
            Self::MaxCount => "max_count",
            Self::MaxDepth => "max_depth",
            Self::MaxDescentRate => "max_descent_rate",
            Self::MaxFractionalCadence => "max_fractional_cadence",
            Self::MaxHeartRate => "max_heart_rate",
            Self::MaxLevMotorPower => "max_lev_motor_power",
            Self::MaxMetCategory => "max_met_category",
            Self::MaxNegGrade => "max_neg_grade",
            Self::MaxNegVerticalSpeed => "max_neg_vertical_speed",
            Self::MaxPerFile => "max_per_file",
            Self::MaxPerFileType => "max_per_file_type",
            Self::MaxPosGrade => "max_pos_grade",
            Self::MaxPosVerticalSpeed => "max_pos_vertical_speed",
            Self::MaxPower => "max_power",
            Self::MaxPowerPosition => "max_power_position",
            Self::MaxRespirationRate => "max_respiration_rate",
            Self::MaxRunningCadence => "max_running_cadence",
            Self::MaxSaturatedHemoglobinPercent => "max_saturated_hemoglobin_percent",
            Self::MaxSize => "max_size",
            Self::MaxSpeed => "max_speed",
            Self::MaxTemperature => "max_temperature",
            Self::MaxTotalHemoglobinConc => "max_total_hemoglobin_conc",
            Self::MeanArterialPressure => "mean_arterial_pressure",
            Self::Memo => "memo",
            Self::MesgData => "mesg_data",
            Self::MesgId => "mesg_id",
            Self::MesgNum => "mesg_num",
            Self::MessageCount => "message_count",
            Self::MessageIndex => "message_index",
            Self::MetabolicAge => "metabolic_age",
            Self::MetabolicCalories => "metabolic_calories",
            Self::MinAltitude => "min_altitude",
            Self::MinCoreTemperature => "min_core_temperature",
            Self::MinHeartRate => "min_heart_rate",
            Self::MinRespirationRate => "min_respiration_rate",
            Self::MinSaturatedHemoglobinPercent => "min_saturated_hemoglobin_percent",
            Self::MinSpeed => "min_speed",
            Self::MinTemperature => "min_temperature",
            Self::MinTotalHemoglobinConc => "min_total_hemoglobin_conc",
            Self::Mode => "mode",
            Self::Model => "model",
            Self::ModerateActivityMinutes => "moderate_activity_minutes",
            Self::MotorPower => "motor_power",
            Self::MountingSide => "mounting_side",
            Self::MoveAlertEnabled => "move_alert_enabled",
            Self::MuscleMass => "muscle_mass",
            Self::N2Load => "n2_load",
            Self::Name => "name",
            Self::NativeFieldNum => "native_field_num",
            Self::NativeMesgNum => "native_mesg_num",
            Self::NdlTime => "ndl_time",
            Self::NecLat => "nec_lat",
            Self::NecLong => "nec_long",
            Self::NextStopDepth => "next_stop_depth",
            Self::NextStopTime => "next_stop_time",
            Self::NightlyValue => "nightly_value",
            Self::NoFlyTimeMode => "no_fly_time_mode",
            Self::NormalizedPower => "normalized_power",
            Self::Notes => "notes",
            Self::NumActiveLengths => "num_active_lengths",
            Self::NumLaps => "num_laps",
            Self::NumLengths => "num_lengths",
            Self::NumPerFile => "num_per_file",
            Self::NumSessions => "num_sessions",
            Self::NumSplits => "num_splits",
            Self::NumValidSteps => "num_valid_steps",
            Self::Number => "number",
            Self::NumberOfScreens => "number_of_screens",
            Self::O2Toxicity => "o2_toxicity",
            Self::ObservedAtTime => "observed_at_time",
            Self::ObservedLocationLat => "observed_location_lat",
            Self::ObservedLocationLong => "observed_location_long",
            Self::Odometer => "odometer",
            Self::OdometerRollover => "odometer_rollover",
            Self::Offset => "offset",
            Self::OffsetCal => "offset_cal",
            Self::OpponentName => "opponent_name",
            Self::OpponentScore => "opponent_score",
            Self::OrientationMatrix => "orientation_matrix",
            Self::OverallSleepScore => "overall_sleep_score",
            Self::OxygenContent => "oxygen_content",
            Self::PagesEnabled => "pages_enabled",
            Self::ParentIndex => "parent_index",
            Self::PartIndex => "part_index",
            Self::PartNumber => "part_number",
            Self::PercentFat => "percent_fat",
            Self::PercentHydration => "percent_hydration",
            Self::PhysiqueRating => "physique_rating",
            Self::Pid => "pid",
            Self::PidDataSize => "pid_data_size",
            Self::Pitch => "pitch",
            Self::PlayerScore => "player_score",
            Self::Po2 => "po2",
            Self::Po2Critical => "po2_critical",
            Self::Po2Deco => "po2_deco",
            Self::Po2Warn => "po2_warn",
            Self::PoolLength => "pool_length",
            Self::PoolLengthUnit => "pool_length_unit",
            Self::PopupEnabled => "popup_enabled",
            Self::PositionLat => "position_lat",
            Self::PositionLong => "position_long",
            Self::PositionSetting => "position_setting",
            Self::Power => "power",
            Self::PowerCalFactor => "power_cal_factor",
            Self::PowerEnabled => "power_enabled",
            Self::PowerHighAlert => "power_high_alert",
            Self::PowerLowAlert => "power_low_alert",
            Self::PowerSetting => "power_setting",
            Self::PowerZoneHighBoundary => "power_zone_high_boundary",
            Self::PrecipitationProbability => "precipitation_probability",
            Self::PreciseTargetSpeed => "precise_target_speed",
            Self::Pressure => "pressure",
            Self::PressureSac => "pressure_sac",
            Self::ProcessingInterval => "processing_interval",
            Self::Product => "product",
            Self::ProductName => "product_name",
            Self::ProjectileType => "projectile_type",
            Self::PwrCalcType => "pwr_calc_type",
            Self::Qualifier => "qualifier",
            Self::Quality => "quality",
            Self::RadarThreatAlert => "radar_threat_alert",
            Self::RadarThreatAvgApproachSpeed => "radar_threat_avg_approach_speed",
            Self::RadarThreatCount => "radar_threat_count",
            Self::RadarThreatLevelMax => "radar_threat_level_max",
            Self::RadarThreatMaxApproachSpeed => "radar_threat_max_approach_speed",
            Self::RawData => "raw_data",
            Self::ReadingConfidence => "reading_confidence",
            Self::ReadingSpo2 => "reading_spo2",
            Self::RearGear => "rear_gear",
            Self::RearGearNum => "rear_gear_num",
            Self::RearGearShiftCount => "rear_gear_shift_count",
            Self::Recurrence => "recurrence",
            Self::RecurrenceValue => "recurrence_value",
            Self::ReferenceIndex => "reference_index",
            Self::ReferenceMesg => "reference_mesg",
            Self::RelativeHumidity => "relative_humidity",
            Self::RemSleepScore => "rem_sleep_score",
            Self::Repeat => "repeat",
            Self::RepeatCalories => "repeat_calories",
            Self::RepeatDistance => "repeat_distance",
            Self::RepeatDiveInterval => "repeat_dive_interval",
            Self::RepeatHr => "repeat_hr",
            Self::RepeatPower => "repeat_power",
            Self::RepeatSteps => "repeat_steps",
            Self::RepeatTime => "repeat_time",
            Self::Repeating => "repeating",
            Self::RepetitionNum => "repetition_num",
            Self::Repetitions => "repetitions",
            Self::ReportId => "report_id",
            Self::Resistance => "resistance",
            Self::RespirationRate => "respiration_rate",
            Self::RestingHeartRate => "resting_heart_rate",
            Self::RestingMetabolicRate => "resting_metabolic_rate",
            Self::RiderPosition => "rider_position",
            Self::RightPco => "right_pco",
            Self::RightPedalSmoothness => "right_pedal_smoothness",
            Self::RightPowerPhase => "right_power_phase",
            Self::RightPowerPhasePeak => "right_power_phase_peak",
            Self::RightTorqueEffectiveness => "right_torque_effectiveness",
            Self::RmssdHrv => "rmssd_hrv",
            Self::Rmv => "rmv",
            Self::Roll => "roll",
            Self::Rotations => "rotations",
            Self::SafetyStopEnabled => "safety_stop_enabled",
            Self::SafetyStopTime => "safety_stop_time",
            Self::SampleTimeOffset => "sample_time_offset",
            Self::SamplingInterval => "sampling_interval",
            Self::SaturatedHemoglobinPercent => "saturated_hemoglobin_percent",
            Self::SaturatedHemoglobinPercentMax => "saturated_hemoglobin_percent_max",
            Self::SaturatedHemoglobinPercentMin => "saturated_hemoglobin_percent_min",
            Self::Scale => "scale",
            Self::Scaling => "scaling",
            Self::ScheduledTime => "scheduled_time",
            Self::Score => "score",
            Self::ScreenEnabled => "screen_enabled",
            Self::ScreenIndex => "screen_index",
            Self::SdmAntId => "sdm_ant_id",
            Self::SdmAntIdTransType => "sdm_ant_id_trans_type",
            Self::SdmCalFactor => "sdm_cal_factor",
            Self::SdrrHrv => "sdrr_hrv",
            Self::SecondaryCustomTargetCadenceHigh => "secondary_custom_target_cadence_high",
            Self::SecondaryCustomTargetCadenceLow => "secondary_custom_target_cadence_low",
            Self::SecondaryCustomTargetHeartRateHigh => "secondary_custom_target_heart_rate_high",
            Self::SecondaryCustomTargetHeartRateLow => "secondary_custom_target_heart_rate_low",
            Self::SecondaryCustomTargetPowerHigh => "secondary_custom_target_power_high",
            Self::SecondaryCustomTargetPowerLow => "secondary_custom_target_power_low",
            Self::SecondaryCustomTargetSpeedHigh => "secondary_custom_target_speed_high",
            Self::SecondaryCustomTargetSpeedLow => "secondary_custom_target_speed_low",
            Self::SecondaryCustomTargetValueHigh => "secondary_custom_target_value_high",
            Self::SecondaryCustomTargetValueLow => "secondary_custom_target_value_low",
            Self::SecondaryTargetCadenceZone => "secondary_target_cadence_zone",
            Self::SecondaryTargetHrZone => "secondary_target_hr_zone",
            Self::SecondaryTargetPowerZone => "secondary_target_power_zone",
            Self::SecondaryTargetSpeedZone => "secondary_target_speed_zone",
            Self::SecondaryTargetStrokeType => "secondary_target_stroke_type",
            Self::SecondaryTargetType => "secondary_target_type",
            Self::SecondaryTargetValue => "secondary_target_value",
            Self::SegmentTime => "segment_time",
            Self::SelectionType => "selection_type",
            Self::Sensor => "sensor",
            Self::SensorPosition => "sensor_position",
            Self::SensorType => "sensor_type",
            Self::Sentence => "sentence",
            Self::SerialNumber => "serial_number",
            Self::Sessions => "sessions",
            Self::SetType => "set_type",
            Self::Severity => "severity",
            Self::ShimanoDi2Enabled => "shimano_di2_enabled",
            Self::ShotCount => "shot_count",
            Self::ShotNum => "shot_num",
            Self::ShotSpeed => "shot_speed",
            Self::SleepDurationScore => "sleep_duration_score",
            Self::SleepLevel => "sleep_level",
            Self::SleepQualityScore => "sleep_quality_score",
            Self::SleepRecoveryScore => "sleep_recovery_score",
            Self::SleepRestlessnessScore => "sleep_restlessness_score",
            Self::SleepTime => "sleep_time",
            Self::SmartNotificationDisplayOrientation => "smart_notification_display_orientation",
            Self::SoftwareVersion => "software_version",
            Self::Sound => "sound",
            Self::Source => "source",
            Self::SourceType => "source_type",
            Self::SpdEnabled => "spd_enabled",
            Self::SpdcadEnabled => "spdcad_enabled",
            Self::Speed => "speed",
            Self::Speed1S => "speed_1s",
            Self::SpeedHighAlert => "speed_high_alert",
            Self::SpeedLowAlert => "speed_low_alert",
            Self::SpeedSetting => "speed_setting",
            Self::SpeedSource => "speed_source",
            Self::SpeedZoneHighBoundary => "speed_zone_high_boundary",
            Self::SplitType => "split_type",
            Self::Sport => "sport",
            Self::SportEvent => "sport_event",
            Self::SportIndex => "sport_index",
            Self::SportPoint => "sport_point",
            Self::SportProfileName => "sport_profile_name",
            Self::Sports => "sports",
            Self::Stage => "stage",
            Self::StanceTime => "stance_time",
            Self::StanceTimeBalance => "stance_time_balance",
            Self::StanceTimePercent => "stance_time_percent",
            Self::StandCount => "stand_count",
            Self::StandardDeviation => "standard_deviation",
            Self::StartCns => "start_cns",
            Self::StartDate => "start_date",
            Self::StartElevation => "start_elevation",
            Self::StartN2 => "start_n2",
            Self::StartPositionLat => "start_position_lat",
            Self::StartPositionLong => "start_position_long",
            Self::StartPressure => "start_pressure",
            Self::StartTime => "start_time",
            Self::StartTimestamp => "start_timestamp",
            Self::StartTimestampMs => "start_timestamp_ms",
            Self::StartTimezoneOffset => "start_timezone_offset",
            Self::Status => "status",
            Self::StepLength => "step_length",
            Self::Steps => "steps",
            Self::StressLevel => "stress_level",
            Self::StressLevelTime => "stress_level_time",
            Self::StressLevelValue => "stress_level_value",
            Self::StrokeCount => "stroke_count",
            Self::StrokeType => "stroke_type",
            Self::Strokes => "strokes",
            Self::SubSport => "sub_sport",
            Self::SurfaceInterval => "surface_interval",
            Self::SwcLat => "swc_lat",
            Self::SwcLong => "swc_long",
            Self::SwimStroke => "swim_stroke",
            Self::SystemTime => "system_time",
            Self::SystemTimestamp => "system_timestamp",
            Self::SystemTimestampMs => "system_timestamp_ms",
            Self::SystolicPressure => "systolic_pressure",
            Self::TapInterface => "tap_interface",
            Self::TapSensitivity => "tap_sensitivity",
            Self::TargetCadenceZone => "target_cadence_zone",
            Self::TargetDistance => "target_distance",
            Self::TargetHrZone => "target_hr_zone",
            Self::TargetPowerZone => "target_power_zone",
            Self::TargetSpeed => "target_speed",
            Self::TargetSpeedZone => "target_speed_zone",
            Self::TargetStrokeType => "target_stroke_type",
            Self::TargetTime => "target_time",
            Self::TargetType => "target_type",
            Self::TargetValue => "target_value",
            Self::Temperature => "temperature",
            Self::TemperatureFeelsLike => "temperature_feels_like",
            Self::TemperatureMax => "temperature_max",
            Self::TemperatureMin => "temperature_min",
            Self::TemperatureSetting => "temperature_setting",
            Self::Text => "text",
            Self::ThresholdHeartRate => "threshold_heart_rate",
            Self::ThresholdPower => "threshold_power",
            Self::Time => "time",
            Self::Time128 => "time128",
            Self::Time256 => "time256",
            Self::TimeAboveThreshold => "time_above_threshold",
            Self::TimeCreated => "time_created",
            Self::TimeDurationAlert => "time_duration_alert",
            Self::TimeFromCourse => "time_from_course",
            Self::TimeInCadenceZone => "time_in_cadence_zone",
            Self::TimeInHrZone => "time_in_hr_zone",
            Self::TimeInPowerZone => "time_in_power_zone",
            Self::TimeInSpeedZone => "time_in_speed_zone",
            Self::TimeMode => "time_mode",
            Self::TimeOffset => "time_offset",
            Self::TimeStanding => "time_standing",
            Self::TimeToSurface => "time_to_surface",
            Self::TimeZoneOffset => "time_zone_offset",
            Self::TimerTime => "timer_time",
            Self::TimerTrigger => "timer_trigger",
            Self::Timestamp => "timestamp",
            Self::Timestamp16 => "timestamp_16",
            Self::Timestamp32K => "timestamp_32k",
            Self::TimestampMin8 => "timestamp_min_8",
            Self::TimestampMs => "timestamp_ms",
            Self::Title => "title",
            Self::TotalAnaerobicTrainingEffect => "total_anaerobic_training_effect",
            Self::TotalAscent => "total_ascent",
            Self::TotalCalories => "total_calories",
            Self::TotalCycles => "total_cycles",
            Self::TotalDescent => "total_descent",
            Self::TotalDistance => "total_distance",
            Self::TotalElapsedTime => "total_elapsed_time",
            Self::TotalFatCalories => "total_fat_calories",
            Self::TotalFlow => "total_flow",
            Self::TotalFractionalAscent => "total_fractional_ascent",
            Self::TotalFractionalCycles => "total_fractional_cycles",
            Self::TotalFractionalDescent => "total_fractional_descent",
            Self::TotalGrit => "total_grit",
            Self::TotalHemoglobinConc => "total_hemoglobin_conc",
            Self::TotalHemoglobinConcMax => "total_hemoglobin_conc_max",
            Self::TotalHemoglobinConcMin => "total_hemoglobin_conc_min",
            Self::TotalMovingTime => "total_moving_time",
            Self::TotalStrides => "total_strides",
            Self::TotalStrokes => "total_strokes",
            Self::TotalTimerTime => "total_timer_time",
            Self::TotalTrainingEffect => "total_training_effect",
            Self::TotalWork => "total_work",
            Self::Track => "track",
            Self::TrainingLoadPeak => "training_load_peak",
            Self::TrainingStressScore => "training_stress_score",
            Self::TransmissionType => "transmission_type",
            Self::TravelGas => "travel_gas",
            Self::Trigger => "trigger",
            Self::TriggerOnAscent => "trigger_on_ascent",
            Self::TriggerOnDescent => "trigger_on_descent",
            Self::TurnRate => "turn_rate",
            Self::Type => "type",
            Self::Uncharged => "uncharged",
            Self::Units => "units",
            Self::UpKeyEnabled => "up_key_enabled",
            Self::UpdateTime => "update_time",
            Self::UpdateTimestamp => "update_timestamp",
            Self::Url => "url",
            Self::UserProfileIndex => "user_profile_index",
            Self::UserProfilePrimaryKey => "user_profile_primary_key",
            Self::UserRunningStepLength => "user_running_step_length",
            Self::UserWalkingStepLength => "user_walking_step_length",
            Self::UtcOffset => "utc_offset",
            Self::UtcTimestamp => "utc_timestamp",
            Self::Uuid => "uuid",
            Self::Validity => "validity",
            Self::Value => "value",
            Self::Velocity => "velocity",
            Self::Version => "version",
            Self::VerticalOscillation => "vertical_oscillation",
            Self::VerticalRatio => "vertical_ratio",
            Self::VerticalSpeed => "vertical_speed",
            Self::VigorousActivityMinutes => "vigorous_activity_minutes",
            Self::VirtualPartnerSpeed => "virtual_partner_speed",
            Self::VisceralFatMass => "visceral_fat_mass",
            Self::VisceralFatRating => "visceral_fat_rating",
            Self::Vo2Max => "vo2_max",
            Self::VolumeSac => "volume_sac",
            Self::VolumeUsed => "volume_used",
            Self::WakeTime => "wake_time",
            Self::WaterDensity => "water_density",
            Self::WaterType => "water_type",
            Self::WeatherAlertsEnabled => "weather_alerts_enabled",
            Self::WeatherConditionsEnabled => "weather_conditions_enabled",
            Self::WeatherReport => "weather_report",
            Self::WeeklyAverage => "weekly_average",
            Self::Weight => "weight",
            Self::WeightDisplayUnit => "weight_display_unit",
            Self::WeightSetting => "weight_setting",
            Self::WindDirection => "wind_direction",
            Self::WindSpeed => "wind_speed",
            Self::WktDescription => "wkt_description",
            Self::WktName => "wkt_name",
            Self::WktStepIndex => "wkt_step_index",
            Self::WktStepName => "wkt_step_name",
            Self::WorkoutDownloadEnabled => "workout_download_enabled",
            Self::WorkoutFeel => "workout_feel",
            Self::WorkoutRpe => "workout_rpe",
            Self::WorkoutsSupported => "workouts_supported",
            Self::ZeroCrossCnt => "zero_cross_cnt",
            Self::Zone => "zone",
            Self::ZoneCount => "zone_count",
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Unit {
    /// "bar"
    Bar,
    /// "bar/min"
    BarPerMinute,
    /// "bpm"
    BeatsPerMinute,
    /// "Breaths/min"
    BreathsPerMinute,
    /// "bytes"
    Bytes,
    /// "calories"
    Calorie,
    /// "C"
    Celcius,
    /// "counts"
    Count,
    /// "cycles"
    Cycle,
    /// "degrees"
    Degree,
    /// "deg/s"
    DegreesPerSecond,
    /// "depends on sensor"
    DependsOnSensor,

    Empty,
    /// "Flow"
    Flow,
    /// "G"
    Gauss,
    /// "g"
    Gee,
    /// "gr"
    Gram,
    /// "g/dL"
    GramPerDeciliter,
    /// "100 * m"
    Hectometer,
    /// "hr"
    Hour,
    /// "if"
    IntensityFactor,
    /// "J"
    Joule,
    /// "kGrit"
    KGrit,
    /// "kcal"
    Kilocalorie,
    /// "kcal/cycle"
    KilocaloriesPerCycle,
    /// "kcal/day"
    KilocaloriesPerDay,
    /// "kcal/min"
    KilocaloriesPerMinute,
    /// "kg"
    Kilogram,
    /// "kg/m^3"
    KilogramsPerCubicMeter,
    /// "kg/m^2"
    KilogramsPerSquareMeter,
    /// "km"
    Kilometer,
    /// "lengths"
    Length,
    /// "L"
    Liter,
    /// "L/min"
    LiterPerMinute,
    /// "m"
    Meter,
    /// "m/cycle"
    MetersPerCycle,
    /// "mps"
    MetersPerSecond,
    /// "m/s,m"
    MetersPerSecondAndMeter,
    /// "m/s^2"
    MetersPerSecondSquared,
    /// "m/s"
    MetersPerSeconds,
    /// "mG"
    Milligee,
    /// "mL/kg/min"
    MillilitersPerKilogramPerMinute,
    /// "mm"
    Millimeter,
    /// "mmHg"
    MillimetersOfMercury,
    /// "ms"
    Millisecond,
    /// "minutes"
    Minute,
    /// "1/32768 s"
    OnePer32768Seconds,
    /// "OTUs"
    OxygenToxicityUnit,
    /// "Pa"
    Pascal,
    /// "%"
    Percent,
    /// "% or bpm"
    PercentOrBeatsPerMinute,
    /// "% or watts"
    PercentOrWatts,
    /// "radians"
    Radian,
    /// "radians/second"
    RadiansPerSecond,
    /// "rpm"
    RevolutionPerMinute,
    /// "s"
    Second,
    /// "semicircles"
    Semicircle,
    /// "steps"
    Step,
    /// "strides"
    Stride,
    /// "strides/min"
    StridesPerMinute,
    /// "strokes"
    Stroke,
    /// "strokes/lap"
    StrokePerLap,
    /// "strokes/min"
    StrokesPerMinute,
    /// "swim_stroke"
    SwimStroke,
    /// "tss"
    TrainingStressScore,
    /// "2 * cycles (steps)"
    TwoCyclesSteps,
    /// "V"
    Voltage,
    /// "watts"
    Watt,
    /// "years"
    Year,
}

impl Unit {
    pub fn as_str(self) -> &'static str {
        match self {
            Self::Bar => "bar",
            Self::BarPerMinute => "bar/min",
            Self::BeatsPerMinute => "bpm",
            Self::BreathsPerMinute => "Breaths/min",
            Self::Bytes => "bytes",
            Self::Calorie => "calories",
            Self::Celcius => "C",
            Self::Count => "counts",
            Self::Cycle => "cycles",
            Self::Degree => "degrees",
            Self::DegreesPerSecond => "deg/s",
            Self::DependsOnSensor => "depends on sensor",
            Self::Empty => "",
            Self::Flow => "Flow",
            Self::Gauss => "G",
            Self::Gee => "g",
            Self::Gram => "gr",
            Self::GramPerDeciliter => "g/dL",
            Self::Hectometer => "100 * m",
            Self::Hour => "hr",
            Self::IntensityFactor => "if",
            Self::Joule => "J",
            Self::KGrit => "kGrit",
            Self::Kilocalorie => "kcal",
            Self::KilocaloriesPerCycle => "kcal/cycle",
            Self::KilocaloriesPerDay => "kcal/day",
            Self::KilocaloriesPerMinute => "kcal/min",
            Self::Kilogram => "kg",
            Self::KilogramsPerCubicMeter => "kg/m^3",
            Self::KilogramsPerSquareMeter => "kg/m^2",
            Self::Kilometer => "km",
            Self::Length => "lengths",
            Self::Liter => "L",
            Self::LiterPerMinute => "L/min",
            Self::Meter => "m",
            Self::MetersPerCycle => "m/cycle",
            Self::MetersPerSecond => "mps",
            Self::MetersPerSecondAndMeter => "m/s,m",
            Self::MetersPerSecondSquared => "m/s^2",
            Self::MetersPerSeconds => "m/s",
            Self::Milligee => "mG",
            Self::MillilitersPerKilogramPerMinute => "mL/kg/min",
            Self::Millimeter => "mm",
            Self::MillimetersOfMercury => "mmHg",
            Self::Millisecond => "ms",
            Self::Minute => "minutes",
            Self::OnePer32768Seconds => "1/32768 s",
            Self::OxygenToxicityUnit => "OTUs",
            Self::Pascal => "Pa",
            Self::Percent => "%",
            Self::PercentOrBeatsPerMinute => "% or bpm",
            Self::PercentOrWatts => "% or watts",
            Self::Radian => "radians",
            Self::RadiansPerSecond => "radians/second",
            Self::RevolutionPerMinute => "rpm",
            Self::Second => "s",
            Self::Semicircle => "semicircles",
            Self::Step => "steps",
            Self::Stride => "strides",
            Self::StridesPerMinute => "strides/min",
            Self::Stroke => "strokes",
            Self::StrokePerLap => "strokes/lap",
            Self::StrokesPerMinute => "strokes/min",
            Self::SwimStroke => "swim_stroke",
            Self::TrainingStressScore => "tss",
            Self::TwoCyclesSteps => "2 * cycles (steps)",
            Self::Voltage => "V",
            Self::Watt => "watts",
            Self::Year => "years",
        }
    }
}