Index: DialityCoreCanProtocol.py =================================================================== diff -u -r7e8f523c6ecb0a8fe78714e66507af7bc1e286cb -r08bdd97f4bf72851052fd1e44178335bea9401e4 --- DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision 7e8f523c6ecb0a8fe78714e66507af7bc1e286cb) +++ DialityCoreCanProtocol.py (.../DialityCoreCanProtocol.py) (revision 08bdd97f4bf72851052fd1e44178335bea9401e4) @@ -18,6 +18,7 @@ import threading import can import math +import time from time import sleep import sys @@ -338,7 +339,7 @@ class DenaliCanMessenger: START_BYTE = DenaliMessage.START_BYTE - DIALIN_MSG_RESP_TO = 1 # number of seconds to wait for a response to a sent command + DIALIN_MSG_RESP_TO = 0.1 # number of seconds to wait for a response to a sent command def __init__(self, can_interface='can0'): """ @@ -415,6 +416,9 @@ channel_id = message.arbitration_id message_length = can_data[DenaliMessage.PAYLOAD_LENGTH_INDEX] + # TEST CODE - REMOVE + #print(str(time.time())+" " + str(channel_id) + " " + str(can_data)) + # if we are building a long message, then proceed to push it to the channel dictionary if channel_id in self.__longMsgChannelIDSet: self.__dialinMessageList = self.__longMessageBuilders[channel_id].push(can_data) @@ -434,7 +438,9 @@ self.__dialinMessageList = None else: # if we do have a builder. This is the first time - self.__dialinMessageList = self.__longMessageBuilders[channel_id].push(can_data, first_packet=True) +# self.__dialinMessageList = self.__longMessageBuilders[channel_id].push(can_data, first_packet=True) + self.__longMessageBuilders[channel_id].push(can_data, first_packet=True) + self.__dialinMessageList = None # Do we have a complete (long or short) Denali Message? if self.__dialinMessageList is not None: @@ -538,6 +544,7 @@ #print(packet) # self.__bus.send(packet, 0.01) self.__bus.send(packet, 0) + #sleep(0.002) # Sending self.__dialinCommandResponseMessage = None @@ -553,6 +560,7 @@ elif time_out == 0: msg_sent = True else: + #msg_sent = False print("No response. Re-sending message.") # We are ready to send again. Reset request ID appropriately