winIDEA SDK
test_hot_attach_detach.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3#
4# This Python example performs a hot attach and detach. Hot Attach and Detach functionality allows you
5# to attach (and detach) the BlueBox development system to a running target system without
6# affecting its operation and have all debug functions available.
7
8import isystem.connect as ic
9
10
11winidea_id = ''
12
13
14def test_hotAttachDetach():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17
18 execCtrl = ic.CExecutionController(connMgr)
19
20 sess_ctrl = ic.CSessionCtrl(connMgr)
21 sess_ctrl.begin_prepare()
22
23 if execCtrl.hotDetach() == 0:
24 print(f"Hot detach succeeded, winIDEA is in `detached` state.")
25
26 if execCtrl.hotAttach() == 0:
27 print(f"Hot attach succeeded, winIDEA is connected.")
28
29
30if __name__ == "__main__":
31 test_hotAttachDetach()