Exemplo n.º 1
0
class DeviceInfo(Message):
    msg_type = 23

    timestamp = DateTime(253)
    device_index = DeviceIndex(0)
    device_type = DynamicField(
        UInt8(1),
        source_type={
            "antplus": SubField("antplus_device_type", AntplusDeviceType),
            "ant": SubField("ant_device_type")
        }
    )
    manufacturer = Manufacturer(2)
    serial_number = UInt32Z(3)
    product = UInt16(4)  # Maybe DynamicField?
    software_version = UInt16(5) * 100
    hardware_version = UInt8(6)
    cum_operating_time = UInt32(7) * "s"
    battery_voltage = UInt16(10, units="V") * 256
    battery_status = BatteryStatus(11)
    sensor_position = BodyLocation(18)
    descriptor = String(19)
    ant_transmission_type = UInt8Z(20)
    ant_device_number = UInt16Z(21)
    ant_network = AntNetwork(22)
    source_type = SourceType(25)
Exemplo n.º 2
0
class BikeProfile(Message):
    msg_type = 6

    message_index = MessageIndex(254)
    name = String(0)
    sport = Sport(1)
    sub_sport = SubSport(2)
    odometer = UInt32(3, units="m") * 100
    bike_spd_ant_id = UInt16Z(4)
    bike_cad_ant_id = UInt16Z(5)
    bike_spdcad_ant_id = UInt16Z(6)
    bike_power_ant_id = UInt16Z(7)
    custom_wheelsize = UInt16(8)
    auto_wheelsize = UInt16(9)
    bike_wieght = UInt16(10)
    power_cal_factor = UInt16(11)
    auto_wheel_cal = Bool(12)
    auto_power_zero = Bool(13)
    id = UInt8(14)
    spd_enabled = Bool(15)
    cad_enabled = Bool(16)
    spdcad_enabled = Bool(17)
    power_enabled = Bool(18)
    crank_length = UInt8(19)
    enabled = Bool(20)
    bike_spd_ant_id_trans_type = UInt8Z(21)
    bike_cad_ant_id_trans_type = UInt8Z(22)
    bike_spdcad_ant_id_trans_type = UInt8Z(23)
    bike_power_ant_id_trans_type = UInt8Z(24)
    odometer_rollover = UInt8(37)
    front_gear_num = UInt8Z(38)
    front_gear = UInt8Z(39)
    rear_gear_num = UInt8Z(40)
    read_gear = UInt8Z(41)
Exemplo n.º 3
0
class UserProfile(Message):
    msg_type = 3

    message_index = MessageIndex(254)
    friendly_name = String(0)
    gender = Gender(1)
    age = UInt8(2) * "years"
    height = UInt8(3)
    weight = UInt16(4)
    language = Language(5)
    elev_setting = DisplayMeasure(6)
    weight_settings = DisplayMeasure(7)
    resting_heart_rate = UInt8(8) * "bpm"
    default_max_running_heart_rate = UInt8(9) * "bpm"
    default_max_biking_heart_rate = UInt8(10) * "bpm"
    default_max_heart_rate = UInt8(11) * "bpm"
    hr_setting = DisplayHeart(12)
    speed_setting = DisplayMeasure(13)
    dist_setting = DisplayMeasure(14)
    power_settings = DisplayPower(16)
    activity_class = ActivityClass(17)
    position_setting = DisplayPosition(18)
    temperature_setting = DisplayMeasure(21)
    local_id = UserLocalId(22)
    global_id = Byte(23)  # array
    height_setting = DisplayMeasure(30)
Exemplo n.º 4
0
class Workout(Message):
    msg_type = 26

    sport = Sport(4)
    capabilities = WorkoutCapabilities(5)
    num_valid_steps = UInt16(6)
    wkt_name = String(8)
Exemplo n.º 5
0
class FileCapabilities(Message):
    msg_type = 37

    message_index = MessageIndex(254)
    type = File(0)
    flags = FileFlags(1)
    directory = String(2)
    max_count = UInt16(3)
    max_size = UInt32(4)
Exemplo n.º 6
0
class CoursePoint(Message):
    msg_type = 32

    message_index = MessageIndex(254)
    timestamp = DateTime(1)
    position_lat = degrees(2)
    position_long = degrees(3)
    distance = UInt32(4, units="m") * 100
    type = CoursePointField(5)
    name = String(6)
Exemplo n.º 7
0
class WorkoutStep(Message):
    msg_type = 27

    message_index = MessageIndex(254)
    wkt_step_name = String(0)
    duration_type = WktStepDuration(1)
    duration_value = UInt32(2)  # variants
    target_type = WktStepTarget(3)
    target_value = UInt32(4)  # variants
    custom_target_value_low = UInt32(5)  # variants
    custom_target_value_high = UInt32(6)  # variants
    intensity = Intensity(7)
Exemplo n.º 8
0
class Software(Message):
    msg_type = 35

    message_index = MessageIndex(254)
    version = UInt16(3) * 100
    part_number = String(5)
Exemplo n.º 9
0
class Session(Message):
    msg_type = 18

    message_index = MessageIndex(254)
    timestamp = DateTime(253)
    event = EventField(0)
    event_type = EventType(1)
    start_time = DateTime(2)
    start_position_lat = degrees(3)
    start_position_long = degrees(4)
    sport = Sport(5)
    sub_sport = SubSport(6)
    total_elapsed_time = UInt32(7, units="s") * 1000
    total_timer_time = UInt32(8, units="s") * 1000
    total_distance = UInt32(9, units="m") * 100
    total_cycles = Dynamic(UInt32(10, units="cycles"),
                           referred_to="sport",
                           running=SubField("total_strides", units="strides"))
    total_calories = UInt16(11) * "kcal"
    total_fat_calories = UInt16(13) * "kcal"
    avg_speed = UInt16(14, units="m/s") * 1000
    max_speed = UInt16(15, units="m/s") * 1000
    avg_heart_rate = UInt8(16) * "bpm"
    max_heart_rate = UInt8(17) * "bpm"
    avg_cadence = Dynamic(UInt8(18, units="rpm"),
                          referred_to="sport",
                          running=SubField("avg_running_cadence",
                                           units="strides/min"))
    max_cadence = Dynamic(UInt8(19, units="rpm"),
                          referred_to="sport",
                          running=SubField("max_running_cadence",
                                           units="strides/min"))
    avg_power = UInt16(20) * "watts"
    max_power = UInt16(21) * "watts"
    total_ascent = UInt16(22) * "m"
    total_descent = UInt16(23) * "m"
    total_training_effect = UInt8(24) * 10
    first_lap_index = UInt16(25)
    num_laps = UInt16(26)
    event_group = UInt8(27)
    trigger = SessionTrigger(28)
    nec_lat = degrees(29)
    nec_long = degrees(30)
    swc_lat = degrees(31)
    swc_long = degrees(32)
    normalized_power = UInt16(34) * "watts"
    training_stress_score = UInt16(35, units="tss") * 10
    intensity_factor = UInt16(36, units="if") * 1000
    left_right_balance = LeftRightBalance100(37)
    avg_stroke_count = UInt32(41, units="strokes/lap") * 10
    avg_stroke_distance = UInt16(42, units="m") * 100
    swim_stroke = SwimStroke(43)
    pool_length = UInt16(44, units="m") * 100
    pool_length_unit = DisplayMeasure(46)
    num_active_lengths = UInt16(47)
    total_work = UInt32(48) * "J"
    avg_altitude = UInt16(49, units="m") * 5 + 500
    max_altitude = UInt16(50, units="m") * 5 + 500
    gps_accuracy = UInt8(51) * "m"
    avg_grade = SInt16(52, units="%") * 100
    avg_pos_grade = SInt16(53, units="%") * 100
    avg_neg_grade = SInt16(54, units="%") * 100
    max_pos_grade = SInt16(55, units="%") * 100
    max_neg_grade = SInt16(56, units="%") * 100
    avg_temperature = SInt8(57) * "°C"
    max_temperature = SInt8(58) * "°C"
    total_moving_time = UInt32(59, units="s") * 1000
    avg_pos_vertical_speed = SInt16(60, units="m/s") * 1000
    avg_neg_vertical_speed = SInt16(61, units="m/s") * 1000
    max_pos_vertical_speed = SInt16(62, units="m/s") * 1000
    max_neg_vertical_speed = SInt16(63, units="m/s") * 1000
    min_heart_rate = UInt8(64) * "bpm"
    time_in_hr_zone = Array(UInt32(65, units="s") * 1000)
    time_in_speed_zone = Array(UInt32(66, units="s") * 1000)
    time_in_cadence_zone = Array(UInt32(67, units="s") * 1000)
    time_in_power_zone = Array(UInt32(68, units="s") * 1000)
    avg_lap_time = UInt32(69, units="s") * 1000
    best_lap_index = UInt16(70)
    min_altitude = UInt16(71, units="m") * 5 + 500
    player_score = UInt16(82)
    opponent_score = UInt16(83)
    opponent_name = String(84)
    stroke_count = Array(UInt16(85))
    zone_count = Array(UInt16(86))
    max_ball_speed = UInt16(87, units="m/s") * 100
    avg_ball_speed = UInt16(88, units="m/s") * 100
    avg_vertical_oscillation = UInt16(89, units="mm") * 10
    avg_stance_time_percent = UInt16(90, units="%") * 100
    avg_stance_time = UInt16(91, units="ms") * 10
    avg_fractional_cadence = UInt8(92, units="rpm") * 128
    max_fractional_cadence = UInt8(93, units="rpm") * 128
    total_fractional_cycles = UInt8(94, units="cycles") * 128
    avg_total_hemoglobin_conc = Array(UInt16(95, units="g/dL") * 100)
    min_total_hemoglobin_conc = Array(UInt16(96, units="g/dL") * 100)
    max_total_hemoglobin_conc = Array(UInt16(97, units="g/dL") * 100)
    avg_saturated_hemoglobin_percent = Array(UInt16(98, units="%") * 10)
    min_saturated_hemoglobin_percent = Array(UInt16(99, units="%") * 10)
    max_saturated_hemoglobin_percent = Array(UInt16(100, units="%") * 10)
    avg_left_torque_effectiveness = UInt8(101, units="%") * 2
    avg_right_torque_effectiveness = UInt8(102, units="%") * 2
    avg_left_pedal_smoothness = UInt8(103, units="%") * 2
    avg_right_pedal_smoothness = UInt8(104, units="%") * 2
    avg_combined_pedal_smoothness = UInt8(105, units="%") * 2
Exemplo n.º 10
0
class Course(Message):
    msg_type = 31

    sport = Sport(4)
    name = String(5)
    capabilities = CourseCapabilities(6)
Exemplo n.º 11
0
class PowerZone(Message):
    msg_type = 9

    message_index = MessageIndex(254)
    high_value = UInt16(1) * "watts"
    name = String(2)
Exemplo n.º 12
0
class CadenceZone(Message):
    msg_type = 131

    message_index = MessageIndex(254)
    high_value = UInt8(0) * "rpm"
    name = String(1)
Exemplo n.º 13
0
class SpeedZone(Message):
    msg_type = 53

    message_index = MessageIndex(254)
    high_value = UInt16(0, units="m/s") * 1000
    name = String(1)
Exemplo n.º 14
0
class HrZone(Message):
    msg_type = 8

    message_index = MessageIndex(254)
    high_bpm = UInt8(1) * "bpm"
    name = String(2)
Exemplo n.º 15
0
class Sport(Message):
    msg_type = 12

    sport = SportField(0)
    sub_sport = SubSport(1)
    name = String(3)