diff --git a/log.capnp b/log.capnp index b8301000b..c8db87965 100644 --- a/log.capnp +++ b/log.capnp @@ -369,20 +369,14 @@ struct DeviceState @0xa4d8b5af2aa492eb { } struct PandaState @0xa7649e2575e4591e { - # from can health - voltage @0 :UInt32; - current @1 :UInt32; ignitionLine @2 :Bool; controlsAllowed @3 :Bool; gasInterceptorDetected @4 :Bool; - hasGps @6 :Bool; canSendErrs @7 :UInt32; canFwdErrs @8 :UInt32; canRxErrs @19 :UInt32; gmlanSendErrs @9 :UInt32; pandaType @10 :PandaType; - fanSpeedRpm @11 :UInt16; - usbPowerMode @12 :UsbPowerMode; ignitionCan @13 :Bool; safetyModel @14 :Car.CarParams.SafetyModel; safetyParam @20 :Int16; @@ -436,13 +430,6 @@ struct PandaState @0xa7649e2575e4591e { redPanda @7; } - enum UsbPowerMode { - none @0; - client @1; - cdp @2; - dcp @3; - } - enum HarnessStatus { notConnected @0; normal @1; @@ -450,6 +437,26 @@ struct PandaState @0xa7649e2575e4591e { } startedSignalDetectedDEPRECATED @5 :Bool; + voltageDEPRECATED @0 :UInt32; + currentDEPRECATED @1 :UInt32; + hasGpsDEPRECATED @6 :Bool; + fanSpeedRpmDEPRECATED @11 :UInt16; + usbPowerModeDEPRECATED @12 :PeripheralState.UsbPowerMode; +} + +struct PeripheralState { + pandaType @0 :PandaState.PandaType; + voltage @1 :UInt32; + current @2 :UInt32; + fanSpeedRpm @3 :UInt16; + usbPowerMode @4 :UsbPowerMode; + + enum UsbPowerMode @0xa8883583b32c9877 { + none @0; + client @1; + cdp @2; + dcp @3; + } } struct RadarState @0x9a185389d6fdd05f { @@ -1377,6 +1384,7 @@ struct Event { controlsState @7 :ControlsState; sensorEvents @11 :List(SensorEventData); pandaState @12 :PandaState; + peripheralState @80 :PeripheralState; radarState @13 :RadarState; liveTracks @16 :List(LiveTracks); sendcan @17 :List(CanData); diff --git a/services.py b/services.py index a70e52712..5f865d1ec 100755 --- a/services.py +++ b/services.py @@ -29,6 +29,7 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op "can": (True, 100.), "controlsState": (True, 100., 10), "pandaState": (True, 2., 1), + "peripheralState": (True, 2., 1), "radarState": (True, 20., 5), "roadEncodeIdx": (True, 20., 1), "liveTracks": (True, 20.),