winIDEA SDK
Loading...
Searching...
No Matches
test_run_stop.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
# (c) TASKING Germany GmbH, 2023
#
# This Python example calls the run() and stop()
# functions which start or stop the target CPU. It then prints
# out whether the CPU is in a running or stopped state.
import isystem.connect as ic
winidea_id = ''
def test_run_stop():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
execCtrl = ic.CExecutionController(connMgr)
execCtrl.run()
isRunning = execCtrl.getCPUStatus(False).isRunning()
print(f"Is CPU in `RUN` state: {isRunning}")
execCtrl.stop()
isStopped = execCtrl.getCPUStatus(False).isStopped()
print(f"Is CPU in `STOP` state: {isStopped}")
if __name__ == "__main__":
test_run_stop()