Configure network driver via project.source.update, then connect.
(api_client, device_simulator)
| 43 | |
| 44 | |
| 45 | def _connect_network(api_client, device_simulator): |
| 46 | """Configure network driver via project.source.update, then connect.""" |
| 47 | # Set network bus type first so activeUiDriver() returns m_networkUi |
| 48 | api_client.command("io.setBusType", {"busType": 1}) |
| 49 | time.sleep(0.1) |
| 50 | |
| 51 | api_client.source_configure( |
| 52 | 0, |
| 53 | { |
| 54 | "address": "127.0.0.1", |
| 55 | "tcpPort": 9000, |
| 56 | "socketTypeIndex": 0, |
| 57 | }, |
| 58 | ) |
| 59 | time.sleep(0.1) |
| 60 | |
| 61 | api_client.configure_frame_parser( |
| 62 | start_sequence="/*", end_sequence="*/", operation_mode=0, frame_detection=1 |
| 63 | ) |
| 64 | api_client.command("project.activate") |
| 65 | time.sleep(0.2) |
| 66 | |
| 67 | api_client.connect_device() |
| 68 | assert device_simulator.wait_for_connection( |
| 69 | timeout=5.0 |
| 70 | ), "Serial Studio did not connect to the device simulator within 5 seconds" |
| 71 | |
| 72 | |
| 73 | def _send_json_frame(api_client, device_simulator, values: list): |
no test coverage detected