Index: dialin/dg/dialysate_generator.py =================================================================== diff -u -rfffbd99bcd6d15ce790e490e3b455fda43e34b8d -r0cab9b7a747d7e2dfc36698ea2481b62971ec786 --- dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision fffbd99bcd6d15ce790e490e3b455fda43e34b8d) +++ dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision 0cab9b7a747d7e2dfc36698ea2481b62971ec786) @@ -234,11 +234,12 @@ self.dg_operation_mode = mode[0] self.dg_operation_sub_mode = smode[0] - def cmd_log_in_to_dg(self): + def cmd_log_in_to_dg(self, resend: bool = False): """ Constructs and sends a login command via CAN bus. Login required before \n other commands can be sent to the DG. + @param resend: (bool) if False (default), try to login once. Otherwise, tries to login indefinitely @return: 1 if logged in, 0 if log in failed """ @@ -249,7 +250,7 @@ self.logger.info("Logging in to the DG...") # Send message - received_message = self.can_interface.send(message) + received_message = self.can_interface.send(message, resend=resend) if received_message is not None: if received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] == 1: Index: dialin/hd/hemodialysis_device.py =================================================================== diff -u -r48606d83a0f15b06d9de893c2c5017c35f266264 -r0cab9b7a747d7e2dfc36698ea2481b62971ec786 --- dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 48606d83a0f15b06d9de893c2c5017c35f266264) +++ dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 0cab9b7a747d7e2dfc36698ea2481b62971ec786) @@ -189,11 +189,12 @@ self.hd_operation_mode = mode[0] self.hd_operation_sub_mode = smode[0] - def cmd_log_in_to_hd(self): + def cmd_log_in_to_hd(self, resend: bool = False): """ Constructs and sends a login command via CAN bus. Login required before \n other commands can be sent to the HD. + @param resend: (bool) if False (default), try to login once. Otherwise, tries to login indefinitely @return: 1 if logged in, 0 if log in failed """ @@ -204,7 +205,7 @@ self.logger.debug("Logging in...") # Send message - received_message = self.can_interface.send(message) + received_message = self.can_interface.send(message, resend=resend) if received_message is not None: if received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] == 1: