Added faults integer to health packet
parent
2a093a39f2
commit
ca39a5d8f6
|
@ -134,6 +134,7 @@ int get_health_pkt(void *dat) {
|
|||
uint32_t can_send_errs_pkt;
|
||||
uint32_t can_fwd_errs_pkt;
|
||||
uint32_t gmlan_send_errs_pkt;
|
||||
uint32_t faults_pkt;
|
||||
uint8_t ignition_line_pkt;
|
||||
uint8_t ignition_can_pkt;
|
||||
uint8_t controls_allowed_pkt;
|
||||
|
@ -161,9 +162,11 @@ int get_health_pkt(void *dat) {
|
|||
health->car_harness_status_pkt = car_harness_status;
|
||||
health->usb_power_mode_pkt = usb_power_mode;
|
||||
health->safety_mode_pkt = (uint8_t)(current_safety_mode);
|
||||
health->fault_status_pkt = 0U; // TODO: populate this field
|
||||
health->power_save_enabled_pkt = (uint8_t)(power_save_status == POWER_SAVE_STATUS_ENABLED);
|
||||
|
||||
health->fault_status_pkt = 0U; // TODO: populate this field
|
||||
health->faults_pkt = 0U; // TODO: populate this field
|
||||
|
||||
return sizeof(*health);
|
||||
}
|
||||
|
||||
|
|
|
@ -346,8 +346,8 @@ class Panda(object):
|
|||
# ******************* health *******************
|
||||
|
||||
def health(self):
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 33)
|
||||
a = struct.unpack("IIIIIIBBBBBBBBB", dat)
|
||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 37)
|
||||
a = struct.unpack("IIIIIIIBBBBBBBBB", dat)
|
||||
return {
|
||||
"uptime": a[0],
|
||||
"voltage": a[1],
|
||||
|
@ -355,15 +355,16 @@ class Panda(object):
|
|||
"can_send_errs": a[3],
|
||||
"can_fwd_errs": a[4],
|
||||
"gmlan_send_errs": a[5],
|
||||
"ignition_line": a[6],
|
||||
"ignition_can": a[7],
|
||||
"controls_allowed": a[8],
|
||||
"gas_interceptor_detected": a[9],
|
||||
"car_harness_status": a[10],
|
||||
"usb_power_mode": a[11],
|
||||
"safety_mode": a[12],
|
||||
"fault_status": a[13],
|
||||
"power_save_enabled": a[14]
|
||||
"faults": a[6],
|
||||
"ignition_line": a[7],
|
||||
"ignition_can": a[8],
|
||||
"controls_allowed": a[9],
|
||||
"gas_interceptor_detected": a[10],
|
||||
"car_harness_status": a[11],
|
||||
"usb_power_mode": a[12],
|
||||
"safety_mode": a[13],
|
||||
"fault_status": a[14],
|
||||
"power_save_enabled": a[15]
|
||||
}
|
||||
|
||||
# ******************* control *******************
|
||||
|
|
Loading…
Reference in New Issue