Index: dialin/hd/calibration_record.py =================================================================== diff -u -r4ae44d3a14162f866419d28db99864f790e3512e -r4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07 --- dialin/hd/calibration_record.py (.../calibration_record.py) (revision 4ae44d3a14162f866419d28db99864f790e3512e) +++ dialin/hd/calibration_record.py (.../calibration_record.py) (revision 4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07) @@ -227,7 +227,7 @@ """ self.logger.debug("Received a complete hd calibration record.") - def cmd_set_hd_calibration_excel_to_fw(self, report_address: str): + def cmd_set_hd_calibration_excel_to_fw(self, report_address: str) -> bool: """ Handles setting the calibration data that is in an excel report to the firmware. @@ -248,7 +248,8 @@ self._utilities.write_excel_record_to_fw_record(self.hd_calibration_record, report_address, self._utilities.CAL_RECORD_TAB_NAME) - self.cmd_set_hd_calibration_record(self.hd_calibration_record) + ret = self.cmd_set_hd_calibration_record(self.hd_calibration_record) + return ret def cmd_set_hd_calibration_record(self, hd_calibration_record: OrderedDict) -> bool: """ @@ -258,6 +259,7 @@ @param hd_calibration_record: (OrderedDict) the hd calibration record to be sent @return: none """ + transfer_status = 1 record_packets = self._utilities.prepare_record_to_send_to_fw(hd_calibration_record) self.logger.debug("Setting HD calibration record") @@ -279,12 +281,18 @@ # If there is no content... if received_message is None: - self.logger.debug("Timeout!!!!") + self.logger.warning("HD ACK not received!") + continue + elif transfer_status == 0: + self.logger.debug("Sending HD calibration record failed") return False - self.logger.debug("Finished sending HD calibration record.") - return True + transfer_status = received_message['message'][6] + if transfer_status == 1: + self.logger.debug("Finished sending HD calibration record.") + return True + def _prepare_hd_calibration_record(self): """ Handles assembling the sub dictionaries of each hardware group to make the main HD calibration_record record. Index: dialin/hd/service_record.py =================================================================== diff -u -r4ae44d3a14162f866419d28db99864f790e3512e -r4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07 --- dialin/hd/service_record.py (.../service_record.py) (revision 4ae44d3a14162f866419d28db99864f790e3512e) +++ dialin/hd/service_record.py (.../service_record.py) (revision 4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07) @@ -209,7 +209,7 @@ @param hd_service_record: (OrderedDict) the hd service record to be sent @return: True upon success, False otherwise """ - + transfer_status = 1 self.logger.debug('Setting HD service record') record_packets = self._utilities.prepare_record_to_send_to_fw(hd_service_record) @@ -231,12 +231,18 @@ # If there is no content... if received_message is None: - self.logger.debug("Timeout!!!!") + self.logger.warning("HD ACK not received!") + continue + elif transfer_status == 0: + self.logger.debug("Sending HD service record failed") return False - self.logger.debug("Finished sending HD service record.") - return True + transfer_status = received_message['message'][6] + if transfer_status == 1: + self.logger.debug("Finished sending HD service record.") + return True + def _prepare_hd_service_record(self): """ Handles assembling the sub dictionaries of each group to make the main HD service record. @@ -291,7 +297,7 @@ return service_records, groups_byte_size - def cmd_set_dg_service_record_excel_to_fw(self, report_address: str): + def cmd_set_dg_service_record_excel_to_fw(self, report_address: str) -> bool: """ Handles setting the service record data that is in an excel report to the firmware. @@ -310,7 +316,8 @@ self._utilities.write_excel_record_to_fw_record(self.hd_service_record, report_address, self._utilities.SERVICE_RECORD_TAB_NAME) - self.cmd_set_hd_service_record(self.hd_service_record) + ret = self.cmd_set_hd_service_record(self.hd_service_record) + return ret def cmd_get_hd_service_record(self, report_address: str = None): """ Index: dialin/hd/system_record.py =================================================================== diff -u -r4ae44d3a14162f866419d28db99864f790e3512e -r4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07 --- dialin/hd/system_record.py (.../system_record.py) (revision 4ae44d3a14162f866419d28db99864f790e3512e) +++ dialin/hd/system_record.py (.../system_record.py) (revision 4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07) @@ -238,7 +238,7 @@ """ self.logger.debug("Received a complete hd system record.") - def cmd_set_hd_system_record_excel_to_fw(self, report_address: str): + def cmd_set_hd_system_record_excel_to_fw(self, report_address: str) -> bool: """ Handles setting the system data that is in an excel report to the firmware. @@ -258,7 +258,8 @@ self._utilities.write_excel_record_to_fw_record(self.hd_system_record, report_address, self._utilities.SYSTEM_RECORD_TAB_NAME) - self.cmd_set_hd_system_record(self.hd_system_record) + ret = self.cmd_set_hd_system_record(self.hd_system_record) + return ret def cmd_set_hd_system_record(self, hd_system_record: OrderedDict) -> bool: """ @@ -267,6 +268,7 @@ @param hd_system_record: (OrderedDict) the hd system record to be sent @return: True upon success, False otherwise """ + transfer_status = 1 record_packets = self._utilities.prepare_record_to_send_to_fw(hd_system_record) self.logger.debug('Setting HD system record') @@ -288,12 +290,18 @@ # If there is no content... if received_message is None: - self.logger.debug("Timeout!!!!") + self.logger.warning("HD ACK not received!") + continue + elif transfer_status == 0: + self.logger.debug("Sending HD system record failed") return False - self.logger.debug("Finished sending HD system record.") - return True + transfer_status = received_message['message'][6] + if transfer_status == 1: + self.logger.debug("Finished sending HD system record.") + return True + def _prepare_hd_system_record(self): """ Handles assembling the sub dictionaries of each group to make the main HD system record. Index: dialin/hd/usage_info_record.py =================================================================== diff -u -r4ae44d3a14162f866419d28db99864f790e3512e -r4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07 --- dialin/hd/usage_info_record.py (.../usage_info_record.py) (revision 4ae44d3a14162f866419d28db99864f790e3512e) +++ dialin/hd/usage_info_record.py (.../usage_info_record.py) (revision 4d7e10ab036e6b21a5c206b9b5a5e22ffdb29f07) @@ -214,12 +214,18 @@ # If there is no content... if received_message is None: - self.logger.debug("Timeout!!!!") + self.logger.warning("HD ACK not received!") + continue + elif transfer_status == 0: + self.logger.debug("Sending HD usage info record failed") return False - self.logger.debug("Finished sending HD usage information record.") - return True + transfer_status = received_message['message'][6] + if transfer_status == 1: + self.logger.debug("Finished sending HD usage info record.") + return True + def _prepare_hd_usage_info_record(self) -> OrderedDict: """ Handles assembling the sub dictionaries of HD usage information. @@ -314,7 +320,7 @@ return status - def cmd_set_dg_usage_info_excel_to_fw(self, report_address: str): + def cmd_set_dg_usage_info_excel_to_fw(self, report_address: str) -> bool: """ Handles setting the usage info data that is in an excel report to the firmware. @@ -333,5 +339,6 @@ self._utilities.write_excel_record_to_fw_record(self.hd_usage_info_record, report_address, self._utilities.USAGE_INFO_RECORD_TAB_NAME) - self._cmd_set_hd_usage_info_record(self.hd_usage_info_record) + ret = self._cmd_set_hd_usage_info_record(self.hd_usage_info_record) + return ret