Wire up project + JS split parser + network driver, then connect.
(api_client, device_simulator)
| 46 | |
| 47 | |
| 48 | def _connect_device(api_client, device_simulator): |
| 49 | """Wire up project + JS split parser + network driver, then connect.""" |
| 50 | api_client.configure_network(host="127.0.0.1", port=9000, socket_type="tcp") |
| 51 | time.sleep(0.1) |
| 52 | api_client.set_operation_mode("project") |
| 53 | api_client.configure_frame_parser( |
| 54 | start_sequence="", end_sequence="\n", operation_mode=0, frame_detection=0 |
| 55 | ) |
| 56 | api_client.set_frame_parser_code(_JS_SPLIT_PARSER, language=0) |
| 57 | api_client.command("project.activate") |
| 58 | time.sleep(0.2) |
| 59 | api_client.connect_device() |
| 60 | assert device_simulator.wait_for_connection( |
| 61 | timeout=5.0 |
| 62 | ), "Serial Studio did not connect to the device simulator within 5 seconds" |
| 63 | |
| 64 | |
| 65 | def _wait_for_frame(api_client, min_sequence: int = 1, timeout: float = 5.0) -> dict: |
no test coverage detected