mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
Add unsafe mode to health packet (#829)
* add unsafe_mode to health packet this compiles update health packet fixes ahh forgot to set it! not actually needed update indices * fix struct Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
@@ -160,7 +160,7 @@ class Panda(object):
|
||||
HW_TYPE_RED_PANDA = b'\x07'
|
||||
|
||||
CAN_PACKET_VERSION = 2
|
||||
HEALTH_PACKET_VERSION = 1
|
||||
HEALTH_PACKET_VERSION = 2
|
||||
|
||||
F2_DEVICES = [HW_TYPE_PEDAL]
|
||||
F4_DEVICES = [HW_TYPE_WHITE_PANDA, HW_TYPE_GREY_PANDA, HW_TYPE_BLACK_PANDA, HW_TYPE_UNO, HW_TYPE_DOS]
|
||||
@@ -353,8 +353,8 @@ class Panda(object):
|
||||
|
||||
@ensure_health_packet_version
|
||||
def health(self):
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 44)
|
||||
a = struct.unpack("<IIIIIIIIBBBBBBBHBBB", dat)
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 46)
|
||||
a = struct.unpack("<IIIIIIIIBBBBBBBHBBBH", dat)
|
||||
return {
|
||||
"uptime": a[0],
|
||||
"voltage": a[1],
|
||||
@@ -375,6 +375,7 @@ class Panda(object):
|
||||
"fault_status": a[16],
|
||||
"power_save_enabled": a[17],
|
||||
"heartbeat_lost": a[18],
|
||||
"unsafe_mode": a[19],
|
||||
}
|
||||
|
||||
# ******************* control *******************
|
||||
|
||||
Reference in New Issue
Block a user