safety: add controls heartbeat (#806)

* safety: add controls heartbeat

* one more second

* better comments
This commit is contained in:
Adeeb Shihadeh
2021-12-15 17:28:57 -08:00
committed by GitHub
parent 305d4e6d2a
commit 6f95a096e6
3 changed files with 16 additions and 3 deletions

View File

@@ -675,8 +675,8 @@ class Panda(object):
msg += self.kline_ll_recv(msg[-1]+1, bus=bus)
return msg
def send_heartbeat(self):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xf3, 0, 0, b'')
def send_heartbeat(self, engaged=True):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xf3, engaged, 0, b'')
# disable heartbeat checks for use outside of openpilot
# sending a heartbeat will reenable the checks