def send_burst_transfer(self, channel, data):
     _logger.debug("send burst transfer %s", channel)
     Ant.send_burst_transfer(self, channel, data)
     self.wait_for_event(Message.Code.EVENT_TRANSFER_TX_START)
     x = self.wait_for_event(Message.Code.EVENT_TRANSFER_TX_COMPLETED)
     _logger.debug("done sending burst transfer %s", channel)
     return x
Exemplo n.º 2
0
    def __init__(self, idVendor, idProduct):
        Ant.__init__(self, idVendor, idProduct)

        self._responses_cond = threading.Condition()
        self._responses = collections.deque()
        self._event_cond = threading.Condition()
        self._events = collections.deque()

        self.start()
 def __init__(self, idVendor, idProduct):
     Ant.__init__(self, idVendor, idProduct)
     
     self._responses_cond = threading.Condition()
     self._responses      = collections.deque()
     self._event_cond     = threading.Condition()
     self._events         = collections.deque()
     
     self.start()
 def send_acknowledged_data(self, channel, data):
     try:
         _logger.debug("send acknowledged data %s", channel)
         Ant.send_acknowledged_data(self, channel, data)
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
         _logger.debug("done sending acknowledged data %s", channel)
     except TransferFailedException:
         _logger.warning("failed to send acknowledged data %s, retrying", channel)
         self.send_acknowledged_data(channel, data)
Exemplo n.º 5
0
 def send_acknowledged_data(self, channel, data):
     try:
         _logger.debug("send acknowledged data %s", channel)
         Ant.send_acknowledged_data(self, channel, data)
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
         _logger.debug("done sending acknowledged data %s", channel)
     except TransferFailedException:
         _logger.warning("failed to send acknowledged data %s, retrying",
                         channel)
         self.send_acknowledged_data(channel, data)
 def send_burst_transfer(self, channel, data):
     try:
         self._last_call = (self.send_burst_transfer, [channel, data])
         _logger.debug("send burst transfer %s", channel)
         Ant.send_burst_transfer(self, channel, data)
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_START])
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
         _logger.debug("done sending burst transfer %s", channel)
     except TransferFailedException:
         _logger.warning("failed to send burst transfer %s, retrying", channel)
         self.send_burst_transfer(channel, data)
Exemplo n.º 7
0
 def send_burst_transfer(self, channel, data):
     try:
         self._last_call = (self.send_burst_transfer, [channel, data])
         _logger.debug("send burst transfer %s", channel)
         Ant.send_burst_transfer(self, channel, data)
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_START])
         self.wait_for_event([Message.Code.EVENT_TRANSFER_TX_COMPLETED])
         _logger.debug("done sending burst transfer %s", channel)
     except TransferFailedException:
         _logger.warning("failed to send burst transfer %s, retrying",
                         channel)
         self.send_burst_transfer(channel, data)
Exemplo n.º 8
0
 def set_network_key(self, network, key):
     Ant.set_network_key(self, network, key)
     return self.wait_for_response(Message.ID.SET_NETWORK_KEY)
Exemplo n.º 9
0
 def set_channel_search_timeout(self, channel, timeout):
     Ant.set_channel_search_timeout(self, channel, timeout)
     return self.wait_for_response(Message.ID.SET_CHANNEL_SEARCH_TIMEOUT)
Exemplo n.º 10
0
 def set_channel_id(self, channel, deviceNum, deviceType, transmissionType):
     Ant.set_channel_id(self, channel, deviceNum, deviceType,
                        transmissionType)
     return self.wait_for_response(Message.ID.SET_CHANNEL_ID)
 def set_network_key(self, network, key):
     Ant.set_network_key(self, network, key)
     return self.wait_for_response(Message.ID.SET_NETWORK_KEY)
 def send_burst_transfer_packet(self, channelSeq, data, first):
     _logger.debug("send burst transfer packet %s", data)
     Ant.send_burst_transfer_packet(self, channelSeq, data, first)
 def reset_system(self):
     Ant.reset_system(self)
     return self.wait_for_response(Message.ID.STARTUP_MESSAGE)
 def request_message(self, channel, messageId):
     _logger.debug("requesting message %#02x", messageId)
     Ant.request_message(self, channel, messageId)
     _logger.debug("done requesting message %#02x", messageId)
     return self.wait_for_response(messageId)
 def set_search_waveform(self, channel, waveform):
     Ant.set_search_waveform(self, channel, waveform)
     return self.wait_for_response(Message.ID.SET_SEARCH_WAVEFORM)
 def set_channel_search_timeout(self, channel, timeout):
     Ant.set_channel_search_timeout(self, channel, timeout)
     return self.wait_for_response(Message.ID.SET_CHANNEL_SEARCH_TIMEOUT)
Exemplo n.º 17
0
 def request_message(self, channel, messageId):
     _logger.debug("requesting message %#02x", messageId)
     Ant.request_message(self, channel, messageId)
     _logger.debug("done requesting message %#02x", messageId)
     return self.wait_for_special(messageId)
 def send_acknowledged_data(self, channel, broadcastData):
     _logger.debug("send acknowledged data %s", channel)
     Ant.send_acknowledged_data(self, channel, broadcastData)
     x = self.wait_for_event(Message.Code.EVENT_TRANSFER_TX_COMPLETED)
     _logger.debug("done sending acknowledged data %s", channel)
     return x
Exemplo n.º 19
0
 def assign_channel(self, channel, channelType, networkNumber):
     Ant.assign_channel(self, channel, channelType, networkNumber)
     return self.wait_for_response(Message.ID.ASSIGN_CHANNEL)
 def assign_channel(self, channel, channelType, networkNumber):
     Ant.assign_channel(self, channel, channelType, networkNumber)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
 def set_channel_rf_freq(self, channel, rfFreq):
     Ant.set_channel_rf_freq(self, channel, rfFreq)
     return self.wait_for_response(Message.ID.SET_CHANNEL_RF_FREQ)
Exemplo n.º 22
0
 def reset_system(self):
     Ant.reset_system(self)
     return self.wait_for_special(Message.ID.STARTUP_MESSAGE)
 def open_channel(self, channel):
     Ant.open_channel(self, channel)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
Exemplo n.º 24
0
 def open_channel(self, channel):
     Ant.open_channel(self, channel)
     return self.wait_for_response(Message.ID.OPEN_CHANNEL)
 def set_channel_id(self, channel, deviceNum, deviceType, transmissionType):
     Ant.set_channel_id(self, channel, deviceNum, deviceType, transmissionType)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
Exemplo n.º 26
0
 def set_channel_period(self, channel, messagePeriod):
     Ant.set_channel_period(self, channel, messagePeriod)
     return self.wait_for_response(Message.ID.SET_CHANNEL_PERIOD)
 def set_channel_period(self, channel, messagePeriod):
     Ant.set_channel_period(self, channel, messagePeriod)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
Exemplo n.º 28
0
 def set_channel_rf_freq(self, channel, rfFreq):
     Ant.set_channel_rf_freq(self, channel, rfFreq)
     return self.wait_for_response(Message.ID.SET_CHANNEL_RF_FREQ)
 def set_channel_search_timeout(self, channel, timeout):
     Ant.set_channel_search_timeout(self, channel, timeout)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
Exemplo n.º 30
0
 def set_search_waveform(self, channel, waveform):
     Ant.set_search_waveform(self, channel, waveform)
     return self.wait_for_response(Message.ID.SET_SEARCH_WAVEFORM)
 def set_channel_rf_freq(self, channel, rfFreq):
     Ant.set_channel_rf_freq(self, channel, rfFreq)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
Exemplo n.º 32
0
 def send_burst_transfer_packet(self, channelSeq, data, first):
     _logger.debug("send burst transfer packet %s", data)
     Ant.send_burst_transfer_packet(self, channelSeq, data, first)
 def set_network_key(self, network, key):
     Ant.set_network_key(self, network, key)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
 def set_search_waveform(self, channel, waveform):
     Ant.set_search_waveform(self, channel, waveform)
     return self.wait_for_response(Message.ID.RESPONSE_CHANNEL)
 def set_channel_period(self, channel, messagePeriod):
     Ant.set_channel_period(self, channel, messagePeriod)
     return self.wait_for_response(Message.ID.SET_CHANNEL_PERIOD)