From b593019b3f13feca7efeecb2ffb9cb42c8535b2e Mon Sep 17 00:00:00 2001 From: "Michael D. M. Dryden" Date: Thu, 7 Apr 2022 16:37:23 -0400 Subject: [PATCH] Fix experiment_process.py parameter sending protocol. --- dstat_interface/core/dstat/experiment_process.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dstat_interface/core/dstat/experiment_process.py b/dstat_interface/core/dstat/experiment_process.py index b82ea0b..98501a4 100644 --- a/dstat_interface/core/dstat/experiment_process.py +++ b/dstat_interface/core/dstat/experiment_process.py @@ -123,22 +123,22 @@ class BaseExperimentProcess(ABC): logger.warning("Expected RQP %s got: %s", n_params, reply) continue - tries = 5 - for i in params: - while True: + tries = 5 + while tries: self.serial.write(f"{i} ".encode('ascii')) try: reply = get_reply() if reply == f"@RCVC {i}": break - except serial.SerialException: - if tries <= 0: + elif reply == "@RCVE": continue + except serial.SerialException: tries -= 1 - pass - else: - break + continue + else: + logger.error('Communication failure') + return False return True return False -- GitLab