Wire up project + frame parser + network driver, then connect.
(api_client, device_simulator)
| 59 | |
| 60 | |
| 61 | def _connect_device(api_client, device_simulator): |
| 62 | """Wire up project + frame parser + network driver, then connect.""" |
| 63 | api_client.configure_network(host="127.0.0.1", port=9000, socket_type="tcp") |
| 64 | time.sleep(0.1) |
| 65 | api_client.set_operation_mode("project") |
| 66 | api_client.configure_frame_parser( |
| 67 | start_sequence="", end_sequence="\n", operation_mode=0, frame_detection=0 |
| 68 | ) |
| 69 | api_client.command("project.activate") |
| 70 | time.sleep(0.2) |
| 71 | api_client.connect_device() |
| 72 | assert device_simulator.wait_for_connection( |
| 73 | timeout=5.0 |
| 74 | ), "Serial Studio did not connect to the device simulator within 5 seconds" |
| 75 | |
| 76 | |
| 77 | # ----------------------------------------------------------------------------- |
no test coverage detected