Skip to content

Commit

Permalink
split pandaState into pandaState and peripheralState (commaai#196)
Browse files Browse the repository at this point in the history
* peripheralState

* move usbPowerMode

* move enum

* move powersave back into pandastate

* add pandaType

* bottom
  • Loading branch information
pd0wm committed Oct 4, 2021
1 parent ce5ef7a commit 2881d47
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
34 changes: 21 additions & 13 deletions log.capnp
Expand Up @@ -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;
Expand Down Expand Up @@ -436,20 +430,33 @@ struct PandaState @0xa7649e2575e4591e {
redPanda @7;
}

enum UsbPowerMode {
none @0;
client @1;
cdp @2;
dcp @3;
}

enum HarnessStatus {
notConnected @0;
normal @1;
flipped @2;
}

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 {
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions services.py
Expand Up @@ -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.),
Expand Down

0 comments on commit 2881d47

Please sign in to comment.