Index: dialin/hd/hemodialysis_device.py =================================================================== diff -u -r0cab9b7a747d7e2dfc36698ea2481b62971ec786 -r09ee2e537391d9fbcccf640e90cbf2e0d3c6644e --- dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 0cab9b7a747d7e2dfc36698ea2481b62971ec786) +++ dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 09ee2e537391d9fbcccf640e90cbf2e0d3c6644e) @@ -91,6 +91,9 @@ msg_id = MsgIds.MSG_ID_HD_CALIBRATION_DATA.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_hd_cal_data_sync) + msg_id = MsgIds.MSG_ID_CAN_ERROR_COUNT.value + self.can_interface.register_receiving_publication_function(channel_id, msg_id, + self._handler_can_fault_sync) # create properties self.hd_operation_mode = self.HD_OP_MODE_INIT_POST @@ -103,6 +106,7 @@ "BloodFlowOffset":0.0, "DialysateFlowGain":0.0, "DialysateFlowOffset":0.0} + self.can_faults = 0 # Create command groups @@ -189,6 +193,19 @@ self.hd_operation_mode = mode[0] self.hd_operation_sub_mode = smode[0] + @_publish(["can_faults"]) + def _handler_can_fault_sync(self, message): + """ + Handles CAN Fault broadcasts + + @param message: published HD operation mode broadcast message + @return: None + """ + can_faults = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1])) + + self.can_faults = can_faults + def cmd_log_in_to_hd(self, resend: bool = False): """ Constructs and sends a login command via CAN bus. Login required before \n Index: dialin/hd/treatment.py =================================================================== diff -u -r363867c876456821000c189f86fbb55b4d583c50 -r09ee2e537391d9fbcccf640e90cbf2e0d3c6644e --- dialin/hd/treatment.py (.../treatment.py) (revision 363867c876456821000c189f86fbb55b4d583c50) +++ dialin/hd/treatment.py (.../treatment.py) (revision 09ee2e537391d9fbcccf640e90cbf2e0d3c6644e) @@ -208,7 +208,7 @@ @_publish([ "treatment_state", "treatment_uf_state", - "saline_bolus_in_progress" + "saline_bolus_state" ]) def _handler_treatment_state_sync(self, message): """