Index: dialin/hd/blood_leak.py =================================================================== diff -u -rf5ed119ffe4c4cf520b22221073b1ff9a6f5968a -rdfc8ec94949bcbd6ff0a3da7c1e6425895e34d93 --- dialin/hd/blood_leak.py (.../blood_leak.py) (revision f5ed119ffe4c4cf520b22221073b1ff9a6f5968a) +++ dialin/hd/blood_leak.py (.../blood_leak.py) (revision dfc8ec94949bcbd6ff0a3da7c1e6425895e34d93) @@ -29,7 +29,7 @@ @unique class EmbModeCommands(DialinEnum): NU = 0 # NULL command - CS = 1 # Control S command (this is handled automatically) + CS = 1 # Control S command (this is handled automatically by using the embedded mode command) SP = 2 # Set point command T = 3 G = 4 @@ -345,6 +345,8 @@ def cmd_blood_leak_set_to_embedded_mode(self): """ Constructs and sends switching to embedded mode command + Constraints: + Must be logged into HD. @return: non-zero integer if successful, False otherwise """ @@ -367,6 +369,8 @@ def cmd_blood_leak_set_embedded_mode_command(self, command: int, msg_payload: int = None): """ Constructs and sends switching to embedded mode command + Constraints: + Must be logged into HD. @return: non-zero integer if successful, False otherwise """ @@ -404,6 +408,8 @@ @param message: published blood leak status message @return: None """ + # Clear the variable for the next read + self.blood_leak_emb_mode_cmd_response = '' payload = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 length, index = bytearray_to_integer(payload, index, False) Index: tests/hd_blood_leak_data.py =================================================================== diff -u -rf5ed119ffe4c4cf520b22221073b1ff9a6f5968a -rdfc8ec94949bcbd6ff0a3da7c1e6425895e34d93 --- tests/hd_blood_leak_data.py (.../hd_blood_leak_data.py) (revision f5ed119ffe4c4cf520b22221073b1ff9a6f5968a) +++ tests/hd_blood_leak_data.py (.../hd_blood_leak_data.py) (revision dfc8ec94949bcbd6ff0a3da7c1e6425895e34d93) @@ -45,14 +45,10 @@ #hd.blood_leak.cmd_blood_leak_set_to_embedded_mode() - hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.Q.value, msg_payload=100) + hd.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.I.value) print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) - sleep(1) - - print(hd.blood_leak.get_blood_leak_emb_mode_command_response()) - """ f = open("/home/fw/projects/dialin/tests/blood_leak.log", "w")