mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 09:13:52 +08:00
Move safety constants to opendbc (#2145)
* move to opendbc * all passing * do the rest * fix * and another * order * and update ref to master
This commit is contained in:
@@ -9,6 +9,8 @@ import binascii
|
||||
from functools import wraps, partial
|
||||
from itertools import accumulate
|
||||
|
||||
from opendbc.safety import Safety
|
||||
|
||||
from .base import BaseHandle
|
||||
from .constants import FW_PATH, McuType
|
||||
from .dfu import PandaDFU
|
||||
@@ -101,43 +103,8 @@ ensure_health_packet_version = partial(ensure_version, "health", "HEALTH_PACKET_
|
||||
|
||||
|
||||
|
||||
class ALTERNATIVE_EXPERIENCE:
|
||||
DEFAULT = 0
|
||||
DISABLE_DISENGAGE_ON_GAS = 1
|
||||
DISABLE_STOCK_AEB = 2
|
||||
RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX = 8
|
||||
ALLOW_AEB = 16
|
||||
|
||||
class Panda:
|
||||
|
||||
# matches cereal.car.CarParams.SafetyModel
|
||||
SAFETY_SILENT = 0
|
||||
SAFETY_HONDA_NIDEC = 1
|
||||
SAFETY_TOYOTA = 2
|
||||
SAFETY_ELM327 = 3
|
||||
SAFETY_GM = 4
|
||||
SAFETY_HONDA_BOSCH_GIRAFFE = 5
|
||||
SAFETY_FORD = 6
|
||||
SAFETY_HYUNDAI = 8
|
||||
SAFETY_CHRYSLER = 9
|
||||
SAFETY_TESLA = 10
|
||||
SAFETY_SUBARU = 11
|
||||
SAFETY_MAZDA = 13
|
||||
SAFETY_NISSAN = 14
|
||||
SAFETY_VOLKSWAGEN_MQB = 15
|
||||
SAFETY_ALLOUTPUT = 17
|
||||
SAFETY_GM_ASCM = 18
|
||||
SAFETY_NOOUTPUT = 19
|
||||
SAFETY_HONDA_BOSCH = 20
|
||||
SAFETY_VOLKSWAGEN_PQ = 21
|
||||
SAFETY_SUBARU_PREGLOBAL = 22
|
||||
SAFETY_HYUNDAI_LEGACY = 23
|
||||
SAFETY_HYUNDAI_COMMUNITY = 24
|
||||
SAFETY_STELLANTIS = 25
|
||||
SAFETY_FAW = 26
|
||||
SAFETY_BODY = 27
|
||||
SAFETY_HYUNDAI_CANFD = 28
|
||||
|
||||
SERIAL_DEBUG = 0
|
||||
SERIAL_ESP = 1
|
||||
SERIAL_LIN1 = 2
|
||||
@@ -747,7 +714,7 @@ class Panda:
|
||||
def set_power_save(self, power_save_enabled=0):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xe7, int(power_save_enabled), 0, b'')
|
||||
|
||||
def set_safety_mode(self, mode=SAFETY_SILENT, param=0):
|
||||
def set_safety_mode(self, mode=Safety.SAFETY_SILENT, param=0):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, param, b'')
|
||||
|
||||
def set_obd(self, obd):
|
||||
|
||||
Reference in New Issue
Block a user