Index: dialin/hd/blood_leak.py =================================================================== diff -u -rdfc8ec94949bcbd6ff0a3da7c1e6425895e34d93 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- dialin/hd/blood_leak.py (.../blood_leak.py) (revision dfc8ec94949bcbd6ff0a3da7c1e6425895e34d93) +++ dialin/hd/blood_leak.py (.../blood_leak.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -206,9 +206,16 @@ # Attach the observer to the list self.attach(observer) + observer_sleep_time = 0.1 + observer_time_out = int(20 / observer_sleep_time) + observer_timer_counter = 0 # Wait until data has been received from firmware while not observer.received: - sleep(0.1) + sleep(observer_sleep_time) + if observer_timer_counter >= observer_time_out: + print('Observer Timeout') + break + observer_timer_counter += 1 # Done with receiving the response from the firmware self._is_emb_mode_command_in_progress = False @@ -418,4 +425,3 @@ # Loop through the length and get the char, char_index = bytearray_to_byte(payload, index + i, False) self.blood_leak_emb_mode_cmd_response += chr(char) - Index: dialin/hd/hemodialysis_device.py =================================================================== diff -u -re6c27d820ba1e0dc880f2242a8b11103aa4d3807 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision e6c27d820ba1e0dc880f2242a8b11103aa4d3807) +++ dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -211,12 +211,13 @@ char, char_index = bytearray_to_byte(payload, index + i, False) temp_message += chr(char) - self.hd_debug_event_index = 0 if self.hd_debug_event_index == self._HD_DEBUG_EVENT_LIST_COUNT - 1 else \ - self.hd_debug_event_index + 1 - self.hd_debug_events.insert(self.hd_debug_event_index, temp_message) self.hd_last_debug_event = temp_message + self.hd_debug_event_index += 1 + if self.hd_debug_event_index == self._HD_DEBUG_EVENT_LIST_COUNT: + self.hd_debug_event_index = 0 + @publish(["hd_logged_in"]) def hd_set_logged_in_status(self, logged_in: bool = False): """ Index: tests/dg_nvm_scripts.py =================================================================== diff -u -r2c6d0a9de5e06a58a3c1e83ed424b028224edc91 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 2c6d0a9de5e06a58a3c1e83ed424b028224edc91) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -32,7 +32,7 @@ # Use cmd_set_dg_sw_config_record() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2022-04-20-DG-SW-CONFIGS-Record.xlsx') + #dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2022-04-20-DG-SW-CONFIGS-Record.xlsx') # Use this function to reset the configuration records to all be 0 #dg.sw_configs.cmd_reset_dg_sw_config_record() Index: tests/hd_blood_leak_data.py =================================================================== diff -u -rdfc8ec94949bcbd6ff0a3da7c1e6425895e34d93 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- tests/hd_blood_leak_data.py (.../hd_blood_leak_data.py) (revision dfc8ec94949bcbd6ff0a3da7c1e6425895e34d93) +++ tests/hd_blood_leak_data.py (.../hd_blood_leak_data.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -39,16 +39,42 @@ # Create an HD object called hd hd = HD(log_level='DEBUG') hd.cmd_log_in_to_hd() - sleep(2) + sleep(1) #hd.blood_leak.cmd_blood_leak_data_broadcast_interval_override(50) - #hd.blood_leak.cmd_blood_leak_set_to_embedded_mode() + hd.blood_leak.cmd_blood_leak_set_to_embedded_mode() - hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.I.value) - print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + while True: + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.I.value, msg_payload=125) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.V.value, msg_payload=125) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.SP.value, msg_payload=30) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.D.value, msg_payload=30) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.Z.value, msg_payload=30) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.Q.value, msg_payload=30) + + print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) + + + + """ f = open("/home/fw/projects/dialin/tests/blood_leak.log", "w") Index: tests/hd_nvm_scripts.py =================================================================== diff -u -r5239867d81fd373c44964081fa9a8a5a93d10ff6 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision 5239867d81fd373c44964081fa9a8a5a93d10ff6) +++ tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -14,6 +14,7 @@ # ############################################################################ from dialin import HD +from time import sleep def run_sw_configs_commands(): @@ -67,8 +68,12 @@ if hd.cmd_log_in_to_hd(): # Comment this function if not needed - run_sw_configs_commands() + #run_sw_configs_commands() # Comment this function if not needed #run_calibration_commands() + hd.system_record.cmd_request_hd_system_record() + sleep(1) + print(hd.system_record.get_hd_system_record()) + Index: tests/peter/test_hd_records.py =================================================================== diff -u -r88b4967ce6b9ac816ac21b26326450de4b540887 -re8e24c91409226c335960c7bddb5ab5edee0aeca --- tests/peter/test_hd_records.py (.../test_hd_records.py) (revision 88b4967ce6b9ac816ac21b26326450de4b540887) +++ tests/peter/test_hd_records.py (.../test_hd_records.py) (revision e8e24c91409226c335960c7bddb5ab5edee0aeca) @@ -161,10 +161,10 @@ if __name__ == "__main__": # test_hd_reset_record_record() - test_hd_sw_config_record() + #test_hd_sw_config_record() #test_hd_calibration_record() #test_hd_service_record() #test_hd_reset_system_record() - #test_hd_system_record() + test_hd_system_record() # test_crc() # test_hd_system_record()