diff --git a/tools/test_ignition.py b/tools/test_ignition.py new file mode 100755 index 00000000..475fe189 --- /dev/null +++ b/tools/test_ignition.py @@ -0,0 +1,36 @@ +#! /usr/bin/env python3 + +import cereal.messaging as messaging +import time + +if __name__ == "__main__": + health_sock = messaging.pub_sock('pandaState') + + try: + while 1: + + msg = messaging.new_message('pandaState') + + msg.pandaState.pandaType = 3 + + msg.pandaState.voltage = 12.0 + msg.pandaState.current = 1.0 + msg.pandaState.ignitionLine = True + msg.pandaState.ignitionCan = True + msg.pandaState.controlsAllowed = True + + health_sock.send(msg.to_bytes()) + + time.sleep(0.1) + except KeyboardInterrupt: + msg = messaging.new_message('pandaState') + + msg.pandaState.pandaType = 3 + + msg.pandaState.voltage = 12.0 + msg.pandaState.current = 1.0 + msg.pandaState.ignitionLine = False + msg.pandaState.ignitionCan = False + msg.pandaState.controlsAllowed = False + + health_sock.send(msg.to_bytes())