| NR_EN_DC_STATUS_COMMAND = b"AT+QENDC\r\n" | NR_EN_DC_STATUS_COMMAND = b"AT+QENDC\r\n" | ||||
| NR_SERIAL_RESPOND_TIME = 0.3 # s | NR_SERIAL_RESPOND_TIME = 0.3 # s | ||||
| CMD_TIME_EPOCH = "date +%s" | CMD_TIME_EPOCH = "date +%s" | ||||
| TIMEOUT_OFFSET = 5.0 | |||||
| class ProcessHandler: | class ProcessHandler: | ||||
| self.config["port"], | self.config["port"], | ||||
| ) | ) | ||||
| try: | try: | ||||
| subprocess.call(iperf_command, timeout=float(time) + 1) | |||||
| subprocess.call(iperf_command, timeout=float(time) + 1 + TIMEOUT_OFFSET) | |||||
| except: | except: | ||||
| print_message("iPerf timed out. Going ahead with next measurement...") | print_message("iPerf timed out. Going ahead with next measurement...") | ||||
| processHandler.kill_all() | processHandler.kill_all() | ||||
| "--one-off", | "--one-off", | ||||
| ] | ] | ||||
| try: | try: | ||||
| subprocess.call(iperf_command, timeout=float(time) + 1.0) | |||||
| subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET) | |||||
| except: | except: | ||||
| print_message("iPerf timed out. Going ahead with next measurement...") | print_message("iPerf timed out. Going ahead with next measurement...") | ||||
| sleep(2) | sleep(2) | ||||
| tcp_algo[congestion_control_index], | tcp_algo[congestion_control_index], | ||||
| ] | ] | ||||
| try: | try: | ||||
| subprocess.call(iperf_command, timeout=float(time) + 2) | |||||
| subprocess.call(iperf_command, timeout=float(time) + 2 + TIMEOUT_OFFSET) | |||||
| except: | except: | ||||
| print_message("iPerf timed out. Going ahead with next measurement...") | print_message("iPerf timed out. Going ahead with next measurement...") | ||||
| sleep(4) | sleep(4) | ||||
| ) | ) | ||||
| sleep(2) | sleep(2) | ||||
| try: | try: | ||||
| subprocess.call(iperf_command, timeout=float(time)+2) | |||||
| subprocess.call(iperf_command, timeout=float(time)+ 2 + TIMEOUT_OFFSET) | |||||
| except: | except: | ||||
| print_message("iPerf timed out. Going ahead with next measurement...") | print_message("iPerf timed out. Going ahead with next measurement...") | ||||
| processHandler.kill_all() | processHandler.kill_all() |