Configure network driver, frame parser, load project, and connect device.
(api_client, device_simulator)
| 98 | |
| 99 | |
| 100 | def _connect_device(api_client, device_simulator): |
| 101 | """Configure network driver, frame parser, load project, and connect device.""" |
| 102 | # Set bus type to Network before loading into FrameBuilder so the correct |
| 103 | # driver is active when the connection is opened. |
| 104 | api_client.configure_network(host="127.0.0.1", port=9000, socket_type="tcp") |
| 105 | time.sleep(0.1) |
| 106 | api_client.set_operation_mode("project") |
| 107 | api_client.configure_frame_parser( |
| 108 | start_sequence="/*", end_sequence="*/", operation_mode=0, frame_detection=1 |
| 109 | ) |
| 110 | api_client.command("project.activate") |
| 111 | time.sleep(0.2) |
| 112 | api_client.connect_device() |
| 113 | assert device_simulator.wait_for_connection( |
| 114 | timeout=5.0 |
| 115 | ), "Serial Studio did not connect to the device simulator within 5 seconds" |
| 116 | |
| 117 | |
| 118 | class TestBasic2DArrayParsing: |
no test coverage detected