add loop breaker to test
This commit is contained in:
1 parent
4c205bdfa0
commit
0b4bb35962
3 files changed
+139
-1
No files matched your search
+8
-1
@@ -275,6 +275,7 @@ def test(test_count = 0, bt_usb_id = None) -> None:
|
||||
return -1
|
||||
log.info(f"Ensuring BLE active...")
|
||||
test_loop_count = 0
|
||||
reset_count = 0
|
||||
found_macs = scan_macs()
|
||||
log.info("Found these MACs on a scan:")
|
||||
log.info(found_macs)
|
||||
@@ -290,7 +291,12 @@ def test(test_count = 0, bt_usb_id = None) -> None:
|
||||
log.info(f" Scanning MACs: {mac_list}")
|
||||
test_list = mac_list
|
||||
while not test_result:
|
||||
log.info(f" Test run {test_count} loop {test_loop_count} start. Initializing run...")
|
||||
if test_count > 20:
|
||||
reset_adapter()
|
||||
reset_count = reset_count + 1
|
||||
test_loop_count = 0
|
||||
log.warning("Too many test loops - resetting adapter")
|
||||
log.info(f" Test run {test_count} loop {reset_count}.{test_loop_count} start. Initializing run...")
|
||||
test_run_results = sensor_data_query(test_list)
|
||||
test_loop_count = test_loop_count + 1
|
||||
for test_run_result in test_run_results:
|
||||
@@ -362,6 +368,7 @@ if __name__ == "__main__":
|
||||
log.info(f"BLE USB ID Detected: {current_usb_id} - Resetting")
|
||||
reset_adapter()
|
||||
test_count = 0
|
||||
reset_count = 0
|
||||
test_results = []
|
||||
log.info(f"Starting BLE Test for {count} iterations")
|
||||
while test_count < count:
|
||||
|
||||
Reference in new issue
Block a user