(api_client, device_simulator)
| 76 | |
| 77 | |
| 78 | def _attach_via_network(api_client, device_simulator) -> None: |
| 79 | api_client.configure_network(host="127.0.0.1", port=9000, socket_type="tcp") |
| 80 | time.sleep(0.1) |
| 81 | api_client.set_operation_mode("project") |
| 82 | api_client.configure_frame_parser( |
| 83 | start_sequence="/*", end_sequence="*/", operation_mode=0, frame_detection=1 |
| 84 | ) |
| 85 | try: |
| 86 | api_client.command("project.activate") |
| 87 | except APIError: |
| 88 | pass |
| 89 | time.sleep(0.2) |
| 90 | api_client.connect_device() |
| 91 | assert device_simulator.wait_for_connection( |
| 92 | timeout=5.0 |
| 93 | ), "Serial Studio did not connect to the device simulator" |
| 94 | |
| 95 | |
| 96 | def _wait_for_publisher_connected(api_client, timeout: float = 8.0) -> bool: |
no test coverage detected