send can_rx_errs in health
parent
ad10c8c7ee
commit
268ab9acf3
|
@ -14,6 +14,7 @@ typedef struct {
|
||||||
|
|
||||||
#define BUS_MAX 4U
|
#define BUS_MAX 4U
|
||||||
|
|
||||||
|
uint32_t can_rx_errs = 0;
|
||||||
uint32_t can_send_errs = 0;
|
uint32_t can_send_errs = 0;
|
||||||
uint32_t can_fwd_errs = 0;
|
uint32_t can_fwd_errs = 0;
|
||||||
uint32_t gmlan_send_errs = 0;
|
uint32_t gmlan_send_errs = 0;
|
||||||
|
|
|
@ -45,6 +45,7 @@ struct __attribute__((packed)) health_t {
|
||||||
uint32_t uptime_pkt;
|
uint32_t uptime_pkt;
|
||||||
uint32_t voltage_pkt;
|
uint32_t voltage_pkt;
|
||||||
uint32_t current_pkt;
|
uint32_t current_pkt;
|
||||||
|
uint32_t can_rx_errs_pkt;
|
||||||
uint32_t can_send_errs_pkt;
|
uint32_t can_send_errs_pkt;
|
||||||
uint32_t can_fwd_errs_pkt;
|
uint32_t can_fwd_errs_pkt;
|
||||||
uint32_t gmlan_send_errs_pkt;
|
uint32_t gmlan_send_errs_pkt;
|
||||||
|
@ -170,6 +171,7 @@ int get_health_pkt(void *dat) {
|
||||||
|
|
||||||
health->controls_allowed_pkt = controls_allowed;
|
health->controls_allowed_pkt = controls_allowed;
|
||||||
health->gas_interceptor_detected_pkt = gas_interceptor_detected;
|
health->gas_interceptor_detected_pkt = gas_interceptor_detected;
|
||||||
|
health->can_rx_errs_pkt = can_rx_errs;
|
||||||
health->can_send_errs_pkt = can_send_errs;
|
health->can_send_errs_pkt = can_send_errs;
|
||||||
health->can_fwd_errs_pkt = can_fwd_errs;
|
health->can_fwd_errs_pkt = can_fwd_errs;
|
||||||
health->gmlan_send_errs_pkt = gmlan_send_errs;
|
health->gmlan_send_errs_pkt = gmlan_send_errs;
|
||||||
|
|
|
@ -347,24 +347,25 @@ class Panda(object):
|
||||||
|
|
||||||
def health(self):
|
def health(self):
|
||||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 37)
|
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 37)
|
||||||
a = struct.unpack("IIIIIIIBBBBBBBBB", dat)
|
a = struct.unpack("IIIIIIIIBBBBBBBBB", dat)
|
||||||
return {
|
return {
|
||||||
"uptime": a[0],
|
"uptime": a[0],
|
||||||
"voltage": a[1],
|
"voltage": a[1],
|
||||||
"current": a[2],
|
"current": a[2],
|
||||||
"can_send_errs": a[3],
|
"can_rx_errs": a[3],
|
||||||
"can_fwd_errs": a[4],
|
"can_send_errs": a[4],
|
||||||
"gmlan_send_errs": a[5],
|
"can_fwd_errs": a[5],
|
||||||
"faults": a[6],
|
"gmlan_send_errs": a[6],
|
||||||
"ignition_line": a[7],
|
"faults": a[7],
|
||||||
"ignition_can": a[8],
|
"ignition_line": a[8],
|
||||||
"controls_allowed": a[9],
|
"ignition_can": a[9],
|
||||||
"gas_interceptor_detected": a[10],
|
"controls_allowed": a[10],
|
||||||
"car_harness_status": a[11],
|
"gas_interceptor_detected": a[11],
|
||||||
"usb_power_mode": a[12],
|
"car_harness_status": a[12],
|
||||||
"safety_mode": a[13],
|
"usb_power_mode": a[13],
|
||||||
"fault_status": a[14],
|
"safety_mode": a[14],
|
||||||
"power_save_enabled": a[15]
|
"fault_status": a[15],
|
||||||
|
"power_save_enabled": a[16]
|
||||||
}
|
}
|
||||||
|
|
||||||
# ******************* control *******************
|
# ******************* control *******************
|
||||||
|
|
Loading…
Reference in New Issue