Index: leahi_dialin/dd/proxies/td_proxy.py =================================================================== diff -u -rb5aa0da384c5cc177f83d59aa221ae28881cd26a -r2dab2b0329a56006e07cd36a3883ed099d7a367a --- leahi_dialin/dd/proxies/td_proxy.py (.../td_proxy.py) (revision b5aa0da384c5cc177f83d59aa221ae28881cd26a) +++ leahi_dialin/dd/proxies/td_proxy.py (.../td_proxy.py) (revision 2dab2b0329a56006e07cd36a3883ed099d7a367a) @@ -98,11 +98,35 @@ byp = integer_to_bytearray(bypass) acd = integer_to_bytearray(acid) bic = integer_to_bytearray(bicarb) - #payload = bic +acd + byp + temp + uf + dial + stt payload = stt + dial + uf + temp + byp + acd + bic - message = DenaliMessage.build_message(channel_id=DenaliChannels.td_to_dd_ch_id, + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dd_ch_id, message_id=MsgIds.MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA.value, payload=payload) self.logger.debug("Sending TD gen dialysate data request to DD.") + self.can_interface.send(message, 0) + + def cmd_td_send_dd_start_pre_gen_request(self, start: bool = 0, dialysate_rate: float = 0.0, dialysate_temp: float = 0.0, + acid_type: int = 0, bicarb_type: int = 0 ): + """ + Constructs and sends a TD start pre gen dialysate request to the DD. + :param start: start and stop boolean + :param dialysate_rate: dialysate rate in ml/min + :param dialysate_temp: dialysate temp in c + :param acid_type: acid type + :param bicarb_type: bicarb type + :return: + """ + stt = integer_to_bytearray(start) + dial = float_to_bytearray(dialysate_rate) + temp = float_to_bytearray(dialysate_temp) + acd = integer_to_bytearray(acid_type) + bic = integer_to_bytearray(bicarb_type) + payload = stt + dial + temp + acd + bic + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dd_ch_id, + message_id=MsgIds.MSG_ID_DD_PRE_GEN_DIALYSATE_REQUEST_DATA.value, + payload=payload) + + self.logger.debug("Sending TD start pre gen request to DD.") self.can_interface.send(message, 0) \ No newline at end of file