diff --git a/board/drivers/can.h b/board/drivers/can.h index 07895e3e..b69348ec 100644 --- a/board/drivers/can.h +++ b/board/drivers/can.h @@ -14,6 +14,7 @@ typedef struct { #define BUS_MAX 4U +uint32_t can_rx_errs = 0; uint32_t can_send_errs = 0; uint32_t can_fwd_errs = 0; uint32_t gmlan_send_errs = 0; diff --git a/board/main.c b/board/main.c index 9c1a8cd1..fefa67fb 100644 --- a/board/main.c +++ b/board/main.c @@ -45,6 +45,7 @@ struct __attribute__((packed)) health_t { uint32_t uptime_pkt; uint32_t voltage_pkt; uint32_t current_pkt; + uint32_t can_rx_errs_pkt; uint32_t can_send_errs_pkt; uint32_t can_fwd_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->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_fwd_errs_pkt = can_fwd_errs; health->gmlan_send_errs_pkt = gmlan_send_errs; diff --git a/python/__init__.py b/python/__init__.py index af9cca71..e99a1ca5 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -347,24 +347,25 @@ class Panda(object): def health(self): dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 37) - a = struct.unpack("IIIIIIIBBBBBBBBB", dat) + a = struct.unpack("IIIIIIIIBBBBBBBBB", dat) return { "uptime": a[0], "voltage": a[1], "current": a[2], - "can_send_errs": a[3], - "can_fwd_errs": a[4], - "gmlan_send_errs": a[5], - "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] + "can_rx_errs": a[3], + "can_send_errs": a[4], + "can_fwd_errs": a[5], + "gmlan_send_errs": a[6], + "faults": a[7], + "ignition_line": a[8], + "ignition_can": a[9], + "controls_allowed": a[10], + "gas_interceptor_detected": a[11], + "car_harness_status": a[12], + "usb_power_mode": a[13], + "safety_mode": a[14], + "fault_status": a[15], + "power_save_enabled": a[16] } # ******************* control *******************