mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
Fixed python health api
This commit is contained in:
@@ -345,8 +345,8 @@ class Panda(object):
|
||||
# ******************* health *******************
|
||||
|
||||
def health(self):
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 27)
|
||||
a = struct.unpack("IIIIIBBBBBBB", dat)
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 28)
|
||||
a = struct.unpack("IIIIIBBBBBBBB", dat)
|
||||
return {
|
||||
"voltage": a[0],
|
||||
"current": a[1],
|
||||
@@ -359,7 +359,8 @@ class Panda(object):
|
||||
"gas_interceptor_detected": a[8],
|
||||
"car_harness_status": a[9],
|
||||
"usb_power_mode": a[10],
|
||||
"safety_mode": a[11]
|
||||
"safety_mode": a[11],
|
||||
"fault_status": a[12]
|
||||
}
|
||||
|
||||
# ******************* control *******************
|
||||
|
||||
Reference in New Issue
Block a user