winIDEA SDK
test_hot_attach_detach.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_hotAttachDetach():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 execCtrl = ic.CExecutionController(connMgr)
16
17 sess_ctrl = ic.CSessionCtrl(connMgr)
18 sess_ctrl.begin_prepare()
19
20 if execCtrl.hotDetach() == 0:
21 print(f"Hot detach succeeded, winIDEA is in `detached` state.")
22
23 if execCtrl.hotAttach() == 0:
24 print(f"Hot attach succeeded, winIDEA is connected.")
25
26
27if __name__ == "__main__":
28 test_hotAttachDetach()