Index: dialin/common/msg_ids.py =================================================================== diff -u -r5ec51022d4c81fba0406aecfbb9b5cdfe4f7d068 -rb53475c9910e6d180ee5b493f417c507cedbb06c --- dialin/common/msg_ids.py (.../msg_ids.py) (revision 5ec51022d4c81fba0406aecfbb9b5cdfe4f7d068) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision b53475c9910e6d180ee5b493f417c507cedbb06c) @@ -200,6 +200,8 @@ MSG_ID_HD_RESPONSE_SERVICE_MODE_REQUEST = 0xB1 MSG_ID_HD_REQUEST_UI_FINAL_POST_RESULT = 0xB2 MSG_ID_DG_FLOW_SENSORS_DATA = 0xB3 + MSG_ID_DG_RESPONSE_SERVICE_MODE_REQUEST = 0xB4 + MSG_ID_HD_REQUEST_DG_ALARMS = 0xB5 MSG_ID_CAN_ERROR_COUNT = 0x999 @@ -334,6 +336,7 @@ MSG_ID_HD_SET_BLOOD_LEAK_2_EMB_MODE = 0x8081 MSG_ID_HD_SET_BLOOD_LEAK_EMB_MODE_COMMAND = 0x8082 MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE = 0x8083 + MSG_ID_HD_SEND_ALARMS_COMMAND = 0x8084 MSG_ID_DG_TESTER_LOGIN_REQUEST = 0xA000 MSG_ID_DG_ALARM_STATE_OVERRIDE = 0xA001 Index: dialin/dg/hd_proxy.py =================================================================== diff -u -r31c0b4a36d8bafbb69e217803546291b1af30f02 -rb53475c9910e6d180ee5b493f417c507cedbb06c --- dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision 31c0b4a36d8bafbb69e217803546291b1af30f02) +++ dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision b53475c9910e6d180ee5b493f417c507cedbb06c) @@ -335,6 +335,28 @@ self.logger.debug("Timeout!!!!") return False + def cmd_resend_dg_alarms(self) -> int: + """ + Constructs and sends the re-send DG alarms command + This will allow Dialin to get caught up with DG alarms that were triggered prior to connection. + + @return: non-zero integer if successful, False otherwise + """ + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_HD_REQUEST_DG_ALARMS.value) + + self.logger.debug("Command to re-send all active DG alarms acknowledged.") + + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.debug("Timeout!!!!") + return False + def cmd_hd_communication_status_override(self, status: bool, reset: int = NO_RESET) -> int: """ Constructs and sends the HD communication status override command. Index: dialin/hd/alarms.py =================================================================== diff -u -re33629935d88cb1e46c04cadc630e63e1e3c9058 -rb53475c9910e6d180ee5b493f417c507cedbb06c --- dialin/hd/alarms.py (.../alarms.py) (revision e33629935d88cb1e46c04cadc630e63e1e3c9058) +++ dialin/hd/alarms.py (.../alarms.py) (revision b53475c9910e6d180ee5b493f417c507cedbb06c) @@ -480,6 +480,29 @@ return 1 == received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] return False + def cmd_resend_all_alarms(self) -> int: + """ + Constructs and sends the re-send all active alarms command. + This will allow Dialin to get caught up with HD alarms that were triggered prior to connection. + Constraints: + Must be logged into HD. + + @return: 1 if successful, zero otherwise + """ + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, + message_id=MsgIds.MSG_ID_HD_SEND_ALARMS_COMMAND.value) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + self.logger.debug("Command to re-send all active HD alarms acknowledged.") + # response payload is OK or not OK + return 1 == received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + return False + def cmd_alarm_state_override(self, alarm: int, state: int, reset: int = NO_RESET) -> int: """ Constructs and sends the alarm state override command