diff --git a/fitparse/profile.py b/fitparse/profile.py index 3e59617..dcfba90 100644 --- a/fitparse/profile.py +++ b/fitparse/profile.py @@ -1,6 +1,7 @@ + ################# BEGIN AUTOMATICALLY GENERATED FIT PROFILE ################## ########################### DO NOT EDIT THIS FILE ############################ -####### EXPORTED PROFILE FROM SDK VERSION 20.33 AT 2017-05-17 22:36:12 ####### +####### EXPORTED PROFILE FROM SDK VERSION 20.35 AT 2017-06-25 21:31:19 ####### ########## PARSED 118 TYPES (1699 VALUES), 76 MESSAGES (950 FIELDS) ########## from fitparse.records import ( @@ -2490,627 +2491,1019 @@ ), }, ), - - - #################################### #################################### - 1: MessageType( - name='capabilities', - mesg_num=1, + 49: MessageType( + name='file_creator', + mesg_num=49, fields={ - 0: Field( # Use language_bits_x types where x is index of array. - name='languages', - type=BASE_TYPES[0x0A], # uint8z + 0: Field( + name='software_version', + type=BASE_TYPES[0x84], # uint16 def_num=0, ), - 1: Field( # Use sport_bits_x types where x is index of array. - name='sports', - type=FIELD_TYPES['sport_bits_0'], + 1: Field( + name='hardware_version', + type=BASE_TYPES[0x02], # uint8 def_num=1, ), - 21: Field( - name='workouts_supported', - type=FIELD_TYPES['workout_capabilities'], - def_num=21, + }, + ), + 162: MessageType( + name='timestamp_correlation', + mesg_num=162, + fields={ + 0: Field( # Fractional part of the UTC timestamp at the time the system timestamp was recorded. + name='fractional_timestamp', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + scale=32768, + units=u's', ), - 23: Field( - name='connectivity_supported', - type=FIELD_TYPES['connectivity_capabilities'], - def_num=23, + 1: Field( # Whole second part of the system timestamp + name='system_timestamp', + type=FIELD_TYPES['date_time'], + def_num=1, + units=u's', + ), + 2: Field( # Fractional part of the system timestamp + name='fractional_system_timestamp', + type=BASE_TYPES[0x84], # uint16 + def_num=2, + scale=32768, + units=u's', + ), + 3: Field( # timestamp epoch expressed in local time used to convert timestamps to local time + name='local_timestamp', + type=FIELD_TYPES['local_date_time'], + def_num=3, + units=u's', + ), + 4: Field( # Millisecond part of the UTC timestamp at the time the system timestamp was recorded. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + units=u'ms', + ), + 5: Field( # Millisecond part of the system timestamp + name='system_timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=5, + units=u'ms', ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of UTC timestamp at the time the system timestamp was recorded. }, ), - 3: MessageType( - name='user_profile', - mesg_num=3, + + + ######################### Activity File Messages ######################### + 18: MessageType( + name='session', + mesg_num=18, fields={ - 0: Field( - name='friendly_name', - type=BASE_TYPES[0x07], # string + 0: Field( # session + name='event', + type=FIELD_TYPES['event'], def_num=0, ), - 1: Field( - name='gender', - type=FIELD_TYPES['gender'], + 1: Field( # stop + name='event_type', + type=FIELD_TYPES['event_type'], def_num=1, ), 2: Field( - name='age', - type=BASE_TYPES[0x02], # uint8 + name='start_time', + type=FIELD_TYPES['date_time'], def_num=2, - units='years', ), 3: Field( - name='height', - type=BASE_TYPES[0x02], # uint8 + name='start_position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=3, - scale=100, - units='m', + units=u'semicircles', ), 4: Field( - name='weight', - type=BASE_TYPES[0x84], # uint16 + name='start_position_long', + type=BASE_TYPES[0x85], # sint32 def_num=4, - scale=10, - units='kg', + units=u'semicircles', ), 5: Field( - name='language', - type=FIELD_TYPES['language'], + name='sport', + type=FIELD_TYPES['sport'], def_num=5, ), 6: Field( - name='elev_setting', - type=FIELD_TYPES['display_measure'], + name='sub_sport', + type=FIELD_TYPES['sub_sport'], def_num=6, ), - 7: Field( - name='weight_setting', - type=FIELD_TYPES['display_measure'], + 7: Field( # Time (includes pauses) + name='total_elapsed_time', + type=BASE_TYPES[0x86], # uint32 def_num=7, + scale=1000, + units=u's', ), - 8: Field( - name='resting_heart_rate', - type=BASE_TYPES[0x02], # uint8 + 8: Field( # Timer Time (excludes pauses) + name='total_timer_time', + type=BASE_TYPES[0x86], # uint32 def_num=8, - units='bpm', + scale=1000, + units=u's', ), 9: Field( - name='default_max_running_heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='total_distance', + type=BASE_TYPES[0x86], # uint32 def_num=9, - units='bpm', + scale=100, + units=u'm', ), 10: Field( - name='default_max_biking_heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='total_cycles', + type=BASE_TYPES[0x86], # uint32 def_num=10, - units='bpm', + units=u'cycles', + subfields=( + SubField( + name='total_strides', + def_num=10, + type=BASE_TYPES[0x86], # uint32 + units=u'strides', + ref_fields=( + ReferenceField( + name='sport', + def_num=5, + value='running', + raw_value=1, + ), + ReferenceField( + name='sport', + def_num=5, + value='walking', + raw_value=11, + ), + ), + ), + ), ), 11: Field( - name='default_max_heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='total_calories', + type=BASE_TYPES[0x84], # uint16 def_num=11, - units='bpm', - ), - 12: Field( - name='hr_setting', - type=FIELD_TYPES['display_heart'], - def_num=12, + units=u'kcal', ), 13: Field( - name='speed_setting', - type=FIELD_TYPES['display_measure'], + name='total_fat_calories', + type=BASE_TYPES[0x84], # uint16 def_num=13, + units=u'kcal', ), - 14: Field( - name='dist_setting', - type=FIELD_TYPES['display_measure'], + 14: Field( # total_distance / total_timer_time + name='avg_speed', + type=BASE_TYPES[0x84], # uint16 def_num=14, + components=( + ComponentField( + name='enhanced_avg_speed', + def_num=124, + scale=1000, + units=u'm/s', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), - 16: Field( - name='power_setting', - type=FIELD_TYPES['display_power'], + 15: Field( + name='max_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=15, + components=( + ComponentField( + name='enhanced_max_speed', + def_num=125, + scale=1000, + units=u'm/s', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), + ), + 16: Field( # average heart rate (excludes pause time) + name='avg_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=16, + units=u'bpm', ), 17: Field( - name='activity_class', - type=FIELD_TYPES['activity_class'], + name='max_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=17, + units=u'bpm', ), - 18: Field( - name='position_setting', - type=FIELD_TYPES['display_position'], + 18: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time + name='avg_cadence', + type=BASE_TYPES[0x02], # uint8 def_num=18, + units=u'rpm', + subfields=( + SubField( + name='avg_running_cadence', + def_num=18, + type=BASE_TYPES[0x02], # uint8 + units=u'strides/min', + ref_fields=( + ReferenceField( + name='sport', + def_num=5, + value='running', + raw_value=1, + ), + ), + ), + ), ), - 21: Field( - name='temperature_setting', - type=FIELD_TYPES['display_measure'], - def_num=21, - ), - 22: Field( - name='local_id', - type=FIELD_TYPES['user_local_id'], - def_num=22, + 19: Field( + name='max_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=19, + units=u'rpm', + subfields=( + SubField( + name='max_running_cadence', + def_num=19, + type=BASE_TYPES[0x02], # uint8 + units=u'strides/min', + ref_fields=( + ReferenceField( + name='sport', + def_num=5, + value='running', + raw_value=1, + ), + ), + ), + ), + ), + 20: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time + name='avg_power', + type=BASE_TYPES[0x84], # uint16 + def_num=20, + units=u'watts', + ), + 21: Field( + name='max_power', + type=BASE_TYPES[0x84], # uint16 + def_num=21, + units=u'watts', + ), + 22: Field( + name='total_ascent', + type=BASE_TYPES[0x84], # uint16 + def_num=22, + units=u'm', ), 23: Field( - name='global_id', - type=BASE_TYPES[0x0D], # byte + name='total_descent', + type=BASE_TYPES[0x84], # uint16 def_num=23, + units=u'm', ), - 28: Field( # Typical wake time - name='wake_time', - type=FIELD_TYPES['localtime_into_day'], + 24: Field( + name='total_training_effect', + type=BASE_TYPES[0x02], # uint8 + def_num=24, + scale=10, + ), + 25: Field( + name='first_lap_index', + type=BASE_TYPES[0x84], # uint16 + def_num=25, + ), + 26: Field( + name='num_laps', + type=BASE_TYPES[0x84], # uint16 + def_num=26, + ), + 27: Field( + name='event_group', + type=BASE_TYPES[0x02], # uint8 + def_num=27, + ), + 28: Field( + name='trigger', + type=FIELD_TYPES['session_trigger'], def_num=28, ), - 29: Field( # Typical bed time - name='sleep_time', - type=FIELD_TYPES['localtime_into_day'], + 29: Field( + name='nec_lat', + type=BASE_TYPES[0x85], # sint32 def_num=29, + units=u'semicircles', ), 30: Field( - name='height_setting', - type=FIELD_TYPES['display_measure'], + name='nec_long', + type=BASE_TYPES[0x85], # sint32 def_num=30, + units=u'semicircles', ), - 31: Field( # User defined running step length set to 0 for auto length - name='user_running_step_length', - type=BASE_TYPES[0x84], # uint16 + 31: Field( + name='swc_lat', + type=BASE_TYPES[0x85], # sint32 def_num=31, - scale=1000, - units='m', + units=u'semicircles', ), - 32: Field( # User defined walking step length set to 0 for auto length - name='user_walking_step_length', - type=BASE_TYPES[0x84], # uint16 + 32: Field( + name='swc_long', + type=BASE_TYPES[0x85], # sint32 def_num=32, - scale=1000, - units='m', - ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + units=u'semicircles', ), - }, - ), - 4: MessageType( - name='hrm_profile', - mesg_num=4, - fields={ - 0: Field( - name='enabled', - type=FIELD_TYPES['bool'], - def_num=0, + 34: Field( + name='normalized_power', + type=BASE_TYPES[0x84], # uint16 + def_num=34, + units=u'watts', ), - 1: Field( - name='hrm_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=1, + 35: Field( + name='training_stress_score', + type=BASE_TYPES[0x84], # uint16 + def_num=35, + scale=10, + units=u'tss', ), - 2: Field( - name='log_hrv', - type=FIELD_TYPES['bool'], - def_num=2, + 36: Field( + name='intensity_factor', + type=BASE_TYPES[0x84], # uint16 + def_num=36, + scale=1000, + units=u'if', ), - 3: Field( - name='hrm_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=3, + 37: Field( + name='left_right_balance', + type=FIELD_TYPES['left_right_balance_100'], + def_num=37, ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 41: Field( + name='avg_stroke_count', + type=BASE_TYPES[0x86], # uint32 + def_num=41, + scale=10, + units=u'strokes/lap', ), - }, - ), - 5: MessageType( - name='sdm_profile', - mesg_num=5, - fields={ - 0: Field( - name='enabled', - type=FIELD_TYPES['bool'], - def_num=0, + 42: Field( + name='avg_stroke_distance', + type=BASE_TYPES[0x84], # uint16 + def_num=42, + scale=100, + units=u'm', ), - 1: Field( - name='sdm_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=1, + 43: Field( + name='swim_stroke', + type=FIELD_TYPES['swim_stroke'], + def_num=43, + units=u'swim_stroke', ), - 2: Field( - name='sdm_cal_factor', + 44: Field( + name='pool_length', type=BASE_TYPES[0x84], # uint16 - def_num=2, - scale=10, - units='%', - ), - 3: Field( - name='odometer', - type=BASE_TYPES[0x86], # uint32 - def_num=3, + def_num=44, scale=100, - units='m', + units=u'm', ), - 4: Field( # Use footpod for speed source instead of GPS - name='speed_source', - type=FIELD_TYPES['bool'], - def_num=4, + 45: Field( + name='threshold_power', + type=BASE_TYPES[0x84], # uint16 + def_num=45, + units=u'watts', ), - 5: Field( - name='sdm_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=5, + 46: Field( + name='pool_length_unit', + type=FIELD_TYPES['display_measure'], + def_num=46, ), - 7: Field( # Rollover counter that can be used to extend the odometer - name='odometer_rollover', - type=BASE_TYPES[0x02], # uint8 - def_num=7, + 47: Field( # # of active lengths of swim pool + name='num_active_lengths', + type=BASE_TYPES[0x84], # uint16 + def_num=47, + units=u'lengths', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 48: Field( + name='total_work', + type=BASE_TYPES[0x86], # uint32 + def_num=48, + units=u'J', ), - }, - ), - 6: MessageType( - name='bike_profile', - mesg_num=6, - fields={ - 0: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=0, + 49: Field( + name='avg_altitude', + type=BASE_TYPES[0x84], # uint16 + def_num=49, + components=( + ComponentField( + name='enhanced_avg_altitude', + def_num=126, + scale=5, + offset=500, + units=u'm', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), - 1: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=1, + 50: Field( + name='max_altitude', + type=BASE_TYPES[0x84], # uint16 + def_num=50, + components=( + ComponentField( + name='enhanced_max_altitude', + def_num=128, + scale=5, + offset=500, + units=u'm', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), - 2: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=2, + 51: Field( + name='gps_accuracy', + type=BASE_TYPES[0x02], # uint8 + def_num=51, + units=u'm', ), - 3: Field( - name='odometer', - type=BASE_TYPES[0x86], # uint32 - def_num=3, + 52: Field( + name='avg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=52, scale=100, - units='m', - ), - 4: Field( - name='bike_spd_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=4, + units=u'%', ), - 5: Field( - name='bike_cad_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=5, + 53: Field( + name='avg_pos_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=53, + scale=100, + units=u'%', ), - 6: Field( - name='bike_spdcad_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=6, + 54: Field( + name='avg_neg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=54, + scale=100, + units=u'%', ), - 7: Field( - name='bike_power_ant_id', - type=BASE_TYPES[0x8B], # uint16z - def_num=7, + 55: Field( + name='max_pos_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=55, + scale=100, + units=u'%', ), - 8: Field( - name='custom_wheelsize', - type=BASE_TYPES[0x84], # uint16 - def_num=8, - scale=1000, - units='m', + 56: Field( + name='max_neg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=56, + scale=100, + units=u'%', ), - 9: Field( - name='auto_wheelsize', - type=BASE_TYPES[0x84], # uint16 - def_num=9, + 57: Field( + name='avg_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=57, + units=u'C', + ), + 58: Field( + name='max_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=58, + units=u'C', + ), + 59: Field( + name='total_moving_time', + type=BASE_TYPES[0x86], # uint32 + def_num=59, scale=1000, - units='m', + units=u's', ), - 10: Field( - name='bike_weight', - type=BASE_TYPES[0x84], # uint16 - def_num=10, - scale=10, - units='kg', + 60: Field( + name='avg_pos_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=60, + scale=1000, + units=u'm/s', ), - 11: Field( - name='power_cal_factor', - type=BASE_TYPES[0x84], # uint16 - def_num=11, - scale=10, - units='%', + 61: Field( + name='avg_neg_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=61, + scale=1000, + units=u'm/s', ), - 12: Field( - name='auto_wheel_cal', - type=FIELD_TYPES['bool'], - def_num=12, + 62: Field( + name='max_pos_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=62, + scale=1000, + units=u'm/s', ), - 13: Field( - name='auto_power_zero', - type=FIELD_TYPES['bool'], - def_num=13, + 63: Field( + name='max_neg_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=63, + scale=1000, + units=u'm/s', ), - 14: Field( - name='id', + 64: Field( + name='min_heart_rate', type=BASE_TYPES[0x02], # uint8 - def_num=14, - ), - 15: Field( - name='spd_enabled', - type=FIELD_TYPES['bool'], - def_num=15, + def_num=64, + units=u'bpm', ), - 16: Field( - name='cad_enabled', - type=FIELD_TYPES['bool'], - def_num=16, + 65: Field( + name='time_in_hr_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=65, + scale=1000, + units=u's', ), - 17: Field( - name='spdcad_enabled', - type=FIELD_TYPES['bool'], - def_num=17, + 66: Field( + name='time_in_speed_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=66, + scale=1000, + units=u's', ), - 18: Field( - name='power_enabled', - type=FIELD_TYPES['bool'], - def_num=18, + 67: Field( + name='time_in_cadence_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=67, + scale=1000, + units=u's', ), - 19: Field( - name='crank_length', - type=BASE_TYPES[0x02], # uint8 - def_num=19, - scale=2, - offset=-110, - units='mm', + 68: Field( + name='time_in_power_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=68, + scale=1000, + units=u's', ), - 20: Field( - name='enabled', - type=FIELD_TYPES['bool'], - def_num=20, + 69: Field( + name='avg_lap_time', + type=BASE_TYPES[0x86], # uint32 + def_num=69, + scale=1000, + units=u's', ), - 21: Field( - name='bike_spd_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=21, + 70: Field( + name='best_lap_index', + type=BASE_TYPES[0x84], # uint16 + def_num=70, ), - 22: Field( - name='bike_cad_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=22, + 71: Field( + name='min_altitude', + type=BASE_TYPES[0x84], # uint16 + def_num=71, + components=( + ComponentField( + name='enhanced_min_altitude', + def_num=127, + scale=5, + offset=500, + units=u'm', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), - 23: Field( - name='bike_spdcad_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=23, + 82: Field( + name='player_score', + type=BASE_TYPES[0x84], # uint16 + def_num=82, ), - 24: Field( - name='bike_power_ant_id_trans_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=24, + 83: Field( + name='opponent_score', + type=BASE_TYPES[0x84], # uint16 + def_num=83, ), - 37: Field( # Rollover counter that can be used to extend the odometer - name='odometer_rollover', - type=BASE_TYPES[0x02], # uint8 - def_num=37, + 84: Field( + name='opponent_name', + type=BASE_TYPES[0x07], # string + def_num=84, ), - 38: Field( # Number of front gears - name='front_gear_num', - type=BASE_TYPES[0x0A], # uint8z - def_num=38, + 85: Field( # stroke_type enum used as the index + name='stroke_count', + type=BASE_TYPES[0x84], # uint16 + def_num=85, + units=u'counts', ), - 39: Field( # Number of teeth on each gear 0 is innermost - name='front_gear', - type=BASE_TYPES[0x0A], # uint8z - def_num=39, + 86: Field( # zone number used as the index + name='zone_count', + type=BASE_TYPES[0x84], # uint16 + def_num=86, + units=u'counts', ), - 40: Field( # Number of rear gears - name='rear_gear_num', - type=BASE_TYPES[0x0A], # uint8z - def_num=40, + 87: Field( + name='max_ball_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=87, + scale=100, + units=u'm/s', ), - 41: Field( # Number of teeth on each gear 0 is innermost - name='rear_gear', - type=BASE_TYPES[0x0A], # uint8z - def_num=41, + 88: Field( + name='avg_ball_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=88, + scale=100, + units=u'm/s', ), - 44: Field( - name='shimano_di2_enabled', - type=FIELD_TYPES['bool'], - def_num=44, + 89: Field( + name='avg_vertical_oscillation', + type=BASE_TYPES[0x84], # uint16 + def_num=89, + scale=10, + units=u'mm', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 90: Field( + name='avg_stance_time_percent', + type=BASE_TYPES[0x84], # uint16 + def_num=90, + scale=100, + units=u'percent', ), - }, - ), - 8: MessageType( - name='hr_zone', - mesg_num=8, - fields={ - 1: Field( - name='high_bpm', + 91: Field( + name='avg_stance_time', + type=BASE_TYPES[0x84], # uint16 + def_num=91, + scale=10, + units=u'ms', + ), + 92: Field( # fractional part of the avg_cadence + name='avg_fractional_cadence', type=BASE_TYPES[0x02], # uint8 - def_num=1, - units='bpm', + def_num=92, + scale=128, + units=u'rpm', ), - 2: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=2, + 93: Field( # fractional part of the max_cadence + name='max_fractional_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=93, + scale=128, + units=u'rpm', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 94: Field( # fractional part of the total_cycles + name='total_fractional_cycles', + type=BASE_TYPES[0x02], # uint8 + def_num=94, + scale=128, + units=u'cycles', ), - }, - ), - 9: MessageType( - name='power_zone', - mesg_num=9, - fields={ - 1: Field( - name='high_value', + 95: Field( # Avg saturated and unsaturated hemoglobin + name='avg_total_hemoglobin_conc', type=BASE_TYPES[0x84], # uint16 - def_num=1, - units='watts', + def_num=95, + scale=100, + units=u'g/dL', ), - 2: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=2, + 96: Field( # Min saturated and unsaturated hemoglobin + name='min_total_hemoglobin_conc', + type=BASE_TYPES[0x84], # uint16 + def_num=96, + scale=100, + units=u'g/dL', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 97: Field( # Max saturated and unsaturated hemoglobin + name='max_total_hemoglobin_conc', + type=BASE_TYPES[0x84], # uint16 + def_num=97, + scale=100, + units=u'g/dL', ), - }, - ), - 10: MessageType( - name='met_zone', - mesg_num=10, - fields={ - 1: Field( - name='high_bpm', - type=BASE_TYPES[0x02], # uint8 - def_num=1, + 98: Field( # Avg percentage of hemoglobin saturated with oxygen + name='avg_saturated_hemoglobin_percent', + type=BASE_TYPES[0x84], # uint16 + def_num=98, + scale=10, + units=u'%', ), - 2: Field( - name='calories', + 99: Field( # Min percentage of hemoglobin saturated with oxygen + name='min_saturated_hemoglobin_percent', type=BASE_TYPES[0x84], # uint16 - def_num=2, + def_num=99, scale=10, - units='kcal/min', + units=u'%', ), - 3: Field( - name='fat_calories', - type=BASE_TYPES[0x02], # uint8 - def_num=3, + 100: Field( # Max percentage of hemoglobin saturated with oxygen + name='max_saturated_hemoglobin_percent', + type=BASE_TYPES[0x84], # uint16 + def_num=100, scale=10, - units='kcal/min', + units=u'%', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 101: Field( + name='avg_left_torque_effectiveness', + type=BASE_TYPES[0x02], # uint8 + def_num=101, + scale=2, + units=u'percent', ), - }, - ), - 12: MessageType( - name='sport', - mesg_num=12, - fields={ - 0: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=0, + 102: Field( + name='avg_right_torque_effectiveness', + type=BASE_TYPES[0x02], # uint8 + def_num=102, + scale=2, + units=u'percent', ), - 1: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=1, + 103: Field( + name='avg_left_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=103, + scale=2, + units=u'percent', ), - 3: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=3, + 104: Field( + name='avg_right_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=104, + scale=2, + units=u'percent', ), - }, - ), - 18: MessageType( - name='session', - mesg_num=18, - fields={ - 0: Field( # session - name='event', - type=FIELD_TYPES['event'], - def_num=0, + 105: Field( + name='avg_combined_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=105, + scale=2, + units=u'percent', ), - 1: Field( # stop - name='event_type', - type=FIELD_TYPES['event_type'], - def_num=1, + 111: Field( + name='sport_index', + type=BASE_TYPES[0x02], # uint8 + def_num=111, ), - 2: Field( - name='start_time', - type=FIELD_TYPES['date_time'], - def_num=2, + 112: Field( # Total time spend in the standing position + name='time_standing', + type=BASE_TYPES[0x86], # uint32 + def_num=112, + scale=1000, + units=u's', ), - 3: Field( - name='start_position_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=3, - units='semicircles', + 113: Field( # Number of transitions to the standing state + name='stand_count', + type=BASE_TYPES[0x84], # uint16 + def_num=113, ), - 4: Field( - name='start_position_long', - type=BASE_TYPES[0x85], # sint32 - def_num=4, - units='semicircles', + 114: Field( # Average platform center offset Left + name='avg_left_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=114, + units=u'mm', ), - 5: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=5, + 115: Field( # Average platform center offset Right + name='avg_right_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=115, + units=u'mm', ), - 6: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=6, + 116: Field( # Average left power phase angles. Indexes defined by power_phase_type. + name='avg_left_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=116, + scale=0.7111111, + units=u'degrees', ), - 7: Field( # Time (includes pauses) - name='total_elapsed_time', + 117: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. + name='avg_left_power_phase_peak', + type=BASE_TYPES[0x02], # uint8 + def_num=117, + scale=0.7111111, + units=u'degrees', + ), + 118: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. + name='avg_right_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=118, + scale=0.7111111, + units=u'degrees', + ), + 119: Field( # Average right power phase peak angles data value indexes defined by power_phase_type. + name='avg_right_power_phase_peak', + type=BASE_TYPES[0x02], # uint8 + def_num=119, + scale=0.7111111, + units=u'degrees', + ), + 120: Field( # Average power by position. Data value indexes defined by rider_position_type. + name='avg_power_position', + type=BASE_TYPES[0x84], # uint16 + def_num=120, + units=u'watts', + ), + 121: Field( # Maximum power by position. Data value indexes defined by rider_position_type. + name='max_power_position', + type=BASE_TYPES[0x84], # uint16 + def_num=121, + units=u'watts', + ), + 122: Field( # Average cadence by position. Data value indexes defined by rider_position_type. + name='avg_cadence_position', + type=BASE_TYPES[0x02], # uint8 + def_num=122, + units=u'rpm', + ), + 123: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. + name='max_cadence_position', + type=BASE_TYPES[0x02], # uint8 + def_num=123, + units=u'rpm', + ), + 124: Field( # total_distance / total_timer_time + name='enhanced_avg_speed', type=BASE_TYPES[0x86], # uint32 - def_num=7, + def_num=124, scale=1000, - units='s', + units=u'm/s', ), - 8: Field( # Timer Time (excludes pauses) - name='total_timer_time', + 125: Field( + name='enhanced_max_speed', type=BASE_TYPES[0x86], # uint32 - def_num=8, + def_num=125, scale=1000, - units='s', + units=u'm/s', ), - 9: Field( - name='total_distance', + 126: Field( + name='enhanced_avg_altitude', + type=BASE_TYPES[0x86], # uint32 + def_num=126, + scale=5, + offset=500, + units=u'm', + ), + 127: Field( + name='enhanced_min_altitude', + type=BASE_TYPES[0x86], # uint32 + def_num=127, + scale=5, + offset=500, + units=u'm', + ), + 128: Field( + name='enhanced_max_altitude', + type=BASE_TYPES[0x86], # uint32 + def_num=128, + scale=5, + offset=500, + units=u'm', + ), + 129: Field( # lev average motor power during session + name='avg_lev_motor_power', + type=BASE_TYPES[0x84], # uint16 + def_num=129, + units=u'watts', + ), + 130: Field( # lev maximum motor power during session + name='max_lev_motor_power', + type=BASE_TYPES[0x84], # uint16 + def_num=130, + units=u'watts', + ), + 131: Field( # lev battery consumption during session + name='lev_battery_consumption', + type=BASE_TYPES[0x02], # uint8 + def_num=131, + scale=2, + units=u'percent', + ), + 132: Field( + name='avg_vertical_ratio', + type=BASE_TYPES[0x84], # uint16 + def_num=132, + scale=100, + units=u'percent', + ), + 133: Field( + name='avg_stance_time_balance', + type=BASE_TYPES[0x84], # uint16 + def_num=133, + scale=100, + units=u'percent', + ), + 134: Field( + name='avg_step_length', + type=BASE_TYPES[0x84], # uint16 + def_num=134, + scale=10, + units=u'mm', + ), + 137: Field( + name='total_anaerobic_training_effect', + type=BASE_TYPES[0x02], # uint8 + def_num=137, + scale=10, + ), + 139: Field( + name='avg_vam', + type=BASE_TYPES[0x84], # uint16 + def_num=139, + scale=1000, + units=u'm/s', + ), + 253: FIELD_TYPE_TIMESTAMP, # Sesson end time. + 254: Field( # Selected bit is set for the current session. + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, + ), + }, + ), + 19: MessageType( + name='lap', + mesg_num=19, + fields={ + 0: Field( + name='event', + type=FIELD_TYPES['event'], + def_num=0, + ), + 1: Field( + name='event_type', + type=FIELD_TYPES['event_type'], + def_num=1, + ), + 2: Field( + name='start_time', + type=FIELD_TYPES['date_time'], + def_num=2, + ), + 3: Field( + name='start_position_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=3, + units=u'semicircles', + ), + 4: Field( + name='start_position_long', + type=BASE_TYPES[0x85], # sint32 + def_num=4, + units=u'semicircles', + ), + 5: Field( + name='end_position_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=5, + units=u'semicircles', + ), + 6: Field( + name='end_position_long', + type=BASE_TYPES[0x85], # sint32 + def_num=6, + units=u'semicircles', + ), + 7: Field( # Time (includes pauses) + name='total_elapsed_time', + type=BASE_TYPES[0x86], # uint32 + def_num=7, + scale=1000, + units=u's', + ), + 8: Field( # Timer Time (excludes pauses) + name='total_timer_time', + type=BASE_TYPES[0x86], # uint32 + def_num=8, + scale=1000, + units=u's', + ), + 9: Field( + name='total_distance', type=BASE_TYPES[0x86], # uint32 def_num=9, scale=100, - units='m', + units=u'm', ), 10: Field( name='total_cycles', type=BASE_TYPES[0x86], # uint32 def_num=10, - units='cycles', + units=u'cycles', subfields=( SubField( name='total_strides', def_num=10, type=BASE_TYPES[0x86], # uint32 - units='strides', + units=u'strides', ref_fields=( ReferenceField( name='sport', - def_num=5, + def_num=25, value='running', raw_value=1, ), ReferenceField( name='sport', - def_num=5, + def_num=25, value='walking', raw_value=11, ), @@ -3122,77 +3515,73 @@ name='total_calories', type=BASE_TYPES[0x84], # uint16 def_num=11, - units='kcal', + units=u'kcal', ), - 13: Field( # If New Leaf + 12: Field( # If New Leaf name='total_fat_calories', type=BASE_TYPES[0x84], # uint16 - def_num=13, - units='kcal', + def_num=12, + units=u'kcal', ), - 14: Field( # total_distance / total_timer_time + 13: Field( name='avg_speed', type=BASE_TYPES[0x84], # uint16 - def_num=14, - scale=1000, - units='m/s', + def_num=13, components=( ComponentField( name='enhanced_avg_speed', - def_num=124, + def_num=110, scale=1000, - units='m/s', + units=u'm/s', accumulate=False, bits=16, bit_offset=0, ), ), ), - 15: Field( + 14: Field( name='max_speed', type=BASE_TYPES[0x84], # uint16 - def_num=15, - scale=1000, - units='m/s', + def_num=14, components=( ComponentField( name='enhanced_max_speed', - def_num=125, + def_num=111, scale=1000, - units='m/s', + units=u'm/s', accumulate=False, bits=16, bit_offset=0, ), ), ), - 16: Field( # average heart rate (excludes pause time) + 15: Field( name='avg_heart_rate', type=BASE_TYPES[0x02], # uint8 - def_num=16, - units='bpm', + def_num=15, + units=u'bpm', ), - 17: Field( + 16: Field( name='max_heart_rate', type=BASE_TYPES[0x02], # uint8 - def_num=17, - units='bpm', + def_num=16, + units=u'bpm', ), - 18: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time + 17: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time name='avg_cadence', type=BASE_TYPES[0x02], # uint8 - def_num=18, - units='rpm', + def_num=17, + units=u'rpm', subfields=( SubField( name='avg_running_cadence', - def_num=18, + def_num=17, type=BASE_TYPES[0x02], # uint8 - units='strides/min', + units=u'strides/min', ref_fields=( ReferenceField( name='sport', - def_num=5, + def_num=25, value='running', raw_value=1, ), @@ -3200,21 +3589,21 @@ ), ), ), - 19: Field( + 18: Field( name='max_cadence', type=BASE_TYPES[0x02], # uint8 - def_num=19, - units='rpm', + def_num=18, + units=u'rpm', subfields=( SubField( name='max_running_cadence', - def_num=19, + def_num=18, type=BASE_TYPES[0x02], # uint8 - units='strides/min', + units=u'strides/min', ref_fields=( ReferenceField( name='sport', - def_num=5, + def_num=25, value='running', raw_value=1, ), @@ -3222,1982 +3611,1089 @@ ), ), ), - 20: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time + 19: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time name='avg_power', type=BASE_TYPES[0x84], # uint16 + def_num=19, + units=u'watts', + ), + 20: Field( + name='max_power', + type=BASE_TYPES[0x84], # uint16 def_num=20, - units='watts', + units=u'watts', ), 21: Field( - name='max_power', + name='total_ascent', type=BASE_TYPES[0x84], # uint16 def_num=21, - units='watts', + units=u'm', ), 22: Field( - name='total_ascent', + name='total_descent', type=BASE_TYPES[0x84], # uint16 def_num=22, - units='m', + units=u'm', ), 23: Field( - name='total_descent', - type=BASE_TYPES[0x84], # uint16 + name='intensity', + type=FIELD_TYPES['intensity'], def_num=23, - units='m', ), 24: Field( - name='total_training_effect', - type=BASE_TYPES[0x02], # uint8 + name='lap_trigger', + type=FIELD_TYPES['lap_trigger'], def_num=24, - scale=10, ), 25: Field( - name='first_lap_index', - type=BASE_TYPES[0x84], # uint16 + name='sport', + type=FIELD_TYPES['sport'], def_num=25, ), 26: Field( - name='num_laps', - type=BASE_TYPES[0x84], # uint16 - def_num=26, - ), - 27: Field( name='event_group', type=BASE_TYPES[0x02], # uint8 - def_num=27, - ), - 28: Field( - name='trigger', - type=FIELD_TYPES['session_trigger'], - def_num=28, - ), - 29: Field( - name='nec_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=29, - units='semicircles', - ), - 30: Field( - name='nec_long', - type=BASE_TYPES[0x85], # sint32 - def_num=30, - units='semicircles', - ), - 31: Field( - name='swc_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=31, - units='semicircles', + def_num=26, ), - 32: Field( - name='swc_long', - type=BASE_TYPES[0x85], # sint32 + 32: Field( # # of lengths of swim pool + name='num_lengths', + type=BASE_TYPES[0x84], # uint16 def_num=32, - units='semicircles', + units=u'lengths', ), - 34: Field( + 33: Field( name='normalized_power', type=BASE_TYPES[0x84], # uint16 + def_num=33, + units=u'watts', + ), + 34: Field( + name='left_right_balance', + type=FIELD_TYPES['left_right_balance_100'], def_num=34, - units='watts', ), 35: Field( - name='training_stress_score', + name='first_length_index', type=BASE_TYPES[0x84], # uint16 def_num=35, - scale=10, - units='tss', - ), - 36: Field( - name='intensity_factor', - type=BASE_TYPES[0x84], # uint16 - def_num=36, - scale=1000, - units='if', ), 37: Field( - name='left_right_balance', - type=FIELD_TYPES['left_right_balance_100'], - def_num=37, - ), - 41: Field( - name='avg_stroke_count', - type=BASE_TYPES[0x86], # uint32 - def_num=41, - scale=10, - units='strokes/lap', - ), - 42: Field( name='avg_stroke_distance', type=BASE_TYPES[0x84], # uint16 - def_num=42, + def_num=37, scale=100, - units='m', + units=u'm', ), - 43: Field( + 38: Field( name='swim_stroke', type=FIELD_TYPES['swim_stroke'], - def_num=43, - units='swim_stroke', - ), - 44: Field( - name='pool_length', - type=BASE_TYPES[0x84], # uint16 - def_num=44, - scale=100, - units='m', - ), - 45: Field( - name='threshold_power', - type=BASE_TYPES[0x84], # uint16 - def_num=45, - units='watts', + def_num=38, ), - 46: Field( - name='pool_length_unit', - type=FIELD_TYPES['display_measure'], - def_num=46, + 39: Field( + name='sub_sport', + type=FIELD_TYPES['sub_sport'], + def_num=39, ), - 47: Field( # # of active lengths of swim pool + 40: Field( # # of active lengths of swim pool name='num_active_lengths', type=BASE_TYPES[0x84], # uint16 - def_num=47, - units='lengths', + def_num=40, + units=u'lengths', ), - 48: Field( + 41: Field( name='total_work', type=BASE_TYPES[0x86], # uint32 - def_num=48, - units='J', + def_num=41, + units=u'J', ), - 49: Field( + 42: Field( name='avg_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=49, - scale=5, - offset=500, - units='m', + def_num=42, components=( ComponentField( name='enhanced_avg_altitude', - def_num=126, + def_num=112, scale=5, offset=500, - units='m', + units=u'm', accumulate=False, bits=16, bit_offset=0, ), ), ), - 50: Field( + 43: Field( name='max_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=50, - scale=5, - offset=500, - units='m', + def_num=43, components=( ComponentField( name='enhanced_max_altitude', - def_num=128, + def_num=114, scale=5, offset=500, - units='m', + units=u'm', accumulate=False, bits=16, bit_offset=0, ), ), ), - 51: Field( + 44: Field( name='gps_accuracy', type=BASE_TYPES[0x02], # uint8 - def_num=51, - units='m', + def_num=44, + units=u'm', ), - 52: Field( + 45: Field( name='avg_grade', type=BASE_TYPES[0x83], # sint16 - def_num=52, + def_num=45, scale=100, - units='%', + units=u'%', ), - 53: Field( + 46: Field( name='avg_pos_grade', type=BASE_TYPES[0x83], # sint16 - def_num=53, + def_num=46, scale=100, - units='%', + units=u'%', ), - 54: Field( + 47: Field( name='avg_neg_grade', type=BASE_TYPES[0x83], # sint16 - def_num=54, + def_num=47, scale=100, - units='%', + units=u'%', ), - 55: Field( + 48: Field( name='max_pos_grade', type=BASE_TYPES[0x83], # sint16 - def_num=55, + def_num=48, scale=100, - units='%', + units=u'%', ), - 56: Field( + 49: Field( name='max_neg_grade', type=BASE_TYPES[0x83], # sint16 - def_num=56, + def_num=49, scale=100, - units='%', + units=u'%', ), - 57: Field( + 50: Field( name='avg_temperature', type=BASE_TYPES[0x01], # sint8 - def_num=57, - units='C', + def_num=50, + units=u'C', ), - 58: Field( + 51: Field( name='max_temperature', type=BASE_TYPES[0x01], # sint8 - def_num=58, - units='C', + def_num=51, + units=u'C', ), - 59: Field( + 52: Field( name='total_moving_time', type=BASE_TYPES[0x86], # uint32 - def_num=59, + def_num=52, scale=1000, - units='s', + units=u's', ), - 60: Field( + 53: Field( name='avg_pos_vertical_speed', type=BASE_TYPES[0x83], # sint16 - def_num=60, + def_num=53, scale=1000, - units='m/s', + units=u'm/s', ), - 61: Field( + 54: Field( name='avg_neg_vertical_speed', type=BASE_TYPES[0x83], # sint16 - def_num=61, + def_num=54, scale=1000, - units='m/s', + units=u'm/s', ), - 62: Field( + 55: Field( name='max_pos_vertical_speed', type=BASE_TYPES[0x83], # sint16 - def_num=62, + def_num=55, scale=1000, - units='m/s', + units=u'm/s', ), - 63: Field( + 56: Field( name='max_neg_vertical_speed', type=BASE_TYPES[0x83], # sint16 - def_num=63, + def_num=56, scale=1000, - units='m/s', - ), - 64: Field( - name='min_heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=64, - units='bpm', + units=u'm/s', ), - 65: Field( + 57: Field( name='time_in_hr_zone', type=BASE_TYPES[0x86], # uint32 - def_num=65, + def_num=57, scale=1000, - units='s', + units=u's', ), - 66: Field( + 58: Field( name='time_in_speed_zone', type=BASE_TYPES[0x86], # uint32 - def_num=66, + def_num=58, scale=1000, - units='s', + units=u's', ), - 67: Field( + 59: Field( name='time_in_cadence_zone', type=BASE_TYPES[0x86], # uint32 - def_num=67, + def_num=59, scale=1000, - units='s', + units=u's', ), - 68: Field( + 60: Field( name='time_in_power_zone', type=BASE_TYPES[0x86], # uint32 - def_num=68, - scale=1000, - units='s', - ), - 69: Field( - name='avg_lap_time', - type=BASE_TYPES[0x86], # uint32 - def_num=69, + def_num=60, scale=1000, - units='s', + units=u's', ), - 70: Field( - name='best_lap_index', + 61: Field( + name='repetition_num', type=BASE_TYPES[0x84], # uint16 - def_num=70, + def_num=61, ), - 71: Field( + 62: Field( name='min_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=71, - scale=5, - offset=500, - units='m', + def_num=62, components=( ComponentField( name='enhanced_min_altitude', - def_num=127, + def_num=113, scale=5, offset=500, - units='m', + units=u'm', accumulate=False, bits=16, bit_offset=0, ), ), ), - 82: Field( - name='player_score', - type=BASE_TYPES[0x84], # uint16 - def_num=82, + 63: Field( + name='min_heart_rate', + type=BASE_TYPES[0x02], # uint8 + def_num=63, + units=u'bpm', ), - 83: Field( + 71: Field( + name='wkt_step_index', + type=FIELD_TYPES['message_index'], + def_num=71, + ), + 74: Field( name='opponent_score', type=BASE_TYPES[0x84], # uint16 - def_num=83, - ), - 84: Field( - name='opponent_name', - type=BASE_TYPES[0x07], # string - def_num=84, + def_num=74, ), - 85: Field( # stroke_type enum used as the index + 75: Field( # stroke_type enum used as the index name='stroke_count', type=BASE_TYPES[0x84], # uint16 - def_num=85, - units='counts', + def_num=75, + units=u'counts', ), - 86: Field( # zone number used as the index + 76: Field( # zone number used as the index name='zone_count', type=BASE_TYPES[0x84], # uint16 - def_num=86, - units='counts', - ), - 87: Field( - name='max_ball_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=87, - scale=100, - units='m/s', - ), - 88: Field( - name='avg_ball_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=88, - scale=100, - units='m/s', + def_num=76, + units=u'counts', ), - 89: Field( + 77: Field( name='avg_vertical_oscillation', type=BASE_TYPES[0x84], # uint16 - def_num=89, + def_num=77, scale=10, - units='mm', + units=u'mm', ), - 90: Field( + 78: Field( name='avg_stance_time_percent', type=BASE_TYPES[0x84], # uint16 - def_num=90, + def_num=78, scale=100, - units='percent', + units=u'percent', ), - 91: Field( + 79: Field( name='avg_stance_time', type=BASE_TYPES[0x84], # uint16 - def_num=91, + def_num=79, scale=10, - units='ms', + units=u'ms', ), - 92: Field( # fractional part of the avg_cadence + 80: Field( # fractional part of the avg_cadence name='avg_fractional_cadence', type=BASE_TYPES[0x02], # uint8 - def_num=92, + def_num=80, scale=128, - units='rpm', + units=u'rpm', ), - 93: Field( # fractional part of the max_cadence + 81: Field( # fractional part of the max_cadence name='max_fractional_cadence', type=BASE_TYPES[0x02], # uint8 - def_num=93, + def_num=81, scale=128, - units='rpm', + units=u'rpm', ), - 94: Field( # fractional part of the total_cycles + 82: Field( # fractional part of the total_cycles name='total_fractional_cycles', type=BASE_TYPES[0x02], # uint8 - def_num=94, + def_num=82, scale=128, - units='cycles', + units=u'cycles', ), - 95: Field( # Avg saturated and unsaturated hemoglobin + 83: Field( + name='player_score', + type=BASE_TYPES[0x84], # uint16 + def_num=83, + ), + 84: Field( # Avg saturated and unsaturated hemoglobin name='avg_total_hemoglobin_conc', type=BASE_TYPES[0x84], # uint16 - def_num=95, + def_num=84, scale=100, - units='g/dL', + units=u'g/dL', ), - 96: Field( # Min saturated and unsaturated hemoglobin + 85: Field( # Min saturated and unsaturated hemoglobin name='min_total_hemoglobin_conc', type=BASE_TYPES[0x84], # uint16 - def_num=96, + def_num=85, scale=100, - units='g/dL', + units=u'g/dL', ), - 97: Field( # Max saturated and unsaturated hemoglobin + 86: Field( # Max saturated and unsaturated hemoglobin name='max_total_hemoglobin_conc', type=BASE_TYPES[0x84], # uint16 - def_num=97, + def_num=86, scale=100, - units='g/dL', + units=u'g/dL', ), - 98: Field( # Avg percentage of hemoglobin saturated with oxygen + 87: Field( # Avg percentage of hemoglobin saturated with oxygen name='avg_saturated_hemoglobin_percent', type=BASE_TYPES[0x84], # uint16 - def_num=98, + def_num=87, scale=10, - units='%', + units=u'%', ), - 99: Field( # Min percentage of hemoglobin saturated with oxygen + 88: Field( # Min percentage of hemoglobin saturated with oxygen name='min_saturated_hemoglobin_percent', type=BASE_TYPES[0x84], # uint16 - def_num=99, + def_num=88, scale=10, - units='%', + units=u'%', ), - 100: Field( # Max percentage of hemoglobin saturated with oxygen + 89: Field( # Max percentage of hemoglobin saturated with oxygen name='max_saturated_hemoglobin_percent', type=BASE_TYPES[0x84], # uint16 - def_num=100, + def_num=89, scale=10, - units='%', + units=u'%', ), - 101: Field( + 91: Field( name='avg_left_torque_effectiveness', type=BASE_TYPES[0x02], # uint8 - def_num=101, + def_num=91, scale=2, - units='percent', + units=u'percent', ), - 102: Field( + 92: Field( name='avg_right_torque_effectiveness', type=BASE_TYPES[0x02], # uint8 - def_num=102, + def_num=92, scale=2, - units='percent', + units=u'percent', ), - 103: Field( + 93: Field( name='avg_left_pedal_smoothness', type=BASE_TYPES[0x02], # uint8 - def_num=103, + def_num=93, scale=2, - units='percent', + units=u'percent', ), - 104: Field( + 94: Field( name='avg_right_pedal_smoothness', type=BASE_TYPES[0x02], # uint8 - def_num=104, + def_num=94, scale=2, - units='percent', + units=u'percent', ), - 105: Field( + 95: Field( name='avg_combined_pedal_smoothness', type=BASE_TYPES[0x02], # uint8 - def_num=105, + def_num=95, scale=2, - units='percent', + units=u'percent', ), - 111: Field( - name='sport_index', - type=BASE_TYPES[0x02], # uint8 - def_num=111, - ), - 112: Field( # Total time spend in the standing position + 98: Field( # Total time spent in the standing position name='time_standing', type=BASE_TYPES[0x86], # uint32 - def_num=112, + def_num=98, scale=1000, - units='s', + units=u's', ), - 113: Field( # Number of transitions to the standing state + 99: Field( # Number of transitions to the standing state name='stand_count', type=BASE_TYPES[0x84], # uint16 - def_num=113, + def_num=99, ), - 114: Field( # Average platform center offset Left + 100: Field( # Average left platform center offset name='avg_left_pco', type=BASE_TYPES[0x01], # sint8 - def_num=114, - units='mm', + def_num=100, + units=u'mm', ), - 115: Field( # Average platform center offset Right + 101: Field( # Average right platform center offset name='avg_right_pco', type=BASE_TYPES[0x01], # sint8 - def_num=115, - units='mm', + def_num=101, + units=u'mm', ), - 116: Field( # Average left power phase angles. Indexes defined by power_phase_type. + 102: Field( # Average left power phase angles. Data value indexes defined by power_phase_type. name='avg_left_power_phase', type=BASE_TYPES[0x02], # uint8 - def_num=116, + def_num=102, scale=0.7111111, - units='degrees', + units=u'degrees', ), - 117: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. + 103: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. name='avg_left_power_phase_peak', type=BASE_TYPES[0x02], # uint8 - def_num=117, + def_num=103, scale=0.7111111, - units='degrees', + units=u'degrees', ), - 118: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. + 104: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. name='avg_right_power_phase', type=BASE_TYPES[0x02], # uint8 - def_num=118, + def_num=104, scale=0.7111111, - units='degrees', + units=u'degrees', ), - 119: Field( # Average right power phase peak angles data value indexes defined by power_phase_type. + 105: Field( # Average right power phase peak angles. Data value indexes defined by power_phase_type. name='avg_right_power_phase_peak', type=BASE_TYPES[0x02], # uint8 - def_num=119, + def_num=105, scale=0.7111111, - units='degrees', + units=u'degrees', ), - 120: Field( # Average power by position. Data value indexes defined by rider_position_type. + 106: Field( # Average power by position. Data value indexes defined by rider_position_type. name='avg_power_position', type=BASE_TYPES[0x84], # uint16 - def_num=120, - units='watts', + def_num=106, + units=u'watts', ), - 121: Field( # Maximum power by position. Data value indexes defined by rider_position_type. + 107: Field( # Maximum power by position. Data value indexes defined by rider_position_type. name='max_power_position', type=BASE_TYPES[0x84], # uint16 - def_num=121, - units='watts', + def_num=107, + units=u'watts', ), - 122: Field( # Average cadence by position. Data value indexes defined by rider_position_type. + 108: Field( # Average cadence by position. Data value indexes defined by rider_position_type. name='avg_cadence_position', type=BASE_TYPES[0x02], # uint8 - def_num=122, - units='rpm', + def_num=108, + units=u'rpm', ), - 123: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. + 109: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. name='max_cadence_position', type=BASE_TYPES[0x02], # uint8 - def_num=123, - units='rpm', + def_num=109, + units=u'rpm', ), - 124: Field( # total_distance / total_timer_time + 110: Field( name='enhanced_avg_speed', type=BASE_TYPES[0x86], # uint32 - def_num=124, + def_num=110, scale=1000, - units='m/s', + units=u'm/s', ), - 125: Field( + 111: Field( name='enhanced_max_speed', type=BASE_TYPES[0x86], # uint32 - def_num=125, + def_num=111, scale=1000, - units='m/s', + units=u'm/s', ), - 126: Field( + 112: Field( name='enhanced_avg_altitude', type=BASE_TYPES[0x86], # uint32 - def_num=126, + def_num=112, scale=5, offset=500, - units='m', + units=u'm', ), - 127: Field( + 113: Field( name='enhanced_min_altitude', type=BASE_TYPES[0x86], # uint32 - def_num=127, + def_num=113, scale=5, offset=500, - units='m', + units=u'm', ), - 128: Field( + 114: Field( name='enhanced_max_altitude', type=BASE_TYPES[0x86], # uint32 - def_num=128, + def_num=114, scale=5, offset=500, - units='m', + units=u'm', ), - 129: Field( # lev average motor power during session + 115: Field( # lev average motor power during lap name='avg_lev_motor_power', type=BASE_TYPES[0x84], # uint16 - def_num=129, - units='watts', + def_num=115, + units=u'watts', ), - 130: Field( # lev maximum motor power during session + 116: Field( # lev maximum motor power during lap name='max_lev_motor_power', type=BASE_TYPES[0x84], # uint16 - def_num=130, - units='watts', + def_num=116, + units=u'watts', ), - 131: Field( # lev battery consumption during session + 117: Field( # lev battery consumption during lap name='lev_battery_consumption', type=BASE_TYPES[0x02], # uint8 - def_num=131, + def_num=117, scale=2, - units='percent', + units=u'percent', ), - 132: Field( + 118: Field( name='avg_vertical_ratio', type=BASE_TYPES[0x84], # uint16 - def_num=132, + def_num=118, scale=100, - units='percent', + units=u'percent', ), - 133: Field( + 119: Field( name='avg_stance_time_balance', type=BASE_TYPES[0x84], # uint16 - def_num=133, + def_num=119, scale=100, - units='percent', + units=u'percent', ), - 134: Field( + 120: Field( name='avg_step_length', type=BASE_TYPES[0x84], # uint16 - def_num=134, - scale=10, - units='mm', - ), - 137: Field( - name='total_anaerobic_training_effect', - type=BASE_TYPES[0x02], # uint8 - def_num=137, + def_num=120, scale=10, + units=u'mm', ), - 139: Field( + 121: Field( name='avg_vam', type=BASE_TYPES[0x84], # uint16 - def_num=139, + def_num=121, scale=1000, - units='m/s', + units=u'm/s', ), - 253: FIELD_TYPE_TIMESTAMP, # Sesson end time. - 254: Field( # Selected bit is set for the current session. + 253: FIELD_TYPE_TIMESTAMP, # Lap end time. + 254: Field( name='message_index', type=FIELD_TYPES['message_index'], def_num=254, ), }, ), - 19: MessageType( - name='lap', - mesg_num=19, + 20: MessageType( + name='record', + mesg_num=20, fields={ 0: Field( - name='event', - type=FIELD_TYPES['event'], + name='position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=0, + units=u'semicircles', ), 1: Field( - name='event_type', - type=FIELD_TYPES['event_type'], + name='position_long', + type=BASE_TYPES[0x85], # sint32 def_num=1, + units=u'semicircles', ), 2: Field( - name='start_time', - type=FIELD_TYPES['date_time'], + name='altitude', + type=BASE_TYPES[0x84], # uint16 def_num=2, + components=( + ComponentField( + name='enhanced_altitude', + def_num=78, + scale=5, + offset=500, + units=u'm', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), 3: Field( - name='start_position_lat', - type=BASE_TYPES[0x85], # sint32 + name='heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=3, - units='semicircles', + units=u'bpm', ), 4: Field( - name='start_position_long', - type=BASE_TYPES[0x85], # sint32 + name='cadence', + type=BASE_TYPES[0x02], # uint8 def_num=4, - units='semicircles', + units=u'rpm', ), 5: Field( - name='end_position_lat', - type=BASE_TYPES[0x85], # sint32 + name='distance', + type=BASE_TYPES[0x86], # uint32 def_num=5, - units='semicircles', + scale=100, + units=u'm', ), 6: Field( - name='end_position_long', - type=BASE_TYPES[0x85], # sint32 + name='speed', + type=BASE_TYPES[0x84], # uint16 def_num=6, - units='semicircles', + components=( + ComponentField( + name='enhanced_speed', + def_num=73, + scale=1000, + units=u'm/s', + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), - 7: Field( # Time (includes pauses) - name='total_elapsed_time', - type=BASE_TYPES[0x86], # uint32 + 7: Field( + name='power', + type=BASE_TYPES[0x84], # uint16 def_num=7, - scale=1000, - units='s', + units=u'watts', ), - 8: Field( # Timer Time (excludes pauses) - name='total_timer_time', - type=BASE_TYPES[0x86], # uint32 + 8: Field( + name='compressed_speed_distance', + type=BASE_TYPES[0x0D], # byte def_num=8, - scale=1000, - units='s', + components=( + ComponentField( + name='speed', + def_num=6, + scale=100, + units=u'm/s', + accumulate=False, + bits=12, + bit_offset=0, + ), + ComponentField( + name='distance', + def_num=5, + scale=16, + units=u'm', + accumulate=True, + bits=12, + bit_offset=12, + ), + ), ), 9: Field( - name='total_distance', - type=BASE_TYPES[0x86], # uint32 + name='grade', + type=BASE_TYPES[0x83], # sint16 def_num=9, scale=100, - units='m', + units=u'%', ), - 10: Field( - name='total_cycles', - type=BASE_TYPES[0x86], # uint32 + 10: Field( # Relative. 0 is none 254 is Max. + name='resistance', + type=BASE_TYPES[0x02], # uint8 def_num=10, - units='cycles', - subfields=( - SubField( - name='total_strides', - def_num=10, - type=BASE_TYPES[0x86], # uint32 - units='strides', - ref_fields=( - ReferenceField( - name='sport', - def_num=25, - value='running', - raw_value=1, - ), - ReferenceField( - name='sport', - def_num=25, - value='walking', - raw_value=11, - ), - ), - ), - ), ), 11: Field( - name='total_calories', - type=BASE_TYPES[0x84], # uint16 + name='time_from_course', + type=BASE_TYPES[0x85], # sint32 def_num=11, - units='kcal', + scale=1000, + units=u's', ), - 12: Field( # If New Leaf - name='total_fat_calories', - type=BASE_TYPES[0x84], # uint16 + 12: Field( + name='cycle_length', + type=BASE_TYPES[0x02], # uint8 def_num=12, - units='kcal', + scale=100, + units=u'm', ), 13: Field( - name='avg_speed', - type=BASE_TYPES[0x84], # uint16 + name='temperature', + type=BASE_TYPES[0x01], # sint8 def_num=13, - scale=1000, - units='m/s', - components=( - ComponentField( - name='enhanced_avg_speed', - def_num=110, - scale=1000, - units='m/s', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), - ), - 14: Field( - name='max_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=14, - scale=1000, - units='m/s', - components=( - ComponentField( - name='enhanced_max_speed', - def_num=111, - scale=1000, - units='m/s', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), - ), - 15: Field( - name='avg_heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=15, - units='bpm', - ), - 16: Field( - name='max_heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=16, - units='bpm', + units=u'C', ), - 17: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time - name='avg_cadence', + 17: Field( # Speed at 1s intervals. Timestamp field indicates time of last array element. + name='speed_1s', type=BASE_TYPES[0x02], # uint8 def_num=17, - units='rpm', - subfields=( - SubField( - name='avg_running_cadence', - def_num=17, - type=BASE_TYPES[0x02], # uint8 - units='strides/min', - ref_fields=( - ReferenceField( - name='sport', - def_num=25, - value='running', - raw_value=1, - ), - ), - ), - ), + scale=16, + units=u'm/s', ), 18: Field( - name='max_cadence', + name='cycles', type=BASE_TYPES[0x02], # uint8 def_num=18, - units='rpm', - subfields=( - SubField( - name='max_running_cadence', - def_num=18, - type=BASE_TYPES[0x02], # uint8 - units='strides/min', - ref_fields=( - ReferenceField( - name='sport', - def_num=25, - value='running', - raw_value=1, - ), - ), + components=( + ComponentField( + name='total_cycles', + def_num=19, + units=u'cycles', + accumulate=True, + bits=8, + bit_offset=0, ), ), ), - 19: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time - name='avg_power', - type=BASE_TYPES[0x84], # uint16 + 19: Field( + name='total_cycles', + type=BASE_TYPES[0x86], # uint32 def_num=19, - units='watts', - ), - 20: Field( - name='max_power', - type=BASE_TYPES[0x84], # uint16 - def_num=20, - units='watts', + units=u'cycles', ), - 21: Field( - name='total_ascent', - type=BASE_TYPES[0x84], # uint16 - def_num=21, - units='m', - ), - 22: Field( - name='total_descent', + 28: Field( + name='compressed_accumulated_power', type=BASE_TYPES[0x84], # uint16 - def_num=22, - units='m', - ), - 23: Field( - name='intensity', - type=FIELD_TYPES['intensity'], - def_num=23, + def_num=28, + components=( + ComponentField( + name='accumulated_power', + def_num=29, + units=u'watts', + accumulate=True, + bits=16, + bit_offset=0, + ), + ), ), - 24: Field( - name='lap_trigger', - type=FIELD_TYPES['lap_trigger'], - def_num=24, + 29: Field( + name='accumulated_power', + type=BASE_TYPES[0x86], # uint32 + def_num=29, + units=u'watts', ), - 25: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=25, + 30: Field( + name='left_right_balance', + type=FIELD_TYPES['left_right_balance'], + def_num=30, ), - 26: Field( - name='event_group', + 31: Field( + name='gps_accuracy', type=BASE_TYPES[0x02], # uint8 - def_num=26, + def_num=31, + units=u'm', ), - 32: Field( # # of lengths of swim pool - name='num_lengths', - type=BASE_TYPES[0x84], # uint16 + 32: Field( + name='vertical_speed', + type=BASE_TYPES[0x83], # sint16 def_num=32, - units='lengths', + scale=1000, + units=u'm/s', ), 33: Field( - name='normalized_power', + name='calories', type=BASE_TYPES[0x84], # uint16 def_num=33, - units='watts', - ), - 34: Field( - name='left_right_balance', - type=FIELD_TYPES['left_right_balance_100'], - def_num=34, - ), - 35: Field( - name='first_length_index', - type=BASE_TYPES[0x84], # uint16 - def_num=35, - ), - 37: Field( - name='avg_stroke_distance', - type=BASE_TYPES[0x84], # uint16 - def_num=37, - scale=100, - units='m', - ), - 38: Field( - name='swim_stroke', - type=FIELD_TYPES['swim_stroke'], - def_num=38, + units=u'kcal', ), 39: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], + name='vertical_oscillation', + type=BASE_TYPES[0x84], # uint16 def_num=39, + scale=10, + units=u'mm', ), - 40: Field( # # of active lengths of swim pool - name='num_active_lengths', + 40: Field( + name='stance_time_percent', type=BASE_TYPES[0x84], # uint16 def_num=40, - units='lengths', + scale=100, + units=u'percent', ), 41: Field( - name='total_work', - type=BASE_TYPES[0x86], # uint32 + name='stance_time', + type=BASE_TYPES[0x84], # uint16 def_num=41, - units='J', + scale=10, + units=u'ms', ), 42: Field( - name='avg_altitude', - type=BASE_TYPES[0x84], # uint16 + name='activity_type', + type=FIELD_TYPES['activity_type'], def_num=42, - scale=5, - offset=500, - units='m', - components=( - ComponentField( - name='enhanced_avg_altitude', - def_num=112, - scale=5, - offset=500, - units='m', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), ), 43: Field( - name='max_altitude', - type=BASE_TYPES[0x84], # uint16 + name='left_torque_effectiveness', + type=BASE_TYPES[0x02], # uint8 def_num=43, - scale=5, - offset=500, - units='m', - components=( - ComponentField( - name='enhanced_max_altitude', - def_num=114, - scale=5, - offset=500, - units='m', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), + scale=2, + units=u'percent', ), 44: Field( - name='gps_accuracy', + name='right_torque_effectiveness', type=BASE_TYPES[0x02], # uint8 def_num=44, - units='m', + scale=2, + units=u'percent', ), 45: Field( - name='avg_grade', - type=BASE_TYPES[0x83], # sint16 + name='left_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 def_num=45, - scale=100, - units='%', + scale=2, + units=u'percent', ), 46: Field( - name='avg_pos_grade', - type=BASE_TYPES[0x83], # sint16 + name='right_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 def_num=46, - scale=100, - units='%', + scale=2, + units=u'percent', ), 47: Field( - name='avg_neg_grade', - type=BASE_TYPES[0x83], # sint16 + name='combined_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 def_num=47, - scale=100, - units='%', + scale=2, + units=u'percent', ), 48: Field( - name='max_pos_grade', - type=BASE_TYPES[0x83], # sint16 + name='time128', + type=BASE_TYPES[0x02], # uint8 def_num=48, - scale=100, - units='%', + scale=128, + units=u's', ), 49: Field( - name='max_neg_grade', - type=BASE_TYPES[0x83], # sint16 + name='stroke_type', + type=FIELD_TYPES['stroke_type'], def_num=49, - scale=100, - units='%', ), 50: Field( - name='avg_temperature', - type=BASE_TYPES[0x01], # sint8 + name='zone', + type=BASE_TYPES[0x02], # uint8 def_num=50, - units='C', ), 51: Field( - name='max_temperature', - type=BASE_TYPES[0x01], # sint8 + name='ball_speed', + type=BASE_TYPES[0x84], # uint16 def_num=51, - units='C', + scale=100, + units=u'm/s', ), - 52: Field( - name='total_moving_time', - type=BASE_TYPES[0x86], # uint32 + 52: Field( # Log cadence and fractional cadence for backwards compatability + name='cadence256', + type=BASE_TYPES[0x84], # uint16 def_num=52, - scale=1000, - units='s', + scale=256, + units=u'rpm', ), 53: Field( - name='avg_pos_vertical_speed', - type=BASE_TYPES[0x83], # sint16 + name='fractional_cadence', + type=BASE_TYPES[0x02], # uint8 def_num=53, - scale=1000, - units='m/s', + scale=128, + units=u'rpm', ), - 54: Field( - name='avg_neg_vertical_speed', - type=BASE_TYPES[0x83], # sint16 + 54: Field( # Total saturated and unsaturated hemoglobin + name='total_hemoglobin_conc', + type=BASE_TYPES[0x84], # uint16 def_num=54, - scale=1000, - units='m/s', + scale=100, + units=u'g/dL', ), - 55: Field( - name='max_pos_vertical_speed', - type=BASE_TYPES[0x83], # sint16 + 55: Field( # Min saturated and unsaturated hemoglobin + name='total_hemoglobin_conc_min', + type=BASE_TYPES[0x84], # uint16 def_num=55, - scale=1000, - units='m/s', + scale=100, + units=u'g/dL', ), - 56: Field( - name='max_neg_vertical_speed', - type=BASE_TYPES[0x83], # sint16 + 56: Field( # Max saturated and unsaturated hemoglobin + name='total_hemoglobin_conc_max', + type=BASE_TYPES[0x84], # uint16 def_num=56, - scale=1000, - units='m/s', + scale=100, + units=u'g/dL', ), - 57: Field( - name='time_in_hr_zone', - type=BASE_TYPES[0x86], # uint32 + 57: Field( # Percentage of hemoglobin saturated with oxygen + name='saturated_hemoglobin_percent', + type=BASE_TYPES[0x84], # uint16 def_num=57, - scale=1000, - units='s', + scale=10, + units=u'%', ), - 58: Field( - name='time_in_speed_zone', - type=BASE_TYPES[0x86], # uint32 + 58: Field( # Min percentage of hemoglobin saturated with oxygen + name='saturated_hemoglobin_percent_min', + type=BASE_TYPES[0x84], # uint16 def_num=58, - scale=1000, - units='s', - ), - 59: Field( - name='time_in_cadence_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=59, - scale=1000, - units='s', - ), - 60: Field( - name='time_in_power_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=60, - scale=1000, - units='s', + scale=10, + units=u'%', ), - 61: Field( - name='repetition_num', + 59: Field( # Max percentage of hemoglobin saturated with oxygen + name='saturated_hemoglobin_percent_max', type=BASE_TYPES[0x84], # uint16 - def_num=61, + def_num=59, + scale=10, + units=u'%', ), 62: Field( - name='min_altitude', - type=BASE_TYPES[0x84], # uint16 + name='device_index', + type=FIELD_TYPES['device_index'], def_num=62, - scale=5, - offset=500, - units='m', - components=( - ComponentField( - name='enhanced_min_altitude', - def_num=113, - scale=5, - offset=500, - units='m', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), ), - 63: Field( - name='min_heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=63, - units='bpm', + 67: Field( # Left platform center offset + name='left_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=67, + units=u'mm', ), - 71: Field( - name='wkt_step_index', - type=FIELD_TYPES['message_index'], - def_num=71, + 68: Field( # Right platform center offset + name='right_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=68, + units=u'mm', ), - 74: Field( - name='opponent_score', - type=BASE_TYPES[0x84], # uint16 - def_num=74, + 69: Field( # Left power phase angles. Data value indexes defined by power_phase_type. + name='left_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=69, + scale=0.7111111, + units=u'degrees', ), - 75: Field( # stroke_type enum used as the index - name='stroke_count', - type=BASE_TYPES[0x84], # uint16 - def_num=75, - units='counts', + 70: Field( # Left power phase peak angles. Data value indexes defined by power_phase_type. + name='left_power_phase_peak', + type=BASE_TYPES[0x02], # uint8 + def_num=70, + scale=0.7111111, + units=u'degrees', ), - 76: Field( # zone number used as the index - name='zone_count', - type=BASE_TYPES[0x84], # uint16 - def_num=76, - units='counts', + 71: Field( # Right power phase angles. Data value indexes defined by power_phase_type. + name='right_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=71, + scale=0.7111111, + units=u'degrees', ), - 77: Field( - name='avg_vertical_oscillation', - type=BASE_TYPES[0x84], # uint16 - def_num=77, - scale=10, - units='mm', + 72: Field( # Right power phase peak angles. Data value indexes defined by power_phase_type. + name='right_power_phase_peak', + type=BASE_TYPES[0x02], # uint8 + def_num=72, + scale=0.7111111, + units=u'degrees', + ), + 73: Field( + name='enhanced_speed', + type=BASE_TYPES[0x86], # uint32 + def_num=73, + scale=1000, + units=u'm/s', ), 78: Field( - name='avg_stance_time_percent', - type=BASE_TYPES[0x84], # uint16 + name='enhanced_altitude', + type=BASE_TYPES[0x86], # uint32 def_num=78, - scale=100, - units='percent', - ), - 79: Field( - name='avg_stance_time', - type=BASE_TYPES[0x84], # uint16 - def_num=79, - scale=10, - units='ms', - ), - 80: Field( # fractional part of the avg_cadence - name='avg_fractional_cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=80, - scale=128, - units='rpm', + scale=5, + offset=500, + units=u'm', ), - 81: Field( # fractional part of the max_cadence - name='max_fractional_cadence', + 81: Field( # lev battery state of charge + name='battery_soc', type=BASE_TYPES[0x02], # uint8 def_num=81, - scale=128, - units='rpm', + scale=2, + units=u'percent', ), - 82: Field( # fractional part of the total_cycles - name='total_fractional_cycles', - type=BASE_TYPES[0x02], # uint8 + 82: Field( # lev motor power + name='motor_power', + type=BASE_TYPES[0x84], # uint16 def_num=82, - scale=128, - units='cycles', + units=u'watts', ), 83: Field( - name='player_score', + name='vertical_ratio', type=BASE_TYPES[0x84], # uint16 def_num=83, + scale=100, + units=u'percent', ), - 84: Field( # Avg saturated and unsaturated hemoglobin - name='avg_total_hemoglobin_conc', + 84: Field( + name='stance_time_balance', type=BASE_TYPES[0x84], # uint16 def_num=84, scale=100, - units='g/dL', + units=u'percent', ), - 85: Field( # Min saturated and unsaturated hemoglobin - name='min_total_hemoglobin_conc', + 85: Field( + name='step_length', type=BASE_TYPES[0x84], # uint16 def_num=85, - scale=100, - units='g/dL', - ), - 86: Field( # Max saturated and unsaturated hemoglobin - name='max_total_hemoglobin_conc', - type=BASE_TYPES[0x84], # uint16 - def_num=86, - scale=100, - units='g/dL', - ), - 87: Field( # Avg percentage of hemoglobin saturated with oxygen - name='avg_saturated_hemoglobin_percent', - type=BASE_TYPES[0x84], # uint16 - def_num=87, - scale=10, - units='%', - ), - 88: Field( # Min percentage of hemoglobin saturated with oxygen - name='min_saturated_hemoglobin_percent', - type=BASE_TYPES[0x84], # uint16 - def_num=88, - scale=10, - units='%', - ), - 89: Field( # Max percentage of hemoglobin saturated with oxygen - name='max_saturated_hemoglobin_percent', - type=BASE_TYPES[0x84], # uint16 - def_num=89, scale=10, - units='%', + units=u'mm', ), - 91: Field( - name='avg_left_torque_effectiveness', - type=BASE_TYPES[0x02], # uint8 - def_num=91, - scale=2, - units='percent', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 21: MessageType( + name='event', + mesg_num=21, + fields={ + 0: Field( + name='event', + type=FIELD_TYPES['event'], + def_num=0, ), - 92: Field( - name='avg_right_torque_effectiveness', - type=BASE_TYPES[0x02], # uint8 - def_num=92, - scale=2, - units='percent', + 1: Field( + name='event_type', + type=FIELD_TYPES['event_type'], + def_num=1, ), - 93: Field( - name='avg_left_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=93, - scale=2, - units='percent', - ), - 94: Field( - name='avg_right_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=94, - scale=2, - units='percent', - ), - 95: Field( - name='avg_combined_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=95, - scale=2, - units='percent', - ), - 98: Field( # Total time spent in the standing position - name='time_standing', - type=BASE_TYPES[0x86], # uint32 - def_num=98, - scale=1000, - units='s', - ), - 99: Field( # Number of transitions to the standing state - name='stand_count', - type=BASE_TYPES[0x84], # uint16 - def_num=99, - ), - 100: Field( # Average left platform center offset - name='avg_left_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=100, - units='mm', - ), - 101: Field( # Average right platform center offset - name='avg_right_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=101, - units='mm', - ), - 102: Field( # Average left power phase angles. Data value indexes defined by power_phase_type. - name='avg_left_power_phase', - type=BASE_TYPES[0x02], # uint8 - def_num=102, - scale=0.7111111, - units='degrees', - ), - 103: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. - name='avg_left_power_phase_peak', - type=BASE_TYPES[0x02], # uint8 - def_num=103, - scale=0.7111111, - units='degrees', - ), - 104: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. - name='avg_right_power_phase', - type=BASE_TYPES[0x02], # uint8 - def_num=104, - scale=0.7111111, - units='degrees', - ), - 105: Field( # Average right power phase peak angles. Data value indexes defined by power_phase_type. - name='avg_right_power_phase_peak', - type=BASE_TYPES[0x02], # uint8 - def_num=105, - scale=0.7111111, - units='degrees', - ), - 106: Field( # Average power by position. Data value indexes defined by rider_position_type. - name='avg_power_position', - type=BASE_TYPES[0x84], # uint16 - def_num=106, - units='watts', - ), - 107: Field( # Maximum power by position. Data value indexes defined by rider_position_type. - name='max_power_position', - type=BASE_TYPES[0x84], # uint16 - def_num=107, - units='watts', - ), - 108: Field( # Average cadence by position. Data value indexes defined by rider_position_type. - name='avg_cadence_position', - type=BASE_TYPES[0x02], # uint8 - def_num=108, - units='rpm', - ), - 109: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. - name='max_cadence_position', - type=BASE_TYPES[0x02], # uint8 - def_num=109, - units='rpm', - ), - 110: Field( - name='enhanced_avg_speed', - type=BASE_TYPES[0x86], # uint32 - def_num=110, - scale=1000, - units='m/s', - ), - 111: Field( - name='enhanced_max_speed', - type=BASE_TYPES[0x86], # uint32 - def_num=111, - scale=1000, - units='m/s', - ), - 112: Field( - name='enhanced_avg_altitude', - type=BASE_TYPES[0x86], # uint32 - def_num=112, - scale=5, - offset=500, - units='m', - ), - 113: Field( - name='enhanced_min_altitude', - type=BASE_TYPES[0x86], # uint32 - def_num=113, - scale=5, - offset=500, - units='m', - ), - 114: Field( - name='enhanced_max_altitude', - type=BASE_TYPES[0x86], # uint32 - def_num=114, - scale=5, - offset=500, - units='m', - ), - 115: Field( # lev average motor power during lap - name='avg_lev_motor_power', - type=BASE_TYPES[0x84], # uint16 - def_num=115, - units='watts', - ), - 116: Field( # lev maximum motor power during lap - name='max_lev_motor_power', - type=BASE_TYPES[0x84], # uint16 - def_num=116, - units='watts', - ), - 117: Field( # lev battery consumption during lap - name='lev_battery_consumption', - type=BASE_TYPES[0x02], # uint8 - def_num=117, - scale=2, - units='percent', - ), - 118: Field( - name='avg_vertical_ratio', - type=BASE_TYPES[0x84], # uint16 - def_num=118, - scale=100, - units='percent', - ), - 119: Field( - name='avg_stance_time_balance', - type=BASE_TYPES[0x84], # uint16 - def_num=119, - scale=100, - units='percent', - ), - 120: Field( - name='avg_step_length', - type=BASE_TYPES[0x84], # uint16 - def_num=120, - scale=10, - units='mm', - ), - 121: Field( - name='avg_vam', - type=BASE_TYPES[0x84], # uint16 - def_num=121, - scale=1000, - units='m/s', - ), - 253: FIELD_TYPE_TIMESTAMP, # Lap end time. - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, - ), - }, - ), - 20: MessageType( - name='record', - mesg_num=20, - fields={ - 0: Field( - name='position_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=0, - units='semicircles', - ), - 1: Field( - name='position_long', - type=BASE_TYPES[0x85], # sint32 - def_num=1, - units='semicircles', - ), - 2: Field( - name='altitude', - type=BASE_TYPES[0x84], # uint16 - def_num=2, - scale=5, - offset=500, - units='m', - components=( - ComponentField( - name='enhanced_altitude', - def_num=78, - scale=5, - offset=500, - units='m', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), + 2: Field( + name='data16', + type=BASE_TYPES[0x84], # uint16 + def_num=2, + components=( + ComponentField( + name='data', + def_num=3, + accumulate=False, + bits=16, + bit_offset=0, + ), + ), ), 3: Field( - name='heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=3, - units='bpm', - ), - 4: Field( - name='cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=4, - units='rpm', - ), - 5: Field( - name='distance', + name='data', type=BASE_TYPES[0x86], # uint32 - def_num=5, - scale=100, - units='m', - ), - 6: Field( - name='speed', - type=BASE_TYPES[0x84], # uint16 - def_num=6, - scale=1000, - units='m/s', - components=( - ComponentField( - name='enhanced_speed', - def_num=73, + def_num=3, + subfields=( + SubField( + name='battery_level', + def_num=3, + type=BASE_TYPES[0x84], # uint16 scale=1000, - units='m/s', - accumulate=False, - bits=16, - bit_offset=0, - ), - ), - ), - 7: Field( - name='power', - type=BASE_TYPES[0x84], # uint16 - def_num=7, - units='watts', - ), - 8: Field( - name='compressed_speed_distance', - type=BASE_TYPES[0x0D], # byte - def_num=8, - components=( - ComponentField( - name='speed', - def_num=6, - scale=100, - units='m/s', - accumulate=False, - bits=12, - bit_offset=0, - ), - ComponentField( - name='distance', - def_num=5, - scale=16, - units='m', - accumulate=True, - bits=12, - bit_offset=12, - ), - ), - ), - 9: Field( - name='grade', - type=BASE_TYPES[0x83], # sint16 - def_num=9, - scale=100, - units='%', - ), - 10: Field( # Relative. 0 is none 254 is Max. - name='resistance', - type=BASE_TYPES[0x02], # uint8 - def_num=10, - ), - 11: Field( - name='time_from_course', - type=BASE_TYPES[0x85], # sint32 - def_num=11, - scale=1000, - units='s', - ), - 12: Field( - name='cycle_length', - type=BASE_TYPES[0x02], # uint8 - def_num=12, - scale=100, - units='m', - ), - 13: Field( - name='temperature', - type=BASE_TYPES[0x01], # sint8 - def_num=13, - units='C', - ), - 17: Field( # Speed at 1s intervals. Timestamp field indicates time of last array element. - name='speed_1s', - type=BASE_TYPES[0x02], # uint8 - def_num=17, - scale=16, - units='m/s', - ), - 18: Field( - name='cycles', - type=BASE_TYPES[0x02], # uint8 - def_num=18, - components=( - ComponentField( - name='total_cycles', - def_num=19, - units='cycles', - accumulate=True, - bits=8, - bit_offset=0, - ), - ), - ), - 19: Field( - name='total_cycles', - type=BASE_TYPES[0x86], # uint32 - def_num=19, - units='cycles', - ), - 28: Field( - name='compressed_accumulated_power', - type=BASE_TYPES[0x84], # uint16 - def_num=28, - components=( - ComponentField( - name='accumulated_power', - def_num=29, - units='watts', - accumulate=True, - bits=16, - bit_offset=0, - ), - ), - ), - 29: Field( - name='accumulated_power', - type=BASE_TYPES[0x86], # uint32 - def_num=29, - units='watts', - ), - 30: Field( - name='left_right_balance', - type=FIELD_TYPES['left_right_balance'], - def_num=30, - ), - 31: Field( - name='gps_accuracy', - type=BASE_TYPES[0x02], # uint8 - def_num=31, - units='m', - ), - 32: Field( - name='vertical_speed', - type=BASE_TYPES[0x83], # sint16 - def_num=32, - scale=1000, - units='m/s', - ), - 33: Field( - name='calories', - type=BASE_TYPES[0x84], # uint16 - def_num=33, - units='kcal', - ), - 39: Field( - name='vertical_oscillation', - type=BASE_TYPES[0x84], # uint16 - def_num=39, - scale=10, - units='mm', - ), - 40: Field( - name='stance_time_percent', - type=BASE_TYPES[0x84], # uint16 - def_num=40, - scale=100, - units='percent', - ), - 41: Field( - name='stance_time', - type=BASE_TYPES[0x84], # uint16 - def_num=41, - scale=10, - units='ms', - ), - 42: Field( - name='activity_type', - type=FIELD_TYPES['activity_type'], - def_num=42, - ), - 43: Field( - name='left_torque_effectiveness', - type=BASE_TYPES[0x02], # uint8 - def_num=43, - scale=2, - units='percent', - ), - 44: Field( - name='right_torque_effectiveness', - type=BASE_TYPES[0x02], # uint8 - def_num=44, - scale=2, - units='percent', - ), - 45: Field( - name='left_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=45, - scale=2, - units='percent', - ), - 46: Field( - name='right_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=46, - scale=2, - units='percent', - ), - 47: Field( - name='combined_pedal_smoothness', - type=BASE_TYPES[0x02], # uint8 - def_num=47, - scale=2, - units='percent', - ), - 48: Field( - name='time128', - type=BASE_TYPES[0x02], # uint8 - def_num=48, - scale=128, - units='s', - ), - 49: Field( - name='stroke_type', - type=FIELD_TYPES['stroke_type'], - def_num=49, - ), - 50: Field( - name='zone', - type=BASE_TYPES[0x02], # uint8 - def_num=50, - ), - 51: Field( - name='ball_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=51, - scale=100, - units='m/s', - ), - 52: Field( # Log cadence and fractional cadence for backwards compatability - name='cadence256', - type=BASE_TYPES[0x84], # uint16 - def_num=52, - scale=256, - units='rpm', - ), - 53: Field( - name='fractional_cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=53, - scale=128, - units='rpm', - ), - 54: Field( # Total saturated and unsaturated hemoglobin - name='total_hemoglobin_conc', - type=BASE_TYPES[0x84], # uint16 - def_num=54, - scale=100, - units='g/dL', - ), - 55: Field( # Min saturated and unsaturated hemoglobin - name='total_hemoglobin_conc_min', - type=BASE_TYPES[0x84], # uint16 - def_num=55, - scale=100, - units='g/dL', - ), - 56: Field( # Max saturated and unsaturated hemoglobin - name='total_hemoglobin_conc_max', - type=BASE_TYPES[0x84], # uint16 - def_num=56, - scale=100, - units='g/dL', - ), - 57: Field( # Percentage of hemoglobin saturated with oxygen - name='saturated_hemoglobin_percent', - type=BASE_TYPES[0x84], # uint16 - def_num=57, - scale=10, - units='%', - ), - 58: Field( # Min percentage of hemoglobin saturated with oxygen - name='saturated_hemoglobin_percent_min', - type=BASE_TYPES[0x84], # uint16 - def_num=58, - scale=10, - units='%', - ), - 59: Field( # Max percentage of hemoglobin saturated with oxygen - name='saturated_hemoglobin_percent_max', - type=BASE_TYPES[0x84], # uint16 - def_num=59, - scale=10, - units='%', - ), - 62: Field( - name='device_index', - type=FIELD_TYPES['device_index'], - def_num=62, - ), - 67: Field( # Left platform center offset - name='left_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=67, - units='mm', - ), - 68: Field( # Right platform center offset - name='right_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=68, - units='mm', - ), - 69: Field( # Left power phase angles. Data value indexes defined by power_phase_type. - name='left_power_phase', - type=BASE_TYPES[0x02], # uint8 - def_num=69, - scale=0.7111111, - units='degrees', - ), - 70: Field( # Left power phase peak angles. Data value indexes defined by power_phase_type. - name='left_power_phase_peak', - type=BASE_TYPES[0x02], # uint8 - def_num=70, - scale=0.7111111, - units='degrees', - ), - 71: Field( # Right power phase angles. Data value indexes defined by power_phase_type. - name='right_power_phase', - type=BASE_TYPES[0x02], # uint8 - def_num=71, - scale=0.7111111, - units='degrees', - ), - 72: Field( # Right power phase peak angles. Data value indexes defined by power_phase_type. - name='right_power_phase_peak', - type=BASE_TYPES[0x02], # uint8 - def_num=72, - scale=0.7111111, - units='degrees', - ), - 73: Field( - name='enhanced_speed', - type=BASE_TYPES[0x86], # uint32 - def_num=73, - scale=1000, - units='m/s', - ), - 78: Field( - name='enhanced_altitude', - type=BASE_TYPES[0x86], # uint32 - def_num=78, - scale=5, - offset=500, - units='m', - ), - 81: Field( # lev battery state of charge - name='battery_soc', - type=BASE_TYPES[0x02], # uint8 - def_num=81, - scale=2, - units='percent', - ), - 82: Field( # lev motor power - name='motor_power', - type=BASE_TYPES[0x84], # uint16 - def_num=82, - units='watts', - ), - 83: Field( - name='vertical_ratio', - type=BASE_TYPES[0x84], # uint16 - def_num=83, - scale=100, - units='percent', - ), - 84: Field( - name='stance_time_balance', - type=BASE_TYPES[0x84], # uint16 - def_num=84, - scale=100, - units='percent', - ), - 85: Field( - name='step_length', - type=BASE_TYPES[0x84], # uint16 - def_num=85, - scale=10, - units='mm', - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 21: MessageType( - name='event', - mesg_num=21, - fields={ - 0: Field( - name='event', - type=FIELD_TYPES['event'], - def_num=0, - ), - 1: Field( - name='event_type', - type=FIELD_TYPES['event_type'], - def_num=1, - ), - 2: Field( - name='data16', - type=BASE_TYPES[0x84], # uint16 - def_num=2, - components=( - ComponentField( - name='data', - def_num=3, - accumulate=False, - bits=16, - bit_offset=0, - ), - ), - ), - 3: Field( - name='data', - type=BASE_TYPES[0x86], # uint32 - def_num=3, - subfields=( - SubField( - name='battery_level', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - scale=1000, - units='V', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='battery', - raw_value=11, - ), - ), + units=u'V', + ref_fields=( + ReferenceField( + name='event', + def_num=0, + value='battery', + raw_value=11, + ), + ), ), SubField( name='cad_high_alert', def_num=3, type=BASE_TYPES[0x84], # uint16 - units='rpm', + units=u'rpm', ref_fields=( ReferenceField( name='event', @@ -5211,7 +4707,7 @@ name='cad_low_alert', def_num=3, type=BASE_TYPES[0x84], # uint16 - units='rpm', + units=u'rpm', ref_fields=( ReferenceField( name='event', @@ -5225,7 +4721,7 @@ name='calorie_duration_alert', def_num=3, type=BASE_TYPES[0x86], # uint32 - units='calories', + units=u'calories', ref_fields=( ReferenceField( name='event', @@ -5266,7 +4762,7 @@ def_num=3, type=BASE_TYPES[0x86], # uint32 scale=100, - units='m', + units=u'm', ref_fields=( ReferenceField( name='event', @@ -5329,1735 +4825,1665 @@ bits=8, bit_offset=16, ), - ComponentField( - name='front_gear', - def_num=10, - accumulate=False, - bits=8, - bit_offset=24, - ), - ), - ), - SubField( - name='hr_high_alert', - def_num=3, - type=BASE_TYPES[0x02], # uint8 - units='bpm', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='hr_high_alert', - raw_value=13, - ), - ), - ), - SubField( - name='hr_low_alert', - def_num=3, - type=BASE_TYPES[0x02], # uint8 - units='bpm', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='hr_low_alert', - raw_value=14, - ), - ), - ), - SubField( - name='power_high_alert', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - units='watts', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='power_high_alert', - raw_value=19, - ), - ), - ), - SubField( - name='power_low_alert', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - units='watts', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='power_low_alert', - raw_value=20, - ), - ), - ), - SubField( # Indicates the rider position value. - name='rider_position', - def_num=3, - type=FIELD_TYPES['rider_position_type'], - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='rider_position_change', - raw_value=44, - ), - ), - ), - SubField( - name='speed_high_alert', - def_num=3, - type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='m/s', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='speed_high_alert', - raw_value=15, - ), - ), - ), - SubField( - name='speed_low_alert', - def_num=3, - type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='m/s', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='speed_low_alert', - raw_value=16, - ), - ), - ), - SubField( - name='sport_point', - def_num=3, - type=BASE_TYPES[0x86], # uint32 - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='sport_point', - raw_value=33, - ), - ), - components=( - ComponentField( - name='score', - def_num=7, - accumulate=False, - bits=16, - bit_offset=0, - ), - ComponentField( - name='opponent_score', - def_num=8, - accumulate=False, - bits=16, - bit_offset=16, - ), + ComponentField( + name='front_gear', + def_num=10, + accumulate=False, + bits=8, + bit_offset=24, + ), ), ), SubField( - name='time_duration_alert', + name='hr_high_alert', def_num=3, - type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='s', + type=BASE_TYPES[0x02], # uint8 + units=u'bpm', ref_fields=( ReferenceField( name='event', def_num=0, - value='time_duration_alert', - raw_value=23, + value='hr_high_alert', + raw_value=13, ), ), ), SubField( - name='timer_trigger', + name='hr_low_alert', def_num=3, - type=FIELD_TYPES['timer_trigger'], + type=BASE_TYPES[0x02], # uint8 + units=u'bpm', ref_fields=( ReferenceField( name='event', def_num=0, - value='timer', - raw_value=0, + value='hr_low_alert', + raw_value=14, ), ), ), SubField( - name='virtual_partner_speed', + name='power_high_alert', def_num=3, type=BASE_TYPES[0x84], # uint16 - scale=1000, - units='m/s', - ref_fields=( - ReferenceField( - name='event', - def_num=0, - value='virtual_partner_pace', - raw_value=12, - ), - ), - ), - ), - ), - 4: Field( - name='event_group', - type=BASE_TYPES[0x02], # uint8 - def_num=4, - ), - 7: Field( # Do not populate directly. Autogenerated by decoder for sport_point subfield components - name='score', - type=BASE_TYPES[0x84], # uint16 - def_num=7, - ), - 8: Field( # Do not populate directly. Autogenerated by decoder for sport_point subfield components - name='opponent_score', - type=BASE_TYPES[0x84], # uint16 - def_num=8, - ), - 9: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Front gear number. 1 is innermost. - name='front_gear_num', - type=BASE_TYPES[0x0A], # uint8z - def_num=9, - ), - 10: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of front teeth. - name='front_gear', - type=BASE_TYPES[0x0A], # uint8z - def_num=10, - ), - 11: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Rear gear number. 1 is innermost. - name='rear_gear_num', - type=BASE_TYPES[0x0A], # uint8z - def_num=11, - ), - 12: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of rear teeth. - name='rear_gear', - type=BASE_TYPES[0x0A], # uint8z - def_num=12, - ), - 13: Field( - name='device_index', - type=FIELD_TYPES['device_index'], - def_num=13, - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 23: MessageType( - name='device_info', - mesg_num=23, - fields={ - 0: Field( - name='device_index', - type=FIELD_TYPES['device_index'], - def_num=0, - ), - 1: Field( - name='device_type', - type=FIELD_TYPES['antplus_device_type'], # uint8 - def_num=1, - subfields=( - SubField( - name='ant_device_type', - def_num=1, - type=BASE_TYPES[0x02], # uint8 - ref_fields=( - ReferenceField( - name='source_type', - def_num=25, - value='ant', - raw_value=0, - ), - ), - ), - SubField( - name='antplus_device_type', - def_num=1, - type=FIELD_TYPES['antplus_device_type'], - ref_fields=( - ReferenceField( - name='source_type', - def_num=25, - value='antplus', - raw_value=1, - ), - ), - ), - ), - ), - 2: Field( - name='manufacturer', - type=FIELD_TYPES['manufacturer'], - def_num=2, - ), - 3: Field( - name='serial_number', - type=BASE_TYPES[0x8C], # uint32z - def_num=3, - ), - 4: Field( - name='product', - type=BASE_TYPES[0x84], # uint16 - def_num=4, - subfields=( - SubField( - name='garmin_product', - def_num=4, - type=FIELD_TYPES['garmin_product'], - ref_fields=( - ReferenceField( - name='manufacturer', - def_num=2, - value='garmin', - raw_value=1, - ), - ReferenceField( - name='manufacturer', - def_num=2, - value='dynastream', - raw_value=15, - ), - ReferenceField( - name='manufacturer', - def_num=2, - value='dynastream_oem', - raw_value=13, - ), - ), - ), - ), - ), - 5: Field( - name='software_version', - type=BASE_TYPES[0x84], # uint16 - def_num=5, - scale=100, - ), - 6: Field( - name='hardware_version', - type=BASE_TYPES[0x02], # uint8 - def_num=6, - ), - 7: Field( # Reset by new battery or charge. - name='cum_operating_time', - type=BASE_TYPES[0x86], # uint32 - def_num=7, - units='s', - ), - 10: Field( - name='battery_voltage', - type=BASE_TYPES[0x84], # uint16 - def_num=10, - scale=256, - units='V', - ), - 11: Field( - name='battery_status', - type=FIELD_TYPES['battery_status'], - def_num=11, - ), - 18: Field( # Indicates the location of the sensor - name='sensor_position', - type=FIELD_TYPES['body_location'], - def_num=18, - ), - 19: Field( # Used to describe the sensor or location - name='descriptor', - type=BASE_TYPES[0x07], # string - def_num=19, - ), - 20: Field( - name='ant_transmission_type', - type=BASE_TYPES[0x0A], # uint8z - def_num=20, - ), - 21: Field( - name='ant_device_number', - type=BASE_TYPES[0x8B], # uint16z - def_num=21, - ), - 22: Field( - name='ant_network', - type=FIELD_TYPES['ant_network'], - def_num=22, - ), - 25: Field( - name='source_type', - type=FIELD_TYPES['source_type'], - def_num=25, - ), - 27: Field( # Optional free form string to indicate the devices name or model - name='product_name', - type=BASE_TYPES[0x07], # string - def_num=27, - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 27: MessageType( - name='workout_step', - mesg_num=27, - fields={ - 0: Field( - name='wkt_step_name', - type=BASE_TYPES[0x07], # string - def_num=0, - ), - 1: Field( - name='duration_type', - type=FIELD_TYPES['wkt_step_duration'], - def_num=1, - ), - 2: Field( - name='duration_value', - type=BASE_TYPES[0x86], # uint32 - def_num=2, - subfields=( - SubField( - name='duration_calories', - def_num=2, - type=BASE_TYPES[0x86], # uint32 - units='calories', + units=u'watts', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='calories', - raw_value=4, + name='event', + def_num=0, + value='power_high_alert', + raw_value=19, ), ), ), SubField( - name='duration_distance', - def_num=2, - type=BASE_TYPES[0x86], # uint32 - scale=100, - units='m', + name='power_low_alert', + def_num=3, + type=BASE_TYPES[0x84], # uint16 + units=u'watts', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='distance', - raw_value=1, + name='event', + def_num=0, + value='power_low_alert', + raw_value=20, ), ), ), - SubField( - name='duration_hr', - def_num=2, - type=FIELD_TYPES['workout_hr'], - units='% or bpm', + SubField( # Indicates the rider position value. + name='rider_position', + def_num=3, + type=FIELD_TYPES['rider_position_type'], ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='hr_less_than', - raw_value=2, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='hr_greater_than', - raw_value=3, + name='event', + def_num=0, + value='rider_position_change', + raw_value=44, ), ), ), SubField( - name='duration_power', - def_num=2, - type=FIELD_TYPES['workout_power'], - units='% or watts', + name='speed_high_alert', + def_num=3, + type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u'm/s', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='power_less_than', - raw_value=14, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='power_greater_than', + name='event', + def_num=0, + value='speed_high_alert', raw_value=15, ), ), ), - SubField( # message_index of step to loop back to. Steps are assumed to be in the order by message_index. custom_name and intensity members are undefined for this duration type. - name='duration_step', - def_num=2, + SubField( + name='speed_low_alert', + def_num=3, type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u'm/s', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_steps_cmplt', - raw_value=6, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_time', - raw_value=7, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_distance', - raw_value=8, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_calories', - raw_value=9, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_hr_less_than', - raw_value=10, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_hr_greater_than', - raw_value=11, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_power_less_than', - raw_value=12, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_power_greater_than', - raw_value=13, + name='event', + def_num=0, + value='speed_low_alert', + raw_value=16, ), ), ), SubField( - name='duration_time', - def_num=2, + name='sport_point', + def_num=3, type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='s', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='time', - raw_value=0, + name='event', + def_num=0, + value='sport_point', + raw_value=33, ), - ReferenceField( - name='duration_type', - def_num=1, - value='repetition_time', - raw_value=28, + ), + components=( + ComponentField( + name='score', + def_num=7, + accumulate=False, + bits=16, + bit_offset=0, + ), + ComponentField( + name='opponent_score', + def_num=8, + accumulate=False, + bits=16, + bit_offset=16, ), ), ), - ), - ), - 3: Field( - name='target_type', - type=FIELD_TYPES['wkt_step_target'], - def_num=3, - ), - 4: Field( - name='target_value', - type=BASE_TYPES[0x86], # uint32 - def_num=4, - subfields=( SubField( - name='repeat_calories', - def_num=4, + name='time_duration_alert', + def_num=3, type=BASE_TYPES[0x86], # uint32 - units='calories', + scale=1000, + units=u's', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_calories', - raw_value=9, + name='event', + def_num=0, + value='time_duration_alert', + raw_value=23, ), ), ), SubField( - name='repeat_distance', - def_num=4, - type=BASE_TYPES[0x86], # uint32 - scale=100, - units='m', + name='timer_trigger', + def_num=3, + type=FIELD_TYPES['timer_trigger'], ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_distance', - raw_value=8, + name='event', + def_num=0, + value='timer', + raw_value=0, ), ), ), SubField( - name='repeat_hr', - def_num=4, - type=FIELD_TYPES['workout_hr'], - units='% or bpm', + name='virtual_partner_speed', + def_num=3, + type=BASE_TYPES[0x84], # uint16 + scale=1000, + units=u'm/s', ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_hr_less_than', - raw_value=10, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_hr_greater_than', - raw_value=11, + name='event', + def_num=0, + value='virtual_partner_pace', + raw_value=12, ), ), ), + ), + ), + 4: Field( + name='event_group', + type=BASE_TYPES[0x02], # uint8 + def_num=4, + ), + 7: Field( # Do not populate directly. Autogenerated by decoder for sport_point subfield components + name='score', + type=BASE_TYPES[0x84], # uint16 + def_num=7, + ), + 8: Field( # Do not populate directly. Autogenerated by decoder for sport_point subfield components + name='opponent_score', + type=BASE_TYPES[0x84], # uint16 + def_num=8, + ), + 9: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Front gear number. 1 is innermost. + name='front_gear_num', + type=BASE_TYPES[0x0A], # uint8z + def_num=9, + ), + 10: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of front teeth. + name='front_gear', + type=BASE_TYPES[0x0A], # uint8z + def_num=10, + ), + 11: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Rear gear number. 1 is innermost. + name='rear_gear_num', + type=BASE_TYPES[0x0A], # uint8z + def_num=11, + ), + 12: Field( # Do not populate directly. Autogenerated by decoder for gear_change subfield components. Number of rear teeth. + name='rear_gear', + type=BASE_TYPES[0x0A], # uint8z + def_num=12, + ), + 13: Field( + name='device_index', + type=FIELD_TYPES['device_index'], + def_num=13, + ), + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 23: MessageType( + name='device_info', + mesg_num=23, + fields={ + 0: Field( + name='device_index', + type=FIELD_TYPES['device_index'], + def_num=0, + ), + 1: Field( + name='device_type', + type=BASE_TYPES[0x02], # uint8 + def_num=1, + subfields=( SubField( - name='repeat_power', - def_num=4, - type=FIELD_TYPES['workout_power'], - units='% or watts', - ref_fields=( - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_power_less_than', - raw_value=12, - ), - ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_power_greater_than', - raw_value=13, - ), - ), - ), - SubField( # # of repetitions - name='repeat_steps', - def_num=4, - type=BASE_TYPES[0x86], # uint32 + name='ant_device_type', + def_num=1, + type=BASE_TYPES[0x02], # uint8 ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_steps_cmplt', - raw_value=6, + name='source_type', + def_num=25, + value='ant', + raw_value=0, ), ), ), SubField( - name='repeat_time', - def_num=4, - type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='s', + name='antplus_device_type', + def_num=1, + type=FIELD_TYPES['antplus_device_type'], ref_fields=( ReferenceField( - name='duration_type', - def_num=1, - value='repeat_until_time', - raw_value=7, + name='source_type', + def_num=25, + value='antplus', + raw_value=1, ), ), ), - SubField( # Zone (1-?); Custom = 0; - name='target_cadence_zone', + ), + ), + 2: Field( + name='manufacturer', + type=FIELD_TYPES['manufacturer'], + def_num=2, + ), + 3: Field( + name='serial_number', + type=BASE_TYPES[0x8C], # uint32z + def_num=3, + ), + 4: Field( + name='product', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + subfields=( + SubField( + name='garmin_product', def_num=4, - type=BASE_TYPES[0x86], # uint32 + type=FIELD_TYPES['garmin_product'], ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='cadence', - raw_value=3, + name='manufacturer', + def_num=2, + value='garmin', + raw_value=1, ), - ), - ), - SubField( # hr zone (1-5);Custom =0; - name='target_hr_zone', - def_num=4, - type=BASE_TYPES[0x86], # uint32 - ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='heart_rate', - raw_value=1, + name='manufacturer', + def_num=2, + value='dynastream', + raw_value=15, ), - ), - ), - SubField( # Power Zone ( 1-7); Custom = 0; - name='target_power_zone', - def_num=4, - type=BASE_TYPES[0x86], # uint32 - ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='power', - raw_value=4, + name='manufacturer', + def_num=2, + value='dynastream_oem', + raw_value=13, ), ), ), - SubField( # speed zone (1-10);Custom =0; - name='target_speed_zone', - def_num=4, - type=BASE_TYPES[0x86], # uint32 + ), + ), + 5: Field( + name='software_version', + type=BASE_TYPES[0x84], # uint16 + def_num=5, + scale=100, + ), + 6: Field( + name='hardware_version', + type=BASE_TYPES[0x02], # uint8 + def_num=6, + ), + 7: Field( # Reset by new battery or charge. + name='cum_operating_time', + type=BASE_TYPES[0x86], # uint32 + def_num=7, + units=u's', + ), + 10: Field( + name='battery_voltage', + type=BASE_TYPES[0x84], # uint16 + def_num=10, + scale=256, + units=u'V', + ), + 11: Field( + name='battery_status', + type=FIELD_TYPES['battery_status'], + def_num=11, + ), + 18: Field( # Indicates the location of the sensor + name='sensor_position', + type=FIELD_TYPES['body_location'], + def_num=18, + ), + 19: Field( # Used to describe the sensor or location + name='descriptor', + type=BASE_TYPES[0x07], # string + def_num=19, + ), + 20: Field( + name='ant_transmission_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=20, + ), + 21: Field( + name='ant_device_number', + type=BASE_TYPES[0x8B], # uint16z + def_num=21, + ), + 22: Field( + name='ant_network', + type=FIELD_TYPES['ant_network'], + def_num=22, + ), + 25: Field( + name='source_type', + type=FIELD_TYPES['source_type'], + def_num=25, + ), + 27: Field( # Optional free form string to indicate the devices name or model + name='product_name', + type=BASE_TYPES[0x07], # string + def_num=27, + ), + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 34: MessageType( + name='activity', + mesg_num=34, + fields={ + 0: Field( # Exclude pauses + name='total_timer_time', + type=BASE_TYPES[0x86], # uint32 + def_num=0, + scale=1000, + units=u's', + ), + 1: Field( + name='num_sessions', + type=BASE_TYPES[0x84], # uint16 + def_num=1, + ), + 2: Field( + name='type', + type=FIELD_TYPES['activity'], + def_num=2, + ), + 3: Field( + name='event', + type=FIELD_TYPES['event'], + def_num=3, + ), + 4: Field( + name='event_type', + type=FIELD_TYPES['event_type'], + def_num=4, + ), + 5: Field( # timestamp epoch expressed in local time, used to convert activity timestamps to local time + name='local_timestamp', + type=FIELD_TYPES['local_date_time'], + def_num=5, + ), + 6: Field( + name='event_group', + type=BASE_TYPES[0x02], # uint8 + def_num=6, + ), + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 72: MessageType( # Corresponds to file_id of workout or course. + name='training_file', + mesg_num=72, + fields={ + 0: Field( + name='type', + type=FIELD_TYPES['file'], + def_num=0, + ), + 1: Field( + name='manufacturer', + type=FIELD_TYPES['manufacturer'], + def_num=1, + ), + 2: Field( + name='product', + type=BASE_TYPES[0x84], # uint16 + def_num=2, + subfields=( + SubField( + name='garmin_product', + def_num=2, + type=FIELD_TYPES['garmin_product'], ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='speed', - raw_value=0, + name='manufacturer', + def_num=1, + value='garmin', + raw_value=1, ), - ), - ), - SubField( - name='target_stroke_type', - def_num=4, - type=FIELD_TYPES['swim_stroke'], - ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='swim_stroke', - raw_value=11, + name='manufacturer', + def_num=1, + value='dynastream', + raw_value=15, + ), + ReferenceField( + name='manufacturer', + def_num=1, + value='dynastream_oem', + raw_value=13, ), ), ), ), ), - 5: Field( - name='custom_target_value_low', + 3: Field( + name='serial_number', + type=BASE_TYPES[0x8C], # uint32z + def_num=3, + ), + 4: Field( + name='time_created', + type=FIELD_TYPES['date_time'], + def_num=4, + ), + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 78: MessageType( # Heart rate variability + name='hrv', + mesg_num=78, + fields={ + 0: Field( # Time between beats + name='time', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + scale=1000, + units=u's', + ), + }, + ), + 101: MessageType( + name='length', + mesg_num=101, + fields={ + 0: Field( + name='event', + type=FIELD_TYPES['event'], + def_num=0, + ), + 1: Field( + name='event_type', + type=FIELD_TYPES['event_type'], + def_num=1, + ), + 2: Field( + name='start_time', + type=FIELD_TYPES['date_time'], + def_num=2, + ), + 3: Field( + name='total_elapsed_time', + type=BASE_TYPES[0x86], # uint32 + def_num=3, + scale=1000, + units=u's', + ), + 4: Field( + name='total_timer_time', + type=BASE_TYPES[0x86], # uint32 + def_num=4, + scale=1000, + units=u's', + ), + 5: Field( + name='total_strokes', + type=BASE_TYPES[0x84], # uint16 + def_num=5, + units=u'strokes', + ), + 6: Field( + name='avg_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=6, + scale=1000, + units=u'm/s', + ), + 7: Field( + name='swim_stroke', + type=FIELD_TYPES['swim_stroke'], + def_num=7, + units=u'swim_stroke', + ), + 9: Field( + name='avg_swimming_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=9, + units=u'strokes/min', + ), + 10: Field( + name='event_group', + type=BASE_TYPES[0x02], # uint8 + def_num=10, + ), + 11: Field( + name='total_calories', + type=BASE_TYPES[0x84], # uint16 + def_num=11, + units=u'kcal', + ), + 12: Field( + name='length_type', + type=FIELD_TYPES['length_type'], + def_num=12, + ), + 18: Field( + name='player_score', + type=BASE_TYPES[0x84], # uint16 + def_num=18, + ), + 19: Field( + name='opponent_score', + type=BASE_TYPES[0x84], # uint16 + def_num=19, + ), + 20: Field( # stroke_type enum used as the index + name='stroke_count', + type=BASE_TYPES[0x84], # uint16 + def_num=20, + units=u'counts', + ), + 21: Field( # zone number used as the index + name='zone_count', + type=BASE_TYPES[0x84], # uint16 + def_num=21, + units=u'counts', + ), + 253: FIELD_TYPE_TIMESTAMP, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, + ), + }, + ), + 128: MessageType( + name='weather_conditions', + mesg_num=128, + fields={ + 0: Field( # Current or forecast + name='weather_report', + type=FIELD_TYPES['weather_report'], + def_num=0, + ), + 1: Field( + name='temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=1, + units=u'C', + ), + 2: Field( # Corresponds to GSC Response weatherIcon field + name='condition', + type=FIELD_TYPES['weather_status'], + def_num=2, + ), + 3: Field( + name='wind_direction', + type=BASE_TYPES[0x84], # uint16 + def_num=3, + units=u'degrees', + ), + 4: Field( + name='wind_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + scale=1000, + units=u'm/s', + ), + 5: Field( # range 0-100 + name='precipitation_probability', + type=BASE_TYPES[0x02], # uint8 + def_num=5, + ), + 6: Field( # Heat Index if GCS heatIdx above or equal to 90F or wind chill if GCS windChill below or equal to 32F + name='temperature_feels_like', + type=BASE_TYPES[0x01], # sint8 + def_num=6, + units=u'C', + ), + 7: Field( + name='relative_humidity', + type=BASE_TYPES[0x02], # uint8 + def_num=7, + ), + 8: Field( # string corresponding to GCS response location string + name='location', + type=BASE_TYPES[0x07], # string + def_num=8, + ), + 9: Field( + name='observed_at_time', + type=FIELD_TYPES['date_time'], + def_num=9, + ), + 10: Field( + name='observed_location_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=10, + units=u'semicircles', + ), + 11: Field( + name='observed_location_long', + type=BASE_TYPES[0x85], # sint32 + def_num=11, + units=u'semicircles', + ), + 12: Field( + name='day_of_week', + type=FIELD_TYPES['day_of_week'], + def_num=12, + ), + 13: Field( + name='high_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=13, + units=u'C', + ), + 14: Field( + name='low_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=14, + units=u'C', + ), + 253: FIELD_TYPE_TIMESTAMP, # time of update for current conditions, else forecast time + }, + ), + 129: MessageType( + name='weather_alert', + mesg_num=129, + fields={ + 0: Field( # Unique identifier from GCS report ID string, length is 12 + name='report_id', + type=BASE_TYPES[0x07], # string + def_num=0, + ), + 1: Field( # Time alert was issued + name='issue_time', + type=FIELD_TYPES['date_time'], + def_num=1, + ), + 2: Field( # Time alert expires + name='expire_time', + type=FIELD_TYPES['date_time'], + def_num=2, + ), + 3: Field( # Warning, Watch, Advisory, Statement + name='severity', + type=FIELD_TYPES['weather_severity'], + def_num=3, + ), + 4: Field( # Tornado, Severe Thunderstorm, etc. + name='type', + type=FIELD_TYPES['weather_severe_type'], + def_num=4, + ), + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 160: MessageType( + name='gps_metadata', + mesg_num=160, + fields={ + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( + name='position_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=1, + units=u'semicircles', + ), + 2: Field( + name='position_long', + type=BASE_TYPES[0x85], # sint32 + def_num=2, + units=u'semicircles', + ), + 3: Field( + name='enhanced_altitude', + type=BASE_TYPES[0x86], # uint32 + def_num=3, + scale=5, + offset=500, + units=u'm', + ), + 4: Field( + name='enhanced_speed', type=BASE_TYPES[0x86], # uint32 + def_num=4, + scale=1000, + units=u'm/s', + ), + 5: Field( + name='heading', + type=BASE_TYPES[0x84], # uint16 def_num=5, - subfields=( - SubField( - name='custom_target_cadence_low', - def_num=5, - type=BASE_TYPES[0x86], # uint32 - units='rpm', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='cadence', - raw_value=3, - ), - ), - ), - SubField( - name='custom_target_heart_rate_low', - def_num=5, - type=FIELD_TYPES['workout_hr'], - units='% or bpm', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='heart_rate', - raw_value=1, - ), - ), - ), - SubField( - name='custom_target_power_low', - def_num=5, - type=FIELD_TYPES['workout_power'], - units='% or watts', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='power', - raw_value=4, - ), - ), - ), - SubField( - name='custom_target_speed_low', - def_num=5, - type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='m/s', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='speed', - raw_value=0, - ), - ), - ), - ), + scale=100, + units=u'degrees', + ), + 6: Field( # Used to correlate UTC to system time if the timestamp of the message is in system time. This UTC time is derived from the GPS data. + name='utc_timestamp', + type=FIELD_TYPES['date_time'], + def_num=6, + units=u's', + ), + 7: Field( # velocity[0] is lon velocity. Velocity[1] is lat velocity. Velocity[2] is altitude velocity. + name='velocity', + type=BASE_TYPES[0x83], # sint16 + def_num=7, + scale=100, + units=u'm/s', + ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp. + }, + ), + 161: MessageType( + name='camera_event', + mesg_num=161, + fields={ + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( + name='camera_event_type', + type=FIELD_TYPES['camera_event_type'], + def_num=1, + ), + 2: Field( + name='camera_file_uuid', + type=BASE_TYPES[0x07], # string + def_num=2, + ), + 3: Field( + name='camera_orientation', + type=FIELD_TYPES['camera_orientation_type'], + def_num=3, + ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp. + }, + ), + 164: MessageType( + name='gyroscope_data', + mesg_num=164, + fields={ + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # Each time in the array describes the time at which the gyro sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in gyro_x and gyro_y and gyro_z + name='sample_time_offset', + type=BASE_TYPES[0x84], # uint16 + def_num=1, + units=u'ms', + ), + 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='gyro_x', + type=BASE_TYPES[0x84], # uint16 + def_num=2, + units=u'counts', + ), + 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='gyro_y', + type=BASE_TYPES[0x84], # uint16 + def_num=3, + units=u'counts', + ), + 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='gyro_z', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + units=u'counts', + ), + 5: Field( # Calibrated gyro reading + name='calibrated_gyro_x', + type=BASE_TYPES[0x88], # float32 + def_num=5, + units=u'deg/s', + ), + 6: Field( # Calibrated gyro reading + name='calibrated_gyro_y', + type=BASE_TYPES[0x88], # float32 + def_num=6, + units=u'deg/s', + ), + 7: Field( # Calibrated gyro reading + name='calibrated_gyro_z', + type=BASE_TYPES[0x88], # float32 + def_num=7, + units=u'deg/s', + ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp + }, + ), + 165: MessageType( + name='accelerometer_data', + mesg_num=165, + fields={ + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # Each time in the array describes the time at which the accelerometer sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in accel_x and accel_y and accel_z + name='sample_time_offset', + type=BASE_TYPES[0x84], # uint16 + def_num=1, + units=u'ms', + ), + 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='accel_x', + type=BASE_TYPES[0x84], # uint16 + def_num=2, + units=u'counts', + ), + 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='accel_y', + type=BASE_TYPES[0x84], # uint16 + def_num=3, + units=u'counts', + ), + 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='accel_z', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + units=u'counts', + ), + 5: Field( # Calibrated accel reading + name='calibrated_accel_x', + type=BASE_TYPES[0x88], # float32 + def_num=5, + units=u'g', + ), + 6: Field( # Calibrated accel reading + name='calibrated_accel_y', + type=BASE_TYPES[0x88], # float32 + def_num=6, + units=u'g', + ), + 7: Field( # Calibrated accel reading + name='calibrated_accel_z', + type=BASE_TYPES[0x88], # float32 + def_num=7, + units=u'g', + ), + 8: Field( # Calibrated accel reading + name='compressed_calibrated_accel_x', + type=BASE_TYPES[0x83], # sint16 + def_num=8, + units=u'mG', + ), + 9: Field( # Calibrated accel reading + name='compressed_calibrated_accel_y', + type=BASE_TYPES[0x83], # sint16 + def_num=9, + units=u'mG', + ), + 10: Field( # Calibrated accel reading + name='compressed_calibrated_accel_z', + type=BASE_TYPES[0x83], # sint16 + def_num=10, + units=u'mG', + ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp + }, + ), + 167: MessageType( + name='three_d_sensor_calibration', + mesg_num=167, + fields={ + 0: Field( # Indicates which sensor the calibration is for + name='sensor_type', + type=FIELD_TYPES['sensor_type'], + def_num=0, ), - 6: Field( - name='custom_target_value_high', + 1: Field( # Calibration factor used to convert from raw ADC value to degrees, g, etc. + name='calibration_factor', type=BASE_TYPES[0x86], # uint32 - def_num=6, + def_num=1, subfields=( - SubField( - name='custom_target_cadence_high', - def_num=6, + SubField( # Accelerometer calibration factor + name='accel_cal_factor', + def_num=1, type=BASE_TYPES[0x86], # uint32 - units='rpm', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='cadence', - raw_value=3, - ), - ), - ), - SubField( - name='custom_target_heart_rate_high', - def_num=6, - type=FIELD_TYPES['workout_hr'], - units='% or bpm', - ref_fields=( - ReferenceField( - name='target_type', - def_num=3, - value='heart_rate', - raw_value=1, - ), - ), - ), - SubField( - name='custom_target_power_high', - def_num=6, - type=FIELD_TYPES['workout_power'], - units='% or watts', + units=u'g', ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='power', - raw_value=4, + name='sensor_type', + def_num=0, + value='accelerometer', + raw_value=0, ), ), ), - SubField( - name='custom_target_speed_high', - def_num=6, + SubField( # Gyro calibration factor + name='gyro_cal_factor', + def_num=1, type=BASE_TYPES[0x86], # uint32 - scale=1000, - units='m/s', + units=u'deg/s', ref_fields=( ReferenceField( - name='target_type', - def_num=3, - value='speed', - raw_value=0, + name='sensor_type', + def_num=0, + value='gyroscope', + raw_value=1, ), ), ), ), ), - 7: Field( - name='intensity', - type=FIELD_TYPES['intensity'], - def_num=7, + 2: Field( # Calibration factor divisor + name='calibration_divisor', + type=BASE_TYPES[0x86], # uint32 + def_num=2, + units=u'counts', ), - 8: Field( - name='notes', - type=BASE_TYPES[0x07], # string - def_num=8, + 3: Field( # Level shift value used to shift the ADC value back into range + name='level_shift', + type=BASE_TYPES[0x86], # uint32 + def_num=3, ), - 9: Field( - name='equipment', - type=FIELD_TYPES['workout_equipment'], - def_num=9, + 4: Field( # Internal calibration factors, one for each: xy, yx, zx + name='offset_cal', + type=BASE_TYPES[0x85], # sint32 + def_num=4, ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 5: Field( # 3 x 3 rotation matrix (row major) + name='orientation_matrix', + type=BASE_TYPES[0x85], # sint32 + def_num=5, + scale=65535, ), + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp }, ), - 32: MessageType( - name='course_point', - mesg_num=32, + 169: MessageType( + name='video_frame', + mesg_num=169, fields={ - 1: Field( - name='timestamp', - type=FIELD_TYPES['date_time'], + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # Number of the frame that the timestamp and timestamp_ms correlate to + name='frame_number', + type=BASE_TYPES[0x86], # uint32 def_num=1, ), - 2: Field( - name='position_lat', - type=BASE_TYPES[0x85], # sint32 + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp + }, + ), + 174: MessageType( + name='obdii_data', + mesg_num=174, + fields={ + 0: Field( # Fractional part of timestamp, added to timestamp + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # Offset of PID reading [i] from start_timestamp+start_timestamp_ms. Readings may span accross seconds. + name='time_offset', + type=BASE_TYPES[0x84], # uint16 + def_num=1, + units=u'ms', + ), + 2: Field( # Parameter ID + name='pid', + type=BASE_TYPES[0x0D], # byte def_num=2, - units='semicircles', ), - 3: Field( - name='position_long', - type=BASE_TYPES[0x85], # sint32 + 3: Field( # Raw parameter data + name='raw_data', + type=BASE_TYPES[0x0D], # byte def_num=3, - units='semicircles', ), - 4: Field( - name='distance', + 4: Field( # Optional, data size of PID[i]. If not specified refer to SAE J1979. + name='pid_data_size', + type=BASE_TYPES[0x02], # uint8 + def_num=4, + ), + 5: Field( # System time associated with sample expressed in ms, can be used instead of time_offset. There will be a system_time value for each raw_data element. For multibyte pids the system_time is repeated. + name='system_time', + type=BASE_TYPES[0x86], # uint32 + def_num=5, + ), + 6: Field( # Timestamp of first sample recorded in the message. Used with time_offset to generate time of each sample + name='start_timestamp', + type=FIELD_TYPES['date_time'], + def_num=6, + ), + 7: Field( # Fractional part of start_timestamp + name='start_timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=7, + units=u'ms', + ), + 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output + }, + ), + 177: MessageType( + name='nmea_sentence', + mesg_num=177, + fields={ + 0: Field( # Fractional part of timestamp, added to timestamp + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # NMEA sentence + name='sentence', + type=BASE_TYPES[0x07], # string + def_num=1, + ), + 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output + }, + ), + 178: MessageType( + name='aviation_attitude', + mesg_num=178, + fields={ + 0: Field( # Fractional part of timestamp, added to timestamp + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + units=u'ms', + ), + 1: Field( # System time associated with sample expressed in ms. + name='system_time', type=BASE_TYPES[0x86], # uint32 + def_num=1, + units=u'ms', + ), + 2: Field( # Range -PI/2 to +PI/2 + name='pitch', + type=BASE_TYPES[0x83], # sint16 + def_num=2, + scale=10430.38, + units=u'radians', + ), + 3: Field( # Range -PI to +PI + name='roll', + type=BASE_TYPES[0x83], # sint16 + def_num=3, + scale=10430.38, + units=u'radians', + ), + 4: Field( # Range -78.4 to +78.4 (-8 Gs to 8 Gs) + name='accel_lateral', + type=BASE_TYPES[0x83], # sint16 def_num=4, scale=100, - units='m', + units=u'm/s^2', ), - 5: Field( - name='type', - type=FIELD_TYPES['course_point'], + 5: Field( # Range -78.4 to +78.4 (-8 Gs to 8 Gs) + name='accel_normal', + type=BASE_TYPES[0x83], # sint16 def_num=5, + scale=100, + units=u'm/s^2', ), - 6: Field( - name='name', - type=BASE_TYPES[0x07], # string + 6: Field( # Range -8.727 to +8.727 (-500 degs/sec to +500 degs/sec) + name='turn_rate', + type=BASE_TYPES[0x83], # sint16 def_num=6, + scale=1024, + units=u'radians/second', ), - 8: Field( - name='favorite', - type=FIELD_TYPES['bool'], + 7: Field( + name='stage', + type=FIELD_TYPES['attitude_stage'], + def_num=7, + ), + 8: Field( # The percent complete of the current attitude stage. Set to 0 for attitude stages 0, 1 and 2 and to 100 for attitude stage 3 by AHRS modules that do not support it. Range - 100 + name='attitude_stage_complete', + type=BASE_TYPES[0x02], # uint8 def_num=8, + units=u'%', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 9: Field( # Track Angle/Heading Range 0 - 2pi + name='track', + type=BASE_TYPES[0x84], # uint16 + def_num=9, + scale=10430.38, + units=u'radians', + ), + 10: Field( + name='validity', + type=FIELD_TYPES['attitude_validity'], + def_num=10, ), + 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output }, ), - 37: MessageType( - name='file_capabilities', - mesg_num=37, + 184: MessageType( + name='video', + mesg_num=184, fields={ 0: Field( - name='type', - type=FIELD_TYPES['file'], + name='url', + type=BASE_TYPES[0x07], # string def_num=0, ), 1: Field( - name='flags', - type=FIELD_TYPES['file_flags'], - def_num=1, - ), - 2: Field( - name='directory', + name='hosting_provider', type=BASE_TYPES[0x07], # string - def_num=2, - ), - 3: Field( - name='max_count', - type=BASE_TYPES[0x84], # uint16 - def_num=3, + def_num=1, ), - 4: Field( - name='max_size', + 2: Field( # Playback time of video + name='duration', type=BASE_TYPES[0x86], # uint32 - def_num=4, - units='bytes', - ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + def_num=2, + units=u'ms', ), }, ), - 38: MessageType( - name='mesg_capabilities', - mesg_num=38, + 185: MessageType( + name='video_title', + mesg_num=185, fields={ - 0: Field( - name='file', - type=FIELD_TYPES['file'], + 0: Field( # Total number of title parts + name='message_count', + type=BASE_TYPES[0x84], # uint16 def_num=0, ), 1: Field( - name='mesg_num', - type=FIELD_TYPES['mesg_num'], + name='text', + type=BASE_TYPES[0x07], # string def_num=1, ), - 2: Field( - name='count_type', - type=FIELD_TYPES['mesg_count'], - def_num=2, - ), - 3: Field( - name='count', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - subfields=( - SubField( - name='max_per_file', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - ref_fields=( - ReferenceField( - name='count_type', - def_num=2, - value='max_per_file', - raw_value=1, - ), - ), - ), - SubField( - name='max_per_file_type', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - ref_fields=( - ReferenceField( - name='count_type', - def_num=2, - value='max_per_file_type', - raw_value=2, - ), - ), - ), - SubField( - name='num_per_file', - def_num=3, - type=BASE_TYPES[0x84], # uint16 - ref_fields=( - ReferenceField( - name='count_type', - def_num=2, - value='num_per_file', - raw_value=0, - ), - ), - ), - ), - ), - 254: Field( + 254: Field( # Long titles will be split into multiple parts name='message_index', type=FIELD_TYPES['message_index'], def_num=254, ), }, ), - 39: MessageType( - name='field_capabilities', - mesg_num=39, + 186: MessageType( + name='video_description', + mesg_num=186, fields={ - 0: Field( - name='file', - type=FIELD_TYPES['file'], + 0: Field( # Total number of description parts + name='message_count', + type=BASE_TYPES[0x84], # uint16 def_num=0, ), 1: Field( - name='mesg_num', - type=FIELD_TYPES['mesg_num'], + name='text', + type=BASE_TYPES[0x07], # string def_num=1, ), - 2: Field( - name='field_num', - type=BASE_TYPES[0x02], # uint8 - def_num=2, - ), - 3: Field( - name='count', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - ), - 254: Field( + 254: Field( # Long descriptions will be split into multiple parts name='message_index', type=FIELD_TYPES['message_index'], def_num=254, ), }, ), - 49: MessageType( - name='file_creator', - mesg_num=49, + 187: MessageType( + name='video_clip', + mesg_num=187, fields={ 0: Field( - name='software_version', + name='clip_number', type=BASE_TYPES[0x84], # uint16 def_num=0, ), 1: Field( - name='hardware_version', - type=BASE_TYPES[0x02], # uint8 + name='start_timestamp', + type=FIELD_TYPES['date_time'], def_num=1, ), - }, - ), - 53: MessageType( - name='speed_zone', - mesg_num=53, - fields={ - 0: Field( - name='high_value', + 2: Field( + name='start_timestamp_ms', type=BASE_TYPES[0x84], # uint16 - def_num=0, - scale=1000, - units='m/s', + def_num=2, ), - 1: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=1, + 3: Field( + name='end_timestamp', + type=FIELD_TYPES['date_time'], + def_num=3, ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 4: Field( + name='end_timestamp_ms', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + ), + 6: Field( # Start of clip in video time + name='clip_start', + type=BASE_TYPES[0x86], # uint32 + def_num=6, + units=u'ms', + ), + 7: Field( # End of clip in video time + name='clip_end', + type=BASE_TYPES[0x86], # uint32 + def_num=7, + units=u'ms', ), }, ), - 55: MessageType( - name='monitoring', - mesg_num=55, + 208: MessageType( + name='magnetometer_data', + mesg_num=208, fields={ - 0: Field( # Associates this data to device_info message. Not required for file with single device (sensor). - name='device_index', - type=FIELD_TYPES['device_index'], + 0: Field( # Millisecond part of the timestamp. + name='timestamp_ms', + type=BASE_TYPES[0x84], # uint16 def_num=0, + units=u'ms', ), - 1: Field( # Accumulated total calories. Maintained by MonitoringReader for each activity_type. See SDK documentation - name='calories', + 1: Field( # Each time in the array describes the time at which the compass sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in cmps_x and cmps_y and cmps_z + name='sample_time_offset', type=BASE_TYPES[0x84], # uint16 def_num=1, - units='kcal', + units=u'ms', ), - 2: Field( # Accumulated distance. Maintained by MonitoringReader for each activity_type. See SDK documentation. - name='distance', - type=BASE_TYPES[0x86], # uint32 + 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='mag_x', + type=BASE_TYPES[0x84], # uint16 def_num=2, - scale=100, - units='m', + units=u'counts', ), - 3: Field( # Accumulated cycles. Maintained by MonitoringReader for each activity_type. See SDK documentation. - name='cycles', - type=BASE_TYPES[0x86], # uint32 - def_num=3, - scale=2, - units='cycles', - subfields=( - SubField( - name='steps', - def_num=3, - type=BASE_TYPES[0x86], # uint32 - units='steps', - ref_fields=( - ReferenceField( - name='activity_type', - def_num=5, - value='walking', - raw_value=6, - ), - ReferenceField( - name='activity_type', - def_num=5, - value='running', - raw_value=1, - ), - ), - ), - SubField( - name='strokes', - def_num=3, - type=BASE_TYPES[0x86], # uint32 - scale=2, - units='strokes', - ref_fields=( - ReferenceField( - name='activity_type', - def_num=5, - value='cycling', - raw_value=2, - ), - ReferenceField( - name='activity_type', - def_num=5, - value='swimming', - raw_value=5, - ), - ), - ), - ), + 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='mag_y', + type=BASE_TYPES[0x84], # uint16 + def_num=3, + units=u'counts', ), - 4: Field( - name='active_time', - type=BASE_TYPES[0x86], # uint32 + 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. + name='mag_z', + type=BASE_TYPES[0x84], # uint16 def_num=4, - scale=1000, - units='s', + units=u'counts', ), - 5: Field( - name='activity_type', - type=FIELD_TYPES['activity_type'], + 5: Field( # Calibrated Magnetometer reading + name='calibrated_mag_x', + type=BASE_TYPES[0x88], # float32 def_num=5, + units=u'G', ), - 6: Field( - name='activity_subtype', - type=FIELD_TYPES['activity_subtype'], + 6: Field( # Calibrated Magnetometer reading + name='calibrated_mag_y', + type=BASE_TYPES[0x88], # float32 def_num=6, + units=u'G', ), - 7: Field( - name='activity_level', - type=FIELD_TYPES['activity_level'], + 7: Field( # Calibrated Magnetometer reading + name='calibrated_mag_z', + type=BASE_TYPES[0x88], # float32 def_num=7, + units=u'G', ), - 8: Field( - name='distance_16', + 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp + }, + ), + + + ###################### Blood Pressure File Messages ###################### + 51: MessageType( + name='blood_pressure', + mesg_num=51, + fields={ + 0: Field( + name='systolic_pressure', type=BASE_TYPES[0x84], # uint16 - def_num=8, - units='100*m', + def_num=0, + units=u'mmHg', ), - 9: Field( - name='cycles_16', + 1: Field( + name='diastolic_pressure', type=BASE_TYPES[0x84], # uint16 - def_num=9, - units='2*cycles or steps', + def_num=1, + units=u'mmHg', ), - 10: Field( - name='active_time_16', + 2: Field( + name='mean_arterial_pressure', type=BASE_TYPES[0x84], # uint16 - def_num=10, - units='s', - ), - 11: Field( # Must align to logging interval, for example, time must be 00:00:00 for daily log. - name='local_timestamp', - type=FIELD_TYPES['local_date_time'], - def_num=11, - ), - 12: Field( # Avg temperature during the logging interval ended at timestamp - name='temperature', - type=BASE_TYPES[0x83], # sint16 - def_num=12, - scale=100, - units='C', - ), - 14: Field( # Min temperature during the logging interval ended at timestamp - name='temperature_min', - type=BASE_TYPES[0x83], # sint16 - def_num=14, - scale=100, - units='C', - ), - 15: Field( # Max temperature during the logging interval ended at timestamp - name='temperature_max', - type=BASE_TYPES[0x83], # sint16 - def_num=15, - scale=100, - units='C', + def_num=2, + units=u'mmHg', ), - 16: Field( # Indexed using minute_activity_level enum - name='activity_time', + 3: Field( + name='map_3_sample_mean', type=BASE_TYPES[0x84], # uint16 - def_num=16, - units='minutes', + def_num=3, + units=u'mmHg', ), - 19: Field( - name='active_calories', + 4: Field( + name='map_morning_values', type=BASE_TYPES[0x84], # uint16 - def_num=19, - units='kcal', - ), - 24: Field( # Indicates single type / intensity for duration since last monitoring message. - name='current_activity_type_intensity', - type=BASE_TYPES[0x0D], # byte - def_num=24, - components=( - ComponentField( - name='activity_type', - def_num=5, - accumulate=False, - bits=5, - bit_offset=0, - ), - ComponentField( - name='intensity', - def_num=28, - accumulate=False, - bits=3, - bit_offset=5, - ), - ), - ), - 25: Field( - name='timestamp_min_8', - type=BASE_TYPES[0x02], # uint8 - def_num=25, - units='min', + def_num=4, + units=u'mmHg', ), - 26: Field( - name='timestamp_16', + 5: Field( + name='map_evening_values', type=BASE_TYPES[0x84], # uint16 - def_num=26, - units='s', + def_num=5, + units=u'mmHg', ), - 27: Field( + 6: Field( name='heart_rate', type=BASE_TYPES[0x02], # uint8 - def_num=27, - units='bpm', + def_num=6, + units=u'bpm', ), - 28: Field( - name='intensity', - type=BASE_TYPES[0x02], # uint8 - def_num=28, - scale=10, + 7: Field( + name='heart_rate_type', + type=FIELD_TYPES['hr_type'], + def_num=7, ), - 29: Field( - name='duration_min', - type=BASE_TYPES[0x84], # uint16 - def_num=29, - units='min', + 8: Field( + name='status', + type=FIELD_TYPES['bp_status'], + def_num=8, ), - 30: Field( - name='duration', - type=BASE_TYPES[0x86], # uint32 - def_num=30, - units='s', + 9: Field( # Associates this blood pressure message to a user. This corresponds to the index of the user profile message in the blood pressure file. + name='user_profile_index', + type=FIELD_TYPES['message_index'], + def_num=9, ), - 31: Field( - name='ascent', - type=BASE_TYPES[0x86], # uint32 - def_num=31, - scale=1000, - units='m', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + + + ########################## Course File Messages ########################## + 31: MessageType( + name='course', + mesg_num=31, + fields={ + 4: Field( + name='sport', + type=FIELD_TYPES['sport'], + def_num=4, ), - 32: Field( - name='descent', - type=BASE_TYPES[0x86], # uint32 - def_num=32, - scale=1000, - units='m', + 5: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=5, ), - 33: Field( - name='moderate_activity_minutes', - type=BASE_TYPES[0x84], # uint16 - def_num=33, - units='minutes', + 6: Field( + name='capabilities', + type=FIELD_TYPES['course_capabilities'], + def_num=6, ), - 34: Field( - name='vigorous_activity_minutes', - type=BASE_TYPES[0x84], # uint16 - def_num=34, - units='minutes', + 7: Field( + name='sub_sport', + type=FIELD_TYPES['sub_sport'], + def_num=7, ), - 253: FIELD_TYPE_TIMESTAMP, # Must align to logging interval, for example, time must be 00:00:00 for daily log. }, ), - 72: MessageType( # Corresponds to file_id of workout or course. - name='training_file', - mesg_num=72, + 32: MessageType( + name='course_point', + mesg_num=32, fields={ - 0: Field( - name='type', - type=FIELD_TYPES['file'], - def_num=0, - ), 1: Field( - name='manufacturer', - type=FIELD_TYPES['manufacturer'], + name='timestamp', + type=FIELD_TYPES['date_time'], def_num=1, ), 2: Field( - name='product', - type=BASE_TYPES[0x84], # uint16 + name='position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=2, - subfields=( - SubField( - name='garmin_product', - def_num=2, - type=FIELD_TYPES['garmin_product'], - ref_fields=( - ReferenceField( - name='manufacturer', - def_num=1, - value='garmin', - raw_value=1, - ), - ReferenceField( - name='manufacturer', - def_num=1, - value='dynastream', - raw_value=15, - ), - ReferenceField( - name='manufacturer', - def_num=1, - value='dynastream_oem', - raw_value=13, - ), - ), - ), - ), + units=u'semicircles', ), 3: Field( - name='serial_number', - type=BASE_TYPES[0x8C], # uint32z + name='position_long', + type=BASE_TYPES[0x85], # sint32 def_num=3, + units=u'semicircles', + ), + 4: Field( + name='distance', + type=BASE_TYPES[0x86], # uint32 + def_num=4, + scale=100, + units=u'm', + ), + 5: Field( + name='type', + type=FIELD_TYPES['course_point'], + def_num=5, ), - 4: Field( - name='time_created', - type=FIELD_TYPES['date_time'], - def_num=4, + 6: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=6, ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 78: MessageType( # Heart rate variability - name='hrv', - mesg_num=78, - fields={ - 0: Field( # Time between beats - name='time', - type=BASE_TYPES[0x84], # uint16 - def_num=0, - scale=1000, - units='s', + 8: Field( + name='favorite', + type=FIELD_TYPES['bool'], + def_num=8, + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, ), - 80: MessageType( - name='ant_rx', - mesg_num=80, + + + ########################## Device File Messages ########################## + 1: MessageType( + name='capabilities', + mesg_num=1, fields={ - 0: Field( - name='fractional_timestamp', - type=BASE_TYPES[0x84], # uint16 + 0: Field( # Use language_bits_x types where x is index of array. + name='languages', + type=BASE_TYPES[0x0A], # uint8z def_num=0, - scale=32768, - units='s', ), - 1: Field( - name='mesg_id', - type=BASE_TYPES[0x0D], # byte + 1: Field( # Use sport_bits_x types where x is index of array. + name='sports', + type=FIELD_TYPES['sport_bits_0'], def_num=1, ), - 2: Field( - name='mesg_data', - type=BASE_TYPES[0x0D], # byte - def_num=2, - components=( - ComponentField( - name='channel_number', - def_num=3, - accumulate=False, - bits=8, - bit_offset=0, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=8, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=16, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=24, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=32, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=40, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=48, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=56, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=64, - ), - ), + 21: Field( + name='workouts_supported', + type=FIELD_TYPES['workout_capabilities'], + def_num=21, + ), + 23: Field( + name='connectivity_supported', + type=FIELD_TYPES['connectivity_capabilities'], + def_num=23, ), + }, + ), + 35: MessageType( + name='software', + mesg_num=35, + fields={ 3: Field( - name='channel_number', - type=BASE_TYPES[0x02], # uint8 + name='version', + type=BASE_TYPES[0x84], # uint16 def_num=3, + scale=100, ), - 4: Field( - name='data', - type=BASE_TYPES[0x0D], # byte - def_num=4, + 5: Field( + name='part_number', + type=BASE_TYPES[0x07], # string + def_num=5, + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 253: FIELD_TYPE_TIMESTAMP, }, ), - 81: MessageType( - name='ant_tx', - mesg_num=81, + 37: MessageType( + name='file_capabilities', + mesg_num=37, fields={ 0: Field( - name='fractional_timestamp', - type=BASE_TYPES[0x84], # uint16 + name='type', + type=FIELD_TYPES['file'], def_num=0, - scale=32768, - units='s', ), 1: Field( - name='mesg_id', - type=BASE_TYPES[0x0D], # byte + name='flags', + type=FIELD_TYPES['file_flags'], def_num=1, ), 2: Field( - name='mesg_data', - type=BASE_TYPES[0x0D], # byte + name='directory', + type=BASE_TYPES[0x07], # string def_num=2, - components=( - ComponentField( - name='channel_number', - def_num=3, - accumulate=False, - bits=8, - bit_offset=0, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=8, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=16, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=24, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=32, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=40, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=48, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=56, - ), - ComponentField( - name='data', - def_num=4, - accumulate=False, - bits=8, - bit_offset=64, - ), - ), ), 3: Field( - name='channel_number', - type=BASE_TYPES[0x02], # uint8 + name='max_count', + type=BASE_TYPES[0x84], # uint16 def_num=3, ), 4: Field( - name='data', - type=BASE_TYPES[0x0D], # byte + name='max_size', + type=BASE_TYPES[0x86], # uint32 def_num=4, + units=u'bytes', + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 253: FIELD_TYPE_TIMESTAMP, }, ), - 82: MessageType( - name='ant_channel_id', - mesg_num=82, + 38: MessageType( + name='mesg_capabilities', + mesg_num=38, fields={ 0: Field( - name='channel_number', - type=BASE_TYPES[0x02], # uint8 + name='file', + type=FIELD_TYPES['file'], def_num=0, ), 1: Field( - name='device_type', - type=BASE_TYPES[0x0A], # uint8z + name='mesg_num', + type=FIELD_TYPES['mesg_num'], def_num=1, ), 2: Field( - name='device_number', - type=BASE_TYPES[0x8B], # uint16z + name='count_type', + type=FIELD_TYPES['mesg_count'], def_num=2, ), 3: Field( - name='transmission_type', - type=BASE_TYPES[0x0A], # uint8z + name='count', + type=BASE_TYPES[0x84], # uint16 def_num=3, + subfields=( + SubField( + name='max_per_file', + def_num=3, + type=BASE_TYPES[0x84], # uint16 + ref_fields=( + ReferenceField( + name='count_type', + def_num=2, + value='max_per_file', + raw_value=1, + ), + ), + ), + SubField( + name='max_per_file_type', + def_num=3, + type=BASE_TYPES[0x84], # uint16 + ref_fields=( + ReferenceField( + name='count_type', + def_num=2, + value='max_per_file_type', + raw_value=2, + ), + ), + ), + SubField( + name='num_per_file', + def_num=3, + type=BASE_TYPES[0x84], # uint16 + ref_fields=( + ReferenceField( + name='count_type', + def_num=2, + value='num_per_file', + raw_value=0, + ), + ), + ), + ), ), - 4: Field( - name='device_index', - type=FIELD_TYPES['device_index'], - def_num=4, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, ), - 101: MessageType( - name='length', - mesg_num=101, + 39: MessageType( + name='field_capabilities', + mesg_num=39, fields={ 0: Field( - name='event', - type=FIELD_TYPES['event'], + name='file', + type=FIELD_TYPES['file'], def_num=0, ), 1: Field( - name='event_type', - type=FIELD_TYPES['event_type'], + name='mesg_num', + type=FIELD_TYPES['mesg_num'], def_num=1, ), 2: Field( - name='start_time', - type=FIELD_TYPES['date_time'], + name='field_num', + type=BASE_TYPES[0x02], # uint8 def_num=2, ), 3: Field( - name='total_elapsed_time', - type=BASE_TYPES[0x86], # uint32 - def_num=3, - scale=1000, - units='s', - ), - 4: Field( - name='total_timer_time', - type=BASE_TYPES[0x86], # uint32 - def_num=4, - scale=1000, - units='s', - ), - 5: Field( - name='total_strokes', - type=BASE_TYPES[0x84], # uint16 - def_num=5, - units='strokes', - ), - 6: Field( - name='avg_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=6, - scale=1000, - units='m/s', - ), - 7: Field( - name='swim_stroke', - type=FIELD_TYPES['swim_stroke'], - def_num=7, - units='swim_stroke', - ), - 9: Field( - name='avg_swimming_cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=9, - units='strokes/min', - ), - 10: Field( - name='event_group', - type=BASE_TYPES[0x02], # uint8 - def_num=10, - ), - 11: Field( - name='total_calories', - type=BASE_TYPES[0x84], # uint16 - def_num=11, - units='kcal', - ), - 12: Field( - name='length_type', - type=FIELD_TYPES['length_type'], - def_num=12, - ), - 18: Field( - name='player_score', - type=BASE_TYPES[0x84], # uint16 - def_num=18, - ), - 19: Field( - name='opponent_score', - type=BASE_TYPES[0x84], # uint16 - def_num=19, - ), - 20: Field( # stroke_type enum used as the index - name='stroke_count', - type=BASE_TYPES[0x84], # uint16 - def_num=20, - units='counts', - ), - 21: Field( # zone number used as the index - name='zone_count', + name='count', type=BASE_TYPES[0x84], # uint16 - def_num=21, - units='counts', + def_num=3, ), - 253: FIELD_TYPE_TIMESTAMP, 254: Field( name='message_index', type=FIELD_TYPES['message_index'], @@ -7108,214 +6534,72 @@ ), }, ), - 127: MessageType( - name='connectivity', - mesg_num=127, - fields={ - 0: Field( # Use Bluetooth for connectivity features - name='bluetooth_enabled', - type=FIELD_TYPES['bool'], - def_num=0, - ), - 1: Field( # Use Bluetooth Low Energy for connectivity features - name='bluetooth_le_enabled', - type=FIELD_TYPES['bool'], - def_num=1, - ), - 2: Field( # Use ANT for connectivity features - name='ant_enabled', - type=FIELD_TYPES['bool'], - def_num=2, - ), - 3: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=3, - ), - 4: Field( - name='live_tracking_enabled', - type=FIELD_TYPES['bool'], - def_num=4, - ), - 5: Field( - name='weather_conditions_enabled', - type=FIELD_TYPES['bool'], - def_num=5, - ), - 6: Field( - name='weather_alerts_enabled', - type=FIELD_TYPES['bool'], - def_num=6, - ), - 7: Field( - name='auto_activity_upload_enabled', - type=FIELD_TYPES['bool'], - def_num=7, - ), - 8: Field( - name='course_download_enabled', - type=FIELD_TYPES['bool'], - def_num=8, - ), - 9: Field( - name='workout_download_enabled', - type=FIELD_TYPES['bool'], - def_num=9, - ), - 10: Field( - name='gps_ephemeris_download_enabled', - type=FIELD_TYPES['bool'], - def_num=10, - ), - 11: Field( - name='incident_detection_enabled', - type=FIELD_TYPES['bool'], - def_num=11, - ), - 12: Field( - name='grouptrack_enabled', - type=FIELD_TYPES['bool'], - def_num=12, - ), - }, - ), - 128: MessageType( - name='weather_conditions', - mesg_num=128, + + + ########################## Goals File Messages ########################### + 15: MessageType( + name='goal', + mesg_num=15, fields={ - 0: Field( # Current or forecast - name='weather_report', - type=FIELD_TYPES['weather_report'], + 0: Field( + name='sport', + type=FIELD_TYPES['sport'], def_num=0, ), 1: Field( - name='temperature', - type=BASE_TYPES[0x01], # sint8 + name='sub_sport', + type=FIELD_TYPES['sub_sport'], def_num=1, - units='C', ), - 2: Field( # Corresponds to GSC Response weatherIcon field - name='condition', - type=FIELD_TYPES['weather_status'], + 2: Field( + name='start_date', + type=FIELD_TYPES['date_time'], def_num=2, ), 3: Field( - name='wind_direction', - type=BASE_TYPES[0x84], # uint16 + name='end_date', + type=FIELD_TYPES['date_time'], def_num=3, - units='degrees', ), 4: Field( - name='wind_speed', - type=BASE_TYPES[0x84], # uint16 + name='type', + type=FIELD_TYPES['goal'], def_num=4, - scale=1000, - units='m/s', ), - 5: Field( # range 0-100 - name='precipitation_probability', - type=BASE_TYPES[0x02], # uint8 + 5: Field( + name='value', + type=BASE_TYPES[0x86], # uint32 def_num=5, ), - 6: Field( # Heat Index if GCS heatIdx above or equal to 90F or wind chill if GCS windChill below or equal to 32F - name='temperature_feels_like', - type=BASE_TYPES[0x01], # sint8 + 6: Field( + name='repeat', + type=FIELD_TYPES['bool'], def_num=6, - units='C', ), 7: Field( - name='relative_humidity', - type=BASE_TYPES[0x02], # uint8 + name='target_value', + type=BASE_TYPES[0x86], # uint32 def_num=7, ), - 8: Field( # string corresponding to GCS response location string - name='location', - type=BASE_TYPES[0x07], # string + 8: Field( + name='recurrence', + type=FIELD_TYPES['goal_recurrence'], def_num=8, ), 9: Field( - name='observed_at_time', - type=FIELD_TYPES['date_time'], + name='recurrence_value', + type=BASE_TYPES[0x84], # uint16 def_num=9, ), 10: Field( - name='observed_location_lat', - type=BASE_TYPES[0x85], # sint32 + name='enabled', + type=FIELD_TYPES['bool'], def_num=10, - units='semicircles', ), 11: Field( - name='observed_location_long', - type=BASE_TYPES[0x85], # sint32 + name='source', + type=FIELD_TYPES['goal_source'], def_num=11, - units='semicircles', - ), - 12: Field( - name='day_of_week', - type=FIELD_TYPES['day_of_week'], - def_num=12, - ), - 13: Field( - name='high_temperature', - type=BASE_TYPES[0x01], # sint8 - def_num=13, - units='C', - ), - 14: Field( - name='low_temperature', - type=BASE_TYPES[0x01], # sint8 - def_num=14, - units='C', - ), - 253: FIELD_TYPE_TIMESTAMP, # time of update for current conditions, else forecast time - }, - ), - 129: MessageType( - name='weather_alert', - mesg_num=129, - fields={ - 0: Field( # Unique identifier from GCS report ID string, length is 12 - name='report_id', - type=BASE_TYPES[0x07], # string - def_num=0, - ), - 1: Field( # Time alert was issued - name='issue_time', - type=FIELD_TYPES['date_time'], - def_num=1, - ), - 2: Field( # Time alert expires - name='expire_time', - type=FIELD_TYPES['date_time'], - def_num=2, - ), - 3: Field( # Warning, Watch, Advisory, Statement - name='severity', - type=FIELD_TYPES['weather_severity'], - def_num=3, - ), - 4: Field( # Tornado, Severe Thunderstorm, etc. - name='type', - type=FIELD_TYPES['weather_severe_type'], - def_num=4, - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 131: MessageType( - name='cadence_zone', - mesg_num=131, - fields={ - 0: Field( - name='high_value', - type=BASE_TYPES[0x02], # uint8 - def_num=0, - units='rpm', - ), - 1: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=1, ), 254: Field( name='message_index', @@ -7324,1968 +6608,2294 @@ ), }, ), - 132: MessageType( - name='hr', - mesg_num=132, + + + ######################## Monitoring File Messages ######################## + 55: MessageType( + name='monitoring', + mesg_num=55, fields={ - 0: Field( - name='fractional_timestamp', - type=BASE_TYPES[0x84], # uint16 + 0: Field( # Associates this data to device_info message. Not required for file with single device (sensor). + name='device_index', + type=FIELD_TYPES['device_index'], def_num=0, - scale=32768, - units='s', ), - 1: Field( - name='time256', - type=BASE_TYPES[0x02], # uint8 + 1: Field( # Accumulated total calories. Maintained by MonitoringReader for each activity_type. See SDK documentation + name='calories', + type=BASE_TYPES[0x84], # uint16 def_num=1, - components=( - ComponentField( - name='fractional_timestamp', - def_num=0, - scale=256, - units='s', - accumulate=False, - bits=8, - bit_offset=0, - ), - ), - ), - 6: Field( - name='filtered_bpm', - type=BASE_TYPES[0x02], # uint8 - def_num=6, - units='bpm', + units=u'kcal', ), - 9: Field( - name='event_timestamp', + 2: Field( # Accumulated distance. Maintained by MonitoringReader for each activity_type. See SDK documentation. + name='distance', type=BASE_TYPES[0x86], # uint32 - def_num=9, - scale=1024, - units='s', + def_num=2, + scale=100, + units=u'm', ), - 10: Field( - name='event_timestamp_12', - type=BASE_TYPES[0x0D], # byte - def_num=10, - components=( - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=0, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=12, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=24, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=36, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=48, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=60, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=72, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=84, - ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=96, + 3: Field( # Accumulated cycles. Maintained by MonitoringReader for each activity_type. See SDK documentation. + name='cycles', + type=BASE_TYPES[0x86], # uint32 + def_num=3, + scale=2, + units=u'cycles', + subfields=( + SubField( + name='steps', + def_num=3, + type=BASE_TYPES[0x86], # uint32 + units=u'steps', + ref_fields=( + ReferenceField( + name='activity_type', + def_num=5, + value='walking', + raw_value=6, + ), + ReferenceField( + name='activity_type', + def_num=5, + value='running', + raw_value=1, + ), + ), ), - ComponentField( - name='event_timestamp', - def_num=9, - scale=1024, - units='s', - accumulate=True, - bits=12, - bit_offset=108, + SubField( + name='strokes', + def_num=3, + type=BASE_TYPES[0x86], # uint32 + scale=2, + units=u'strokes', + ref_fields=( + ReferenceField( + name='activity_type', + def_num=5, + value='cycling', + raw_value=2, + ), + ReferenceField( + name='activity_type', + def_num=5, + value='swimming', + raw_value=5, + ), + ), ), ), ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - 142: MessageType( - name='segment_lap', - mesg_num=142, - fields={ - 0: Field( - name='event', - type=FIELD_TYPES['event'], - def_num=0, - ), - 1: Field( - name='event_type', - type=FIELD_TYPES['event_type'], - def_num=1, - ), - 2: Field( - name='start_time', - type=FIELD_TYPES['date_time'], - def_num=2, - ), - 3: Field( - name='start_position_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=3, - units='semicircles', - ), 4: Field( - name='start_position_long', - type=BASE_TYPES[0x85], # sint32 + name='active_time', + type=BASE_TYPES[0x86], # uint32 def_num=4, - units='semicircles', + scale=1000, + units=u's', ), 5: Field( - name='end_position_lat', - type=BASE_TYPES[0x85], # sint32 + name='activity_type', + type=FIELD_TYPES['activity_type'], def_num=5, - units='semicircles', ), 6: Field( - name='end_position_long', - type=BASE_TYPES[0x85], # sint32 + name='activity_subtype', + type=FIELD_TYPES['activity_subtype'], def_num=6, - units='semicircles', ), - 7: Field( # Time (includes pauses) - name='total_elapsed_time', - type=BASE_TYPES[0x86], # uint32 + 7: Field( + name='activity_level', + type=FIELD_TYPES['activity_level'], def_num=7, - scale=1000, - units='s', ), - 8: Field( # Timer Time (excludes pauses) - name='total_timer_time', - type=BASE_TYPES[0x86], # uint32 + 8: Field( + name='distance_16', + type=BASE_TYPES[0x84], # uint16 def_num=8, - scale=1000, - units='s', + units=u'100 * m', ), 9: Field( - name='total_distance', - type=BASE_TYPES[0x86], # uint32 + name='cycles_16', + type=BASE_TYPES[0x84], # uint16 def_num=9, - scale=100, - units='m', + units=u'2 * cycles (steps)', ), 10: Field( - name='total_cycles', - type=BASE_TYPES[0x86], # uint32 + name='active_time_16', + type=BASE_TYPES[0x84], # uint16 def_num=10, - units='cycles', - subfields=( - SubField( - name='total_strokes', - def_num=10, - type=BASE_TYPES[0x86], # uint32 - units='strokes', - ref_fields=( - ReferenceField( - name='sport', - def_num=23, - value='cycling', - raw_value=2, - ), - ), - ), - ), + units=u's', ), - 11: Field( - name='total_calories', - type=BASE_TYPES[0x84], # uint16 + 11: Field( # Must align to logging interval, for example, time must be 00:00:00 for daily log. + name='local_timestamp', + type=FIELD_TYPES['local_date_time'], def_num=11, - units='kcal', ), - 12: Field( # If New Leaf - name='total_fat_calories', - type=BASE_TYPES[0x84], # uint16 + 12: Field( # Avg temperature during the logging interval ended at timestamp + name='temperature', + type=BASE_TYPES[0x83], # sint16 def_num=12, - units='kcal', - ), - 13: Field( - name='avg_speed', - type=BASE_TYPES[0x84], # uint16 - def_num=13, - scale=1000, - units='m/s', + scale=100, + units=u'C', ), - 14: Field( - name='max_speed', - type=BASE_TYPES[0x84], # uint16 + 14: Field( # Min temperature during the logging interval ended at timestamp + name='temperature_min', + type=BASE_TYPES[0x83], # sint16 def_num=14, - scale=1000, - units='m/s', + scale=100, + units=u'C', ), - 15: Field( - name='avg_heart_rate', - type=BASE_TYPES[0x02], # uint8 + 15: Field( # Max temperature during the logging interval ended at timestamp + name='temperature_max', + type=BASE_TYPES[0x83], # sint16 def_num=15, - units='bpm', + scale=100, + units=u'C', ), - 16: Field( - name='max_heart_rate', - type=BASE_TYPES[0x02], # uint8 + 16: Field( # Indexed using minute_activity_level enum + name='activity_time', + type=BASE_TYPES[0x84], # uint16 def_num=16, - units='bpm', - ), - 17: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time - name='avg_cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=17, - units='rpm', - ), - 18: Field( - name='max_cadence', - type=BASE_TYPES[0x02], # uint8 - def_num=18, - units='rpm', + units=u'minutes', ), - 19: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time - name='avg_power', + 19: Field( + name='active_calories', type=BASE_TYPES[0x84], # uint16 def_num=19, - units='watts', - ), - 20: Field( - name='max_power', - type=BASE_TYPES[0x84], # uint16 - def_num=20, - units='watts', - ), - 21: Field( - name='total_ascent', - type=BASE_TYPES[0x84], # uint16 - def_num=21, - units='m', - ), - 22: Field( - name='total_descent', - type=BASE_TYPES[0x84], # uint16 - def_num=22, - units='m', - ), - 23: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=23, + units=u'kcal', ), - 24: Field( - name='event_group', - type=BASE_TYPES[0x02], # uint8 + 24: Field( # Indicates single type / intensity for duration since last monitoring message. + name='current_activity_type_intensity', + type=BASE_TYPES[0x0D], # byte def_num=24, + components=( + ComponentField( + name='activity_type', + def_num=5, + accumulate=False, + bits=5, + bit_offset=0, + ), + ComponentField( + name='intensity', + def_num=28, + accumulate=False, + bits=3, + bit_offset=5, + ), + ), ), - 25: Field( # North east corner latitude. - name='nec_lat', - type=BASE_TYPES[0x85], # sint32 + 25: Field( + name='timestamp_min_8', + type=BASE_TYPES[0x02], # uint8 def_num=25, - units='semicircles', + units=u'min', ), - 26: Field( # North east corner longitude. - name='nec_long', - type=BASE_TYPES[0x85], # sint32 + 26: Field( + name='timestamp_16', + type=BASE_TYPES[0x84], # uint16 def_num=26, - units='semicircles', + units=u's', ), - 27: Field( # South west corner latitude. - name='swc_lat', - type=BASE_TYPES[0x85], # sint32 + 27: Field( + name='heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=27, - units='semicircles', + units=u'bpm', ), - 28: Field( # South west corner latitude. - name='swc_long', - type=BASE_TYPES[0x85], # sint32 + 28: Field( + name='intensity', + type=BASE_TYPES[0x02], # uint8 def_num=28, - units='semicircles', + scale=10, ), 29: Field( - name='name', - type=BASE_TYPES[0x07], # string + name='duration_min', + type=BASE_TYPES[0x84], # uint16 def_num=29, + units=u'min', ), 30: Field( - name='normalized_power', - type=BASE_TYPES[0x84], # uint16 + name='duration', + type=BASE_TYPES[0x86], # uint32 def_num=30, - units='watts', + units=u's', + ), + 31: Field( + name='ascent', + type=BASE_TYPES[0x86], # uint32 + def_num=31, + scale=1000, + units=u'm', + ), + 32: Field( + name='descent', + type=BASE_TYPES[0x86], # uint32 + def_num=32, + scale=1000, + units=u'm', + ), + 33: Field( + name='moderate_activity_minutes', + type=BASE_TYPES[0x84], # uint16 + def_num=33, + units=u'minutes', + ), + 34: Field( + name='vigorous_activity_minutes', + type=BASE_TYPES[0x84], # uint16 + def_num=34, + units=u'minutes', + ), + 253: FIELD_TYPE_TIMESTAMP, # Must align to logging interval, for example, time must be 00:00:00 for daily log. + }, + ), + 103: MessageType( + name='monitoring_info', + mesg_num=103, + fields={ + 0: Field( # Use to convert activity timestamps to local time if device does not support time zone and daylight savings time correction. + name='local_timestamp', + type=FIELD_TYPES['local_date_time'], + def_num=0, + units=u's', ), - 31: Field( - name='left_right_balance', - type=FIELD_TYPES['left_right_balance_100'], - def_num=31, + 1: Field( + name='activity_type', + type=FIELD_TYPES['activity_type'], + def_num=1, ), - 32: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=32, + 3: Field( # Indexed by activity_type + name='cycles_to_distance', + type=BASE_TYPES[0x84], # uint16 + def_num=3, + scale=5000, + units=u'm/cycle', ), - 33: Field( - name='total_work', - type=BASE_TYPES[0x86], # uint32 - def_num=33, - units='J', + 4: Field( # Indexed by activity_type + name='cycles_to_calories', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + scale=5000, + units=u'kcal/cycle', ), - 34: Field( - name='avg_altitude', + 5: Field( + name='resting_metabolic_rate', type=BASE_TYPES[0x84], # uint16 - def_num=34, - scale=5, - offset=500, - units='m', + def_num=5, + units=u'kcal / day', ), - 35: Field( - name='max_altitude', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 132: MessageType( + name='hr', + mesg_num=132, + fields={ + 0: Field( + name='fractional_timestamp', type=BASE_TYPES[0x84], # uint16 - def_num=35, - scale=5, - offset=500, - units='m', + def_num=0, + scale=32768, + units=u's', ), - 36: Field( - name='gps_accuracy', + 1: Field( + name='time256', type=BASE_TYPES[0x02], # uint8 - def_num=36, - units='m', + def_num=1, + components=( + ComponentField( + name='fractional_timestamp', + def_num=0, + scale=256, + units=u's', + accumulate=False, + bits=8, + bit_offset=0, + ), + ), ), - 37: Field( - name='avg_grade', - type=BASE_TYPES[0x83], # sint16 - def_num=37, - scale=100, - units='%', + 6: Field( + name='filtered_bpm', + type=BASE_TYPES[0x02], # uint8 + def_num=6, + units=u'bpm', ), - 38: Field( - name='avg_pos_grade', - type=BASE_TYPES[0x83], # sint16 - def_num=38, - scale=100, - units='%', + 9: Field( + name='event_timestamp', + type=BASE_TYPES[0x86], # uint32 + def_num=9, + scale=1024, + units=u's', ), - 39: Field( - name='avg_neg_grade', - type=BASE_TYPES[0x83], # sint16 - def_num=39, - scale=100, - units='%', + 10: Field( + name='event_timestamp_12', + type=BASE_TYPES[0x0D], # byte + def_num=10, + components=( + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=0, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=12, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=24, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=36, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=48, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=60, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=72, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=84, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=96, + ), + ComponentField( + name='event_timestamp', + def_num=9, + scale=1024, + units=u's', + accumulate=True, + bits=12, + bit_offset=108, + ), + ), ), - 40: Field( - name='max_pos_grade', - type=BASE_TYPES[0x83], # sint16 - def_num=40, - scale=100, - units='%', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + + + ############################# Other Messages ############################# + 80: MessageType( + name='ant_rx', + mesg_num=80, + fields={ + 0: Field( + name='fractional_timestamp', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + scale=32768, + units=u's', + ), + 1: Field( + name='mesg_id', + type=BASE_TYPES[0x0D], # byte + def_num=1, + ), + 2: Field( + name='mesg_data', + type=BASE_TYPES[0x0D], # byte + def_num=2, + components=( + ComponentField( + name='channel_number', + def_num=3, + accumulate=False, + bits=8, + bit_offset=0, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=8, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=16, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=24, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=32, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=40, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=48, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=56, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=64, + ), + ), ), - 41: Field( - name='max_neg_grade', - type=BASE_TYPES[0x83], # sint16 - def_num=41, - scale=100, - units='%', + 3: Field( + name='channel_number', + type=BASE_TYPES[0x02], # uint8 + def_num=3, ), - 42: Field( - name='avg_temperature', - type=BASE_TYPES[0x01], # sint8 - def_num=42, - units='C', + 4: Field( + name='data', + type=BASE_TYPES[0x0D], # byte + def_num=4, ), - 43: Field( - name='max_temperature', - type=BASE_TYPES[0x01], # sint8 - def_num=43, - units='C', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 81: MessageType( + name='ant_tx', + mesg_num=81, + fields={ + 0: Field( + name='fractional_timestamp', + type=BASE_TYPES[0x84], # uint16 + def_num=0, + scale=32768, + units=u's', ), - 44: Field( - name='total_moving_time', - type=BASE_TYPES[0x86], # uint32 - def_num=44, - scale=1000, - units='s', + 1: Field( + name='mesg_id', + type=BASE_TYPES[0x0D], # byte + def_num=1, ), - 45: Field( - name='avg_pos_vertical_speed', - type=BASE_TYPES[0x83], # sint16 - def_num=45, - scale=1000, - units='m/s', + 2: Field( + name='mesg_data', + type=BASE_TYPES[0x0D], # byte + def_num=2, + components=( + ComponentField( + name='channel_number', + def_num=3, + accumulate=False, + bits=8, + bit_offset=0, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=8, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=16, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=24, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=32, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=40, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=48, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=56, + ), + ComponentField( + name='data', + def_num=4, + accumulate=False, + bits=8, + bit_offset=64, + ), + ), ), - 46: Field( - name='avg_neg_vertical_speed', - type=BASE_TYPES[0x83], # sint16 - def_num=46, - scale=1000, - units='m/s', + 3: Field( + name='channel_number', + type=BASE_TYPES[0x02], # uint8 + def_num=3, ), - 47: Field( - name='max_pos_vertical_speed', - type=BASE_TYPES[0x83], # sint16 - def_num=47, - scale=1000, - units='m/s', + 4: Field( + name='data', + type=BASE_TYPES[0x0D], # byte + def_num=4, ), - 48: Field( - name='max_neg_vertical_speed', - type=BASE_TYPES[0x83], # sint16 - def_num=48, - scale=1000, - units='m/s', + 253: FIELD_TYPE_TIMESTAMP, + }, + ), + 82: MessageType( + name='ant_channel_id', + mesg_num=82, + fields={ + 0: Field( + name='channel_number', + type=BASE_TYPES[0x02], # uint8 + def_num=0, ), - 49: Field( - name='time_in_hr_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=49, - scale=1000, - units='s', + 1: Field( + name='device_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=1, ), - 50: Field( - name='time_in_speed_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=50, - scale=1000, - units='s', + 2: Field( + name='device_number', + type=BASE_TYPES[0x8B], # uint16z + def_num=2, ), - 51: Field( - name='time_in_cadence_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=51, - scale=1000, - units='s', + 3: Field( + name='transmission_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=3, ), - 52: Field( - name='time_in_power_zone', - type=BASE_TYPES[0x86], # uint32 - def_num=52, - scale=1000, - units='s', + 4: Field( + name='device_index', + type=FIELD_TYPES['device_index'], + def_num=4, ), - 53: Field( - name='repetition_num', - type=BASE_TYPES[0x84], # uint16 - def_num=53, + }, + ), + 145: MessageType( + name='memo_glob', + mesg_num=145, + fields={ + 0: Field( # Block of utf8 bytes + name='memo', + type=BASE_TYPES[0x0D], # byte + def_num=0, ), - 54: Field( - name='min_altitude', + 1: Field( # Allows relating glob to another mesg If used only required for first part of each memo_glob + name='message_number', type=BASE_TYPES[0x84], # uint16 - def_num=54, - scale=5, - offset=500, - units='m', - ), - 55: Field( - name='min_heart_rate', - type=BASE_TYPES[0x02], # uint8 - def_num=55, - units='bpm', - ), - 56: Field( - name='active_time', - type=BASE_TYPES[0x86], # uint32 - def_num=56, - scale=1000, - units='s', + def_num=1, ), - 57: Field( - name='wkt_step_index', + 2: Field( # Index of external mesg + name='message_index', type=FIELD_TYPES['message_index'], - def_num=57, + def_num=2, ), - 58: Field( - name='sport_event', - type=FIELD_TYPES['sport_event'], - def_num=58, + 250: Field( # Sequence number of memo blocks + name='part_index', + type=BASE_TYPES[0x86], # uint32 + def_num=250, ), - 59: Field( - name='avg_left_torque_effectiveness', + }, + ), + 200: MessageType( + name='exd_screen_configuration', + mesg_num=200, + fields={ + 0: Field( + name='screen_index', type=BASE_TYPES[0x02], # uint8 - def_num=59, - scale=2, - units='percent', + def_num=0, ), - 60: Field( - name='avg_right_torque_effectiveness', + 1: Field( # number of fields in screen + name='field_count', type=BASE_TYPES[0x02], # uint8 - def_num=60, - scale=2, - units='percent', + def_num=1, ), - 61: Field( - name='avg_left_pedal_smoothness', + 2: Field( + name='layout', + type=FIELD_TYPES['exd_layout'], + def_num=2, + ), + 3: Field( + name='screen_enabled', + type=FIELD_TYPES['bool'], + def_num=3, + ), + }, + ), + 201: MessageType( + name='exd_data_field_configuration', + mesg_num=201, + fields={ + 0: Field( + name='screen_index', type=BASE_TYPES[0x02], # uint8 - def_num=61, - scale=2, - units='percent', + def_num=0, ), - 62: Field( - name='avg_right_pedal_smoothness', + 1: Field( + name='concept_field', + type=BASE_TYPES[0x0D], # byte + def_num=1, + components=( + ComponentField( + name='field_id', + def_num=2, + accumulate=False, + bits=4, + bit_offset=0, + ), + ComponentField( + name='concept_count', + def_num=3, + accumulate=False, + bits=4, + bit_offset=4, + ), + ), + ), + 2: Field( + name='field_id', type=BASE_TYPES[0x02], # uint8 - def_num=62, - scale=2, - units='percent', + def_num=2, ), - 63: Field( - name='avg_combined_pedal_smoothness', + 3: Field( + name='concept_count', type=BASE_TYPES[0x02], # uint8 - def_num=63, - scale=2, - units='percent', + def_num=3, ), - 64: Field( - name='status', - type=FIELD_TYPES['segment_lap_status'], - def_num=64, + 4: Field( + name='display_type', + type=FIELD_TYPES['exd_display_type'], + def_num=4, ), - 65: Field( - name='uuid', + 5: Field( + name='title', type=BASE_TYPES[0x07], # string - def_num=65, + def_num=5, ), - 66: Field( # fractional part of the avg_cadence - name='avg_fractional_cadence', + }, + ), + 202: MessageType( + name='exd_data_concept_configuration', + mesg_num=202, + fields={ + 0: Field( + name='screen_index', type=BASE_TYPES[0x02], # uint8 - def_num=66, - scale=128, - units='rpm', + def_num=0, ), - 67: Field( # fractional part of the max_cadence - name='max_fractional_cadence', + 1: Field( + name='concept_field', + type=BASE_TYPES[0x0D], # byte + def_num=1, + components=( + ComponentField( + name='field_id', + def_num=2, + accumulate=False, + bits=4, + bit_offset=0, + ), + ComponentField( + name='concept_index', + def_num=3, + accumulate=False, + bits=4, + bit_offset=4, + ), + ), + ), + 2: Field( + name='field_id', type=BASE_TYPES[0x02], # uint8 - def_num=67, - scale=128, - units='rpm', + def_num=2, ), - 68: Field( # fractional part of the total_cycles - name='total_fractional_cycles', + 3: Field( + name='concept_index', type=BASE_TYPES[0x02], # uint8 - def_num=68, - scale=128, - units='cycles', + def_num=3, ), - 69: Field( - name='front_gear_shift_count', - type=BASE_TYPES[0x84], # uint16 - def_num=69, + 4: Field( + name='data_page', + type=BASE_TYPES[0x02], # uint8 + def_num=4, ), - 70: Field( - name='rear_gear_shift_count', - type=BASE_TYPES[0x84], # uint16 - def_num=70, + 5: Field( + name='concept_key', + type=BASE_TYPES[0x02], # uint8 + def_num=5, ), - 71: Field( # Total time spent in the standing position - name='time_standing', - type=BASE_TYPES[0x86], # uint32 - def_num=71, - scale=1000, - units='s', + 6: Field( + name='scaling', + type=BASE_TYPES[0x02], # uint8 + def_num=6, ), - 72: Field( # Number of transitions to the standing state - name='stand_count', - type=BASE_TYPES[0x84], # uint16 - def_num=72, + 8: Field( + name='data_units', + type=FIELD_TYPES['exd_data_units'], + def_num=8, ), - 73: Field( # Average left platform center offset - name='avg_left_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=73, - units='mm', + 9: Field( + name='qualifier', + type=FIELD_TYPES['exd_qualifiers'], + def_num=9, ), - 74: Field( # Average right platform center offset - name='avg_right_pco', - type=BASE_TYPES[0x01], # sint8 - def_num=74, - units='mm', + 10: Field( + name='descriptor', + type=FIELD_TYPES['exd_descriptors'], + def_num=10, ), - 75: Field( # Average left power phase angles. Data value indexes defined by power_phase_type. - name='avg_left_power_phase', + 11: Field( + name='is_signed', + type=FIELD_TYPES['bool'], + def_num=11, + ), + }, + ), + 206: MessageType( # Must be logged before developer field is used + name='field_description', + mesg_num=206, + fields={ + 0: Field( + name='developer_data_index', type=BASE_TYPES[0x02], # uint8 - def_num=75, - scale=0.7111111, - units='degrees', + def_num=0, ), - 76: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. - name='avg_left_power_phase_peak', + 1: Field( + name='field_definition_number', type=BASE_TYPES[0x02], # uint8 - def_num=76, - scale=0.7111111, - units='degrees', + def_num=1, ), - 77: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. - name='avg_right_power_phase', + 2: Field( + name='fit_base_type_id', + type=FIELD_TYPES['fit_base_type'], + def_num=2, + ), + 3: Field( + name='field_name', + type=BASE_TYPES[0x07], # string + def_num=3, + ), + 4: Field( + name='array', type=BASE_TYPES[0x02], # uint8 - def_num=77, - scale=0.7111111, - units='degrees', + def_num=4, ), - 78: Field( # Average right power phase peak angles. Data value indexes defined by power_phase_type. - name='avg_right_power_phase_peak', + 5: Field( + name='components', + type=BASE_TYPES[0x07], # string + def_num=5, + ), + 6: Field( + name='scale', type=BASE_TYPES[0x02], # uint8 - def_num=78, - scale=0.7111111, - units='degrees', + def_num=6, ), - 79: Field( # Average power by position. Data value indexes defined by rider_position_type. - name='avg_power_position', - type=BASE_TYPES[0x84], # uint16 - def_num=79, - units='watts', + 7: Field( + name='offset', + type=BASE_TYPES[0x01], # sint8 + def_num=7, ), - 80: Field( # Maximum power by position. Data value indexes defined by rider_position_type. - name='max_power_position', - type=BASE_TYPES[0x84], # uint16 - def_num=80, - units='watts', + 8: Field( + name='units', + type=BASE_TYPES[0x07], # string + def_num=8, + ), + 9: Field( + name='bits', + type=BASE_TYPES[0x07], # string + def_num=9, ), - 81: Field( # Average cadence by position. Data value indexes defined by rider_position_type. - name='avg_cadence_position', - type=BASE_TYPES[0x02], # uint8 - def_num=81, - units='rpm', + 10: Field( + name='accumulate', + type=BASE_TYPES[0x07], # string + def_num=10, ), - 82: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. - name='max_cadence_position', - type=BASE_TYPES[0x02], # uint8 - def_num=82, - units='rpm', + 13: Field( + name='fit_base_unit_id', + type=FIELD_TYPES['fit_base_unit'], + def_num=13, ), - 83: Field( # Manufacturer that produced the segment - name='manufacturer', - type=FIELD_TYPES['manufacturer'], - def_num=83, + 14: Field( + name='native_mesg_num', + type=FIELD_TYPES['mesg_num'], + def_num=14, ), - 253: FIELD_TYPE_TIMESTAMP, # Lap end time. - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 15: Field( + name='native_field_num', + type=BASE_TYPES[0x02], # uint8 + def_num=15, ), }, ), - 149: MessageType( # Unique Identification data for an individual segment leader within a segment file - name='segment_leaderboard_entry', - mesg_num=149, + 207: MessageType( # Must be logged before field description + name='developer_data_id', + mesg_num=207, fields={ - 0: Field( # Friendly name assigned to leader - name='name', - type=BASE_TYPES[0x07], # string + 0: Field( + name='developer_id', + type=BASE_TYPES[0x0D], # byte def_num=0, ), - 1: Field( # Leader classification - name='type', - type=FIELD_TYPES['segment_leaderboard_type'], + 1: Field( + name='application_id', + type=BASE_TYPES[0x0D], # byte def_num=1, ), - 2: Field( # Primary user ID of this leader - name='group_primary_key', - type=BASE_TYPES[0x86], # uint32 + 2: Field( + name='manufacturer_id', + type=FIELD_TYPES['manufacturer'], def_num=2, ), - 3: Field( # ID of the activity associated with this leader time - name='activity_id', - type=BASE_TYPES[0x86], # uint32 + 3: Field( + name='developer_data_index', + type=BASE_TYPES[0x02], # uint8 def_num=3, ), - 4: Field( # Segment Time (includes pauses) - name='segment_time', + 4: Field( + name='application_version', type=BASE_TYPES[0x86], # uint32 def_num=4, - scale=1000, - units='s', - ), - 5: Field( # String version of the activity_id. 21 characters long, express in decimal - name='activity_id_string', - type=BASE_TYPES[0x07], # string - def_num=5, - ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, ), }, ), - 150: MessageType( # Navigation and race evaluation point for a segment decribing a point along the segment path and time it took each segment leader to reach that point - name='segment_point', - mesg_num=150, + + + ######################### Schedule File Messages ######################### + 28: MessageType( + name='schedule', + mesg_num=28, fields={ - 1: Field( - name='position_lat', - type=BASE_TYPES[0x85], # sint32 + 0: Field( # Corresponds to file_id of scheduled workout / course. + name='manufacturer', + type=FIELD_TYPES['manufacturer'], + def_num=0, + ), + 1: Field( # Corresponds to file_id of scheduled workout / course. + name='product', + type=BASE_TYPES[0x84], # uint16 def_num=1, - units='semicircles', + subfields=( + SubField( + name='garmin_product', + def_num=1, + type=FIELD_TYPES['garmin_product'], + ref_fields=( + ReferenceField( + name='manufacturer', + def_num=0, + value='garmin', + raw_value=1, + ), + ReferenceField( + name='manufacturer', + def_num=0, + value='dynastream', + raw_value=15, + ), + ReferenceField( + name='manufacturer', + def_num=0, + value='dynastream_oem', + raw_value=13, + ), + ), + ), + ), ), - 2: Field( - name='position_long', - type=BASE_TYPES[0x85], # sint32 + 2: Field( # Corresponds to file_id of scheduled workout / course. + name='serial_number', + type=BASE_TYPES[0x8C], # uint32z def_num=2, - units='semicircles', ), - 3: Field( # Accumulated distance along the segment at the described point - name='distance', - type=BASE_TYPES[0x86], # uint32 + 3: Field( # Corresponds to file_id of scheduled workout / course. + name='time_created', + type=FIELD_TYPES['date_time'], def_num=3, - scale=100, - units='m', ), - 4: Field( # Accumulated altitude along the segment at the described point - name='altitude', - type=BASE_TYPES[0x84], # uint16 + 4: Field( # TRUE if this activity has been started + name='completed', + type=FIELD_TYPES['bool'], def_num=4, - scale=5, - offset=500, - units='m', ), - 5: Field( # Accumualted time each leader board member required to reach the described point. This value is zero for all leader board members at the starting point of the segment. - name='leader_time', - type=BASE_TYPES[0x86], # uint32 + 5: Field( + name='type', + type=FIELD_TYPES['schedule'], def_num=5, - scale=1000, - units='s', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 6: Field( + name='scheduled_time', + type=FIELD_TYPES['local_date_time'], + def_num=6, ), }, ), - 158: MessageType( - name='workout_session', - mesg_num=158, + + + ######################### Segment File Messages ########################## + 142: MessageType( + name='segment_lap', + mesg_num=142, fields={ 0: Field( - name='sport', - type=FIELD_TYPES['sport'], + name='event', + type=FIELD_TYPES['event'], def_num=0, ), 1: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], + name='event_type', + type=FIELD_TYPES['event_type'], def_num=1, ), 2: Field( - name='num_valid_steps', - type=BASE_TYPES[0x84], # uint16 + name='start_time', + type=FIELD_TYPES['date_time'], def_num=2, ), 3: Field( - name='first_step_index', - type=BASE_TYPES[0x84], # uint16 + name='start_position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=3, + units=u'semicircles', ), 4: Field( - name='pool_length', - type=BASE_TYPES[0x84], # uint16 + name='start_position_long', + type=BASE_TYPES[0x85], # sint32 def_num=4, - scale=100, - units='m', + units=u'semicircles', ), 5: Field( - name='pool_length_unit', - type=FIELD_TYPES['display_measure'], + name='end_position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=5, + units=u'semicircles', ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 6: Field( + name='end_position_long', + type=BASE_TYPES[0x85], # sint32 + def_num=6, + units=u'semicircles', ), - }, - ), - 159: MessageType( - name='watchface_settings', - mesg_num=159, - fields={ - 0: Field( - name='mode', - type=FIELD_TYPES['watchface_mode'], - def_num=0, + 7: Field( # Time (includes pauses) + name='total_elapsed_time', + type=BASE_TYPES[0x86], # uint32 + def_num=7, + scale=1000, + units=u's', ), - 1: Field( - name='layout', - type=BASE_TYPES[0x0D], # byte - def_num=1, + 8: Field( # Timer Time (excludes pauses) + name='total_timer_time', + type=BASE_TYPES[0x86], # uint32 + def_num=8, + scale=1000, + units=u's', + ), + 9: Field( + name='total_distance', + type=BASE_TYPES[0x86], # uint32 + def_num=9, + scale=100, + units=u'm', + ), + 10: Field( + name='total_cycles', + type=BASE_TYPES[0x86], # uint32 + def_num=10, + units=u'cycles', subfields=( SubField( - name='analog_layout', - def_num=1, - type=FIELD_TYPES['analog_watchface_layout'], - ref_fields=( - ReferenceField( - name='mode', - def_num=0, - value='analog', - raw_value=1, - ), - ), - ), - SubField( - name='digital_layout', - def_num=1, - type=FIELD_TYPES['digital_watchface_layout'], + name='total_strokes', + def_num=10, + type=BASE_TYPES[0x86], # uint32 + units=u'strokes', ref_fields=( ReferenceField( - name='mode', - def_num=0, - value='digital', - raw_value=0, + name='sport', + def_num=23, + value='cycling', + raw_value=2, ), ), ), ), ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 11: Field( + name='total_calories', + type=BASE_TYPES[0x84], # uint16 + def_num=11, + units=u'kcal', ), - }, - ), - 160: MessageType( - name='gps_metadata', - mesg_num=160, - fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', + 12: Field( # If New Leaf + name='total_fat_calories', type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + def_num=12, + units=u'kcal', ), - 1: Field( - name='position_lat', - type=BASE_TYPES[0x85], # sint32 - def_num=1, - units='semicircles', + 13: Field( + name='avg_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=13, + scale=1000, + units=u'm/s', ), - 2: Field( - name='position_long', - type=BASE_TYPES[0x85], # sint32 - def_num=2, - units='semicircles', + 14: Field( + name='max_speed', + type=BASE_TYPES[0x84], # uint16 + def_num=14, + scale=1000, + units=u'm/s', ), - 3: Field( - name='enhanced_altitude', - type=BASE_TYPES[0x86], # uint32 - def_num=3, - scale=5, - offset=500, - units='m', + 15: Field( + name='avg_heart_rate', + type=BASE_TYPES[0x02], # uint8 + def_num=15, + units=u'bpm', ), - 4: Field( - name='enhanced_speed', - type=BASE_TYPES[0x86], # uint32 - def_num=4, - scale=1000, - units='m/s', + 16: Field( + name='max_heart_rate', + type=BASE_TYPES[0x02], # uint8 + def_num=16, + units=u'bpm', ), - 5: Field( - name='heading', + 17: Field( # total_cycles / total_timer_time if non_zero_avg_cadence otherwise total_cycles / total_elapsed_time + name='avg_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=17, + units=u'rpm', + ), + 18: Field( + name='max_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=18, + units=u'rpm', + ), + 19: Field( # total_power / total_timer_time if non_zero_avg_power otherwise total_power / total_elapsed_time + name='avg_power', type=BASE_TYPES[0x84], # uint16 - def_num=5, - scale=100, - units='degrees', + def_num=19, + units=u'watts', ), - 6: Field( # Used to correlate UTC to system time if the timestamp of the message is in system time. This UTC time is derived from the GPS data. - name='utc_timestamp', - type=FIELD_TYPES['date_time'], - def_num=6, - units='s', + 20: Field( + name='max_power', + type=BASE_TYPES[0x84], # uint16 + def_num=20, + units=u'watts', ), - 7: Field( # velocity[0] is lon velocity. Velocity[1] is lat velocity. Velocity[2] is altitude velocity. - name='velocity', - type=BASE_TYPES[0x83], # sint16 - def_num=7, - scale=100, - units='m/s', + 21: Field( + name='total_ascent', + type=BASE_TYPES[0x84], # uint16 + def_num=21, + units=u'm', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp. - }, - ), - 161: MessageType( - name='camera_event', - mesg_num=161, - fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', + 22: Field( + name='total_descent', type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + def_num=22, + units=u'm', ), - 1: Field( - name='camera_event_type', - type=FIELD_TYPES['camera_event_type'], - def_num=1, + 23: Field( + name='sport', + type=FIELD_TYPES['sport'], + def_num=23, ), - 2: Field( - name='camera_file_uuid', - type=BASE_TYPES[0x07], # string - def_num=2, + 24: Field( + name='event_group', + type=BASE_TYPES[0x02], # uint8 + def_num=24, ), - 3: Field( - name='camera_orientation', - type=FIELD_TYPES['camera_orientation_type'], - def_num=3, + 25: Field( # North east corner latitude. + name='nec_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=25, + units=u'semicircles', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp. - }, - ), - 162: MessageType( - name='timestamp_correlation', - mesg_num=162, - fields={ - 0: Field( # Fractional part of the UTC timestamp at the time the system timestamp was recorded. - name='fractional_timestamp', - type=BASE_TYPES[0x84], # uint16 - def_num=0, - scale=32768, - units='s', + 26: Field( # North east corner longitude. + name='nec_long', + type=BASE_TYPES[0x85], # sint32 + def_num=26, + units=u'semicircles', ), - 1: Field( # Whole second part of the system timestamp - name='system_timestamp', - type=FIELD_TYPES['date_time'], - def_num=1, - units='s', + 27: Field( # South west corner latitude. + name='swc_lat', + type=BASE_TYPES[0x85], # sint32 + def_num=27, + units=u'semicircles', ), - 2: Field( # Fractional part of the system timestamp - name='fractional_system_timestamp', + 28: Field( # South west corner latitude. + name='swc_long', + type=BASE_TYPES[0x85], # sint32 + def_num=28, + units=u'semicircles', + ), + 29: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=29, + ), + 30: Field( + name='normalized_power', type=BASE_TYPES[0x84], # uint16 - def_num=2, - scale=32768, - units='s', + def_num=30, + units=u'watts', ), - 3: Field( # timestamp epoch expressed in local time used to convert timestamps to local time - name='local_timestamp', - type=FIELD_TYPES['local_date_time'], - def_num=3, - units='s', + 31: Field( + name='left_right_balance', + type=FIELD_TYPES['left_right_balance_100'], + def_num=31, ), - 4: Field( # Millisecond part of the UTC timestamp at the time the system timestamp was recorded. - name='timestamp_ms', + 32: Field( + name='sub_sport', + type=FIELD_TYPES['sub_sport'], + def_num=32, + ), + 33: Field( + name='total_work', + type=BASE_TYPES[0x86], # uint32 + def_num=33, + units=u'J', + ), + 34: Field( + name='avg_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=4, - units='ms', + def_num=34, + scale=5, + offset=500, + units=u'm', ), - 5: Field( # Millisecond part of the system timestamp - name='system_timestamp_ms', + 35: Field( + name='max_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=5, - units='ms', + def_num=35, + scale=5, + offset=500, + units=u'm', + ), + 36: Field( + name='gps_accuracy', + type=BASE_TYPES[0x02], # uint8 + def_num=36, + units=u'm', + ), + 37: Field( + name='avg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=37, + scale=100, + units=u'%', + ), + 38: Field( + name='avg_pos_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=38, + scale=100, + units=u'%', + ), + 39: Field( + name='avg_neg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=39, + scale=100, + units=u'%', + ), + 40: Field( + name='max_pos_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=40, + scale=100, + units=u'%', + ), + 41: Field( + name='max_neg_grade', + type=BASE_TYPES[0x83], # sint16 + def_num=41, + scale=100, + units=u'%', + ), + 42: Field( + name='avg_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=42, + units=u'C', + ), + 43: Field( + name='max_temperature', + type=BASE_TYPES[0x01], # sint8 + def_num=43, + units=u'C', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of UTC timestamp at the time the system timestamp was recorded. - }, - ), - 164: MessageType( - name='gyroscope_data', - mesg_num=164, - fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', - type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + 44: Field( + name='total_moving_time', + type=BASE_TYPES[0x86], # uint32 + def_num=44, + scale=1000, + units=u's', ), - 1: Field( # Each time in the array describes the time at which the gyro sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in gyro_x and gyro_y and gyro_z - name='sample_time_offset', - type=BASE_TYPES[0x84], # uint16 - def_num=1, - units='ms', + 45: Field( + name='avg_pos_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=45, + scale=1000, + units=u'm/s', ), - 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='gyro_x', - type=BASE_TYPES[0x84], # uint16 - def_num=2, - units='counts', + 46: Field( + name='avg_neg_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=46, + scale=1000, + units=u'm/s', ), - 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='gyro_y', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - units='counts', + 47: Field( + name='max_pos_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=47, + scale=1000, + units=u'm/s', ), - 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='gyro_z', - type=BASE_TYPES[0x84], # uint16 - def_num=4, - units='counts', + 48: Field( + name='max_neg_vertical_speed', + type=BASE_TYPES[0x83], # sint16 + def_num=48, + scale=1000, + units=u'm/s', ), - 5: Field( # Calibrated gyro reading - name='calibrated_gyro_x', - type=BASE_TYPES[0x88], # float32 - def_num=5, - units='deg/s', + 49: Field( + name='time_in_hr_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=49, + scale=1000, + units=u's', ), - 6: Field( # Calibrated gyro reading - name='calibrated_gyro_y', - type=BASE_TYPES[0x88], # float32 - def_num=6, - units='deg/s', + 50: Field( + name='time_in_speed_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=50, + scale=1000, + units=u's', ), - 7: Field( # Calibrated gyro reading - name='calibrated_gyro_z', - type=BASE_TYPES[0x88], # float32 - def_num=7, - units='deg/s', + 51: Field( + name='time_in_cadence_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=51, + scale=1000, + units=u's', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp - }, - ), - 165: MessageType( - name='accelerometer_data', - mesg_num=165, - fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', - type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + 52: Field( + name='time_in_power_zone', + type=BASE_TYPES[0x86], # uint32 + def_num=52, + scale=1000, + units=u's', ), - 1: Field( # Each time in the array describes the time at which the accelerometer sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in accel_x and accel_y and accel_z - name='sample_time_offset', + 53: Field( + name='repetition_num', type=BASE_TYPES[0x84], # uint16 - def_num=1, - units='ms', + def_num=53, ), - 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='accel_x', + 54: Field( + name='min_altitude', type=BASE_TYPES[0x84], # uint16 - def_num=2, - units='counts', + def_num=54, + scale=5, + offset=500, + units=u'm', ), - 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='accel_y', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - units='counts', + 55: Field( + name='min_heart_rate', + type=BASE_TYPES[0x02], # uint8 + def_num=55, + units=u'bpm', ), - 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='accel_z', - type=BASE_TYPES[0x84], # uint16 - def_num=4, - units='counts', + 56: Field( + name='active_time', + type=BASE_TYPES[0x86], # uint32 + def_num=56, + scale=1000, + units=u's', ), - 5: Field( # Calibrated accel reading - name='calibrated_accel_x', - type=BASE_TYPES[0x88], # float32 - def_num=5, - units='g', + 57: Field( + name='wkt_step_index', + type=FIELD_TYPES['message_index'], + def_num=57, ), - 6: Field( # Calibrated accel reading - name='calibrated_accel_y', - type=BASE_TYPES[0x88], # float32 - def_num=6, - units='g', + 58: Field( + name='sport_event', + type=FIELD_TYPES['sport_event'], + def_num=58, ), - 7: Field( # Calibrated accel reading - name='calibrated_accel_z', - type=BASE_TYPES[0x88], # float32 - def_num=7, - units='g', + 59: Field( + name='avg_left_torque_effectiveness', + type=BASE_TYPES[0x02], # uint8 + def_num=59, + scale=2, + units=u'percent', ), - 8: Field( # Calibrated accel reading - name='compressed_calibrated_accel_x', - type=BASE_TYPES[0x83], # sint16 - def_num=8, - units='mG', + 60: Field( + name='avg_right_torque_effectiveness', + type=BASE_TYPES[0x02], # uint8 + def_num=60, + scale=2, + units=u'percent', ), - 9: Field( # Calibrated accel reading - name='compressed_calibrated_accel_y', - type=BASE_TYPES[0x83], # sint16 - def_num=9, - units='mG', + 61: Field( + name='avg_left_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=61, + scale=2, + units=u'percent', ), - 10: Field( # Calibrated accel reading - name='compressed_calibrated_accel_z', - type=BASE_TYPES[0x83], # sint16 - def_num=10, - units='mG', + 62: Field( + name='avg_right_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=62, + scale=2, + units=u'percent', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp - }, - ), - 167: MessageType( - name='three_d_sensor_calibration', - mesg_num=167, - fields={ - 0: Field( # Indicates which sensor the calibration is for - name='sensor_type', - type=FIELD_TYPES['sensor_type'], - def_num=0, + 63: Field( + name='avg_combined_pedal_smoothness', + type=BASE_TYPES[0x02], # uint8 + def_num=63, + scale=2, + units=u'percent', ), - 1: Field( # Calibration factor used to convert from raw ADC value to degrees, g, etc. - name='calibration_factor', - type=BASE_TYPES[0x86], # uint32 - def_num=1, - subfields=( - SubField( # Accelerometer calibration factor - name='accel_cal_factor', - def_num=1, - type=BASE_TYPES[0x86], # uint32 - units='g', - ref_fields=( - ReferenceField( - name='sensor_type', - def_num=0, - value='accelerometer', - raw_value=0, - ), - ), - ), - SubField( # Gyro calibration factor - name='gyro_cal_factor', - def_num=1, - type=BASE_TYPES[0x86], # uint32 - units='deg/s', - ref_fields=( - ReferenceField( - name='sensor_type', - def_num=0, - value='gyroscope', - raw_value=1, - ), - ), - ), - ), + 64: Field( + name='status', + type=FIELD_TYPES['segment_lap_status'], + def_num=64, ), - 2: Field( # Calibration factor divisor - name='calibration_divisor', - type=BASE_TYPES[0x86], # uint32 - def_num=2, - units='counts', + 65: Field( + name='uuid', + type=BASE_TYPES[0x07], # string + def_num=65, ), - 3: Field( # Level shift value used to shift the ADC value back into range - name='level_shift', - type=BASE_TYPES[0x86], # uint32 - def_num=3, + 66: Field( # fractional part of the avg_cadence + name='avg_fractional_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=66, + scale=128, + units=u'rpm', ), - 4: Field( # Internal calibration factors, one for each: xy, yx, zx - name='offset_cal', - type=BASE_TYPES[0x85], # sint32 - def_num=4, + 67: Field( # fractional part of the max_cadence + name='max_fractional_cadence', + type=BASE_TYPES[0x02], # uint8 + def_num=67, + scale=128, + units=u'rpm', ), - 5: Field( # 3 x 3 rotation matrix (row major) - name='orientation_matrix', - type=BASE_TYPES[0x85], # sint32 - def_num=5, - scale=65535, + 68: Field( # fractional part of the total_cycles + name='total_fractional_cycles', + type=BASE_TYPES[0x02], # uint8 + def_num=68, + scale=128, + units=u'cycles', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp - }, - ), - 169: MessageType( - name='video_frame', - mesg_num=169, - fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', + 69: Field( + name='front_gear_shift_count', type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + def_num=69, ), - 1: Field( # Number of the frame that the timestamp and timestamp_ms correlate to - name='frame_number', + 70: Field( + name='rear_gear_shift_count', + type=BASE_TYPES[0x84], # uint16 + def_num=70, + ), + 71: Field( # Total time spent in the standing position + name='time_standing', type=BASE_TYPES[0x86], # uint32 - def_num=1, + def_num=71, + scale=1000, + units=u's', ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp - }, - ), - 174: MessageType( - name='obdii_data', - mesg_num=174, - fields={ - 0: Field( # Fractional part of timestamp, added to timestamp - name='timestamp_ms', + 72: Field( # Number of transitions to the standing state + name='stand_count', type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + def_num=72, ), - 1: Field( # Offset of PID reading [i] from start_timestamp+start_timestamp_ms. Readings may span accross seconds. - name='time_offset', - type=BASE_TYPES[0x84], # uint16 - def_num=1, - units='ms', + 73: Field( # Average left platform center offset + name='avg_left_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=73, + units=u'mm', ), - 2: Field( # Parameter ID - name='pid', - type=BASE_TYPES[0x0D], # byte - def_num=2, + 74: Field( # Average right platform center offset + name='avg_right_pco', + type=BASE_TYPES[0x01], # sint8 + def_num=74, + units=u'mm', ), - 3: Field( # Raw parameter data - name='raw_data', - type=BASE_TYPES[0x0D], # byte - def_num=3, + 75: Field( # Average left power phase angles. Data value indexes defined by power_phase_type. + name='avg_left_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=75, + scale=0.7111111, + units=u'degrees', ), - 4: Field( # Optional, data size of PID[i]. If not specified refer to SAE J1979. - name='pid_data_size', + 76: Field( # Average left power phase peak angles. Data value indexes defined by power_phase_type. + name='avg_left_power_phase_peak', type=BASE_TYPES[0x02], # uint8 - def_num=4, + def_num=76, + scale=0.7111111, + units=u'degrees', ), - 5: Field( # System time associated with sample expressed in ms, can be used instead of time_offset. There will be a system_time value for each raw_data element. For multibyte pids the system_time is repeated. - name='system_time', - type=BASE_TYPES[0x86], # uint32 - def_num=5, + 77: Field( # Average right power phase angles. Data value indexes defined by power_phase_type. + name='avg_right_power_phase', + type=BASE_TYPES[0x02], # uint8 + def_num=77, + scale=0.7111111, + units=u'degrees', ), - 6: Field( # Timestamp of first sample recorded in the message. Used with time_offset to generate time of each sample - name='start_timestamp', - type=FIELD_TYPES['date_time'], - def_num=6, + 78: Field( # Average right power phase peak angles. Data value indexes defined by power_phase_type. + name='avg_right_power_phase_peak', + type=BASE_TYPES[0x02], # uint8 + def_num=78, + scale=0.7111111, + units=u'degrees', ), - 7: Field( # Fractional part of start_timestamp - name='start_timestamp_ms', + 79: Field( # Average power by position. Data value indexes defined by rider_position_type. + name='avg_power_position', type=BASE_TYPES[0x84], # uint16 - def_num=7, - units='ms', + def_num=79, + units=u'watts', ), - 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output - }, - ), - 177: MessageType( - name='nmea_sentence', - mesg_num=177, - fields={ - 0: Field( # Fractional part of timestamp, added to timestamp - name='timestamp_ms', + 80: Field( # Maximum power by position. Data value indexes defined by rider_position_type. + name='max_power_position', type=BASE_TYPES[0x84], # uint16 - def_num=0, - units='ms', + def_num=80, + units=u'watts', ), - 1: Field( # NMEA sentence - name='sentence', - type=BASE_TYPES[0x07], # string - def_num=1, + 81: Field( # Average cadence by position. Data value indexes defined by rider_position_type. + name='avg_cadence_position', + type=BASE_TYPES[0x02], # uint8 + def_num=81, + units=u'rpm', + ), + 82: Field( # Maximum cadence by position. Data value indexes defined by rider_position_type. + name='max_cadence_position', + type=BASE_TYPES[0x02], # uint8 + def_num=82, + units=u'rpm', + ), + 83: Field( # Manufacturer that produced the segment + name='manufacturer', + type=FIELD_TYPES['manufacturer'], + def_num=83, + ), + 253: FIELD_TYPE_TIMESTAMP, # Lap end time. + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output }, ), - 178: MessageType( - name='aviation_attitude', - mesg_num=178, + 148: MessageType( # Unique Identification data for a segment file + name='segment_id', + mesg_num=148, fields={ - 0: Field( # Fractional part of timestamp, added to timestamp - name='timestamp_ms', - type=BASE_TYPES[0x84], # uint16 + 0: Field( # Friendly name assigned to segment + name='name', + type=BASE_TYPES[0x07], # string def_num=0, - units='ms', ), - 1: Field( # System time associated with sample expressed in ms. - name='system_time', - type=BASE_TYPES[0x86], # uint32 + 1: Field( # UUID of the segment + name='uuid', + type=BASE_TYPES[0x07], # string def_num=1, - units='ms', ), - 2: Field( # Range -PI/2 to +PI/2 - name='pitch', - type=BASE_TYPES[0x83], # sint16 + 2: Field( # Sport associated with the segment + name='sport', + type=FIELD_TYPES['sport'], def_num=2, - scale=10430.38, - units='radians', ), - 3: Field( # Range -PI to +PI - name='roll', - type=BASE_TYPES[0x83], # sint16 + 3: Field( # Segment enabled for evaluation + name='enabled', + type=FIELD_TYPES['bool'], def_num=3, - scale=10430.38, - units='radians', ), - 4: Field( # Range -78.4 to +78.4 (-8 Gs to 8 Gs) - name='accel_lateral', - type=BASE_TYPES[0x83], # sint16 + 4: Field( # Primary key of the user that created the segment + name='user_profile_primary_key', + type=BASE_TYPES[0x86], # uint32 def_num=4, - scale=100, - units='m/s^2', ), - 5: Field( # Range -78.4 to +78.4 (-8 Gs to 8 Gs) - name='accel_normal', - type=BASE_TYPES[0x83], # sint16 + 5: Field( # ID of the device that created the segment + name='device_id', + type=BASE_TYPES[0x86], # uint32 def_num=5, - scale=100, - units='m/s^2', ), - 6: Field( # Range -8.727 to +8.727 (-500 degs/sec to +500 degs/sec) - name='turn_rate', - type=BASE_TYPES[0x83], # sint16 + 6: Field( # Index for the Leader Board entry selected as the default race participant + name='default_race_leader', + type=BASE_TYPES[0x02], # uint8 def_num=6, - scale=1024, - units='radians/second', ), - 7: Field( - name='stage', - type=FIELD_TYPES['attitude_stage'], + 7: Field( # Indicates if any segments should be deleted + name='delete_status', + type=FIELD_TYPES['segment_delete_status'], def_num=7, ), - 8: Field( # The percent complete of the current attitude stage. Set to 0 for attitude stages 0, 1 and 2 and to 100 for attitude stage 3 by AHRS modules that do not support it. Range - 100 - name='attitude_stage_complete', - type=BASE_TYPES[0x02], # uint8 + 8: Field( # Indicates how the segment was selected to be sent to the device + name='selection_type', + type=FIELD_TYPES['segment_selection_type'], def_num=8, - units='%', ), - 9: Field( # Track Angle/Heading Range 0 - 2pi - name='track', - type=BASE_TYPES[0x84], # uint16 - def_num=9, - scale=10430.38, - units='radians', - ), - 10: Field( - name='validity', - type=FIELD_TYPES['attitude_validity'], - def_num=10, - ), - 253: FIELD_TYPE_TIMESTAMP, # Timestamp message was output }, ), - 184: MessageType( - name='video', - mesg_num=184, + 149: MessageType( # Unique Identification data for an individual segment leader within a segment file + name='segment_leaderboard_entry', + mesg_num=149, fields={ - 0: Field( - name='url', - type=BASE_TYPES[0x07], # string - def_num=0, - ), - 1: Field( - name='hosting_provider', + 0: Field( # Friendly name assigned to leader + name='name', type=BASE_TYPES[0x07], # string - def_num=1, - ), - 2: Field( # Playback time of video - name='duration', - type=BASE_TYPES[0x86], # uint32 - def_num=2, - units='ms', - ), - }, - ), - 185: MessageType( - name='video_title', - mesg_num=185, - fields={ - 0: Field( # Total number of title parts - name='message_count', - type=BASE_TYPES[0x84], # uint16 def_num=0, ), - 1: Field( - name='text', - type=BASE_TYPES[0x07], # string + 1: Field( # Leader classification + name='type', + type=FIELD_TYPES['segment_leaderboard_type'], def_num=1, ), - 254: Field( # Long titles will be split into multiple parts - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 2: Field( # Primary user ID of this leader + name='group_primary_key', + type=BASE_TYPES[0x86], # uint32 + def_num=2, ), - }, - ), - 186: MessageType( - name='video_description', - mesg_num=186, - fields={ - 0: Field( # Total number of description parts - name='message_count', - type=BASE_TYPES[0x84], # uint16 - def_num=0, + 3: Field( # ID of the activity associated with this leader time + name='activity_id', + type=BASE_TYPES[0x86], # uint32 + def_num=3, ), - 1: Field( - name='text', + 4: Field( # Segment Time (includes pauses) + name='segment_time', + type=BASE_TYPES[0x86], # uint32 + def_num=4, + scale=1000, + units=u's', + ), + 5: Field( # String version of the activity_id. 21 characters long, express in decimal + name='activity_id_string', type=BASE_TYPES[0x07], # string - def_num=1, + def_num=5, ), - 254: Field( # Long descriptions will be split into multiple parts + 254: Field( name='message_index', type=FIELD_TYPES['message_index'], def_num=254, ), }, ), - 187: MessageType( - name='video_clip', - mesg_num=187, + 150: MessageType( # Navigation and race evaluation point for a segment decribing a point along the segment path and time it took each segment leader to reach that point + name='segment_point', + mesg_num=150, fields={ - 0: Field( - name='clip_number', - type=BASE_TYPES[0x84], # uint16 - def_num=0, - ), 1: Field( - name='start_timestamp', - type=FIELD_TYPES['date_time'], + name='position_lat', + type=BASE_TYPES[0x85], # sint32 def_num=1, + units=u'semicircles', ), 2: Field( - name='start_timestamp_ms', - type=BASE_TYPES[0x84], # uint16 + name='position_long', + type=BASE_TYPES[0x85], # sint32 def_num=2, + units=u'semicircles', ), - 3: Field( - name='end_timestamp', - type=FIELD_TYPES['date_time'], + 3: Field( # Accumulated distance along the segment at the described point + name='distance', + type=BASE_TYPES[0x86], # uint32 def_num=3, + scale=100, + units=u'm', ), - 4: Field( - name='end_timestamp_ms', + 4: Field( # Accumulated altitude along the segment at the described point + name='altitude', type=BASE_TYPES[0x84], # uint16 def_num=4, + scale=5, + offset=500, + units=u'm', ), - 6: Field( # Start of clip in video time - name='clip_start', + 5: Field( # Accumualted time each leader board member required to reach the described point. This value is zero for all leader board members at the starting point of the segment. + name='leader_time', type=BASE_TYPES[0x86], # uint32 - def_num=6, - units='ms', + def_num=5, + scale=1000, + units=u's', ), - 7: Field( # End of clip in video time - name='clip_end', - type=BASE_TYPES[0x86], # uint32 - def_num=7, - units='ms', + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, ), - 188: MessageType( - name='ohr_settings', - mesg_num=188, + + + ####################### Segment List File Messages ####################### + 151: MessageType( # Summary of the unique segment and leaderboard information associated with a segment file. This message is used to compile a segment list file describing all segment files on a device. The segment list file is used when refreshing the contents of a segment file with the latest available leaderboard information. + name='segment_file', + mesg_num=151, fields={ - 0: Field( + 1: Field( # UUID of the segment file + name='file_uuid', + type=BASE_TYPES[0x07], # string + def_num=1, + ), + 3: Field( # Enabled state of the segment file name='enabled', - type=FIELD_TYPES['switch'], - def_num=0, + type=FIELD_TYPES['bool'], + def_num=3, ), - }, - ), - 200: MessageType( - name='exd_screen_configuration', - mesg_num=200, - fields={ - 0: Field( - name='screen_index', - type=BASE_TYPES[0x02], # uint8 - def_num=0, + 4: Field( # Primary key of the user that created the segment file + name='user_profile_primary_key', + type=BASE_TYPES[0x86], # uint32 + def_num=4, ), - 1: Field( # number of fields in screen - name='field_count', - type=BASE_TYPES[0x02], # uint8 - def_num=1, + 7: Field( # Leader type of each leader in the segment file + name='leader_type', + type=FIELD_TYPES['segment_leaderboard_type'], + def_num=7, ), - 2: Field( - name='layout', - type=FIELD_TYPES['exd_layout'], - def_num=2, + 8: Field( # Group primary key of each leader in the segment file + name='leader_group_primary_key', + type=BASE_TYPES[0x86], # uint32 + def_num=8, ), - 3: Field( - name='screen_enabled', - type=FIELD_TYPES['bool'], - def_num=3, + 9: Field( # Activity ID of each leader in the segment file + name='leader_activity_id', + type=BASE_TYPES[0x86], # uint32 + def_num=9, + ), + 10: Field( # String version of the activity ID of each leader in the segment file. 21 characters long for each ID, express in decimal + name='leader_activity_id_string', + type=BASE_TYPES[0x07], # string + def_num=10, + ), + 11: Field( # Index for the Leader Board entry selected as the default race participant + name='default_race_leader', + type=BASE_TYPES[0x02], # uint8 + def_num=11, + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, ), - 201: MessageType( - name='exd_data_field_configuration', - mesg_num=201, + + + ######################### Settings File Messages ######################### + 2: MessageType( + name='device_settings', + mesg_num=2, fields={ - 0: Field( - name='screen_index', + 0: Field( # Index into time zone arrays. + name='active_time_zone', type=BASE_TYPES[0x02], # uint8 def_num=0, ), - 1: Field( - name='concept_field', - type=BASE_TYPES[0x0D], # byte + 1: Field( # Offset from system time. Required to convert timestamp from system time to UTC. + name='utc_offset', + type=BASE_TYPES[0x86], # uint32 def_num=1, - components=( - ComponentField( - name='field_id', - def_num=2, - accumulate=False, - bits=4, - bit_offset=0, - ), - ComponentField( - name='concept_count', - def_num=3, - accumulate=False, - bits=4, - bit_offset=4, - ), - ), ), - 2: Field( - name='field_id', - type=BASE_TYPES[0x02], # uint8 + 2: Field( # Offset from system time. + name='time_offset', + type=BASE_TYPES[0x86], # uint32 def_num=2, + units=u's', ), - 3: Field( - name='concept_count', - type=BASE_TYPES[0x02], # uint8 - def_num=3, - ), - 4: Field( - name='display_type', - type=FIELD_TYPES['exd_display_type'], + 4: Field( # Display mode for the time + name='time_mode', + type=FIELD_TYPES['time_mode'], def_num=4, ), - 5: Field( - name='title', - type=BASE_TYPES[0x07], # string + 5: Field( # timezone offset in 1/4 hour increments + name='time_zone_offset', + type=BASE_TYPES[0x01], # sint8 def_num=5, + scale=4, + units=u'hr', ), - }, - ), - 202: MessageType( - name='exd_data_concept_configuration', - mesg_num=202, - fields={ - 0: Field( - name='screen_index', - type=BASE_TYPES[0x02], # uint8 - def_num=0, + 12: Field( # Mode for backlight + name='backlight_mode', + type=FIELD_TYPES['backlight_mode'], + def_num=12, ), - 1: Field( - name='concept_field', - type=BASE_TYPES[0x0D], # byte - def_num=1, - components=( - ComponentField( - name='field_id', - def_num=2, - accumulate=False, - bits=4, - bit_offset=0, - ), - ComponentField( - name='concept_index', - def_num=3, - accumulate=False, - bits=4, - bit_offset=4, - ), - ), + 36: Field( # Enabled state of the activity tracker functionality + name='activity_tracker_enabled', + type=FIELD_TYPES['bool'], + def_num=36, + ), + 39: Field( # UTC timestamp used to set the devices clock and date + name='clock_time', + type=FIELD_TYPES['date_time'], + def_num=39, ), - 2: Field( - name='field_id', - type=BASE_TYPES[0x02], # uint8 - def_num=2, + 40: Field( # Bitfield to configure enabled screens for each supported loop + name='pages_enabled', + type=BASE_TYPES[0x84], # uint16 + def_num=40, ), - 3: Field( - name='concept_index', - type=BASE_TYPES[0x02], # uint8 - def_num=3, + 46: Field( # Enabled state of the move alert + name='move_alert_enabled', + type=FIELD_TYPES['bool'], + def_num=46, ), - 4: Field( - name='data_page', - type=BASE_TYPES[0x02], # uint8 - def_num=4, + 47: Field( # Display mode for the date + name='date_mode', + type=FIELD_TYPES['date_mode'], + def_num=47, ), - 5: Field( - name='concept_key', - type=BASE_TYPES[0x02], # uint8 - def_num=5, + 55: Field( + name='display_orientation', + type=FIELD_TYPES['display_orientation'], + def_num=55, ), - 6: Field( - name='scaling', - type=BASE_TYPES[0x02], # uint8 - def_num=6, + 56: Field( + name='mounting_side', + type=FIELD_TYPES['side'], + def_num=56, ), - 8: Field( - name='data_units', - type=FIELD_TYPES['exd_data_units'], - def_num=8, + 57: Field( # Bitfield to indicate one page as default for each supported loop + name='default_page', + type=BASE_TYPES[0x84], # uint16 + def_num=57, ), - 9: Field( - name='qualifier', - type=FIELD_TYPES['exd_qualifiers'], - def_num=9, + 58: Field( # Minimum steps before an autosync can occur + name='autosync_min_steps', + type=BASE_TYPES[0x84], # uint16 + def_num=58, + units=u'steps', ), - 10: Field( - name='descriptor', - type=FIELD_TYPES['exd_descriptors'], - def_num=10, + 59: Field( # Minimum minutes before an autosync can occur + name='autosync_min_time', + type=BASE_TYPES[0x84], # uint16 + def_num=59, + units=u'minutes', ), - 11: Field( - name='is_signed', + 80: Field( # Enable auto-detect setting for the lactate threshold feature. + name='lactate_threshold_autodetect_enabled', type=FIELD_TYPES['bool'], - def_num=11, + def_num=80, + ), + 86: Field( # Automatically upload using BLE + name='ble_auto_upload_enabled', + type=FIELD_TYPES['bool'], + def_num=86, + ), + 89: Field( # Helps to conserve battery by changing modes + name='auto_sync_frequency', + type=FIELD_TYPES['auto_sync_frequency'], + def_num=89, + ), + 90: Field( # Allows setting specific activities auto-activity detect enabled/disabled settings + name='auto_activity_detect', + type=FIELD_TYPES['auto_activity_detect'], + def_num=90, + ), + 94: Field( # Number of screens configured to display + name='number_of_screens', + type=BASE_TYPES[0x02], # uint8 + def_num=94, + ), + 95: Field( # Smart Notification display orientation + name='smart_notification_display_orientation', + type=FIELD_TYPES['display_orientation'], + def_num=95, ), }, ), - 206: MessageType( # Must be logged before developer field is used - name='field_description', - mesg_num=206, + 3: MessageType( + name='user_profile', + mesg_num=3, fields={ 0: Field( - name='developer_data_index', - type=BASE_TYPES[0x02], # uint8 + name='friendly_name', + type=BASE_TYPES[0x07], # string def_num=0, ), 1: Field( - name='field_definition_number', - type=BASE_TYPES[0x02], # uint8 + name='gender', + type=FIELD_TYPES['gender'], def_num=1, ), 2: Field( - name='fit_base_type_id', - type=FIELD_TYPES['fit_base_type'], + name='age', + type=BASE_TYPES[0x02], # uint8 def_num=2, + units=u'years', ), 3: Field( - name='field_name', - type=BASE_TYPES[0x07], # string + name='height', + type=BASE_TYPES[0x02], # uint8 def_num=3, + scale=100, + units=u'm', ), 4: Field( - name='array', - type=BASE_TYPES[0x02], # uint8 + name='weight', + type=BASE_TYPES[0x84], # uint16 def_num=4, + scale=10, + units=u'kg', ), 5: Field( - name='components', - type=BASE_TYPES[0x07], # string + name='language', + type=FIELD_TYPES['language'], def_num=5, ), 6: Field( - name='scale', - type=BASE_TYPES[0x02], # uint8 + name='elev_setting', + type=FIELD_TYPES['display_measure'], def_num=6, ), 7: Field( - name='offset', - type=BASE_TYPES[0x01], # sint8 + name='weight_setting', + type=FIELD_TYPES['display_measure'], def_num=7, ), 8: Field( - name='units', - type=BASE_TYPES[0x07], # string + name='resting_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=8, + units=u'bpm', ), 9: Field( - name='bits', - type=BASE_TYPES[0x07], # string + name='default_max_running_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=9, + units=u'bpm', ), 10: Field( - name='accumulate', - type=BASE_TYPES[0x07], # string + name='default_max_biking_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=10, + units=u'bpm', + ), + 11: Field( + name='default_max_heart_rate', + type=BASE_TYPES[0x02], # uint8 + def_num=11, + units=u'bpm', + ), + 12: Field( + name='hr_setting', + type=FIELD_TYPES['display_heart'], + def_num=12, ), 13: Field( - name='fit_base_unit_id', - type=FIELD_TYPES['fit_base_unit'], + name='speed_setting', + type=FIELD_TYPES['display_measure'], def_num=13, ), 14: Field( - name='native_mesg_num', - type=FIELD_TYPES['mesg_num'], + name='dist_setting', + type=FIELD_TYPES['display_measure'], def_num=14, ), - 15: Field( - name='native_field_num', - type=BASE_TYPES[0x02], # uint8 - def_num=15, + 16: Field( + name='power_setting', + type=FIELD_TYPES['display_power'], + def_num=16, ), - }, - ), - 207: MessageType( # Must be logged before field description - name='developer_data_id', - mesg_num=207, - fields={ - 0: Field( - name='developer_id', - type=BASE_TYPES[0x0D], # byte - def_num=0, + 17: Field( + name='activity_class', + type=FIELD_TYPES['activity_class'], + def_num=17, ), - 1: Field( - name='application_id', + 18: Field( + name='position_setting', + type=FIELD_TYPES['display_position'], + def_num=18, + ), + 21: Field( + name='temperature_setting', + type=FIELD_TYPES['display_measure'], + def_num=21, + ), + 22: Field( + name='local_id', + type=FIELD_TYPES['user_local_id'], + def_num=22, + ), + 23: Field( + name='global_id', type=BASE_TYPES[0x0D], # byte - def_num=1, + def_num=23, ), - 2: Field( - name='manufacturer_id', - type=FIELD_TYPES['manufacturer'], - def_num=2, + 28: Field( # Typical wake time + name='wake_time', + type=FIELD_TYPES['localtime_into_day'], + def_num=28, ), - 3: Field( - name='developer_data_index', - type=BASE_TYPES[0x02], # uint8 - def_num=3, + 29: Field( # Typical bed time + name='sleep_time', + type=FIELD_TYPES['localtime_into_day'], + def_num=29, ), - 4: Field( - name='application_version', - type=BASE_TYPES[0x86], # uint32 - def_num=4, + 30: Field( + name='height_setting', + type=FIELD_TYPES['display_measure'], + def_num=30, + ), + 31: Field( # User defined running step length set to 0 for auto length + name='user_running_step_length', + type=BASE_TYPES[0x84], # uint16 + def_num=31, + scale=1000, + units=u'm', + ), + 32: Field( # User defined walking step length set to 0 for auto length + name='user_walking_step_length', + type=BASE_TYPES[0x84], # uint16 + def_num=32, + scale=1000, + units=u'm', + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, - ), - 208: MessageType( - name='magnetometer_data', - mesg_num=208, + ), + 4: MessageType( + name='hrm_profile', + mesg_num=4, fields={ - 0: Field( # Millisecond part of the timestamp. - name='timestamp_ms', - type=BASE_TYPES[0x84], # uint16 + 0: Field( + name='enabled', + type=FIELD_TYPES['bool'], def_num=0, - units='ms', ), - 1: Field( # Each time in the array describes the time at which the compass sample with the corrosponding index was taken. Limited to 30 samples in each message. The samples may span across seconds. Array size must match the number of samples in cmps_x and cmps_y and cmps_z - name='sample_time_offset', - type=BASE_TYPES[0x84], # uint16 + 1: Field( + name='hrm_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=1, - units='ms', ), - 2: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='mag_x', - type=BASE_TYPES[0x84], # uint16 + 2: Field( + name='log_hrv', + type=FIELD_TYPES['bool'], def_num=2, - units='counts', ), - 3: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='mag_y', - type=BASE_TYPES[0x84], # uint16 + 3: Field( + name='hrm_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z def_num=3, - units='counts', - ), - 4: Field( # These are the raw ADC reading. Maximum number of samples is 30 in each message. The samples may span across seconds. A conversion will need to be done on this data once read. - name='mag_z', - type=BASE_TYPES[0x84], # uint16 - def_num=4, - units='counts', - ), - 5: Field( # Calibrated Magnetometer reading - name='calibrated_mag_x', - type=BASE_TYPES[0x88], # float32 - def_num=5, - units='G', - ), - 6: Field( # Calibrated Magnetometer reading - name='calibrated_mag_y', - type=BASE_TYPES[0x88], # float32 - def_num=6, - units='G', ), - 7: Field( # Calibrated Magnetometer reading - name='calibrated_mag_z', - type=BASE_TYPES[0x88], # float32 - def_num=7, - units='G', + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 253: FIELD_TYPE_TIMESTAMP, # Whole second part of the timestamp }, ), - - - ######################### Activity File Messages ######################### - 34: MessageType( - name='activity', - mesg_num=34, + 5: MessageType( + name='sdm_profile', + mesg_num=5, fields={ - 0: Field( # Exclude pauses - name='total_timer_time', - type=BASE_TYPES[0x86], # uint32 + 0: Field( + name='enabled', + type=FIELD_TYPES['bool'], def_num=0, - scale=1000, - units='s', ), 1: Field( - name='num_sessions', - type=BASE_TYPES[0x84], # uint16 + name='sdm_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=1, ), 2: Field( - name='type', - type=FIELD_TYPES['activity'], + name='sdm_cal_factor', + type=BASE_TYPES[0x84], # uint16 def_num=2, + scale=10, + units=u'%', ), 3: Field( - name='event', - type=FIELD_TYPES['event'], + name='odometer', + type=BASE_TYPES[0x86], # uint32 def_num=3, + scale=100, + units=u'm', ), - 4: Field( - name='event_type', - type=FIELD_TYPES['event_type'], + 4: Field( # Use footpod for speed source instead of GPS + name='speed_source', + type=FIELD_TYPES['bool'], def_num=4, ), - 5: Field( # timestamp epoch expressed in local time, used to convert activity timestamps to local time - name='local_timestamp', - type=FIELD_TYPES['local_date_time'], + 5: Field( + name='sdm_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z def_num=5, ), - 6: Field( - name='event_group', + 7: Field( # Rollover counter that can be used to extend the odometer + name='odometer_rollover', type=BASE_TYPES[0x02], # uint8 - def_num=6, + def_num=7, + ), + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 253: FIELD_TYPE_TIMESTAMP, }, ), - - - ###################### Blood Pressure File Messages ###################### - 51: MessageType( - name='blood_pressure', - mesg_num=51, + 6: MessageType( + name='bike_profile', + mesg_num=6, fields={ 0: Field( - name='systolic_pressure', - type=BASE_TYPES[0x84], # uint16 + name='name', + type=BASE_TYPES[0x07], # string def_num=0, - units='mmHg', ), 1: Field( - name='diastolic_pressure', - type=BASE_TYPES[0x84], # uint16 + name='sport', + type=FIELD_TYPES['sport'], def_num=1, - units='mmHg', ), 2: Field( - name='mean_arterial_pressure', - type=BASE_TYPES[0x84], # uint16 + name='sub_sport', + type=FIELD_TYPES['sub_sport'], def_num=2, - units='mmHg', ), 3: Field( - name='map_3_sample_mean', - type=BASE_TYPES[0x84], # uint16 + name='odometer', + type=BASE_TYPES[0x86], # uint32 def_num=3, - units='mmHg', + scale=100, + units=u'm', ), 4: Field( - name='map_morning_values', - type=BASE_TYPES[0x84], # uint16 + name='bike_spd_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=4, - units='mmHg', ), 5: Field( - name='map_evening_values', - type=BASE_TYPES[0x84], # uint16 + name='bike_cad_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=5, - units='mmHg', ), 6: Field( - name='heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='bike_spdcad_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=6, - units='bpm', ), 7: Field( - name='heart_rate_type', - type=FIELD_TYPES['hr_type'], + name='bike_power_ant_id', + type=BASE_TYPES[0x8B], # uint16z def_num=7, ), 8: Field( - name='status', - type=FIELD_TYPES['bp_status'], + name='custom_wheelsize', + type=BASE_TYPES[0x84], # uint16 def_num=8, + scale=1000, + units=u'm', ), - 9: Field( # Associates this blood pressure message to a user. This corresponds to the index of the user profile message in the blood pressure file. - name='user_profile_index', - type=FIELD_TYPES['message_index'], + 9: Field( + name='auto_wheelsize', + type=BASE_TYPES[0x84], # uint16 def_num=9, + scale=1000, + units=u'm', ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - - - ########################## Course File Messages ########################## - 31: MessageType( - name='course', - mesg_num=31, - fields={ - 4: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=4, + 10: Field( + name='bike_weight', + type=BASE_TYPES[0x84], # uint16 + def_num=10, + scale=10, + units=u'kg', + ), + 11: Field( + name='power_cal_factor', + type=BASE_TYPES[0x84], # uint16 + def_num=11, + scale=10, + units=u'%', + ), + 12: Field( + name='auto_wheel_cal', + type=FIELD_TYPES['bool'], + def_num=12, + ), + 13: Field( + name='auto_power_zero', + type=FIELD_TYPES['bool'], + def_num=13, + ), + 14: Field( + name='id', + type=BASE_TYPES[0x02], # uint8 + def_num=14, + ), + 15: Field( + name='spd_enabled', + type=FIELD_TYPES['bool'], + def_num=15, + ), + 16: Field( + name='cad_enabled', + type=FIELD_TYPES['bool'], + def_num=16, + ), + 17: Field( + name='spdcad_enabled', + type=FIELD_TYPES['bool'], + def_num=17, + ), + 18: Field( + name='power_enabled', + type=FIELD_TYPES['bool'], + def_num=18, + ), + 19: Field( + name='crank_length', + type=BASE_TYPES[0x02], # uint8 + def_num=19, + scale=2, + offset=-110, + units=u'mm', + ), + 20: Field( + name='enabled', + type=FIELD_TYPES['bool'], + def_num=20, + ), + 21: Field( + name='bike_spd_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=21, + ), + 22: Field( + name='bike_cad_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=22, + ), + 23: Field( + name='bike_spdcad_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=23, + ), + 24: Field( + name='bike_power_ant_id_trans_type', + type=BASE_TYPES[0x0A], # uint8z + def_num=24, + ), + 37: Field( # Rollover counter that can be used to extend the odometer + name='odometer_rollover', + type=BASE_TYPES[0x02], # uint8 + def_num=37, ), - 5: Field( - name='name', - type=BASE_TYPES[0x07], # string - def_num=5, + 38: Field( # Number of front gears + name='front_gear_num', + type=BASE_TYPES[0x0A], # uint8z + def_num=38, ), - 6: Field( - name='capabilities', - type=FIELD_TYPES['course_capabilities'], - def_num=6, + 39: Field( # Number of teeth on each gear 0 is innermost + name='front_gear', + type=BASE_TYPES[0x0A], # uint8z + def_num=39, ), - 7: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=7, + 40: Field( # Number of rear gears + name='rear_gear_num', + type=BASE_TYPES[0x0A], # uint8z + def_num=40, ), - }, - ), - - - ########################## Device File Messages ########################## - 35: MessageType( - name='software', - mesg_num=35, - fields={ - 3: Field( - name='version', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - scale=100, + 41: Field( # Number of teeth on each gear 0 is innermost + name='rear_gear', + type=BASE_TYPES[0x0A], # uint8z + def_num=41, ), - 5: Field( - name='part_number', - type=BASE_TYPES[0x07], # string - def_num=5, + 44: Field( + name='shimano_di2_enabled', + type=FIELD_TYPES['bool'], + def_num=44, ), 254: Field( name='message_index', @@ -9294,321 +8904,207 @@ ), }, ), - - - ########################## Goals File Messages ########################### - 15: MessageType( - name='goal', - mesg_num=15, + 127: MessageType( + name='connectivity', + mesg_num=127, fields={ - 0: Field( - name='sport', - type=FIELD_TYPES['sport'], + 0: Field( # Use Bluetooth for connectivity features + name='bluetooth_enabled', + type=FIELD_TYPES['bool'], def_num=0, ), - 1: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], + 1: Field( # Use Bluetooth Low Energy for connectivity features + name='bluetooth_le_enabled', + type=FIELD_TYPES['bool'], def_num=1, ), - 2: Field( - name='start_date', - type=FIELD_TYPES['date_time'], + 2: Field( # Use ANT for connectivity features + name='ant_enabled', + type=FIELD_TYPES['bool'], def_num=2, ), 3: Field( - name='end_date', - type=FIELD_TYPES['date_time'], + name='name', + type=BASE_TYPES[0x07], # string def_num=3, ), 4: Field( - name='type', - type=FIELD_TYPES['goal'], + name='live_tracking_enabled', + type=FIELD_TYPES['bool'], def_num=4, ), 5: Field( - name='value', - type=BASE_TYPES[0x86], # uint32 + name='weather_conditions_enabled', + type=FIELD_TYPES['bool'], def_num=5, ), 6: Field( - name='repeat', + name='weather_alerts_enabled', type=FIELD_TYPES['bool'], def_num=6, ), 7: Field( - name='target_value', - type=BASE_TYPES[0x86], # uint32 + name='auto_activity_upload_enabled', + type=FIELD_TYPES['bool'], def_num=7, ), 8: Field( - name='recurrence', - type=FIELD_TYPES['goal_recurrence'], + name='course_download_enabled', + type=FIELD_TYPES['bool'], def_num=8, ), 9: Field( - name='recurrence_value', - type=BASE_TYPES[0x84], # uint16 + name='workout_download_enabled', + type=FIELD_TYPES['bool'], def_num=9, ), 10: Field( - name='enabled', + name='gps_ephemeris_download_enabled', type=FIELD_TYPES['bool'], def_num=10, ), 11: Field( - name='source', - type=FIELD_TYPES['goal_source'], + name='incident_detection_enabled', + type=FIELD_TYPES['bool'], def_num=11, ), - 254: Field( - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=254, + 12: Field( + name='grouptrack_enabled', + type=FIELD_TYPES['bool'], + def_num=12, ), }, ), - - - ######################## Monitoring File Messages ######################## - 103: MessageType( - name='monitoring_info', - mesg_num=103, + 159: MessageType( + name='watchface_settings', + mesg_num=159, fields={ - 0: Field( # Use to convert activity timestamps to local time if device does not support time zone and daylight savings time correction. - name='local_timestamp', - type=FIELD_TYPES['local_date_time'], + 0: Field( + name='mode', + type=FIELD_TYPES['watchface_mode'], def_num=0, - units='s', ), 1: Field( - name='activity_type', - type=FIELD_TYPES['activity_type'], - def_num=1, - ), - 3: Field( # Indexed by activity_type - name='cycles_to_distance', - type=BASE_TYPES[0x84], # uint16 - def_num=3, - scale=5000, - units='m/cycle', - ), - 4: Field( # Indexed by activity_type - name='cycles_to_calories', - type=BASE_TYPES[0x84], # uint16 - def_num=4, - scale=5000, - units='kcal/cycle', - ), - 5: Field( - name='resting_metabolic_rate', - type=BASE_TYPES[0x84], # uint16 - def_num=5, - units='kcal/day', - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - - - ############################# Other Messages ############################# - 145: MessageType( - name='memo_glob', - mesg_num=145, - fields={ - 0: Field( # Block of utf8 bytes - name='memo', + name='layout', type=BASE_TYPES[0x0D], # byte - def_num=0, - ), - 1: Field( # Allows relating glob to another mesg If used only required for first part of each memo_glob - name='message_number', - type=BASE_TYPES[0x84], # uint16 - def_num=1, - ), - 2: Field( # Index of external mesg - name='message_index', - type=FIELD_TYPES['message_index'], - def_num=2, - ), - 250: Field( # Sequence number of memo blocks - name='part_index', - type=BASE_TYPES[0x86], # uint32 - def_num=250, - ), - }, - ), - - - ######################### Schedule File Messages ######################### - 28: MessageType( - name='schedule', - mesg_num=28, - fields={ - 0: Field( # Corresponds to file_id of scheduled workout / course. - name='manufacturer', - type=FIELD_TYPES['manufacturer'], - def_num=0, - ), - 1: Field( # Corresponds to file_id of scheduled workout / course. - name='product', - type=BASE_TYPES[0x84], # uint16 def_num=1, subfields=( SubField( - name='garmin_product', + name='analog_layout', def_num=1, - type=FIELD_TYPES['garmin_product'], + type=FIELD_TYPES['analog_watchface_layout'], ref_fields=( ReferenceField( - name='manufacturer', + name='mode', def_num=0, - value='garmin', + value='analog', raw_value=1, ), + ), + ), + SubField( + name='digital_layout', + def_num=1, + type=FIELD_TYPES['digital_watchface_layout'], + ref_fields=( ReferenceField( - name='manufacturer', - def_num=0, - value='dynastream', - raw_value=15, - ), - ReferenceField( - name='manufacturer', + name='mode', def_num=0, - value='dynastream_oem', - raw_value=13, + value='digital', + raw_value=0, ), ), ), ), ), - 2: Field( # Corresponds to file_id of scheduled workout / course. - name='serial_number', - type=BASE_TYPES[0x8C], # uint32z - def_num=2, - ), - 3: Field( # Corresponds to file_id of scheduled workout / course. - name='time_created', - type=FIELD_TYPES['date_time'], - def_num=3, - ), - 4: Field( # TRUE if this activity has been started - name='completed', - type=FIELD_TYPES['bool'], - def_num=4, - ), - 5: Field( - name='type', - type=FIELD_TYPES['schedule'], - def_num=5, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 6: Field( - name='scheduled_time', - type=FIELD_TYPES['local_date_time'], - def_num=6, + }, + ), + 188: MessageType( + name='ohr_settings', + mesg_num=188, + fields={ + 0: Field( + name='enabled', + type=FIELD_TYPES['switch'], + def_num=0, ), }, ), - ######################### Segment File Messages ########################## - 148: MessageType( # Unique Identification data for a segment file - name='segment_id', - mesg_num=148, + ###################### Sport Settings File Messages ###################### + 7: MessageType( + name='zones_target', + mesg_num=7, fields={ - 0: Field( # Friendly name assigned to segment - name='name', - type=BASE_TYPES[0x07], # string - def_num=0, - ), - 1: Field( # UUID of the segment - name='uuid', - type=BASE_TYPES[0x07], # string + 1: Field( + name='max_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=1, ), - 2: Field( # Sport associated with the segment - name='sport', - type=FIELD_TYPES['sport'], + 2: Field( + name='threshold_heart_rate', + type=BASE_TYPES[0x02], # uint8 def_num=2, ), - 3: Field( # Segment enabled for evaluation - name='enabled', - type=FIELD_TYPES['bool'], + 3: Field( + name='functional_threshold_power', + type=BASE_TYPES[0x84], # uint16 def_num=3, ), - 4: Field( # Primary key of the user that created the segment - name='user_profile_primary_key', - type=BASE_TYPES[0x86], # uint32 - def_num=4, - ), - 5: Field( # ID of the device that created the segment - name='device_id', - type=BASE_TYPES[0x86], # uint32 + 5: Field( + name='hr_calc_type', + type=FIELD_TYPES['hr_zone_calc'], def_num=5, ), - 6: Field( # Index for the Leader Board entry selected as the default race participant - name='default_race_leader', - type=BASE_TYPES[0x02], # uint8 - def_num=6, - ), - 7: Field( # Indicates if any segments should be deleted - name='delete_status', - type=FIELD_TYPES['segment_delete_status'], + 7: Field( + name='pwr_calc_type', + type=FIELD_TYPES['pwr_zone_calc'], def_num=7, ), - 8: Field( # Indicates how the segment was selected to be sent to the device - name='selection_type', - type=FIELD_TYPES['segment_selection_type'], - def_num=8, - ), }, ), - - - ####################### Segment List File Messages ####################### - 151: MessageType( # Summary of the unique segment and leaderboard information associated with a segment file. This message is used to compile a segment list file describing all segment files on a device. The segment list file is used when refreshing the contents of a segment file with the latest available leaderboard information. - name='segment_file', - mesg_num=151, + 8: MessageType( + name='hr_zone', + mesg_num=8, fields={ - 1: Field( # UUID of the segment file - name='file_uuid', - type=BASE_TYPES[0x07], # string + 1: Field( + name='high_bpm', + type=BASE_TYPES[0x02], # uint8 def_num=1, + units=u'bpm', ), - 3: Field( # Enabled state of the segment file - name='enabled', - type=FIELD_TYPES['bool'], - def_num=3, - ), - 4: Field( # Primary key of the user that created the segment file - name='user_profile_primary_key', - type=BASE_TYPES[0x86], # uint32 - def_num=4, - ), - 7: Field( # Leader type of each leader in the segment file - name='leader_type', - type=FIELD_TYPES['segment_leaderboard_type'], - def_num=7, + 2: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=2, ), - 8: Field( # Group primary key of each leader in the segment file - name='leader_group_primary_key', - type=BASE_TYPES[0x86], # uint32 - def_num=8, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 9: Field( # Activity ID of each leader in the segment file - name='leader_activity_id', - type=BASE_TYPES[0x86], # uint32 - def_num=9, + }, + ), + 9: MessageType( + name='power_zone', + mesg_num=9, + fields={ + 1: Field( + name='high_value', + type=BASE_TYPES[0x84], # uint16 + def_num=1, + units=u'watts', ), - 10: Field( # String version of the activity ID of each leader in the segment file. 21 characters long for each ID, express in decimal - name='leader_activity_id_string', + 2: Field( + name='name', type=BASE_TYPES[0x07], # string - def_num=10, - ), - 11: Field( # Index for the Leader Board entry selected as the default race participant - name='default_race_leader', - type=BASE_TYPES[0x02], # uint8 - def_num=11, + def_num=2, ), 254: Field( name='message_index', @@ -9617,217 +9113,778 @@ ), }, ), - - - ######################### Settings File Messages ######################### - 2: MessageType( - name='device_settings', - mesg_num=2, + 10: MessageType( + name='met_zone', + mesg_num=10, fields={ - 0: Field( # Index into time zone arrays. - name='active_time_zone', + 1: Field( + name='high_bpm', type=BASE_TYPES[0x02], # uint8 - def_num=0, - ), - 1: Field( # Offset from system time. Required to convert timestamp from system time to UTC. - name='utc_offset', - type=BASE_TYPES[0x86], # uint32 def_num=1, ), - 2: Field( # Offset from system time. - name='time_offset', - type=BASE_TYPES[0x86], # uint32 + 2: Field( + name='calories', + type=BASE_TYPES[0x84], # uint16 def_num=2, - units='s', + scale=10, + units=u'kcal / min', ), - 4: Field( # Display mode for the time - name='time_mode', - type=FIELD_TYPES['time_mode'], - def_num=4, + 3: Field( + name='fat_calories', + type=BASE_TYPES[0x02], # uint8 + def_num=3, + scale=10, + units=u'kcal / min', ), - 5: Field( # timezone offset in 1/4 hour increments - name='time_zone_offset', - type=BASE_TYPES[0x01], # sint8 - def_num=5, - scale=4, - units='hr', + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 12: Field( # Mode for backlight - name='backlight_mode', - type=FIELD_TYPES['backlight_mode'], - def_num=12, + }, + ), + 12: MessageType( + name='sport', + mesg_num=12, + fields={ + 0: Field( + name='sport', + type=FIELD_TYPES['sport'], + def_num=0, ), - 36: Field( # Enabled state of the activity tracker functionality - name='activity_tracker_enabled', - type=FIELD_TYPES['bool'], - def_num=36, + 1: Field( + name='sub_sport', + type=FIELD_TYPES['sub_sport'], + def_num=1, ), - 39: Field( # UTC timestamp used to set the devices clock and date - name='clock_time', - type=FIELD_TYPES['date_time'], - def_num=39, + 3: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=3, ), - 40: Field( # Bitfield to configure enabled screens for each supported loop - name='pages_enabled', + }, + ), + 53: MessageType( + name='speed_zone', + mesg_num=53, + fields={ + 0: Field( + name='high_value', type=BASE_TYPES[0x84], # uint16 - def_num=40, + def_num=0, + scale=1000, + units=u'm/s', ), - 46: Field( # Enabled state of the move alert - name='move_alert_enabled', - type=FIELD_TYPES['bool'], - def_num=46, + 1: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=1, ), - 47: Field( # Display mode for the date - name='date_mode', - type=FIELD_TYPES['date_mode'], - def_num=47, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 55: Field( - name='display_orientation', - type=FIELD_TYPES['display_orientation'], - def_num=55, + }, + ), + 131: MessageType( + name='cadence_zone', + mesg_num=131, + fields={ + 0: Field( + name='high_value', + type=BASE_TYPES[0x02], # uint8 + def_num=0, + units=u'rpm', ), - 56: Field( - name='mounting_side', - type=FIELD_TYPES['side'], - def_num=56, + 1: Field( + name='name', + type=BASE_TYPES[0x07], # string + def_num=1, ), - 57: Field( # Bitfield to indicate one page as default for each supported loop - name='default_page', - type=BASE_TYPES[0x84], # uint16 - def_num=57, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), - 58: Field( # Minimum steps before an autosync can occur - name='autosync_min_steps', - type=BASE_TYPES[0x84], # uint16 - def_num=58, - units='steps', + }, + ), + + + ########################## Totals File Messages ########################## + 33: MessageType( + name='totals', + mesg_num=33, + fields={ + 0: Field( # Excludes pauses + name='timer_time', + type=BASE_TYPES[0x86], # uint32 + def_num=0, + units=u's', ), - 59: Field( # Minimum minutes before an autosync can occur - name='autosync_min_time', - type=BASE_TYPES[0x84], # uint16 - def_num=59, - units='minutes', + 1: Field( + name='distance', + type=BASE_TYPES[0x86], # uint32 + def_num=1, + units=u'm', ), - 80: Field( # Enable auto-detect setting for the lactate threshold feature. - name='lactate_threshold_autodetect_enabled', - type=FIELD_TYPES['bool'], - def_num=80, + 2: Field( + name='calories', + type=BASE_TYPES[0x86], # uint32 + def_num=2, + units=u'kcal', ), - 86: Field( # Automatically upload using BLE - name='ble_auto_upload_enabled', - type=FIELD_TYPES['bool'], - def_num=86, + 3: Field( + name='sport', + type=FIELD_TYPES['sport'], + def_num=3, ), - 89: Field( # Helps to conserve battery by changing modes - name='auto_sync_frequency', - type=FIELD_TYPES['auto_sync_frequency'], - def_num=89, + 4: Field( # Includes pauses + name='elapsed_time', + type=BASE_TYPES[0x86], # uint32 + def_num=4, + units=u's', ), - 90: Field( # Allows setting specific activities auto-activity detect enabled/disabled settings - name='auto_activity_detect', - type=FIELD_TYPES['auto_activity_detect'], - def_num=90, + 5: Field( + name='sessions', + type=BASE_TYPES[0x84], # uint16 + def_num=5, ), - 94: Field( # Number of screens configured to display - name='number_of_screens', + 6: Field( + name='active_time', + type=BASE_TYPES[0x86], # uint32 + def_num=6, + units=u's', + ), + 9: Field( + name='sport_index', type=BASE_TYPES[0x02], # uint8 - def_num=94, + def_num=9, ), - 95: Field( # Smart Notification display orientation - name='smart_notification_display_orientation', - type=FIELD_TYPES['display_orientation'], - def_num=95, + 253: FIELD_TYPE_TIMESTAMP, + 254: Field( + name='message_index', + type=FIELD_TYPES['message_index'], + def_num=254, ), }, ), - ###################### Sport Settings File Messages ###################### - 7: MessageType( - name='zones_target', - mesg_num=7, + ####################### Weight Scale File Messages ####################### + 30: MessageType( + name='weight_scale', + mesg_num=30, fields={ + 0: Field( + name='weight', + type=FIELD_TYPES['weight'], + def_num=0, + scale=100, + units=u'kg', + ), 1: Field( - name='max_heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='percent_fat', + type=BASE_TYPES[0x84], # uint16 def_num=1, + scale=100, + units=u'%', ), 2: Field( - name='threshold_heart_rate', - type=BASE_TYPES[0x02], # uint8 + name='percent_hydration', + type=BASE_TYPES[0x84], # uint16 def_num=2, + scale=100, + units=u'%', ), 3: Field( - name='functional_threshold_power', + name='visceral_fat_mass', type=BASE_TYPES[0x84], # uint16 def_num=3, + scale=100, + units=u'kg', + ), + 4: Field( + name='bone_mass', + type=BASE_TYPES[0x84], # uint16 + def_num=4, + scale=100, + units=u'kg', ), 5: Field( - name='hr_calc_type', - type=FIELD_TYPES['hr_zone_calc'], + name='muscle_mass', + type=BASE_TYPES[0x84], # uint16 def_num=5, + scale=100, + units=u'kg', ), 7: Field( - name='pwr_calc_type', - type=FIELD_TYPES['pwr_zone_calc'], + name='basal_met', + type=BASE_TYPES[0x84], # uint16 def_num=7, + scale=4, + units=u'kcal/day', ), + 8: Field( + name='physique_rating', + type=BASE_TYPES[0x02], # uint8 + def_num=8, + ), + 9: Field( # ~4kJ per kcal, 0.25 allows max 16384 kcal + name='active_met', + type=BASE_TYPES[0x84], # uint16 + def_num=9, + scale=4, + units=u'kcal/day', + ), + 10: Field( + name='metabolic_age', + type=BASE_TYPES[0x02], # uint8 + def_num=10, + units=u'years', + ), + 11: Field( + name='visceral_fat_rating', + type=BASE_TYPES[0x02], # uint8 + def_num=11, + ), + 12: Field( # Associates this weight scale message to a user. This corresponds to the index of the user profile message in the weight scale file. + name='user_profile_index', + type=FIELD_TYPES['message_index'], + def_num=12, + ), + 253: FIELD_TYPE_TIMESTAMP, }, ), - ########################## Totals File Messages ########################## - 33: MessageType( - name='totals', - mesg_num=33, + ######################### Workout File Messages ########################## + 26: MessageType( + name='workout', + mesg_num=26, fields={ - 0: Field( # Excludes pauses - name='timer_time', - type=BASE_TYPES[0x86], # uint32 + 4: Field( + name='sport', + type=FIELD_TYPES['sport'], + def_num=4, + ), + 5: Field( + name='capabilities', + type=FIELD_TYPES['workout_capabilities'], + def_num=5, + ), + 6: Field( # number of valid steps + name='num_valid_steps', + type=BASE_TYPES[0x84], # uint16 + def_num=6, + ), + 8: Field( + name='wkt_name', + type=BASE_TYPES[0x07], # string + def_num=8, + ), + 11: Field( + name='sub_sport', + type=FIELD_TYPES['sub_sport'], + def_num=11, + ), + 14: Field( + name='pool_length', + type=BASE_TYPES[0x84], # uint16 + def_num=14, + scale=100, + units=u'm', + ), + 15: Field( + name='pool_length_unit', + type=FIELD_TYPES['display_measure'], + def_num=15, + ), + }, + ), + 27: MessageType( + name='workout_step', + mesg_num=27, + fields={ + 0: Field( + name='wkt_step_name', + type=BASE_TYPES[0x07], # string def_num=0, - units='s', ), 1: Field( - name='distance', - type=BASE_TYPES[0x86], # uint32 + name='duration_type', + type=FIELD_TYPES['wkt_step_duration'], def_num=1, - units='m', ), 2: Field( - name='calories', + name='duration_value', type=BASE_TYPES[0x86], # uint32 def_num=2, - units='kcal', + subfields=( + SubField( + name='duration_calories', + def_num=2, + type=BASE_TYPES[0x86], # uint32 + units=u'calories', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='calories', + raw_value=4, + ), + ), + ), + SubField( + name='duration_distance', + def_num=2, + type=BASE_TYPES[0x86], # uint32 + scale=100, + units=u'm', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='distance', + raw_value=1, + ), + ), + ), + SubField( + name='duration_hr', + def_num=2, + type=FIELD_TYPES['workout_hr'], + units=u'% or bpm', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='hr_less_than', + raw_value=2, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='hr_greater_than', + raw_value=3, + ), + ), + ), + SubField( + name='duration_power', + def_num=2, + type=FIELD_TYPES['workout_power'], + units=u'% or watts', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='power_less_than', + raw_value=14, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='power_greater_than', + raw_value=15, + ), + ), + ), + SubField( # message_index of step to loop back to. Steps are assumed to be in the order by message_index. custom_name and intensity members are undefined for this duration type. + name='duration_step', + def_num=2, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_steps_cmplt', + raw_value=6, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_time', + raw_value=7, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_distance', + raw_value=8, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_calories', + raw_value=9, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_hr_less_than', + raw_value=10, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_hr_greater_than', + raw_value=11, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_power_less_than', + raw_value=12, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_power_greater_than', + raw_value=13, + ), + ), + ), + SubField( + name='duration_time', + def_num=2, + type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u's', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='time', + raw_value=0, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repetition_time', + raw_value=28, + ), + ), + ), + ), ), 3: Field( - name='sport', - type=FIELD_TYPES['sport'], + name='target_type', + type=FIELD_TYPES['wkt_step_target'], def_num=3, ), - 4: Field( # Includes pauses - name='elapsed_time', + 4: Field( + name='target_value', type=BASE_TYPES[0x86], # uint32 def_num=4, - units='s', + subfields=( + SubField( + name='repeat_calories', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + units=u'calories', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_calories', + raw_value=9, + ), + ), + ), + SubField( + name='repeat_distance', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + scale=100, + units=u'm', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_distance', + raw_value=8, + ), + ), + ), + SubField( + name='repeat_hr', + def_num=4, + type=FIELD_TYPES['workout_hr'], + units=u'% or bpm', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_hr_less_than', + raw_value=10, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_hr_greater_than', + raw_value=11, + ), + ), + ), + SubField( + name='repeat_power', + def_num=4, + type=FIELD_TYPES['workout_power'], + units=u'% or watts', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_power_less_than', + raw_value=12, + ), + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_power_greater_than', + raw_value=13, + ), + ), + ), + SubField( # # of repetitions + name='repeat_steps', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_steps_cmplt', + raw_value=6, + ), + ), + ), + SubField( + name='repeat_time', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u's', + ref_fields=( + ReferenceField( + name='duration_type', + def_num=1, + value='repeat_until_time', + raw_value=7, + ), + ), + ), + SubField( # Zone (1-?); Custom = 0; + name='target_cadence_zone', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='cadence', + raw_value=3, + ), + ), + ), + SubField( # hr zone (1-5);Custom =0; + name='target_hr_zone', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='heart_rate', + raw_value=1, + ), + ), + ), + SubField( # Power Zone ( 1-7); Custom = 0; + name='target_power_zone', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='power', + raw_value=4, + ), + ), + ), + SubField( # speed zone (1-10);Custom =0; + name='target_speed_zone', + def_num=4, + type=BASE_TYPES[0x86], # uint32 + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='speed', + raw_value=0, + ), + ), + ), + SubField( + name='target_stroke_type', + def_num=4, + type=FIELD_TYPES['swim_stroke'], + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='swim_stroke', + raw_value=11, + ), + ), + ), + ), ), 5: Field( - name='sessions', - type=BASE_TYPES[0x84], # uint16 + name='custom_target_value_low', + type=BASE_TYPES[0x86], # uint32 def_num=5, + subfields=( + SubField( + name='custom_target_cadence_low', + def_num=5, + type=BASE_TYPES[0x86], # uint32 + units=u'rpm', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='cadence', + raw_value=3, + ), + ), + ), + SubField( + name='custom_target_heart_rate_low', + def_num=5, + type=FIELD_TYPES['workout_hr'], + units=u'% or bpm', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='heart_rate', + raw_value=1, + ), + ), + ), + SubField( + name='custom_target_power_low', + def_num=5, + type=FIELD_TYPES['workout_power'], + units=u'% or watts', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='power', + raw_value=4, + ), + ), + ), + SubField( + name='custom_target_speed_low', + def_num=5, + type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u'm/s', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='speed', + raw_value=0, + ), + ), + ), + ), ), 6: Field( - name='active_time', + name='custom_target_value_high', type=BASE_TYPES[0x86], # uint32 def_num=6, - units='s', + subfields=( + SubField( + name='custom_target_cadence_high', + def_num=6, + type=BASE_TYPES[0x86], # uint32 + units=u'rpm', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='cadence', + raw_value=3, + ), + ), + ), + SubField( + name='custom_target_heart_rate_high', + def_num=6, + type=FIELD_TYPES['workout_hr'], + units=u'% or bpm', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='heart_rate', + raw_value=1, + ), + ), + ), + SubField( + name='custom_target_power_high', + def_num=6, + type=FIELD_TYPES['workout_power'], + units=u'% or watts', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='power', + raw_value=4, + ), + ), + ), + SubField( + name='custom_target_speed_high', + def_num=6, + type=BASE_TYPES[0x86], # uint32 + scale=1000, + units=u'm/s', + ref_fields=( + ReferenceField( + name='target_type', + def_num=3, + value='speed', + raw_value=0, + ), + ), + ), + ), + ), + 7: Field( + name='intensity', + type=FIELD_TYPES['intensity'], + def_num=7, + ), + 8: Field( + name='notes', + type=BASE_TYPES[0x07], # string + def_num=8, ), 9: Field( - name='sport_index', - type=BASE_TYPES[0x02], # uint8 + name='equipment', + type=FIELD_TYPES['workout_equipment'], def_num=9, ), - 253: FIELD_TYPE_TIMESTAMP, 254: Field( name='message_index', type=FIELD_TYPES['message_index'], @@ -9835,136 +9892,46 @@ ), }, ), - - - ####################### Weight Scale File Messages ####################### - 30: MessageType( - name='weight_scale', - mesg_num=30, + 158: MessageType( + name='workout_session', + mesg_num=158, fields={ 0: Field( - name='weight', - type=FIELD_TYPES['weight'], + name='sport', + type=FIELD_TYPES['sport'], def_num=0, - scale=100, - units='kg', ), 1: Field( - name='percent_fat', - type=BASE_TYPES[0x84], # uint16 + name='sub_sport', + type=FIELD_TYPES['sub_sport'], def_num=1, - scale=100, - units='%', ), 2: Field( - name='percent_hydration', + name='num_valid_steps', type=BASE_TYPES[0x84], # uint16 def_num=2, - scale=100, - units='%', ), 3: Field( - name='visceral_fat_mass', + name='first_step_index', type=BASE_TYPES[0x84], # uint16 def_num=3, - scale=100, - units='kg', ), 4: Field( - name='bone_mass', + name='pool_length', type=BASE_TYPES[0x84], # uint16 def_num=4, scale=100, - units='kg', + units=u'm', ), 5: Field( - name='muscle_mass', - type=BASE_TYPES[0x84], # uint16 + name='pool_length_unit', + type=FIELD_TYPES['display_measure'], def_num=5, - scale=100, - units='kg', - ), - 7: Field( - name='basal_met', - type=BASE_TYPES[0x84], # uint16 - def_num=7, - scale=4, - units='kcal/day', - ), - 8: Field( - name='physique_rating', - type=BASE_TYPES[0x02], # uint8 - def_num=8, - ), - 9: Field( # ~4kJ per kcal, 0.25 allows max 16384 kcal - name='active_met', - type=BASE_TYPES[0x84], # uint16 - def_num=9, - scale=4, - units='kcal/day', - ), - 10: Field( - name='metabolic_age', - type=BASE_TYPES[0x02], # uint8 - def_num=10, - units='years', - ), - 11: Field( - name='visceral_fat_rating', - type=BASE_TYPES[0x02], # uint8 - def_num=11, ), - 12: Field( # Associates this weight scale message to a user. This corresponds to the index of the user profile message in the weight scale file. - name='user_profile_index', + 254: Field( + name='message_index', type=FIELD_TYPES['message_index'], - def_num=12, - ), - 253: FIELD_TYPE_TIMESTAMP, - }, - ), - - - ######################### Workout File Messages ########################## - 26: MessageType( - name='workout', - mesg_num=26, - fields={ - 4: Field( - name='sport', - type=FIELD_TYPES['sport'], - def_num=4, - ), - 5: Field( - name='capabilities', - type=FIELD_TYPES['workout_capabilities'], - def_num=5, - ), - 6: Field( # number of valid steps - name='num_valid_steps', - type=BASE_TYPES[0x84], # uint16 - def_num=6, - ), - 8: Field( - name='wkt_name', - type=BASE_TYPES[0x07], # string - def_num=8, - ), - 11: Field( - name='sub_sport', - type=FIELD_TYPES['sub_sport'], - def_num=11, - ), - 14: Field( - name='pool_length', - type=BASE_TYPES[0x84], # uint16 - def_num=14, - scale=100, - units='m', - ), - 15: Field( - name='pool_length_unit', - type=FIELD_TYPES['display_measure'], - def_num=15, + def_num=254, ), }, ), diff --git a/scripts/generate_profile.py b/scripts/generate_profile.py index 52e5c00..6fa4970 100755 --- a/scripts/generate_profile.py +++ b/scripts/generate_profile.py @@ -274,8 +274,18 @@ def fix_units(data): def parse_csv_fields(data, num_expected): if data is None or data == '': return [None] * num_expected - elif isinstance(data, str): - ret = [(int(x.strip()) if x.strip().isdigit() else x.strip()) for x in data.strip().split(',')] + elif isinstance(data, str) or isinstance(data, unicode): + ret = [] + lines = data.strip().splitlines() + for line in lines: + line = line.strip() + if not line: + continue + for x in line.split(','): + x = x.strip() + if not x: + continue + ret.append(int(x) if x.isdigit() else x) else: ret = [data] @@ -364,6 +374,8 @@ def parse_messages(messages_rows, type_list): group_name = "" for row in messages_rows: + if not any(row): + continue if (row[3] is not None) and all(r == b'' for n, r in enumerate(row[:14]) if n != 3): # Only row 3 means it's a group name group_name = row[3].decode().title() @@ -379,6 +391,7 @@ def parse_messages(messages_rows, type_list): # Get components if they exist components = [] component_names = parse_csv_fields(row[5].decode(), 0) + assert type(component_names) == type([]) if component_names and (len(component_names) != 1 or component_names[0] != ''): num_components = len(component_names) components = [ @@ -421,7 +434,7 @@ def parse_messages(messages_rows, type_list): field = field._replace(scale=None, offset=None, units=None) message.fields.append(field) - elif row[2] != b'': + elif row[2] != b'' or not row[1]: # Sub fields subfield = SubFieldInfo( name=row[2].decode(), num=field.num, type=row[3].decode(), scale=fix_scale(row[6]), @@ -530,9 +543,9 @@ def main(input_xls_or_zip, output_py_path=None): if output_py_path: open(output_py_path, 'w').write(output) - print("Profile%s written to %s", - ' version %s' % profile_version if profile_version else '', - output_py_path + print("Profile%s written to %s" % + ((' version %s' % profile_version if profile_version else ''), + output_py_path) ) else: print(output.strip())