Index: dialin/hd/dg_proxy.py =================================================================== diff -u -r2c9af55b37926e59b48675e39b09cb81adff50e9 -r7dd2efd57eb7353a88af7ba058ac4e232bca4006 --- dialin/hd/dg_proxy.py (.../dg_proxy.py) (revision 2c9af55b37926e59b48675e39b09cb81adff50e9) +++ dialin/hd/dg_proxy.py (.../dg_proxy.py) (revision 7dd2efd57eb7353a88af7ba058ac4e232bca4006) @@ -22,7 +22,7 @@ from ..dg import NO_RESET, RESET -class DGHDProxy(AbstractSubSystem): +class HDDGProxy(AbstractSubSystem): """ Hemodialysis Device (HD) Dialin API sub-class for DG proxy commands. """ @@ -36,16 +36,19 @@ self.can_interface = can_interface self.logger = logger - - def cmd_dg_send_command_response(self): + def cmd_dg_send_command_response(self, cmd_id: int = 0, rejected: bool = 0, rejection_code:int = 0): """ - Constructs and sends a ui disposable installation confirm message + Constructs and sends a DG command response to the HD. @return: none """ + cmd = integer_to_bytearray(cmd_id) + rej = integer_to_bytearray(rejected) + rec = integer_to_bytearray(rejection_code) + payload = cmd + rej + rec + message = DenaliMessage.build_message(channel_id=DenaliChannels.dg_to_hd_ch_id, + message_id=MsgIds.MSG_ID_DG_COMMAND_RESPONSE.value, + payload=payload) - message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, - message_id=MsgIds.MSG_ID_UI_INSTALLATION_CONFIRM.value) - - self.logger.debug("Sending user disposable installation confirm to HD.") - self.can_interface.send(message, 0) \ No newline at end of file + self.logger.debug("Sending DG command response to the HD.") + self.can_interface.send(message, 0)