Index: leahi_dialin/fp/filtration_purification.py =================================================================== diff -u -r5224de78275fde7b4699f8e903f53b645be6ec0a -r31d0d53df3f8bff9f9f401beb10200c6af711e63 --- leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision 5224de78275fde7b4699f8e903f53b645be6ec0a) +++ leahi_dialin/fp/filtration_purification.py (.../filtration_purification.py) (revision 31d0d53df3f8bff9f9f401beb10200c6af711e63) @@ -77,8 +77,7 @@ self.callback_id = None # register handler for FP operation mode broadcast messages if self.can_interface is not None: - channel_id = DenaliChannels.fp_sync_broadcast_ch_id - self.can_interface.register_receiving_publication_function(channel_id, + self.can_interface.register_receiving_publication_function(DenaliChannels.fp_sync_broadcast_ch_id, MsgIds.MSG_ID_FP_OP_MODE_DATA.value, self._handler_fp_op_mode_sync) @@ -87,14 +86,14 @@ MsgIds.MSG_ID_DD_VERSION_RESPONSE.value, self._handler_fp_version_response_sync) - self.can_interface.register_receiving_publication_function(channel_id, + self.can_interface.register_receiving_publication_function(DenaliChannels.fp_sync_broadcast_ch_id, MsgIds.MSG_ID_FP_DEBUG_EVENT.value, self._handler_fp_debug_event_sync) - self.can_interface.register_receiving_publication_function(channel_id, + self.can_interface.register_receiving_publication_function(DenaliChannels.dd_to_dialin_ch_id, MsgIds.MSG_ID_FP_DEF_STATUS_RESPONSE.value, self._handler_fp_defeatured_response) - self.can_interface.register_receiving_publication_function(channel_id, + self.can_interface.register_receiving_publication_function(DenaliChannels.dd_to_dialin_ch_id, MsgIds.MSG_ID_FP_BOOST_PUMP_INSTALL_STATUS_RESPONSE.value, self._handler_fp_boost_pump_installed_response) # Dialin will send a login message during construction. This is for the leahi subsystems to start @@ -232,8 +231,8 @@ @param message: defeatured response from FP @return: None """ - self.fp_defeatured = struct.unpack('?', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1])) + self.fp_defeatured = True if struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] == 1 else False self.fp_defeatured_timestamp = timestamp @@ -246,8 +245,8 @@ @param message: defeatured response from FP @return: None """ - self.fp_p40_installed = struct.unpack('?', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1])) + self.fp_p40_installed = True if struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] == 1 else False self.fp_p40_installed_timestamp = timestamp