MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _connect_device

Function _connect_device

tests/integration/test_script_api_call.py:61–74  ·  view source on GitHub ↗

Wire up project + frame parser + network driver, then connect.

(api_client, device_simulator)

Source from the content-addressed store, hash-verified

59
60
61def _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# -----------------------------------------------------------------------------

Calls 6

configure_networkMethod · 0.80
set_operation_modeMethod · 0.80
commandMethod · 0.80
connect_deviceMethod · 0.80
wait_for_connectionMethod · 0.45

Tested by

no test coverage detected