Exemplo n.º 1
0
class Event(Message):
    msg_type = 21

    timestamp = DateTime(253)
    event = EventField(0)
    event_type = EventType(1)
    data16 = UInt16(2)  # components
    data = DynamicField(
        UInt32(3),
        event={
            "timer": SubField("timer_trigger", TimerTrigger),
            "course_point": SubField("course_point_index", MessageIndex),
            "battery": SubField(
                "battery_level",
                lambda number: UInt16(number, units="V") * 1000),
            "virtual_partner_pace": SubField(
                "virtual_partner_speed",
                lambda number: UInt16(number, units="m/s") * 1000),
            "hr_high_alert": SubField("hr_high_alert", UInt8, units="bpm"),
            "hr_low_alert": SubField("hr_low_alert", UInt8, units="bpm"),
            "speed_high_alert": SubField(
                "speed_high_alert",
                lambda number: UInt16(number, units="m/s") * 1000),
            "speed_low_alert": SubField(
                "speed_low_alert",
                lambda number: UInt16(number, units="m/s") * 1000),
            "cad_high_alert": SubField("cad_high_alert", UInt16, units="rpm"),
            "cad_low_alert": SubField("cad_low_alert", UInt16, units="rpm"),
            "power_high_alert": SubField(
                "power_high_alert", UInt16, units="watts"),
            "power_low_alert": SubField(
                "power_low_alert", UInt16, units="watts"),
            "time_duration_alert": SubField(
                "time_duration_alert",
                lambda number: UInt32(number, units="s") * 1000),
            "distance_duration_alert": SubField(
                "distance_duration_alert",
                lambda number: UInt32(number, units="m") * 100),
            "calorie_duration_alert": SubField(
                "calorie_duration_alert", units="calories"),
            "fitness_equipment": SubField(
                "fitness_equipment_state", FitnessEquipmentState),
            "sport_point": SubField("sport_point"),  # components
            ("front_gear_change", "rear_gear_change"): SubField(
                "gear_change_data")  # components
        }
    )
    event_group = UInt8(4)
    score = UInt16(7)
    opponent_score = UInt16(8)
    front_gear_num = UInt8Z(9)
    front_gear = UInt8Z(10)
    rear_gear_num = UInt8Z(11)
    rear_gear = UInt8Z(12)
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 Capabilities(Message):
    msg_type = 1

    languages = UInt8Z(0)  # array
    sports = SportBits0(1)  # array
    workouts_supported = WorkoutCapabilities(21)
    connectivity_supported = ConnectivityCapabilities(23)
Exemplo n.º 4
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.º 5
0
class HrmProfile(Message):
    msg_type = 4

    message_index = MessageIndex(254)
    enabled = Bool(0)
    hrm_ant_id = UInt16Z(1)
    log_hrv = Bool(2)
    hrm_ant_id_trans_type = UInt8Z(3)
Exemplo n.º 6
0
class SdmProfile(Message):
    msg_type = 5

    message_index = MessageIndex(254)
    enabled = Bool(0)
    sdm_ant_id = UInt16Z(1)
    sdm_cal_factor = UInt16(2)
    odometer = UInt32(3, units="m") * 100
    speed_source = Bool(4)
    sdm_ant_id_trans_byte = UInt8Z(5)
    odometer_rollover = UInt8(7)