From fdc2434de6a97b1cd170f548a26618f094000654 Mon Sep 17 00:00:00 2001 From: Kevin Roscom Date: Wed, 16 Feb 2022 22:44:09 -0600 Subject: [PATCH] fake ignition script --- tools/test_ignition.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 tools/test_ignition.py 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())