Index: leahi_dialin/protocols/CAN.py =================================================================== diff -u -r62972f33f3d84041e8d8e68a274e5f2a4cd67568 -r38e8dd31728056dbb7f9304c98ab16d7147b75a2 --- leahi_dialin/protocols/CAN.py (.../CAN.py) (revision 62972f33f3d84041e8d8e68a274e5f2a4cd67568) +++ leahi_dialin/protocols/CAN.py (.../CAN.py) (revision 38e8dd31728056dbb7f9304c98ab16d7147b75a2) @@ -94,7 +94,6 @@ @param seq: (int) Overrides current sequence number if set @return:: dictionary with channel_id and 8-byte padded message """ - if payload is None: payload = [] @@ -169,7 +168,6 @@ @param message: packet that may or may not be multiple of 8 bytes @return:: packet that is 8-byte multiple - """ message_length = len(message) @@ -192,7 +190,6 @@ @return:: CRC in message """ - crc_index = DenaliMessage.PAYLOAD_START_INDEX + DenaliMessage.get_payload_length(message) return message['message'][crc_index] @@ -204,7 +201,6 @@ @return:: TRUE if CRC matches, FALSE otherwise """ - if message is None: return False else: @@ -223,9 +219,7 @@ @param message: dictionary with channel_id and message keys @return:: integer with channel id - """ - return message['channel_id'] @staticmethod @@ -315,7 +309,6 @@ Returns request ID from packet @param message: complete Diality Packet @return:: integer with request ID - """ msg_id_array = message['message'][DenaliMessage.MSG_ID_INDEX: DenaliMessage.PAYLOAD_LENGTH_INDEX] @@ -351,7 +344,6 @@ @param message: dictionary with channel_id and message keys @return:: a payload array if exist """ - payload_length = DenaliMessage.get_payload_length(message) if payload_length == 0: @@ -381,7 +373,6 @@ Updates made to the "Message List.xlsx" document found in the Diality Software Team SharePoint, specifically in the CAN Channels sheet, should also be applied here. """ - td_alarm_broadcast_ch_id = 0x001 dd_alarm_broadcast_ch_id = 0x002 fp_alarm_broadcast_ch_id = 0x004 @@ -470,7 +461,6 @@ @param can_interface - string containing the can interface, e.g., 'can0" @return: DialityCanMessenger object - """ self.message_queue_mutex = threading.Lock() self.response_dictionary_mutex = threading.Lock() @@ -525,9 +515,7 @@ def start(self): """ starts listening to the can interface. - """ - if self.bus is None: self.logger.error("Cannot start can listener.") return @@ -546,7 +534,6 @@ def stop(self): """ Stop listening the can interface - """ self.run = False self.logger.debug("\nCan listener has stopped.") @@ -579,7 +566,6 @@ Handles messages added to the leahi_dialin canbus message queue @return: None """ - while True: if not self.message_queue: @@ -739,7 +725,6 @@ @param function_ptr: function reference """ - self.ui_received_function_ptr = function_ptr def send(self, @@ -826,7 +811,6 @@ @param send: (bool) Whether we're sending or receiving this packet @return: The styled message """ - tmp = str(message) data = tmp[-41:-18].upper()