diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-09-20 22:56:37 -0400 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-09-20 22:56:37 -0400 |
commit | ef7c7dc0afab46f0e2e5eb8b051e769fb7a1a6b5 (patch) | |
tree | cf63e51b4c4fad01afcad08cc281303067aaa3a4 | |
parent | b2692a38bffa2c223f62b0aab5ce2c510fdefa30 (diff) |
Simplify passthrough command to just a boolean.
-rw-r--r-- | README.md | 18 | ||||
-rw-r--r-- | gen/cpp/openxc.pb | 13 | ||||
-rw-r--r-- | gen/cpp/openxc.pb.c | 4 | ||||
-rw-r--r-- | gen/cpp/openxc.pb.h | 24 | ||||
-rw-r--r-- | gen/java/com/openxc/BinaryMessages.java | 229 | ||||
-rw-r--r-- | gen/python/openxc_pb2.py | 72 | ||||
-rw-r--r-- | openxc.proto | 8 |
7 files changed, 108 insertions, 260 deletions
@@ -281,22 +281,18 @@ MAC address of an included Bluetooth module) into into the outgoing data stream. #### Passthrough CAN Mode -The `passthrough` command controls the passthrough mode for each of the CAN -buses. There are three passthrough modes: - -* `off` - Only the specified simple vehicle messages are processed and output - from the VI. -* `filtered` - If the CAN acceptance filter is not otherwise disabled, only the - pre-defined CAN messages (i.e. those compiled with the firmware) will be - output in the low-level CAN format from VI. -* `unfiltered` - All received CAN messages will be passed through from the bus - to the VI's output. +The `passthrough` command controls whether low-level CAN messages are passed +through from the CAN bus through the VI to the output stream. If the CAN +acceptance filter is in bypass mode and passthrough is enabled, the output +stream will include all received CAN messages. If the bypass filter is enabled, +only those CAN messages that have been pre-defined in the firmware are +forwarded. **Request** { "command": "passthrough" "bus": 1, - "mode": + "enabled": true } **Response** diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb index aa302360..90fe8778 100644 --- a/gen/cpp/openxc.pb +++ b/gen/cpp/openxc.pb @@ -1,5 +1,5 @@ -ƒ +” openxc.protoopenxc"” VehicleMessage) type (2.openxc.VehicleMessage.Type' @@ -38,15 +38,10 @@ DIAGNOSTIC Action ADD -CANCEL"« +CANCEL"= PassthroughModeControlCommand -bus (C -mode (25.openxc.PassthroughModeControlCommand.PassthroughMode"8 -PassthroughMode -OFF -FILTERED - -UNFILTERED"] +bus ( +enabled ("] CommandResponse) type (2.openxc.ControlCommand.Type message ( diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c index 2ca5768c..f11ad592 100644 --- a/gen/cpp/openxc.pb.c +++ b/gen/cpp/openxc.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.1 at Sat Sep 20 21:59:09 2014. */ +/* Generated by nanopb-0.3.1 at Sat Sep 20 22:56:34 2014. */ #include "openxc.pb.h" @@ -41,7 +41,7 @@ const pb_field_t openxc_DiagnosticControlCommand_fields[3] = { const pb_field_t openxc_PassthroughModeControlCommand_fields[3] = { PB_FIELD( 1, INT32 , OPTIONAL, STATIC , FIRST, openxc_PassthroughModeControlCommand, bus, bus, 0), - PB_FIELD( 2, ENUM , OPTIONAL, STATIC , OTHER, openxc_PassthroughModeControlCommand, mode, bus, 0), + PB_FIELD( 2, BOOL , OPTIONAL, STATIC , OTHER, openxc_PassthroughModeControlCommand, enabled, bus, 0), PB_LAST_FIELD }; diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h index 555a672e..4c86b880 100644 --- a/gen/cpp/openxc.pb.h +++ b/gen/cpp/openxc.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.1 at Sat Sep 20 21:59:09 2014. */ +/* Generated by nanopb-0.3.1 at Sat Sep 20 22:56:34 2014. */ #ifndef PB_OPENXC_PB_H_INCLUDED #define PB_OPENXC_PB_H_INCLUDED @@ -34,12 +34,6 @@ typedef enum _openxc_DiagnosticControlCommand_Action { openxc_DiagnosticControlCommand_Action_CANCEL = 2 } openxc_DiagnosticControlCommand_Action; -typedef enum _openxc_PassthroughModeControlCommand_PassthroughMode { - openxc_PassthroughModeControlCommand_PassthroughMode_OFF = 1, - openxc_PassthroughModeControlCommand_PassthroughMode_FILTERED = 2, - openxc_PassthroughModeControlCommand_PassthroughMode_UNFILTERED = 3 -} openxc_PassthroughModeControlCommand_PassthroughMode; - typedef enum _openxc_DiagnosticRequest_DecodedType { openxc_DiagnosticRequest_DecodedType_NONE = 1, openxc_DiagnosticRequest_DecodedType_OBD2 = 2 @@ -128,8 +122,8 @@ typedef struct _openxc_DynamicField { typedef struct _openxc_PassthroughModeControlCommand { bool has_bus; int32_t bus; - bool has_mode; - openxc_PassthroughModeControlCommand_PassthroughMode mode; + bool has_enabled; + bool enabled; } openxc_PassthroughModeControlCommand; typedef PB_BYTES_ARRAY_T(8) openxc_RawMessage_data_t; @@ -192,7 +186,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_RawMessage_init_default {false, 0, false, 0, false, {0, {0}}} #define openxc_ControlCommand_init_default {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticControlCommand_init_default, false, openxc_PassthroughModeControlCommand_init_default} #define openxc_DiagnosticControlCommand_init_default {false, openxc_DiagnosticRequest_init_default, false, (openxc_DiagnosticControlCommand_Action)0} -#define openxc_PassthroughModeControlCommand_init_default {false, 0, false, (openxc_PassthroughModeControlCommand_PassthroughMode)0} +#define openxc_PassthroughModeControlCommand_init_default {false, 0, false, 0} #define openxc_CommandResponse_init_default {false, (openxc_ControlCommand_Type)0, false, "", false, 0} #define openxc_DiagnosticRequest_init_default {false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0, false, 0, false, "", false, (openxc_DiagnosticRequest_DecodedType)0} #define openxc_DiagnosticResponse_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0} @@ -202,7 +196,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_RawMessage_init_zero {false, 0, false, 0, false, {0, {0}}} #define openxc_ControlCommand_init_zero {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticControlCommand_init_zero, false, openxc_PassthroughModeControlCommand_init_zero} #define openxc_DiagnosticControlCommand_init_zero {false, openxc_DiagnosticRequest_init_zero, false, (openxc_DiagnosticControlCommand_Action)0} -#define openxc_PassthroughModeControlCommand_init_zero {false, 0, false, (openxc_PassthroughModeControlCommand_PassthroughMode)0} +#define openxc_PassthroughModeControlCommand_init_zero {false, 0, false, 0} #define openxc_CommandResponse_init_zero {false, (openxc_ControlCommand_Type)0, false, "", false, 0} #define openxc_DiagnosticRequest_init_zero {false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0, false, 0, false, "", false, (openxc_DiagnosticRequest_DecodedType)0} #define openxc_DiagnosticResponse_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0} @@ -235,7 +229,7 @@ typedef struct _openxc_VehicleMessage { #define openxc_DynamicField_numeric_value_tag 3 #define openxc_DynamicField_boolean_value_tag 4 #define openxc_PassthroughModeControlCommand_bus_tag 1 -#define openxc_PassthroughModeControlCommand_mode_tag 2 +#define openxc_PassthroughModeControlCommand_enabled_tag 2 #define openxc_RawMessage_bus_tag 1 #define openxc_RawMessage_message_id_tag 2 #define openxc_RawMessage_data_tag 3 @@ -268,11 +262,11 @@ extern const pb_field_t openxc_DynamicField_fields[5]; extern const pb_field_t openxc_TranslatedMessage_fields[5]; /* Maximum encoded size of messages (where known) */ -#define openxc_VehicleMessage_size 693 +#define openxc_VehicleMessage_size 689 #define openxc_RawMessage_size 27 -#define openxc_ControlCommand_size 103 +#define openxc_ControlCommand_size 99 #define openxc_DiagnosticControlCommand_size 76 -#define openxc_PassthroughModeControlCommand_size 17 +#define openxc_PassthroughModeControlCommand_size 13 #define openxc_CommandResponse_size 139 #define openxc_DiagnosticRequest_size 68 #define openxc_DiagnosticResponse_size 56 diff --git a/gen/java/com/openxc/BinaryMessages.java b/gen/java/com/openxc/BinaryMessages.java index 31e3249f..4d83a4d9 100644 --- a/gen/java/com/openxc/BinaryMessages.java +++ b/gen/java/com/openxc/BinaryMessages.java @@ -3624,15 +3624,15 @@ public final class BinaryMessages { */ int getBus(); - // optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2; + // optional bool enabled = 2; /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - boolean hasMode(); + boolean hasEnabled(); /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode getMode(); + boolean getEnabled(); } /** * Protobuf type {@code openxc.PassthroughModeControlCommand} @@ -3691,14 +3691,8 @@ public final class BinaryMessages { break; } case 16: { - int rawValue = input.readEnum(); - com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode value = com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - mode_ = value; - } + bitField0_ |= 0x00000002; + enabled_ = input.readBool(); break; } } @@ -3740,97 +3734,6 @@ public final class BinaryMessages { return PARSER; } - /** - * Protobuf enum {@code openxc.PassthroughModeControlCommand.PassthroughMode} - */ - public enum PassthroughMode - implements com.google.protobuf.ProtocolMessageEnum { - /** - * <code>OFF = 1;</code> - */ - OFF(0, 1), - /** - * <code>FILTERED = 2;</code> - */ - FILTERED(1, 2), - /** - * <code>UNFILTERED = 3;</code> - */ - UNFILTERED(2, 3), - ; - - /** - * <code>OFF = 1;</code> - */ - public static final int OFF_VALUE = 1; - /** - * <code>FILTERED = 2;</code> - */ - public static final int FILTERED_VALUE = 2; - /** - * <code>UNFILTERED = 3;</code> - */ - public static final int UNFILTERED_VALUE = 3; - - - public final int getNumber() { return value; } - - public static PassthroughMode valueOf(int value) { - switch (value) { - case 1: return OFF; - case 2: return FILTERED; - case 3: return UNFILTERED; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap<PassthroughMode> - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap<PassthroughMode> - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap<PassthroughMode>() { - public PassthroughMode findValueByNumber(int number) { - return PassthroughMode.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.openxc.BinaryMessages.PassthroughModeControlCommand.getDescriptor().getEnumTypes().get(0); - } - - private static final PassthroughMode[] VALUES = values(); - - public static PassthroughMode valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private PassthroughMode(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:openxc.PassthroughModeControlCommand.PassthroughMode) - } - private int bitField0_; // optional int32 bus = 1; public static final int BUS_FIELD_NUMBER = 1; @@ -3848,25 +3751,25 @@ public final class BinaryMessages { return bus_; } - // optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2; - public static final int MODE_FIELD_NUMBER = 2; - private com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode mode_; + // optional bool enabled = 2; + public static final int ENABLED_FIELD_NUMBER = 2; + private boolean enabled_; /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public boolean hasMode() { + public boolean hasEnabled() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode getMode() { - return mode_; + public boolean getEnabled() { + return enabled_; } private void initFields() { bus_ = 0; - mode_ = com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode.OFF; + enabled_ = false; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -3884,7 +3787,7 @@ public final class BinaryMessages { output.writeInt32(1, bus_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, mode_.getNumber()); + output.writeBool(2, enabled_); } getUnknownFields().writeTo(output); } @@ -3901,7 +3804,7 @@ public final class BinaryMessages { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, mode_.getNumber()); + .computeBoolSize(2, enabled_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -4021,7 +3924,7 @@ public final class BinaryMessages { super.clear(); bus_ = 0; bitField0_ = (bitField0_ & ~0x00000001); - mode_ = com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode.OFF; + enabled_ = false; bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -4058,7 +3961,7 @@ public final class BinaryMessages { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.mode_ = mode_; + result.enabled_ = enabled_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -4078,8 +3981,8 @@ public final class BinaryMessages { if (other.hasBus()) { setBus(other.getBus()); } - if (other.hasMode()) { - setMode(other.getMode()); + if (other.hasEnabled()) { + setEnabled(other.getEnabled()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -4141,38 +4044,35 @@ public final class BinaryMessages { return this; } - // optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2; - private com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode mode_ = com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode.OFF; + // optional bool enabled = 2; + private boolean enabled_ ; /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public boolean hasMode() { + public boolean hasEnabled() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode getMode() { - return mode_; + public boolean getEnabled() { + return enabled_; } /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public Builder setMode(com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder setEnabled(boolean value) { bitField0_ |= 0x00000002; - mode_ = value; + enabled_ = value; onChanged(); return this; } /** - * <code>optional .openxc.PassthroughModeControlCommand.PassthroughMode mode = 2;</code> + * <code>optional bool enabled = 2;</code> */ - public Builder clearMode() { + public Builder clearEnabled() { bitField0_ = (bitField0_ & ~0x00000002); - mode_ = com.openxc.BinaryMessages.PassthroughModeControlCommand.PassthroughMode.OFF; + enabled_ = false; onChanged(); return this; } @@ -9047,36 +8947,33 @@ public final class BinaryMessages { "\030DiagnosticControlCommand\022*\n\007request\030\001 \001", "(\0132\031.openxc.DiagnosticRequest\0227\n\006action\030" + "\002 \001(\0162\'.openxc.DiagnosticControlCommand." + - "Action\"\035\n\006Action\022\007\n\003ADD\020\001\022\n\n\006CANCEL\020\002\"\253\001" + - "\n\035PassthroughModeControlCommand\022\013\n\003bus\030\001" + - " \001(\005\022C\n\004mode\030\002 \001(\01625.openxc.PassthroughM" + - "odeControlCommand.PassthroughMode\"8\n\017Pas" + - "sthroughMode\022\007\n\003OFF\020\001\022\014\n\010FILTERED\020\002\022\016\n\nU" + - "NFILTERED\020\003\"]\n\017CommandResponse\022)\n\004type\030\001" + - " \001(\0162\033.openxc.ControlCommand.Type\022\017\n\007mes" + - "sage\030\002 \001(\t\022\016\n\006status\030\003 \001(\010\"\375\001\n\021Diagnosti", - "cRequest\022\013\n\003bus\030\001 \001(\005\022\022\n\nmessage_id\030\002 \001(" + - "\r\022\014\n\004mode\030\003 \001(\r\022\013\n\003pid\030\004 \001(\r\022\017\n\007payload\030" + - "\005 \001(\014\022\032\n\022multiple_responses\030\006 \001(\010\022\021\n\tfre" + - "quency\030\007 \001(\001\022\014\n\004name\030\010 \001(\t\022;\n\014decoded_ty" + - "pe\030\t \001(\0162%.openxc.DiagnosticRequest.Deco" + - "dedType\"!\n\013DecodedType\022\010\n\004NONE\020\001\022\010\n\004OBD2" + - "\020\002\"\241\001\n\022DiagnosticResponse\022\013\n\003bus\030\001 \001(\005\022\022" + - "\n\nmessage_id\030\002 \001(\r\022\014\n\004mode\030\003 \001(\r\022\013\n\003pid\030" + - "\004 \001(\r\022\017\n\007success\030\005 \001(\010\022\036\n\026negative_respo" + - "nse_code\030\006 \001(\r\022\017\n\007payload\030\007 \001(\014\022\r\n\005value", - "\030\010 \001(\001\"\242\001\n\014DynamicField\022\'\n\004type\030\001 \001(\0162\031." + - "openxc.DynamicField.Type\022\024\n\014string_value" + - "\030\002 \001(\t\022\025\n\rnumeric_value\030\003 \001(\001\022\025\n\rboolean" + - "_value\030\004 \001(\010\"%\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020" + - "\002\022\010\n\004BOOL\020\003\"\367\001\n\021TranslatedMessage\022,\n\004typ" + - "e\030\001 \001(\0162\036.openxc.TranslatedMessage.Type\022" + - "\014\n\004name\030\002 \001(\t\022#\n\005value\030\003 \001(\0132\024.openxc.Dy" + - "namicField\022#\n\005event\030\004 \001(\0132\024.openxc.Dynam" + - "icField\"\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010\n\004" + - "BOOL\020\003\022\022\n\016EVENTED_STRING\020\004\022\017\n\013EVENTED_NU", - "M\020\005\022\020\n\014EVENTED_BOOL\020\006B\034\n\ncom.openxcB\016Bin" + - "aryMessages" + "Action\"\035\n\006Action\022\007\n\003ADD\020\001\022\n\n\006CANCEL\020\002\"=\n" + + "\035PassthroughModeControlCommand\022\013\n\003bus\030\001 " + + "\001(\005\022\017\n\007enabled\030\002 \001(\010\"]\n\017CommandResponse\022" + + ")\n\004type\030\001 \001(\0162\033.openxc.ControlCommand.Ty" + + "pe\022\017\n\007message\030\002 \001(\t\022\016\n\006status\030\003 \001(\010\"\375\001\n\021" + + "DiagnosticRequest\022\013\n\003bus\030\001 \001(\005\022\022\n\nmessag" + + "e_id\030\002 \001(\r\022\014\n\004mode\030\003 \001(\r\022\013\n\003pid\030\004 \001(\r\022\017\n" + + "\007payload\030\005 \001(\014\022\032\n\022multiple_responses\030\006 \001", + "(\010\022\021\n\tfrequency\030\007 \001(\001\022\014\n\004name\030\010 \001(\t\022;\n\014d" + + "ecoded_type\030\t \001(\0162%.openxc.DiagnosticReq" + + "uest.DecodedType\"!\n\013DecodedType\022\010\n\004NONE\020" + + "\001\022\010\n\004OBD2\020\002\"\241\001\n\022DiagnosticResponse\022\013\n\003bu" + + "s\030\001 \001(\005\022\022\n\nmessage_id\030\002 \001(\r\022\014\n\004mode\030\003 \001(" + + "\r\022\013\n\003pid\030\004 \001(\r\022\017\n\007success\030\005 \001(\010\022\036\n\026negat" + + "ive_response_code\030\006 \001(\r\022\017\n\007payload\030\007 \001(\014" + + "\022\r\n\005value\030\010 \001(\001\"\242\001\n\014DynamicField\022\'\n\004type" + + "\030\001 \001(\0162\031.openxc.DynamicField.Type\022\024\n\014str" + + "ing_value\030\002 \001(\t\022\025\n\rnumeric_value\030\003 \001(\001\022\025", + "\n\rboolean_value\030\004 \001(\010\"%\n\004Type\022\n\n\006STRING\020" + + "\001\022\007\n\003NUM\020\002\022\010\n\004BOOL\020\003\"\367\001\n\021TranslatedMessa" + + "ge\022,\n\004type\030\001 \001(\0162\036.openxc.TranslatedMess" + + "age.Type\022\014\n\004name\030\002 \001(\t\022#\n\005value\030\003 \001(\0132\024." + + "openxc.DynamicField\022#\n\005event\030\004 \001(\0132\024.ope" + + "nxc.DynamicField\"\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003" + + "NUM\020\002\022\010\n\004BOOL\020\003\022\022\n\016EVENTED_STRING\020\004\022\017\n\013E" + + "VENTED_NUM\020\005\022\020\n\014EVENTED_BOOL\020\006B\034\n\ncom.op" + + "enxcB\016BinaryMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -9112,7 +9009,7 @@ public final class BinaryMessages { internal_static_openxc_PassthroughModeControlCommand_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_openxc_PassthroughModeControlCommand_descriptor, - new java.lang.String[] { "Bus", "Mode", }); + new java.lang.String[] { "Bus", "Enabled", }); internal_static_openxc_CommandResponse_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_openxc_CommandResponse_fieldAccessorTable = new diff --git a/gen/python/openxc_pb2.py b/gen/python/openxc_pb2.py index 38be6b4a..d5f50ad2 100644 --- a/gen/python/openxc_pb2.py +++ b/gen/python/openxc_pb2.py @@ -13,7 +13,7 @@ from google.protobuf import descriptor_pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='openxc.proto', package='openxc', - serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\x94\x03\n\x0eVehicleMessage\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.VehicleMessage.Type\x12\'\n\x0braw_message\x18\x02 \x01(\x0b\x32\x12.openxc.RawMessage\x12\x35\n\x12translated_message\x18\x03 \x01(\x0b\x32\x19.openxc.TranslatedMessage\x12\x37\n\x13\x64iagnostic_response\x18\x04 \x01(\x0b\x32\x1a.openxc.DiagnosticResponse\x12/\n\x0f\x63ontrol_command\x18\x05 \x01(\x0b\x32\x16.openxc.ControlCommand\x12\x31\n\x10\x63ommand_response\x18\x06 \x01(\x0b\x32\x17.openxc.CommandResponse\"Z\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x13\n\x0f\x43ONTROL_COMMAND\x10\x04\x12\x14\n\x10\x43OMMAND_RESPONSE\x10\x05\";\n\nRawMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"\x87\x02\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12<\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32 .openxc.DiagnosticControlCommand\x12G\n\x18passthrough_mode_request\x18\x03 \x01(\x0b\x32%.openxc.PassthroughModeControlCommand\"C\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x0f\n\x0bPASSTHROUGH\x10\x04\"\x9e\x01\n\x18\x44iagnosticControlCommand\x12*\n\x07request\x18\x01 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\x12\x37\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\'.openxc.DiagnosticControlCommand.Action\"\x1d\n\x06\x41\x63tion\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06\x43\x41NCEL\x10\x02\"\xab\x01\n\x1dPassthroughModeControlCommand\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x43\n\x04mode\x18\x02 \x01(\x0e\x32\x35.openxc.PassthroughModeControlCommand.PassthroughMode\"8\n\x0fPassthroughMode\x12\x07\n\x03OFF\x10\x01\x12\x0c\n\x08\x46ILTERED\x10\x02\x12\x0e\n\nUNFILTERED\x10\x03\"]\n\x0f\x43ommandResponse\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\x08\"\xfd\x01\n\x11\x44iagnosticRequest\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x12\x1a\n\x12multiple_responses\x18\x06 \x01(\x08\x12\x11\n\tfrequency\x18\x07 \x01(\x01\x12\x0c\n\x04name\x18\x08 \x01(\t\x12;\n\x0c\x64\x65\x63oded_type\x18\t \x01(\x0e\x32%.openxc.DiagnosticRequest.DecodedType\"!\n\x0b\x44\x65\x63odedType\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04OBD2\x10\x02\"\xa1\x01\n\x12\x44iagnosticResponse\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12\x1e\n\x16negative_response_code\x18\x06 \x01(\r\x12\x0f\n\x07payload\x18\x07 \x01(\x0c\x12\r\n\x05value\x18\x08 \x01(\x01\"\xa2\x01\n\x0c\x44ynamicField\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.openxc.DynamicField.Type\x12\x14\n\x0cstring_value\x18\x02 \x01(\t\x12\x15\n\rnumeric_value\x18\x03 \x01(\x01\x12\x15\n\rboolean_value\x18\x04 \x01(\x08\"%\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\"\xf7\x01\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12#\n\x05value\x18\x03 \x01(\x0b\x32\x14.openxc.DynamicField\x12#\n\x05\x65vent\x18\x04 \x01(\x0b\x32\x14.openxc.DynamicField\"\\\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x12\n\x0e\x45VENTED_STRING\x10\x04\x12\x0f\n\x0b\x45VENTED_NUM\x10\x05\x12\x10\n\x0c\x45VENTED_BOOL\x10\x06\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') + serialized_pb='\n\x0copenxc.proto\x12\x06openxc\"\x94\x03\n\x0eVehicleMessage\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.VehicleMessage.Type\x12\'\n\x0braw_message\x18\x02 \x01(\x0b\x32\x12.openxc.RawMessage\x12\x35\n\x12translated_message\x18\x03 \x01(\x0b\x32\x19.openxc.TranslatedMessage\x12\x37\n\x13\x64iagnostic_response\x18\x04 \x01(\x0b\x32\x1a.openxc.DiagnosticResponse\x12/\n\x0f\x63ontrol_command\x18\x05 \x01(\x0b\x32\x16.openxc.ControlCommand\x12\x31\n\x10\x63ommand_response\x18\x06 \x01(\x0b\x32\x17.openxc.CommandResponse\"Z\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x13\n\x0f\x43ONTROL_COMMAND\x10\x04\x12\x14\n\x10\x43OMMAND_RESPONSE\x10\x05\";\n\nRawMessage\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"\x87\x02\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12<\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32 .openxc.DiagnosticControlCommand\x12G\n\x18passthrough_mode_request\x18\x03 \x01(\x0b\x32%.openxc.PassthroughModeControlCommand\"C\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\x12\x0f\n\x0bPASSTHROUGH\x10\x04\"\x9e\x01\n\x18\x44iagnosticControlCommand\x12*\n\x07request\x18\x01 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\x12\x37\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\'.openxc.DiagnosticControlCommand.Action\"\x1d\n\x06\x41\x63tion\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06\x43\x41NCEL\x10\x02\"=\n\x1dPassthroughModeControlCommand\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x0f\n\x07\x65nabled\x18\x02 \x01(\x08\"]\n\x0f\x43ommandResponse\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\x08\"\xfd\x01\n\x11\x44iagnosticRequest\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x12\x1a\n\x12multiple_responses\x18\x06 \x01(\x08\x12\x11\n\tfrequency\x18\x07 \x01(\x01\x12\x0c\n\x04name\x18\x08 \x01(\t\x12;\n\x0c\x64\x65\x63oded_type\x18\t \x01(\x0e\x32%.openxc.DiagnosticRequest.DecodedType\"!\n\x0b\x44\x65\x63odedType\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04OBD2\x10\x02\"\xa1\x01\n\x12\x44iagnosticResponse\x12\x0b\n\x03\x62us\x18\x01 \x01(\x05\x12\x12\n\nmessage_id\x18\x02 \x01(\r\x12\x0c\n\x04mode\x18\x03 \x01(\r\x12\x0b\n\x03pid\x18\x04 \x01(\r\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12\x1e\n\x16negative_response_code\x18\x06 \x01(\r\x12\x0f\n\x07payload\x18\x07 \x01(\x0c\x12\r\n\x05value\x18\x08 \x01(\x01\"\xa2\x01\n\x0c\x44ynamicField\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.openxc.DynamicField.Type\x12\x14\n\x0cstring_value\x18\x02 \x01(\t\x12\x15\n\rnumeric_value\x18\x03 \x01(\x01\x12\x15\n\rboolean_value\x18\x04 \x01(\x08\"%\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\"\xf7\x01\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12#\n\x05value\x18\x03 \x01(\x0b\x32\x14.openxc.DynamicField\x12#\n\x05\x65vent\x18\x04 \x01(\x0b\x32\x14.openxc.DynamicField\"\\\n\x04Type\x12\n\n\x06STRING\x10\x01\x12\x07\n\x03NUM\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x12\n\x0e\x45VENTED_STRING\x10\x04\x12\x0f\n\x0b\x45VENTED_NUM\x10\x05\x12\x10\n\x0c\x45VENTED_BOOL\x10\x06\x42\x1c\n\ncom.openxcB\x0e\x42inaryMessages') @@ -100,31 +100,6 @@ _DIAGNOSTICCONTROLCOMMAND_ACTION = _descriptor.EnumDescriptor( serialized_end=917, ) -_PASSTHROUGHMODECONTROLCOMMAND_PASSTHROUGHMODE = _descriptor.EnumDescriptor( - name='PassthroughMode', - full_name='openxc.PassthroughModeControlCommand.PassthroughMode', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='OFF', index=0, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FILTERED', index=1, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='UNFILTERED', index=2, number=3, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=1035, - serialized_end=1091, -) - _DIAGNOSTICREQUEST_DECODEDTYPE = _descriptor.EnumDescriptor( name='DecodedType', full_name='openxc.DiagnosticRequest.DecodedType', @@ -142,8 +117,8 @@ _DIAGNOSTICREQUEST_DECODEDTYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1409, - serialized_end=1442, + serialized_start=1298, + serialized_end=1331, ) _DYNAMICFIELD_TYPE = _descriptor.EnumDescriptor( @@ -167,8 +142,8 @@ _DYNAMICFIELD_TYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1734, - serialized_end=1771, + serialized_start=1623, + serialized_end=1660, ) _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor( @@ -204,8 +179,8 @@ _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor( ], containing_type=None, options=None, - serialized_start=1929, - serialized_end=2021, + serialized_start=1818, + serialized_end=1910, ) @@ -409,9 +384,9 @@ _PASSTHROUGHMODECONTROLCOMMAND = _descriptor.Descriptor( is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='mode', full_name='openxc.PassthroughModeControlCommand.mode', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=1, + name='enabled', full_name='openxc.PassthroughModeControlCommand.enabled', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -420,13 +395,12 @@ _PASSTHROUGHMODECONTROLCOMMAND = _descriptor.Descriptor( ], nested_types=[], enum_types=[ - _PASSTHROUGHMODECONTROLCOMMAND_PASSTHROUGHMODE, ], options=None, is_extendable=False, extension_ranges=[], - serialized_start=920, - serialized_end=1091, + serialized_start=919, + serialized_end=980, ) @@ -467,8 +441,8 @@ _COMMANDRESPONSE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=1093, - serialized_end=1186, + serialized_start=982, + serialized_end=1075, ) @@ -552,8 +526,8 @@ _DIAGNOSTICREQUEST = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=1189, - serialized_end=1442, + serialized_start=1078, + serialized_end=1331, ) @@ -629,8 +603,8 @@ _DIAGNOSTICRESPONSE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=1445, - serialized_end=1606, + serialized_start=1334, + serialized_end=1495, ) @@ -679,8 +653,8 @@ _DYNAMICFIELD = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=1609, - serialized_end=1771, + serialized_start=1498, + serialized_end=1660, ) @@ -729,8 +703,8 @@ _TRANSLATEDMESSAGE = _descriptor.Descriptor( options=None, is_extendable=False, extension_ranges=[], - serialized_start=1774, - serialized_end=2021, + serialized_start=1663, + serialized_end=1910, ) _VEHICLEMESSAGE.fields_by_name['type'].enum_type = _VEHICLEMESSAGE_TYPE @@ -747,8 +721,6 @@ _CONTROLCOMMAND_TYPE.containing_type = _CONTROLCOMMAND; _DIAGNOSTICCONTROLCOMMAND.fields_by_name['request'].message_type = _DIAGNOSTICREQUEST _DIAGNOSTICCONTROLCOMMAND.fields_by_name['action'].enum_type = _DIAGNOSTICCONTROLCOMMAND_ACTION _DIAGNOSTICCONTROLCOMMAND_ACTION.containing_type = _DIAGNOSTICCONTROLCOMMAND; -_PASSTHROUGHMODECONTROLCOMMAND.fields_by_name['mode'].enum_type = _PASSTHROUGHMODECONTROLCOMMAND_PASSTHROUGHMODE -_PASSTHROUGHMODECONTROLCOMMAND_PASSTHROUGHMODE.containing_type = _PASSTHROUGHMODECONTROLCOMMAND; _COMMANDRESPONSE.fields_by_name['type'].enum_type = _CONTROLCOMMAND_TYPE _DIAGNOSTICREQUEST.fields_by_name['decoded_type'].enum_type = _DIAGNOSTICREQUEST_DECODEDTYPE _DIAGNOSTICREQUEST_DECODEDTYPE.containing_type = _DIAGNOSTICREQUEST; diff --git a/openxc.proto b/openxc.proto index fd61b6c8..1be1df8a 100644 --- a/openxc.proto +++ b/openxc.proto @@ -42,14 +42,8 @@ message DiagnosticControlCommand { } message PassthroughModeControlCommand { - enum PassthroughMode { - OFF = 1; - FILTERED = 2; - UNFILTERED = 3; - } - optional int32 bus = 1; - optional PassthroughMode mode = 2; + optional bool enabled = 2; } message CommandResponse { |