コード例 #1
0
ファイル: ExplorAnt.py プロジェクト: roggenbrot/FortiusANT
    #---------------------------------------------------------------------------
    # Show what devices discovered
    #---------------------------------------------------------------------------
    for d in deviceIDs:
        logfile.Console (" %3s discovered on channel=%s, number=%5s typeID=%3s TrType=%3s" % \
            (d.DeviceType, d.Channel, d.DeviceNumber, d.DeviceTypeID, d.TransmissionType) )
    logfile.Console("--------------------")

    #---------------------------------------------------------------------------
    # Free pairing channels
    #---------------------------------------------------------------------------
    messages = []
    for i in range(0, NrDevicesToPair):
        messages.append(
            ant.msg41_UnassignChannel(i))  # Does not have much effect
        pass
    AntDongle.Write(messages)
    AntDongle.ResetDongle()  # This one does the job

while AntDongle.OK:
    #---------------------------------------------------------------------------
    # If any channel specified and/or found: Open the device channels & listen.
    #---------------------------------------------------------------------------
    if clv.vtx < 0:
        clv.vtx = ant.DeviceNumber_VTX  # Not found during pair, try anyway
    if clv.vhu < 0:
        clv.vhu = ant.DeviceNumber_VHU  # Not found during pair, try anyway
    if clv.SimulateTrainer or clv.hrm >= 0 or clv.fe >= 0 or clv.scs >= 0 or clv.vtx >= 0 or clv.vhu >= 0:
        # ----------------------------------------------------------------------
        # Calibrate ANT+ dongle (because reset was done!)
コード例 #2
0
    logfile.Console ("Pairing stopped")

    #---------------------------------------------------------------------------
    # Show what devices discovered
    #---------------------------------------------------------------------------
    for d in deviceIDs:
        logfile.Console (" %3s discovered on channel=%s, number=%5s typeID=%3s TrType=%3s" % \
            (d.DeviceType, d.Channel, d.DeviceNumber, d.DeviceTypeID, d.TransmissionType) )
    logfile.Console ("--------------------")

    #---------------------------------------------------------------------------
    # Free pairing channels
    #---------------------------------------------------------------------------
    messages = []
    for i in range(0, NrDevicesToPair):
        messages.append ( ant.msg41_UnassignChannel(i) )    # Does not have much effect
        pass
    AntDongle.Write(messages)
    AntDongle.ResetDongle ()                          # This one does the job

while AntDongle.OK:
    #---------------------------------------------------------------------------
    # If any channel specified and/or found: Open the device channels & listen.
    #---------------------------------------------------------------------------
    if clv.vtx < 0: clv.vtx = ant.DeviceNumber_VTX # Not found during pair, try anyway
    if clv.vhu < 0: clv.vhu = ant.DeviceNumber_VHU # Not found during pair, try anyway
    if clv.SimulateTrainer or clv.hrm >= 0 or clv.fe >= 0 or clv.scs >= 0 or clv.vtx >= 0 or clv.vhu >= 0:
        # ----------------------------------------------------------------------
        # Calibrate ANT+ dongle (because reset was done!)
        # ----------------------------------------------------------------------
        AntDongle.Calibrate()