python lib: disable checks on reconnect

This commit is contained in:
Adeeb Shihadeh 2022-08-18 22:01:12 -07:00 committed by Bruce Wayne
parent 36b317185c
commit d3e2477231
1 changed files with 7 additions and 4 deletions

View File

@ -211,16 +211,14 @@ class Panda:
def __init__(self, serial: Optional[str] = None, claim: bool = True, disable_checks: bool = True):
self._serial = serial
self._disable_checks = disable_checks
self._handle = None
self._bcd_device = None
# connect and set mcu type
self.connect(claim)
# disable openpilot's heartbeat checks
if disable_checks:
self.set_heartbeat_disabled()
self.set_power_save(0)
def close(self):
self._handle.close()
@ -270,6 +268,11 @@ class Panda:
self.health_version, self.can_version = self.get_packets_versions()
print("connected")
# disable openpilot's heartbeat checks
if self._disable_checks:
self.set_heartbeat_disabled()
self.set_power_save(0)
def reset(self, enter_bootstub=False, enter_bootloader=False, reconnect=True):
try:
if enter_bootloader: