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

Function _connect_device

tests/integration/test_2d_array_parsing.py:100–115  ·  view source on GitHub ↗

Configure network driver, frame parser, load project, and connect device.

(api_client, device_simulator)

Source from the content-addressed store, hash-verified

98
99
100def _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
118class TestBasic2DArrayParsing:

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