fit_rust/protocol/
get_field_string_value.rs

1use paste::paste;
2
3/// An enum of all possible data types a `Message` field may be
4#[derive(Debug, Copy, Clone, PartialEq)]
5pub enum FieldType {
6    Activity,
7    ActivityClass,
8    ActivityLevel,
9    ActivitySubtype,
10    ActivityType,
11    AntNetwork,
12    AttitudeStage,
13    AttitudeValidity,
14    AutoActivityDetect,
15    AutoSyncFrequency,
16    BacklightMode,
17    BacklightTimeout,
18    BatteryStatus,
19    BodyLocation,
20    Bool,
21    BpStatus,
22    Byte,
23    CameraEventType,
24    CameraOrientationType,
25    ClimbProEvent,
26    ConnectivityCapabilities,
27    CourseCapabilities,
28    CoursePoint,
29    DateMode,
30    DateTime,
31    DayOfWeek,
32    DeviceIndex,
33    DisplayHeart,
34    DisplayMeasure,
35    DisplayOrientation,
36    DisplayPosition,
37    DisplayPower,
38    DiveAlarmType,
39    DiveBacklightMode,
40    DiveGasStatus,
41    Event,
42    EventType,
43    ExdDataUnits,
44    ExdDescriptors,
45    ExdDisplayType,
46    ExdLayout,
47    ExdQualifiers,
48    ExerciseCategory,
49    File,
50    FileFlags,
51    FitBaseType,
52    FitBaseUnit,
53    Float32,
54    Gender,
55    Goal,
56    GoalRecurrence,
57    GoalSource,
58    HrType,
59    HrZoneCalc,
60    Intensity,
61    Language,
62    LapTrigger,
63    LeftRightBalance,
64    LeftRightBalance100,
65    LengthType,
66    LocalDateTime,
67    LocaltimeIntoDay,
68    Manufacturer,
69    MesgCount,
70    MesgNum,
71    MessageIndex,
72    PwrZoneCalc,
73    RadarThreatLevelType,
74    Schedule,
75    SegmentDeleteStatus,
76    SegmentLapStatus,
77    SegmentLeaderboardType,
78    SegmentSelectionType,
79    SensorType,
80    SessionTrigger,
81    SetType,
82    Side,
83    Sint16,
84    Sint32,
85    Sint8,
86    SourceType,
87    Sport,
88    SportBits0,
89    SportEvent,
90    String,
91    StrokeType,
92    SubSport,
93    SwimStroke,
94    Switch,
95    TapSensitivity,
96    TimeMode,
97    TissueModelType,
98    Tone,
99    Uint16,
100    Uint16Z,
101    Uint32,
102    Uint32Z,
103    Uint8,
104    Uint8Z,
105    UserLocalId,
106    WatchfaceMode,
107    WaterType,
108    WeatherReport,
109    WeatherSevereType,
110    WeatherSeverity,
111    WeatherStatus,
112    Weight,
113    WktStepDuration,
114    WktStepTarget,
115    WorkoutCapabilities,
116    WorkoutEquipment,
117    Coordinates,
118    Timestamp,
119    None,
120}
121
122/// Certain `FieldType` values refer to predefined text strings in the SDK.
123///
124/// # Example
125///
126/// ```
127/// let field_type = FieldType::BodyLocation;
128/// let parsed_value = 27;
129/// let predefined_text = match_predefined_field_value(field_type, parsed_value);
130/// assert_eq!(predefined_text, Some("left_forearm_extensors"));
131/// ```
132macro_rules! define_field_mappings {
133    ($(($type:ident, { $($key:expr => $value:expr),* $(,)* }) ),* $(,)*) => {
134        $(
135            paste! {
136                 pub fn [<$type:lower _stringify_field_value>](k: usize) -> Option<&'static str> {
137                    match k {
138                        $(
139                            $key => Some($value),
140                        )*
141                        _ => None,
142                    }
143                }
144
145                 pub fn [<$type:lower _parse_field_value>](value: &str) -> Option<usize> {
146                    match value {
147                        $(
148                            $value => Some($key),
149                        )*
150                        _ => None,
151                    }
152                }
153            }
154        )*
155    }
156}
157
158define_field_mappings! {
159    (Activity, {
160        0 => "manual",
161        1 => "auto_multi_sport",
162    }),
163    (ActivityClass, {
164        127 => "level",
165        100 => "level_max",
166        128 => "athlete",
167    }),
168    (ActivityLevel, {
169        0 => "low",
170        1 => "medium",
171        2 => "high",
172    }),
173    (ActivitySubtype, {
174        0 => "generic",
175        1 => "treadmill",
176        2 => "street",
177        3 => "trail",
178        4 => "track",
179        5 => "spin",
180        6 => "indoor_cycling",
181        7 => "road",
182        8 => "mountain",
183        9 => "downhill",
184        10 => "recumbent",
185        11 => "cyclocross",
186        12 => "hand_cycling",
187        13 => "track_cycling",
188        14 => "indoor_rowing",
189        15 => "elliptical",
190        16 => "stair_climbing",
191        17 => "lap_swimming",
192        18 => "open_water",
193        254 => "all",
194    }),
195    (ActivityType, {
196        0 => "generic",
197        1 => "running",
198        2 => "cycling",
199        3 => "transition",
200        4 => "fitness_equipment",
201        5 => "swimming",
202        6 => "walking",
203        8 => "sedentary",
204        254 => "all",
205    }),
206    (AntNetwork, {
207        0 => "public",
208        1 => "antplus",
209        2 => "antfs",
210        3 => "private",
211    }),
212    (AttitudeStage, {
213        0 => "failed",
214        1 => "aligning",
215        2 => "degraded",
216        3 => "valid",
217    }),
218    (AttitudeValidity, {
219        1 => "track_angle_heading_valid",
220        2 => "pitch_valid",
221        4 => "roll_valid",
222        8 => "lateral_body_accel_valid",
223        16 => "normal_body_accel_valid",
224        32 => "turn_rate_valid",
225        64 => "hw_fail",
226        128 => "mag_invalid",
227        256 => "no_gps",
228        512 => "gps_invalid",
229        1024 => "solution_coasting",
230        2048 => "true_track_angle",
231        4096 => "magnetic_heading",
232    }),
233    (AutoActivityDetect, {
234        0 => "none",
235        1 => "running",
236        2 => "cycling",
237        4 => "swimming",
238        8 => "walking",
239        32 => "elliptical",
240        1024 => "sedentary",
241    }),
242    (AutoSyncFrequency, {
243        0 => "never",
244        1 => "occasionally",
245        2 => "frequent",
246        3 => "once_a_day",
247        4 => "remote",
248    }),
249    (BacklightMode, {
250        0 => "off",
251        1 => "manual",
252        2 => "key_and_messages",
253        3 => "auto_brightness",
254        4 => "smart_notifications",
255        5 => "key_and_messages_night",
256        6 => "key_and_messages_and_smart_notifications",
257    }),
258    (BacklightTimeout, {
259        0 => "infinite",
260    }),
261    (BatteryStatus, {
262        1 => "new",
263        2 => "good",
264        3 => "ok",
265        4 => "low",
266        5 => "critical",
267        6 => "charging",
268        7 => "unknown",
269    }),
270    (BodyLocation, {
271        0 => "left_leg",
272        1 => "left_calf",
273        2 => "left_shin",
274        3 => "left_hamstring",
275        4 => "left_quad",
276        5 => "left_glute",
277        6 => "right_leg",
278        7 => "right_calf",
279        8 => "right_shin",
280        9 => "right_hamstring",
281        10 => "right_quad",
282        11 => "right_glute",
283        12 => "torso_back",
284        13 => "left_lower_back",
285        14 => "left_upper_back",
286        15 => "right_lower_back",
287        16 => "right_upper_back",
288        17 => "torso_front",
289        18 => "left_abdomen",
290        19 => "left_chest",
291        20 => "right_abdomen",
292        21 => "right_chest",
293        22 => "left_arm",
294        23 => "left_shoulder",
295        24 => "left_bicep",
296        25 => "left_tricep",
297        26 => "left_brachioradialis",
298        27 => "left_forearm_extensors",
299        28 => "right_arm",
300        29 => "right_shoulder",
301        30 => "right_bicep",
302        31 => "right_tricep",
303        32 => "right_brachioradialis",
304        33 => "right_forearm_extensors",
305        34 => "neck",
306        35 => "throat",
307        36 => "waist_mid_back",
308        37 => "waist_front",
309        38 => "waist_left",
310        39 => "waist_right",
311    }),
312    (BpStatus, {
313        0 => "no_error",
314        1 => "error_incomplete_data",
315        2 => "error_no_measurement",
316        3 => "error_data_out_of_range",
317        4 => "error_irregular_heart_rate",
318    }),
319    (CameraEventType, {
320        0 => "video_start",
321        1 => "video_split",
322        2 => "video_end",
323        3 => "photo_taken",
324        4 => "video_second_stream_start",
325        5 => "video_second_stream_split",
326        6 => "video_second_stream_end",
327        7 => "video_split_start",
328        8 => "video_second_stream_split_start",
329        11 => "video_pause",
330        12 => "video_second_stream_pause",
331        13 => "video_resume",
332        14 => "video_second_stream_resume",
333    }),
334    (CameraOrientationType, {
335        0 => "camera_orientation_0",
336        1 => "camera_orientation_90",
337        2 => "camera_orientation_180",
338        3 => "camera_orientation_270",
339    }),
340    (ClimbProEvent, {
341        0 => "approach",
342        1 => "start",
343        2 => "complete",
344    }),
345    (ConnectivityCapabilities, {
346        1 => "bluetooth",
347        2 => "bluetooth_le",
348        4 => "ant",
349        8 => "activity_upload",
350        16 => "course_download",
351        32 => "workout_download",
352        64 => "live_track",
353        128 => "weather_conditions",
354        256 => "weather_alerts",
355        512 => "gps_ephemeris_download",
356        1024 => "explicit_archive",
357        2048 => "setup_incomplete",
358        4096 => "continue_sync_after_software_update",
359        8192 => "connect_iq_app_download",
360        16384 => "golf_course_download",
361        32768 => "device_initiates_sync",
362        65536 => "connect_iq_watch_app_download",
363        131072 => "connect_iq_widget_download",
364        262144 => "connect_iq_watch_face_download",
365        524288 => "connect_iq_data_field_download",
366        1048576 => "connect_iq_app_managment",
367        2097152 => "swing_sensor",
368        4194304 => "swing_sensor_remote",
369        8388608 => "incident_detection",
370        16777216 => "audio_prompts",
371        33554432 => "wifi_verification",
372        67108864 => "true_up",
373        134217728 => "find_my_watch",
374        268435456 => "remote_manual_sync",
375        536870912 => "live_track_auto_start",
376        1073741824 => "live_track_messaging",
377        2147483648 => "instant_input",
378    }),
379    (CourseCapabilities, {
380        1 => "processed",
381        2 => "valid",
382        4 => "time",
383        8 => "distance",
384        16 => "position",
385        32 => "heart_rate",
386        64 => "power",
387        128 => "cadence",
388        256 => "training",
389        512 => "navigation",
390        1024 => "bikeway",
391    }),
392    (CoursePoint, {
393        0 => "generic",
394        1 => "summit",
395        2 => "valley",
396        3 => "water",
397        4 => "food",
398        5 => "danger",
399        6 => "left",
400        7 => "right",
401        8 => "straight",
402        9 => "first_aid",
403        10 => "fourth_category",
404        11 => "third_category",
405        12 => "second_category",
406        13 => "first_category",
407        14 => "hors_category",
408        15 => "sprint",
409        16 => "left_fork",
410        17 => "right_fork",
411        18 => "middle_fork",
412        19 => "slight_left",
413        20 => "sharp_left",
414        21 => "slight_right",
415        22 => "sharp_right",
416        23 => "u_turn",
417        24 => "segment_start",
418        25 => "segment_end",
419        27 => "campsite",
420        28 => "aid_station",
421        29 => "rest_area",
422        30 => "general_distance",
423        31 => "service",
424        32 => "energy_gel",
425        33 => "sports_drink",
426        34 => "mile_marker",
427        35 => "checkpoint",
428        36 => "shelter",
429        37 => "meeting_spot",
430        38 => "overlook",
431        39 => "toilet",
432        40 => "shower",
433        41 => "gear",
434        42 => "sharp_curve",
435        43 => "steep_incline",
436        44 => "tunnel",
437        45 => "bridge",
438        46 => "obstacle",
439        47 => "crossing",
440        48 => "store",
441        49 => "transition",
442        50 => "navaid",
443        51 => "transport",
444        52 => "alert",
445        53 => "info",
446    }),
447    (DateMode, {
448        0 => "day_month",
449        1 => "month_day",
450    }),
451    (DateTime, {
452        268435456 => "min",
453    }),
454    (DayOfWeek, {
455        0 => "sunday",
456        1 => "monday",
457        2 => "tuesday",
458        3 => "wednesday",
459        4 => "thursday",
460        5 => "friday",
461        6 => "saturday",
462    }),
463    (DeviceIndex, {
464        0 => "creator",
465    }),
466    (DisplayHeart, {
467        0 => "bpm",
468        1 => "max",
469        2 => "reserve",
470    }),
471    (DisplayMeasure, {
472        0 => "metric",
473        1 => "statute",
474        2 => "nautical",
475    }),
476    (DisplayOrientation, {
477        0 => "auto",
478        1 => "portrait",
479        2 => "landscape",
480        3 => "portrait_flipped",
481        4 => "landscape_flipped",
482    }),
483    (DisplayPosition, {
484        0 => "degree",
485        1 => "degree_minute",
486        2 => "degree_minute_second",
487        3 => "austrian_grid",
488        4 => "british_grid",
489        5 => "dutch_grid",
490        6 => "hungarian_grid",
491        7 => "finnish_grid",
492        8 => "german_grid",
493        9 => "icelandic_grid",
494        10 => "indonesian_equatorial",
495        11 => "indonesian_irian",
496        12 => "indonesian_southern",
497        13 => "india_zone_0",
498        14 => "india_zone_IA",
499        15 => "india_zone_IB",
500        16 => "india_zone_IIA",
501        17 => "india_zone_IIB",
502        18 => "india_zone_IIIA",
503        19 => "india_zone_IIIB",
504        20 => "india_zone_IVA",
505        21 => "india_zone_IVB",
506        22 => "irish_transverse",
507        23 => "irish_grid",
508        24 => "loran",
509        25 => "maidenhead_grid",
510        26 => "mgrs_grid",
511        27 => "new_zealand_grid",
512        28 => "new_zealand_transverse",
513        29 => "qatar_grid",
514        30 => "modified_swedish_grid",
515        31 => "swedish_grid",
516        32 => "south_african_grid",
517        33 => "swiss_grid",
518        34 => "taiwan_grid",
519        35 => "united_states_grid",
520        36 => "utm_ups_grid",
521        37 => "west_malayan",
522        38 => "borneo_rso",
523        39 => "estonian_grid",
524        40 => "latvian_grid",
525        41 => "swedish_ref_99_grid",
526    }),
527    (DisplayPower, {
528        0 => "watts",
529        1 => "percent_ftp",
530    }),
531    (DiveAlarmType, {
532        0 => "depth",
533        1 => "time",
534    }),
535    (DiveBacklightMode, {
536        0 => "at_depth",
537        1 => "always_on",
538    }),
539    (DiveGasStatus, {
540        0 => "disabled",
541        1 => "enabled",
542        2 => "backup_only",
543    }),
544    (Event, {
545        0 => "timer",
546        3 => "workout",
547        4 => "workout_step",
548        5 => "power_down",
549        6 => "power_up",
550        7 => "off_course",
551        8 => "session",
552        9 => "lap",
553        10 => "course_point",
554        11 => "battery",
555        12 => "virtual_partner_pace",
556        13 => "hr_high_alert",
557        14 => "hr_low_alert",
558        15 => "speed_high_alert",
559        16 => "speed_low_alert",
560        17 => "cad_high_alert",
561        18 => "cad_low_alert",
562        19 => "power_high_alert",
563        20 => "power_low_alert",
564        21 => "recovery_hr",
565        22 => "battery_low",
566        23 => "time_duration_alert",
567        24 => "distance_duration_alert",
568        25 => "calorie_duration_alert",
569        26 => "activity",
570        27 => "fitness_equipment",
571        28 => "length",
572        32 => "user_marker",
573        33 => "sport_point",
574        36 => "calibration",
575        42 => "front_gear_change",
576        43 => "rear_gear_change",
577        44 => "rider_position_change",
578        45 => "elev_high_alert",
579        46 => "elev_low_alert",
580        47 => "comm_timeout",
581        75 => "radar_threat_alert",
582    }),
583    (EventType, {
584        0 => "start",
585        1 => "stop",
586        2 => "consecutive_depreciated",
587        3 => "marker",
588        4 => "stop_all",
589        5 => "begin_depreciated",
590        6 => "end_depreciated",
591        7 => "end_all_depreciated",
592        8 => "stop_disable",
593        9 => "stop_disable_all",
594    }),
595    (ExdDataUnits, {
596        0 => "no_units",
597        1 => "laps",
598        2 => "miles_per_hour",
599        3 => "kilometers_per_hour",
600        4 => "feet_per_hour",
601        5 => "meters_per_hour",
602        6 => "degrees_celsius",
603        7 => "degrees_farenheit",
604        8 => "zone",
605        9 => "gear",
606        10 => "rpm",
607        11 => "bpm",
608        12 => "degrees",
609        13 => "millimeters",
610        14 => "meters",
611        15 => "kilometers",
612        16 => "feet",
613        17 => "yards",
614        18 => "kilofeet",
615        19 => "miles",
616        20 => "time",
617        21 => "enum_turn_type",
618        22 => "percent",
619        23 => "watts",
620        24 => "watts_per_kilogram",
621        25 => "enum_battery_status",
622        26 => "enum_bike_light_beam_angle_mode",
623        27 => "enum_bike_light_battery_status",
624        28 => "enum_bike_light_network_config_type",
625        29 => "lights",
626        30 => "seconds",
627        31 => "minutes",
628        32 => "hours",
629        33 => "calories",
630        34 => "kilojoules",
631        35 => "milliseconds",
632        36 => "second_per_mile",
633        37 => "second_per_kilometer",
634        38 => "centimeter",
635        39 => "enum_course_point",
636        40 => "bradians",
637        41 => "enum_sport",
638        42 => "inches_hg",
639        43 => "mm_hg",
640        44 => "mbars",
641        45 => "hecto_pascals",
642        46 => "feet_per_min",
643        47 => "meters_per_min",
644        48 => "meters_per_sec",
645        49 => "eight_cardinal",
646    }),
647    (ExdDescriptors, {
648        0 => "bike_light_battery_status",
649        1 => "beam_angle_status",
650        2 => "batery_level",
651        3 => "light_network_mode",
652        4 => "number_lights_connected",
653        5 => "cadence",
654        6 => "distance",
655        7 => "estimated_time_of_arrival",
656        8 => "heading",
657        9 => "time",
658        10 => "battery_level",
659        11 => "trainer_resistance",
660        12 => "trainer_target_power",
661        13 => "time_seated",
662        14 => "time_standing",
663        15 => "elevation",
664        16 => "grade",
665        17 => "ascent",
666        18 => "descent",
667        19 => "vertical_speed",
668        20 => "di2_battery_level",
669        21 => "front_gear",
670        22 => "rear_gear",
671        23 => "gear_ratio",
672        24 => "heart_rate",
673        25 => "heart_rate_zone",
674        26 => "time_in_heart_rate_zone",
675        27 => "heart_rate_reserve",
676        28 => "calories",
677        29 => "gps_accuracy",
678        30 => "gps_signal_strength",
679        31 => "temperature",
680        32 => "time_of_day",
681        33 => "balance",
682        34 => "pedal_smoothness",
683        35 => "power",
684        36 => "functional_threshold_power",
685        37 => "intensity_factor",
686        38 => "work",
687        39 => "power_ratio",
688        40 => "normalized_power",
689        41 => "training_stress_Score",
690        42 => "time_on_zone",
691        43 => "speed",
692        44 => "laps",
693        45 => "reps",
694        46 => "workout_step",
695        47 => "course_distance",
696        48 => "navigation_distance",
697        49 => "course_estimated_time_of_arrival",
698        50 => "navigation_estimated_time_of_arrival",
699        51 => "course_time",
700        52 => "navigation_time",
701        53 => "course_heading",
702        54 => "navigation_heading",
703        55 => "power_zone",
704        56 => "torque_effectiveness",
705        57 => "timer_time",
706        58 => "power_weight_ratio",
707        59 => "left_platform_center_offset",
708        60 => "right_platform_center_offset",
709        61 => "left_power_phase_start_angle",
710        62 => "right_power_phase_start_angle",
711        63 => "left_power_phase_finish_angle",
712        64 => "right_power_phase_finish_angle",
713        65 => "gears",
714        66 => "pace",
715        67 => "training_effect",
716        68 => "vertical_oscillation",
717        69 => "vertical_ratio",
718        70 => "ground_contact_time",
719        71 => "left_ground_contact_time_balance",
720        72 => "right_ground_contact_time_balance",
721        73 => "stride_length",
722        74 => "running_cadence",
723        75 => "performance_condition",
724        76 => "course_type",
725        77 => "time_in_power_zone",
726        78 => "navigation_turn",
727        79 => "course_location",
728        80 => "navigation_location",
729        81 => "compass",
730        82 => "gear_combo",
731        83 => "muscle_oxygen",
732        84 => "icon",
733        85 => "compass_heading",
734        86 => "gps_heading",
735        87 => "gps_elevation",
736        88 => "anaerobic_training_effect",
737        89 => "course",
738        90 => "off_course",
739        91 => "glide_ratio",
740        92 => "vertical_distance",
741        93 => "vmg",
742        94 => "ambient_pressure",
743        95 => "pressure",
744        96 => "vam",
745    }),
746    (ExdDisplayType, {
747        0 => "numerical",
748        1 => "simple",
749        2 => "graph",
750        3 => "bar",
751        4 => "circle_graph",
752        5 => "virtual_partner",
753        6 => "balance",
754        7 => "string_list",
755        8 => "string",
756        9 => "simple_dynamic_icon",
757        10 => "gauge",
758    }),
759    (ExdLayout, {
760        0 => "full_screen",
761        1 => "half_vertical",
762        2 => "half_horizontal",
763        3 => "half_vertical_right_split",
764        4 => "half_horizontal_bottom_split",
765        5 => "full_quarter_split",
766        6 => "half_vertical_left_split",
767        7 => "half_horizontal_top_split",
768        8 => "dynamic",
769    }),
770    (ExdQualifiers, {
771        0 => "no_qualifier",
772        1 => "instantaneous",
773        2 => "average",
774        3 => "lap",
775        4 => "maximum",
776        5 => "maximum_average",
777        6 => "maximum_lap",
778        7 => "last_lap",
779        8 => "average_lap",
780        9 => "to_destination",
781        10 => "to_go",
782        11 => "to_next",
783        12 => "next_course_point",
784        13 => "total",
785        14 => "three_second_average",
786        15 => "ten_second_average",
787        16 => "thirty_second_average",
788        17 => "percent_maximum",
789        18 => "percent_maximum_average",
790        19 => "lap_percent_maximum",
791        20 => "elapsed",
792        21 => "sunrise",
793        22 => "sunset",
794        23 => "compared_to_virtual_partner",
795        24 => "maximum_24h",
796        25 => "minimum_24h",
797        26 => "minimum",
798        27 => "first",
799        28 => "second",
800        29 => "third",
801        30 => "shifter",
802        31 => "last_sport",
803        32 => "moving",
804        33 => "stopped",
805        34 => "estimated_total",
806        242 => "zone_9",
807        243 => "zone_8",
808        244 => "zone_7",
809        245 => "zone_6",
810        246 => "zone_5",
811        247 => "zone_4",
812        248 => "zone_3",
813        249 => "zone_2",
814        250 => "zone_1",
815    }),
816    (ExerciseCategory, {
817        0 => "bench_press",
818        1 => "calf_raise",
819        2 => "cardio",
820        3 => "carry",
821        4 => "chop",
822        5 => "core",
823        6 => "crunch",
824        7 => "curl",
825        8 => "deadlift",
826        9 => "flye",
827        10 => "hip_raise",
828        11 => "hip_stability",
829        12 => "hip_swing",
830        13 => "hyperextension",
831        14 => "lateral_raise",
832        15 => "leg_curl",
833        16 => "leg_raise",
834        17 => "lunge",
835        18 => "olympic_lift",
836        19 => "plank",
837        20 => "plyo",
838        21 => "pull_up",
839        22 => "push_up",
840        23 => "row",
841        24 => "shoulder_press",
842        25 => "shoulder_stability",
843        26 => "shrug",
844        27 => "sit_up",
845        28 => "squat",
846        29 => "total_body",
847        30 => "triceps_extension",
848        31 => "warm_up",
849        32 => "run",
850        65534 => "unknown",
851    }),
852    (File, {
853        1 => "device",
854        2 => "settings",
855        3 => "sport",
856        4 => "activity",
857        5 => "workout",
858        6 => "course",
859        7 => "schedules",
860        9 => "weight",
861        10 => "totals",
862        11 => "goals",
863        14 => "blood_pressure",
864        15 => "monitoring_a",
865        20 => "activity_summary",
866        28 => "monitoring_daily",
867        32 => "monitoring_b",
868        34 => "segment",
869        35 => "segment_list",
870        40 => "exd_configuration",
871        247 => "mfg_range_min",
872        254 => "mfg_range_max",
873    }),
874    (FileFlags, {
875        2 => "read",
876        4 => "write",
877        8 => "erase",
878    }),
879    (FitBaseType, {
880        0 => "enum",
881        1 => "sint8",
882        2 => "uint8",
883        131 => "sint16",
884        132 => "uint16",
885        133 => "sint32",
886        134 => "uint32",
887        7 => "string",
888        136 => "float32",
889        137 => "float64",
890        10 => "uint8z",
891        139 => "uint16z",
892        140 => "uint32z",
893        13 => "byte",
894        142 => "sint64",
895        143 => "uint64",
896        144 => "uint64z",
897    }),
898    (FitBaseUnit, {
899        0 => "other",
900        1 => "kilogram",
901        2 => "pound",
902    }),
903    (Gender, {
904        0 => "female",
905        1 => "male",
906        2 => "unspecified",
907    }),
908    (Goal, {
909        0 => "time",
910        1 => "distance",
911        2 => "calories",
912        3 => "frequency",
913        4 => "steps",
914        5 => "ascent",
915        6 => "active_minutes",
916    }),
917    (GoalRecurrence, {
918        0 => "off",
919        1 => "daily",
920        2 => "weekly",
921        3 => "monthly",
922        4 => "yearly",
923        5 => "custom",
924    }),
925    (GoalSource, {
926        0 => "auto",
927        1 => "community",
928        2 => "user",
929    }),
930    (HrType, {
931        0 => "normal",
932        1 => "irregular",
933    }),
934    (HrZoneCalc, {
935        0 => "custom",
936        1 => "percent_max_hr",
937        2 => "percent_hrr",
938    }),
939    (Intensity, {
940        0 => "active",
941        1 => "rest",
942        2 => "warmup",
943        3 => "cooldown",
944        4 => "recovery",
945        5 => "interval",
946        6 => "other",
947    }),
948    (Language, {
949        0 => "english",
950        1 => "french",
951        2 => "italian",
952        3 => "german",
953        4 => "spanish",
954        5 => "croatian",
955        6 => "czech",
956        7 => "danish",
957        8 => "dutch",
958        9 => "finnish",
959        10 => "greek",
960        11 => "hungarian",
961        12 => "norwegian",
962        13 => "polish",
963        14 => "portuguese",
964        15 => "slovakian",
965        16 => "slovenian",
966        17 => "swedish",
967        18 => "russian",
968        19 => "turkish",
969        20 => "latvian",
970        21 => "ukrainian",
971        22 => "arabic",
972        23 => "farsi",
973        24 => "bulgarian",
974        25 => "romanian",
975        26 => "chinese",
976        27 => "japanese",
977        28 => "korean",
978        29 => "taiwanese",
979        30 => "thai",
980        31 => "hebrew",
981        32 => "brazilian_portuguese",
982        33 => "indonesian",
983        34 => "malaysian",
984        35 => "vietnamese",
985        36 => "burmese",
986        37 => "mongolian",
987        254 => "custom",
988    }),
989    (LapTrigger, {
990        0 => "manual",
991        1 => "time",
992        2 => "distance",
993        3 => "position_start",
994        4 => "position_lap",
995        5 => "position_waypoint",
996        6 => "position_marked",
997        7 => "session_end",
998        8 => "fitness_equipment",
999    }),
1000    (LeftRightBalance, {
1001        127 => "mask",
1002        128 => "right",
1003    }),
1004    (LeftRightBalance100, {
1005        16383 => "mask",
1006        32768 => "right",
1007    }),
1008    (LengthType, {
1009        0 => "idle",
1010        1 => "active",
1011    }),
1012    (LocalDateTime, {
1013        268435456 => "min",
1014    }),
1015    (LocaltimeIntoDay, {
1016    }),
1017    (Manufacturer, {
1018        1 => "garmin",
1019        2 => "garmin_fr405_antfs",
1020        3 => "zephyr",
1021        4 => "dayton",
1022        5 => "idt",
1023        6 => "srm",
1024        7 => "quarq",
1025        8 => "ibike",
1026        9 => "saris",
1027        10 => "spark_hk",
1028        11 => "tanita",
1029        12 => "echowell",
1030        13 => "dynastream_oem",
1031        14 => "nautilus",
1032        15 => "dynastream",
1033        16 => "timex",
1034        17 => "metrigear",
1035        18 => "xelic",
1036        19 => "beurer",
1037        20 => "cardiosport",
1038        21 => "a_and_d",
1039        22 => "hmm",
1040        23 => "suunto",
1041        24 => "thita_elektronik",
1042        25 => "gpulse",
1043        26 => "clean_mobile",
1044        27 => "pedal_brain",
1045        28 => "peaksware",
1046        29 => "saxonar",
1047        30 => "lemond_fitness",
1048        31 => "dexcom",
1049        32 => "wahoo_fitness",
1050        33 => "octane_fitness",
1051        34 => "archinoetics",
1052        35 => "the_hurt_box",
1053        36 => "citizen_systems",
1054        37 => "magellan",
1055        38 => "osynce",
1056        39 => "holux",
1057        40 => "concept2",
1058        41 => "shimano",
1059        42 => "one_giant_leap",
1060        43 => "ace_sensor",
1061        44 => "brim_brothers",
1062        45 => "xplova",
1063        46 => "perception_digital",
1064        47 => "bf1systems",
1065        48 => "pioneer",
1066        49 => "spantec",
1067        50 => "metalogics",
1068        51 => "4iiiis",
1069        52 => "seiko_epson",
1070        53 => "seiko_epson_oem",
1071        54 => "ifor_powell",
1072        55 => "maxwell_guider",
1073        56 => "star_trac",
1074        57 => "breakaway",
1075        58 => "alatech_technology_ltd",
1076        59 => "mio_technology_europe",
1077        60 => "rotor",
1078        61 => "geonaute",
1079        62 => "id_bike",
1080        63 => "specialized",
1081        64 => "wtek",
1082        65 => "physical_enterprises",
1083        66 => "north_pole_engineering",
1084        67 => "bkool",
1085        68 => "cateye",
1086        69 => "stages_cycling",
1087        70 => "sigmasport",
1088        71 => "tomtom",
1089        72 => "peripedal",
1090        73 => "wattbike",
1091        76 => "moxy",
1092        77 => "ciclosport",
1093        78 => "powerbahn",
1094        79 => "acorn_projects_aps",
1095        80 => "lifebeam",
1096        81 => "bontrager",
1097        82 => "wellgo",
1098        83 => "scosche",
1099        84 => "magura",
1100        85 => "woodway",
1101        86 => "elite",
1102        87 => "nielsen_kellerman",
1103        88 => "dk_city",
1104        89 => "tacx",
1105        90 => "direction_technology",
1106        91 => "magtonic",
1107        92 => "1partcarbon",
1108        93 => "inside_ride_technologies",
1109        94 => "sound_of_motion",
1110        95 => "stryd",
1111        96 => "icg",
1112        97 => "MiPulse",
1113        98 => "bsx_athletics",
1114        99 => "look",
1115        100 => "campagnolo_srl",
1116        101 => "body_bike_smart",
1117        102 => "praxisworks",
1118        103 => "limits_technology",
1119        104 => "topaction_technology",
1120        105 => "cosinuss",
1121        106 => "fitcare",
1122        107 => "magene",
1123        108 => "giant_manufacturing_co",
1124        109 => "tigrasport",
1125        110 => "salutron",
1126        111 => "technogym",
1127        112 => "bryton_sensors",
1128        113 => "latitude_limited",
1129        114 => "soaring_technology",
1130        115 => "igpsport",
1131        116 => "thinkrider",
1132        117 => "gopher_sport",
1133        118 => "waterrower",
1134        119 => "orangetheory",
1135        120 => "inpeak",
1136        121 => "kinetic",
1137        122 => "johnson_health_tech",
1138        123 => "polar_electro",
1139        124 => "seesense",
1140        125 => "nci_technology",
1141        126 => "iqsquare",
1142        127 => "leomo",
1143        128 => "ifit_com",
1144        129 => "coros_byte",
1145        130 => "versa_design",
1146        131 => "chileaf",
1147        132 => "cycplus",
1148        133 => "gravaa_byte",
1149        134 => "sigeyi",
1150        135 => "coospo",
1151        136 => "geoid",
1152        137 => "bosch",
1153        138 => "kyto",
1154        139 => "kinetic_sports",
1155        140 => "decathlon_byte",
1156        141 => "tq_systems",
1157        142 => "tag_heuer",
1158        255 => "development",
1159        257 => "healthandlife",
1160        258 => "lezyne",
1161        259 => "scribe_labs",
1162        260 => "zwift",
1163        261 => "watteam",
1164        262 => "recon",
1165        263 => "favero_electronics",
1166        264 => "dynovelo",
1167        265 => "strava",
1168        266 => "precor",
1169        267 => "bryton",
1170        268 => "sram",
1171        269 => "navman",
1172        270 => "cobi",
1173        271 => "spivi",
1174        272 => "mio_magellan",
1175        273 => "evesports",
1176        274 => "sensitivus_gauge",
1177        275 => "podoon",
1178        276 => "life_time_fitness",
1179        277 => "falco_e_motors",
1180        278 => "minoura",
1181        279 => "cycliq",
1182        280 => "luxottica",
1183        281 => "trainer_road",
1184        282 => "the_sufferfest",
1185        283 => "fullspeedahead",
1186        284 => "virtualtraining",
1187        285 => "feedbacksports",
1188        286 => "omata",
1189        287 => "vdo",
1190        288 => "magneticdays",
1191        289 => "hammerhead",
1192        290 => "kinetic_by_kurt",
1193        291 => "shapelog",
1194        292 => "dabuziduo",
1195        293 => "jetblack",
1196        294 => "coros",
1197        295 => "virtugo",
1198        296 => "velosense",
1199        297 => "cycligentinc",
1200        298 => "trailforks",
1201        299 => "mahle_ebikemotion",
1202        300 => "nurvv",
1203        301 => "microprogram",
1204        302 => "zone5cloud",
1205        303 => "greenteg",
1206        304 => "yamaha_motors",
1207        305 => "whoop",
1208        306 => "gravaa",
1209        307 => "onelap",
1210        308 => "monark_exercise",
1211        309 => "form",
1212        310 => "decathlon",
1213        311 => "syncros",
1214        312 => "heatup",
1215        313 => "cannondale",
1216        314 => "true_fitness",
1217        315 => "RGT_cycling",
1218        316 => "vasa",
1219        317 => "race_republic",
1220        318 => "fazua",
1221        5759 => "actigraphcorp",
1222    }),
1223    (MesgCount, {
1224        0 => "num_per_file",
1225        1 => "max_per_file",
1226        2 => "max_per_file_type",
1227    }),
1228    (MesgNum, {
1229        0 => "file_id",
1230        1 => "capabilities",
1231        2 => "device_settings",
1232        3 => "user_profile",
1233        4 => "hrm_profile",
1234        5 => "sdm_profile",
1235        6 => "bike_profile",
1236        7 => "zones_target",
1237        8 => "hr_zone",
1238        9 => "power_zone",
1239        10 => "met_zone",
1240        12 => "sport",
1241        15 => "goal",
1242        18 => "session",
1243        19 => "lap",
1244        20 => "record",
1245        21 => "event",
1246        23 => "device_info",
1247        26 => "workout",
1248        27 => "workout_step",
1249        28 => "schedule",
1250        30 => "weight_scale",
1251        31 => "course",
1252        32 => "course_point",
1253        33 => "totals",
1254        34 => "activity",
1255        35 => "software",
1256        37 => "file_capabilities",
1257        38 => "mesg_capabilities",
1258        39 => "field_capabilities",
1259        49 => "file_creator",
1260        51 => "blood_pressure",
1261        53 => "speed_zone",
1262        55 => "monitoring",
1263        72 => "training_file",
1264        78 => "hrv",
1265        80 => "ant_rx",
1266        81 => "ant_tx",
1267        82 => "ant_channel_id",
1268        101 => "length",
1269        103 => "monitoring_info",
1270        105 => "pad",
1271        106 => "slave_device",
1272        127 => "connectivity",
1273        128 => "weather_conditions",
1274        129 => "weather_alert",
1275        131 => "cadence_zone",
1276        132 => "hr",
1277        142 => "segment_lap",
1278        145 => "memo_glob",
1279        148 => "segment_id",
1280        149 => "segment_leaderboard_entry",
1281        150 => "segment_point",
1282        151 => "segment_file",
1283        158 => "workout_session",
1284        159 => "watchface_settings",
1285        160 => "gps_metadata",
1286        161 => "camera_event",
1287        162 => "timestamp_correlation",
1288        164 => "gyroscope_data",
1289        165 => "accelerometer_data",
1290        167 => "three_d_sensor_calibration",
1291        169 => "video_frame",
1292        174 => "obdii_data",
1293        177 => "nmea_sentence",
1294        178 => "aviation_attitude",
1295        184 => "video",
1296        185 => "video_title",
1297        186 => "video_description",
1298        187 => "video_clip",
1299        188 => "ohr_settings",
1300        200 => "exd_screen_configuration",
1301        201 => "exd_data_field_configuration",
1302        202 => "exd_data_concept_configuration",
1303        206 => "field_description",
1304        207 => "developer_data_id",
1305        208 => "magnetometer_data",
1306        209 => "barometer_data",
1307        210 => "one_d_sensor_calibration",
1308        225 => "set",
1309        227 => "stress_level",
1310        258 => "dive_settings",
1311        259 => "dive_gas",
1312        262 => "dive_alarm",
1313        264 => "exercise_title",
1314        268 => "dive_summary",
1315        285 => "jump",
1316        317 => "climb_pro",
1317        375 => "device_aux_battery_info",
1318        65280 => "mfg_range_min",
1319        65534 => "mfg_range_max",
1320    }),
1321    (MessageIndex, {
1322        32768 => "selected",
1323        28672 => "reserved",
1324        4095 => "mask",
1325    }),
1326    (PwrZoneCalc, {
1327        0 => "custom",
1328        1 => "percent_ftp",
1329    }),
1330    (RadarThreatLevelType, {
1331        0 => "threat_unknown",
1332        1 => "threat_none",
1333        2 => "threat_approaching",
1334        3 => "threat_approaching_fast",
1335    }),
1336    (Schedule, {
1337        0 => "workout",
1338        1 => "course",
1339    }),
1340    (SegmentDeleteStatus, {
1341        0 => "do_not_delete",
1342        1 => "delete_one",
1343        2 => "delete_all",
1344    }),
1345    (SegmentLapStatus, {
1346        0 => "end",
1347        1 => "fail",
1348    }),
1349    (SegmentLeaderboardType, {
1350        0 => "overall",
1351        1 => "personal_best",
1352        2 => "connections",
1353        3 => "group",
1354        4 => "challenger",
1355        5 => "kom",
1356        6 => "qom",
1357        7 => "pr",
1358        8 => "goal",
1359        9 => "rival",
1360        10 => "club_leader",
1361    }),
1362    (SegmentSelectionType, {
1363        0 => "starred",
1364        1 => "suggested",
1365    }),
1366    (SensorType, {
1367        0 => "accelerometer",
1368        1 => "gyroscope",
1369        2 => "compass",
1370        3 => "barometer",
1371    }),
1372    (SessionTrigger, {
1373        0 => "activity_end",
1374        1 => "manual",
1375        2 => "auto_multi_sport",
1376        3 => "fitness_equipment",
1377    }),
1378    (SetType, {
1379        0 => "rest",
1380        1 => "active",
1381    }),
1382    (Side, {
1383        0 => "right",
1384        1 => "left",
1385    }),
1386    (SourceType, {
1387        0 => "ant",
1388        1 => "antplus",
1389        2 => "bluetooth",
1390        3 => "bluetooth_low_energy",
1391        4 => "wifi",
1392        5 => "local",
1393    }),
1394    (Sport, {
1395        0 => "generic",
1396        1 => "running",
1397        2 => "cycling",
1398        3 => "transition",
1399        4 => "fitness_equipment",
1400        5 => "swimming",
1401        6 => "basketball",
1402        7 => "soccer",
1403        8 => "tennis",
1404        9 => "american_football",
1405        10 => "training",
1406        11 => "walking",
1407        12 => "cross_country_skiing",
1408        13 => "alpine_skiing",
1409        14 => "snowboarding",
1410        15 => "rowing",
1411        16 => "mountaineering",
1412        17 => "hiking",
1413        18 => "multisport",
1414        19 => "paddling",
1415        20 => "flying",
1416        21 => "e_biking",
1417        22 => "motorcycling",
1418        23 => "boating",
1419        24 => "driving",
1420        25 => "golf",
1421        26 => "hang_gliding",
1422        27 => "horseback_riding",
1423        28 => "hunting",
1424        29 => "fishing",
1425        30 => "inline_skating",
1426        31 => "rock_climbing",
1427        32 => "sailing",
1428        33 => "ice_skating",
1429        34 => "sky_diving",
1430        35 => "snowshoeing",
1431        36 => "snowmobiling",
1432        37 => "stand_up_paddleboarding",
1433        38 => "surfing",
1434        39 => "wakeboarding",
1435        40 => "water_skiing",
1436        41 => "kayaking",
1437        42 => "rafting",
1438        43 => "windsurfing",
1439        44 => "kitesurfing",
1440        45 => "tactical",
1441        46 => "jumpmaster",
1442        47 => "boxing",
1443        48 => "floor_climbing",
1444        53 => "diving",
1445        254 => "all",
1446    }),
1447    (SportBits0, {
1448        1 => "generic",
1449        2 => "running",
1450        4 => "cycling",
1451        8 => "transition",
1452        16 => "fitness_equipment",
1453        32 => "swimming",
1454        64 => "basketball",
1455        128 => "soccer",
1456    }),
1457    (SportEvent, {
1458        0 => "uncategorized",
1459        1 => "geocaching",
1460        2 => "fitness",
1461        3 => "recreation",
1462        4 => "race",
1463        5 => "special_event",
1464        6 => "training",
1465        7 => "transportation",
1466        8 => "touring",
1467    }),
1468    (StrokeType, {
1469        0 => "no_event",
1470        1 => "other",
1471        2 => "serve",
1472        3 => "forehand",
1473        4 => "backhand",
1474        5 => "smash",
1475    }),
1476    (SubSport, {
1477        0 => "generic",
1478        1 => "treadmill",
1479        2 => "street",
1480        3 => "trail",
1481        4 => "track",
1482        5 => "spin",
1483        6 => "indoor_cycling",
1484        7 => "road",
1485        8 => "mountain",
1486        9 => "downhill",
1487        10 => "recumbent",
1488        11 => "cyclocross",
1489        12 => "hand_cycling",
1490        13 => "track_cycling",
1491        14 => "indoor_rowing",
1492        15 => "elliptical",
1493        16 => "stair_climbing",
1494        17 => "lap_swimming",
1495        18 => "open_water",
1496        19 => "flexibility_training",
1497        20 => "strength_training",
1498        21 => "warm_up",
1499        22 => "match",
1500        23 => "exercise",
1501        24 => "challenge",
1502        25 => "indoor_skiing",
1503        26 => "cardio_training",
1504        27 => "indoor_walking",
1505        28 => "e_bike_fitness",
1506        29 => "bmx",
1507        30 => "casual_walking",
1508        31 => "speed_walking",
1509        32 => "bike_to_run_transition",
1510        33 => "run_to_bike_transition",
1511        34 => "swim_to_bike_transition",
1512        35 => "atv",
1513        36 => "motocross",
1514        37 => "backcountry",
1515        38 => "resort",
1516        39 => "rc_drone",
1517        40 => "wingsuit",
1518        41 => "whitewater",
1519        42 => "skate_skiing",
1520        43 => "yoga",
1521        44 => "pilates",
1522        45 => "indoor_running",
1523        46 => "gravel_cycling",
1524        47 => "e_bike_mountain",
1525        48 => "commuting",
1526        49 => "mixed_surface",
1527        50 => "navigate",
1528        51 => "track_me",
1529        52 => "map",
1530        53 => "single_gas_diving",
1531        54 => "multi_gas_diving",
1532        55 => "gauge_diving",
1533        56 => "apnea_diving",
1534        57 => "apnea_hunting",
1535        58 => "virtual_activity",
1536        59 => "obstacle",
1537        62 => "breathing",
1538        65 => "sail_race",
1539        67 => "ultra",
1540        68 => "indoor_climbing",
1541        69 => "bouldering",
1542        254 => "all",
1543    }),
1544    (SwimStroke, {
1545        0 => "freestyle",
1546        1 => "backstroke",
1547        2 => "breaststroke",
1548        3 => "butterfly",
1549        4 => "drill",
1550        5 => "mixed",
1551        6 => "im",
1552    }),
1553    (Switch, {
1554        0 => "off",
1555        1 => "on",
1556        2 => "auto",
1557    }),
1558    (TapSensitivity, {
1559        0 => "high",
1560        1 => "medium",
1561        2 => "low",
1562    }),
1563    (TimeMode, {
1564        0 => "hour12",
1565        1 => "hour24",
1566        2 => "military",
1567        3 => "hour_12_with_seconds",
1568        4 => "hour_24_with_seconds",
1569        5 => "utc",
1570    }),
1571    (TissueModelType, {
1572        0 => "zhl_16c",
1573    }),
1574    (Tone, {
1575        0 => "off",
1576        1 => "tone",
1577        2 => "vibrate",
1578        3 => "tone_and_vibrate",
1579    }),
1580    (UserLocalId, {
1581        0 => "local_min",
1582        15 => "local_max",
1583        16 => "stationary_min",
1584        255 => "stationary_max",
1585        256 => "portable_min",
1586        65534 => "portable_max",
1587    }),
1588    (WatchfaceMode, {
1589        0 => "digital",
1590        1 => "analog",
1591        2 => "connect_iq",
1592        3 => "disabled",
1593    }),
1594    (WaterType, {
1595        0 => "fresh",
1596        1 => "salt",
1597        2 => "en13319",
1598        3 => "custom",
1599    }),
1600    (WeatherReport, {
1601        0 => "current",
1602        1 => "hourly_forecast",
1603        2 => "daily_forecast",
1604    }),
1605    (WeatherSevereType, {
1606        0 => "unspecified",
1607        1 => "tornado",
1608        2 => "tsunami",
1609        3 => "hurricane",
1610        4 => "extreme_wind",
1611        5 => "typhoon",
1612        6 => "inland_hurricane",
1613        7 => "hurricane_force_wind",
1614        8 => "waterspout",
1615        9 => "severe_thunderstorm",
1616        10 => "wreckhouse_winds",
1617        11 => "les_suetes_wind",
1618        12 => "avalanche",
1619        13 => "flash_flood",
1620        14 => "tropical_storm",
1621        15 => "inland_tropical_storm",
1622        16 => "blizzard",
1623        17 => "ice_storm",
1624        18 => "freezing_rain",
1625        19 => "debris_flow",
1626        20 => "flash_freeze",
1627        21 => "dust_storm",
1628        22 => "high_wind",
1629        23 => "winter_storm",
1630        24 => "heavy_freezing_spray",
1631        25 => "extreme_cold",
1632        26 => "wind_chill",
1633        27 => "cold_wave",
1634        28 => "heavy_snow_alert",
1635        29 => "lake_effect_blowing_snow",
1636        30 => "snow_squall",
1637        31 => "lake_effect_snow",
1638        32 => "winter_weather",
1639        33 => "sleet",
1640        34 => "snowfall",
1641        35 => "snow_and_blowing_snow",
1642        36 => "blowing_snow",
1643        37 => "snow_alert",
1644        38 => "arctic_outflow",
1645        39 => "freezing_drizzle",
1646        40 => "storm",
1647        41 => "storm_surge",
1648        42 => "rainfall",
1649        43 => "areal_flood",
1650        44 => "coastal_flood",
1651        45 => "lakeshore_flood",
1652        46 => "excessive_heat",
1653        47 => "heat",
1654        48 => "weather",
1655        49 => "high_heat_and_humidity",
1656        50 => "humidex_and_health",
1657        51 => "humidex",
1658        52 => "gale",
1659        53 => "freezing_spray",
1660        54 => "special_marine",
1661        55 => "squall",
1662        56 => "strong_wind",
1663        57 => "lake_wind",
1664        58 => "marine_weather",
1665        59 => "wind",
1666        60 => "small_craft_hazardous_seas",
1667        61 => "hazardous_seas",
1668        62 => "small_craft",
1669        63 => "small_craft_winds",
1670        64 => "small_craft_rough_bar",
1671        65 => "high_water_level",
1672        66 => "ashfall",
1673        67 => "freezing_fog",
1674        68 => "dense_fog",
1675        69 => "dense_smoke",
1676        70 => "blowing_dust",
1677        71 => "hard_freeze",
1678        72 => "freeze",
1679        73 => "frost",
1680        74 => "fire_weather",
1681        75 => "flood",
1682        76 => "rip_tide",
1683        77 => "high_surf",
1684        78 => "smog",
1685        79 => "air_quality",
1686        80 => "brisk_wind",
1687        81 => "air_stagnation",
1688        82 => "low_water",
1689        83 => "hydrological",
1690        84 => "special_weather",
1691    }),
1692    (WeatherSeverity, {
1693        0 => "unknown",
1694        1 => "warning",
1695        2 => "watch",
1696        3 => "advisory",
1697        4 => "statement",
1698    }),
1699    (WeatherStatus, {
1700        0 => "clear",
1701        1 => "partly_cloudy",
1702        2 => "mostly_cloudy",
1703        3 => "rain",
1704        4 => "snow",
1705        5 => "windy",
1706        6 => "thunderstorms",
1707        7 => "wintry_mix",
1708        8 => "fog",
1709        11 => "hazy",
1710        12 => "hail",
1711        13 => "scattered_showers",
1712        14 => "scattered_thunderstorms",
1713        15 => "unknown_precipitation",
1714        16 => "light_rain",
1715        17 => "heavy_rain",
1716        18 => "light_snow",
1717        19 => "heavy_snow",
1718        20 => "light_rain_snow",
1719        21 => "heavy_rain_snow",
1720        22 => "cloudy",
1721    }),
1722    (Weight, {
1723        65534 => "calculating",
1724    }),
1725    (WktStepDuration, {
1726        0 => "time",
1727        1 => "distance",
1728        2 => "hr_less_than",
1729        3 => "hr_greater_than",
1730        4 => "calories",
1731        5 => "open",
1732        6 => "repeat_until_steps_cmplt",
1733        7 => "repeat_until_time",
1734        8 => "repeat_until_distance",
1735        9 => "repeat_until_calories",
1736        10 => "repeat_until_hr_less_than",
1737        11 => "repeat_until_hr_greater_than",
1738        12 => "repeat_until_power_less_than",
1739        13 => "repeat_until_power_greater_than",
1740        14 => "power_less_than",
1741        15 => "power_greater_than",
1742        16 => "training_peaks_tss",
1743        17 => "repeat_until_power_last_lap_less_than",
1744        18 => "repeat_until_max_power_last_lap_less_than",
1745        19 => "power_3s_less_than",
1746        20 => "power_10s_less_than",
1747        21 => "power_30s_less_than",
1748        22 => "power_3s_greater_than",
1749        23 => "power_10s_greater_than",
1750        24 => "power_30s_greater_than",
1751        25 => "power_lap_less_than",
1752        26 => "power_lap_greater_than",
1753        27 => "repeat_until_training_peaks_tss",
1754        28 => "repetition_time",
1755        29 => "reps",
1756        31 => "time_only",
1757    }),
1758    (WktStepTarget, {
1759        0 => "speed",
1760        1 => "heart_rate",
1761        2 => "open",
1762        3 => "cadence",
1763        4 => "power",
1764        5 => "grade",
1765        6 => "resistance",
1766        7 => "power_3s",
1767        8 => "power_10s",
1768        9 => "power_30s",
1769        10 => "power_lap",
1770        11 => "swim_stroke",
1771        12 => "speed_lap",
1772        13 => "heart_rate_lap",
1773    }),
1774    (WorkoutCapabilities, {
1775        1 => "interval",
1776        2 => "custom",
1777        4 => "fitness_equipment",
1778        8 => "firstbeat",
1779        16 => "new_leaf",
1780        32 => "tcx",
1781        128 => "speed",
1782        256 => "heart_rate",
1783        512 => "distance",
1784        1024 => "cadence",
1785        2048 => "power",
1786        4096 => "grade",
1787        8192 => "resistance",
1788        16384 => "protected",
1789    }),
1790    (WorkoutEquipment, {
1791        0 => "none",
1792        1 => "swim_fins",
1793        2 => "swim_kickboard",
1794        3 => "swim_paddles",
1795        4 => "swim_pull_buoy",
1796        5 => "swim_snorkel",
1797   }),
1798}
1799
1800pub fn get_field_string_value(f: FieldType, k: usize) -> Option<&'static str> {
1801    match f {
1802        FieldType::Activity => activity_stringify_field_value(k),
1803        FieldType::ActivityClass => activityclass_stringify_field_value(k),
1804        FieldType::ActivityLevel => activitylevel_stringify_field_value(k),
1805        FieldType::ActivitySubtype => activitysubtype_stringify_field_value(k),
1806        FieldType::ActivityType => activitytype_stringify_field_value(k),
1807        FieldType::AntNetwork => antnetwork_stringify_field_value(k),
1808        FieldType::AttitudeStage => attitudestage_stringify_field_value(k),
1809        FieldType::AttitudeValidity => attitudevalidity_stringify_field_value(k),
1810        FieldType::AutoActivityDetect => autoactivitydetect_stringify_field_value(k),
1811        FieldType::AutoSyncFrequency => autosyncfrequency_stringify_field_value(k),
1812        FieldType::BacklightMode => backlightmode_stringify_field_value(k),
1813        FieldType::BacklightTimeout => backlighttimeout_stringify_field_value(k),
1814        FieldType::BatteryStatus => batterystatus_stringify_field_value(k),
1815        FieldType::BodyLocation => bodylocation_stringify_field_value(k),
1816        FieldType::BpStatus => bpstatus_stringify_field_value(k),
1817        FieldType::CameraEventType => cameraeventtype_stringify_field_value(k),
1818        FieldType::CameraOrientationType => cameraorientationtype_stringify_field_value(k),
1819        FieldType::ClimbProEvent => climbproevent_stringify_field_value(k),
1820        FieldType::ConnectivityCapabilities => connectivitycapabilities_stringify_field_value(k),
1821        FieldType::CourseCapabilities => coursecapabilities_stringify_field_value(k),
1822        FieldType::CoursePoint => coursepoint_stringify_field_value(k),
1823        FieldType::DateMode => datemode_stringify_field_value(k),
1824        FieldType::DateTime => datetime_stringify_field_value(k),
1825        FieldType::DayOfWeek => dayofweek_stringify_field_value(k),
1826        FieldType::DeviceIndex => deviceindex_stringify_field_value(k),
1827        FieldType::DisplayHeart => displayheart_stringify_field_value(k),
1828        FieldType::DisplayMeasure => displaymeasure_stringify_field_value(k),
1829        FieldType::DisplayOrientation => displayorientation_stringify_field_value(k),
1830        FieldType::DisplayPosition => displayposition_stringify_field_value(k),
1831        FieldType::DisplayPower => displaypower_stringify_field_value(k),
1832        FieldType::DiveAlarmType => divealarmtype_stringify_field_value(k),
1833        FieldType::DiveBacklightMode => divebacklightmode_stringify_field_value(k),
1834        FieldType::DiveGasStatus => divegasstatus_stringify_field_value(k),
1835        FieldType::Event => event_stringify_field_value(k),
1836        FieldType::EventType => eventtype_stringify_field_value(k),
1837        FieldType::ExdDataUnits => exddataunits_stringify_field_value(k),
1838        FieldType::ExdDescriptors => exddescriptors_stringify_field_value(k),
1839        FieldType::ExdDisplayType => exddisplaytype_stringify_field_value(k),
1840        FieldType::ExdLayout => exdlayout_stringify_field_value(k),
1841        FieldType::ExdQualifiers => exdqualifiers_stringify_field_value(k),
1842        FieldType::ExerciseCategory => exercisecategory_stringify_field_value(k),
1843        FieldType::File => file_stringify_field_value(k),
1844        FieldType::FileFlags => fileflags_stringify_field_value(k),
1845        FieldType::FitBaseType => fitbasetype_stringify_field_value(k),
1846        FieldType::FitBaseUnit => fitbaseunit_stringify_field_value(k),
1847        FieldType::Gender => gender_stringify_field_value(k),
1848        FieldType::Goal => goal_stringify_field_value(k),
1849        FieldType::GoalRecurrence => goalrecurrence_stringify_field_value(k),
1850        FieldType::GoalSource => goalsource_stringify_field_value(k),
1851        FieldType::HrType => hrtype_stringify_field_value(k),
1852        FieldType::HrZoneCalc => hrzonecalc_stringify_field_value(k),
1853        FieldType::Intensity => intensity_stringify_field_value(k),
1854        FieldType::Language => language_stringify_field_value(k),
1855        FieldType::LapTrigger => laptrigger_stringify_field_value(k),
1856        FieldType::LeftRightBalance => leftrightbalance_stringify_field_value(k),
1857        FieldType::LeftRightBalance100 => leftrightbalance100_stringify_field_value(k),
1858        FieldType::LengthType => lengthtype_stringify_field_value(k),
1859        FieldType::LocalDateTime => localdatetime_stringify_field_value(k),
1860        FieldType::LocaltimeIntoDay => localtimeintoday_stringify_field_value(k),
1861        FieldType::Manufacturer => manufacturer_stringify_field_value(k),
1862        FieldType::MesgCount => mesgcount_stringify_field_value(k),
1863        FieldType::MesgNum => mesgnum_stringify_field_value(k),
1864        FieldType::MessageIndex => messageindex_stringify_field_value(k),
1865        FieldType::PwrZoneCalc => pwrzonecalc_stringify_field_value(k),
1866        FieldType::RadarThreatLevelType => radarthreatleveltype_stringify_field_value(k),
1867        FieldType::Schedule => schedule_stringify_field_value(k),
1868        FieldType::SegmentDeleteStatus => segmentdeletestatus_stringify_field_value(k),
1869        FieldType::SegmentLapStatus => segmentlapstatus_stringify_field_value(k),
1870        FieldType::SegmentLeaderboardType => segmentleaderboardtype_stringify_field_value(k),
1871        FieldType::SegmentSelectionType => segmentselectiontype_stringify_field_value(k),
1872        FieldType::SensorType => sensortype_stringify_field_value(k),
1873        FieldType::SessionTrigger => sessiontrigger_stringify_field_value(k),
1874        FieldType::SetType => settype_stringify_field_value(k),
1875        FieldType::Side => side_stringify_field_value(k),
1876        FieldType::SourceType => sourcetype_stringify_field_value(k),
1877        FieldType::Sport => sport_stringify_field_value(k),
1878        FieldType::SportBits0 => sportbits0_stringify_field_value(k),
1879        FieldType::SportEvent => sportevent_stringify_field_value(k),
1880        FieldType::StrokeType => stroketype_stringify_field_value(k),
1881        FieldType::SubSport => subsport_stringify_field_value(k),
1882        FieldType::SwimStroke => swimstroke_stringify_field_value(k),
1883        FieldType::Switch => switch_stringify_field_value(k),
1884        FieldType::TapSensitivity => tapsensitivity_stringify_field_value(k),
1885        FieldType::TimeMode => timemode_stringify_field_value(k),
1886        FieldType::TissueModelType => tissuemodeltype_stringify_field_value(k),
1887        FieldType::Tone => tone_stringify_field_value(k),
1888        FieldType::UserLocalId => userlocalid_stringify_field_value(k),
1889        FieldType::WatchfaceMode => watchfacemode_stringify_field_value(k),
1890        FieldType::WaterType => watertype_stringify_field_value(k),
1891        FieldType::WeatherReport => weatherreport_stringify_field_value(k),
1892        FieldType::WeatherSevereType => weatherseveretype_stringify_field_value(k),
1893        FieldType::WeatherSeverity => weatherseverity_stringify_field_value(k),
1894        FieldType::WeatherStatus => weatherstatus_stringify_field_value(k),
1895        FieldType::Weight => weight_stringify_field_value(k),
1896        FieldType::WktStepDuration => wktstepduration_stringify_field_value(k),
1897        FieldType::WktStepTarget => wktsteptarget_stringify_field_value(k),
1898        FieldType::WorkoutCapabilities => workoutcapabilities_stringify_field_value(k),
1899        FieldType::WorkoutEquipment => workoutequipment_stringify_field_value(k),
1900        FieldType::None => None,
1901        _ => None,
1902    }
1903}
1904
1905pub fn get_field_key_from_string(f: FieldType, value: &str) -> Option<usize> {
1906    match f {
1907        FieldType::Activity => activity_parse_field_value(value),
1908        FieldType::ActivityClass => activityclass_parse_field_value(value),
1909        FieldType::ActivityLevel => activitylevel_parse_field_value(value),
1910        FieldType::ActivitySubtype => activitysubtype_parse_field_value(value),
1911        FieldType::ActivityType => activitytype_parse_field_value(value),
1912        FieldType::AntNetwork => antnetwork_parse_field_value(value),
1913        FieldType::AttitudeStage => attitudestage_parse_field_value(value),
1914        FieldType::AttitudeValidity => attitudevalidity_parse_field_value(value),
1915        FieldType::AutoActivityDetect => autoactivitydetect_parse_field_value(value),
1916        FieldType::AutoSyncFrequency => autosyncfrequency_parse_field_value(value),
1917        FieldType::BacklightMode => backlightmode_parse_field_value(value),
1918        FieldType::BacklightTimeout => backlighttimeout_parse_field_value(value),
1919        FieldType::BatteryStatus => batterystatus_parse_field_value(value),
1920        FieldType::BodyLocation => bodylocation_parse_field_value(value),
1921        FieldType::BpStatus => bpstatus_parse_field_value(value),
1922        FieldType::CameraEventType => cameraeventtype_parse_field_value(value),
1923        FieldType::CameraOrientationType => cameraorientationtype_parse_field_value(value),
1924        FieldType::ClimbProEvent => climbproevent_parse_field_value(value),
1925        FieldType::ConnectivityCapabilities => connectivitycapabilities_parse_field_value(value),
1926        FieldType::CourseCapabilities => coursecapabilities_parse_field_value(value),
1927        FieldType::CoursePoint => coursepoint_parse_field_value(value),
1928        FieldType::DateMode => datemode_parse_field_value(value),
1929        FieldType::DateTime => datetime_parse_field_value(value),
1930        FieldType::DayOfWeek => dayofweek_parse_field_value(value),
1931        FieldType::DeviceIndex => deviceindex_parse_field_value(value),
1932        FieldType::DisplayHeart => displayheart_parse_field_value(value),
1933        FieldType::DisplayMeasure => displaymeasure_parse_field_value(value),
1934        FieldType::DisplayOrientation => displayorientation_parse_field_value(value),
1935        FieldType::DisplayPosition => displayposition_parse_field_value(value),
1936        FieldType::DisplayPower => displaypower_parse_field_value(value),
1937        FieldType::DiveAlarmType => divealarmtype_parse_field_value(value),
1938        FieldType::DiveBacklightMode => divebacklightmode_parse_field_value(value),
1939        FieldType::DiveGasStatus => divegasstatus_parse_field_value(value),
1940        FieldType::Event => event_parse_field_value(value),
1941        FieldType::EventType => eventtype_parse_field_value(value),
1942        FieldType::ExdDataUnits => exddataunits_parse_field_value(value),
1943        FieldType::ExdDescriptors => exddescriptors_parse_field_value(value),
1944        FieldType::ExdDisplayType => exddisplaytype_parse_field_value(value),
1945        FieldType::ExdLayout => exdlayout_parse_field_value(value),
1946        FieldType::ExdQualifiers => exdqualifiers_parse_field_value(value),
1947        FieldType::ExerciseCategory => exercisecategory_parse_field_value(value),
1948        FieldType::File => file_parse_field_value(value),
1949        FieldType::FileFlags => fileflags_parse_field_value(value),
1950        FieldType::FitBaseType => fitbasetype_parse_field_value(value),
1951        FieldType::FitBaseUnit => fitbaseunit_parse_field_value(value),
1952        FieldType::Gender => gender_parse_field_value(value),
1953        FieldType::Goal => goal_parse_field_value(value),
1954        FieldType::GoalRecurrence => goalrecurrence_parse_field_value(value),
1955        FieldType::GoalSource => goalsource_parse_field_value(value),
1956        FieldType::HrType => hrtype_parse_field_value(value),
1957        FieldType::HrZoneCalc => hrzonecalc_parse_field_value(value),
1958        FieldType::Intensity => intensity_parse_field_value(value),
1959        FieldType::Language => language_parse_field_value(value),
1960        FieldType::LapTrigger => laptrigger_parse_field_value(value),
1961        FieldType::LeftRightBalance => leftrightbalance_parse_field_value(value),
1962        FieldType::LeftRightBalance100 => leftrightbalance100_parse_field_value(value),
1963        FieldType::LengthType => lengthtype_parse_field_value(value),
1964        FieldType::LocalDateTime => localdatetime_parse_field_value(value),
1965        FieldType::LocaltimeIntoDay => localtimeintoday_parse_field_value(value),
1966        FieldType::Manufacturer => manufacturer_parse_field_value(value),
1967        FieldType::MesgCount => mesgcount_parse_field_value(value),
1968        FieldType::MesgNum => mesgnum_parse_field_value(value),
1969        FieldType::MessageIndex => messageindex_parse_field_value(value),
1970        FieldType::PwrZoneCalc => pwrzonecalc_parse_field_value(value),
1971        FieldType::RadarThreatLevelType => radarthreatleveltype_parse_field_value(value),
1972        FieldType::Schedule => schedule_parse_field_value(value),
1973        FieldType::SegmentDeleteStatus => segmentdeletestatus_parse_field_value(value),
1974        FieldType::SegmentLapStatus => segmentlapstatus_parse_field_value(value),
1975        FieldType::SegmentLeaderboardType => segmentleaderboardtype_parse_field_value(value),
1976        FieldType::SegmentSelectionType => segmentselectiontype_parse_field_value(value),
1977        FieldType::SensorType => sensortype_parse_field_value(value),
1978        FieldType::SessionTrigger => sessiontrigger_parse_field_value(value),
1979        FieldType::SetType => settype_parse_field_value(value),
1980        FieldType::Side => side_parse_field_value(value),
1981        FieldType::SourceType => sourcetype_parse_field_value(value),
1982        FieldType::Sport => sport_parse_field_value(value),
1983        FieldType::SportBits0 => sportbits0_parse_field_value(value),
1984        FieldType::SportEvent => sportevent_parse_field_value(value),
1985        FieldType::StrokeType => stroketype_parse_field_value(value),
1986        FieldType::SubSport => subsport_parse_field_value(value),
1987        FieldType::SwimStroke => swimstroke_parse_field_value(value),
1988        FieldType::Switch => switch_parse_field_value(value),
1989        FieldType::TapSensitivity => tapsensitivity_parse_field_value(value),
1990        FieldType::TimeMode => timemode_parse_field_value(value),
1991        FieldType::TissueModelType => tissuemodeltype_parse_field_value(value),
1992        FieldType::Tone => tone_parse_field_value(value),
1993        FieldType::UserLocalId => userlocalid_parse_field_value(value),
1994        FieldType::WatchfaceMode => watchfacemode_parse_field_value(value),
1995        FieldType::WaterType => watertype_parse_field_value(value),
1996        FieldType::WeatherReport => weatherreport_parse_field_value(value),
1997        FieldType::WeatherSevereType => weatherseveretype_parse_field_value(value),
1998        FieldType::WeatherSeverity => weatherseverity_parse_field_value(value),
1999        FieldType::WeatherStatus => weatherstatus_parse_field_value(value),
2000        FieldType::Weight => weight_parse_field_value(value),
2001        FieldType::WktStepDuration => wktstepduration_parse_field_value(value),
2002        FieldType::WktStepTarget => wktsteptarget_parse_field_value(value),
2003        FieldType::WorkoutCapabilities => workoutcapabilities_parse_field_value(value),
2004        FieldType::WorkoutEquipment => workoutequipment_parse_field_value(value),
2005        FieldType::None => None,
2006        _ => None,
2007    }
2008}