Refactor diagnostic fields for decoding payload.
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Wed, 26 Mar 2014 14:48:29 +0000 (10:48 -0400)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Wed, 26 Mar 2014 14:48:29 +0000 (10:48 -0400)
README.md
gen/cpp/openxc.pb
gen/cpp/openxc.pb.c
gen/cpp/openxc.pb.h
gen/java/com/openxc/BinaryMessages.java
gen/python/openxc_pb2.py
openxc.proto

index cef6ea3..aa44b05 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,7 +58,6 @@ with this command format:
           "mode": 1,
           "pid": 5,
           "payload": "0x1234",
-          "parse_payload": true,
           "multiple_responses": false,
           "factor": 1.0,
           "offset": 0,
@@ -84,11 +83,6 @@ with this command format:
     Each byte in the string *must* be represented with 2 characters, e.g. `0x1`
     is `0x01` - the complete string must have an even number of characters.
 
-**parse_payload** - (optional, false by default) if `true`, the complete payload
-    in the response message will be parsed as a number and returned in the
-    `value` field of the response. The `payload` field will be omitted in
-    responses with a `value`.
-
 **name** - (optional, defaults to nothing) A human readable, string name for
   this request. If provided, the response will have a `name` field (much like a
   normal translated message) with this value in place of `bus`, `id`, `mode` and
@@ -102,17 +96,15 @@ with this command format:
   see any additional responses after the first and it will just take up memory
   in the VI for longer.
 
-**factor** - (optional, 1.0 by default) if `parse_payload` is true, the value in
-    the payload will be multiplied by this factor before returning. The `factor`
-    is applied before the `offset`.
-
-**offset** - (optional, 0 by default) if `parse_payload` is true, this offset
-    will be added to the value in the payload before returning. The `offset` is
-    applied after the `factor`.
-
 **frequency** - (optional, defaults to 0) The frequency in Hz to send this
     request. To send a single request, set this to 0 or leave it out.
 
+**decoded_type** - (optional, defaults to "obd2" if the request is a recognized
+OBD-II mode 1 request, otherwise "none") If specified, the valid values are
+`"none"` and `"obd2"`. If `obd2`, the payload will be decoded according to the
+OBD-II specification and returned in the `value` field. Set this to `none` to
+manually override the OBD-II decoding feature for a known PID.
+
 The `bus+id+mode+pid` key is unique, so if you send a create request with that
 key twice, it'll overwrite the existing one (i.e. it will change the frequency,
 the only other parameter). To cancel a recurring request, send this command with
@@ -168,8 +160,7 @@ Finally, the `payload` and `value` fields are mutually exclusive:
     handle 64-bit integers, which is why we are not using a numerical data type.
 
 **value** - (optional) if the response had a payload, this may be the
-    payload interpreted as an integer and transformed with a factor and offset
-    provided with the request.
+    payload interpreted as an integer.
 
 The response to a simple PID request would look like this:
 
index f259bba..da31233 100644 (file)
@@ -1,5 +1,5 @@
 
-\83\f
\f
 \fopenxc.proto\12\ 6openxc"\94\ 3
 \ eVehicleMessage\12)
 \ 4type\18\ 1 \ 1(\ e2\e.openxc.VehicleMessage.Type\12'
@@ -32,7 +32,7 @@ message_id\18\ 2 \ 1(\r\12
 DIAGNOSTIC\10\ 3"M
 \ fCommandResponse\12)
 \ 4type\18\ 1 \ 1(\ e2\e.openxc.ControlCommand.Type\12\ f
-\amessage\18\ 2 \ 1(  "½\ 1
+\amessage\18\ 2 \ 1(  "ý\ 1
 \11DiagnosticRequest\12\v
 \ 3bus\18\ 1 \ 1(\ 5\12\12
 
@@ -40,12 +40,13 @@ message_id\18\ 2 \ 1(\r\12
 \ 4mode\18\ 3 \ 1(\r\12\v
 \ 3pid\18\ 4 \ 1(\r\12\ f
 \apayload\18\ 5 \ 1(\f\12\1a
-\12multiple_responses\18\ 6 \ 1(\b\12\ e
-\ 6factor\18\a \ 1(\ 1\12\ e
-\ 6offset\18\b \ 1(\ 1\12\11
-       frequency\18       \ 1(\ 1\12\f
-\ 4name\18
\ 1(    "¡\ 1
+\12multiple_responses\18\ 6 \ 1(\b\12\11
+       frequency\18\a \ 1(\ 1\12\f
+\ 4name\18\b \ 1(     \12;
+\fdecoded_type\18  \ 1(\ e2%.openxc.DiagnosticRequest.DecodedType"!
+\vDecodedType\12\b
+\ 4NONE\10\ 1\12\b
+\ 4OBD2\10\ 2\ 1
 \12DiagnosticResponse\12\v
 \ 3bus\18\ 1 \ 1(\ 5\12\12
 
index e62efad..e3be257 100644 (file)
@@ -1,5 +1,5 @@
 /* Automatically generated nanopb constant definitions */
-/* Generated by nanopb-0.2.5 at Mon Mar 24 17:19:53 2014. */
+/* Generated by nanopb-0.2.5 at Wed Mar 26 09:29:06 2014. */
 
 #include "openxc.pb.h"
 
@@ -34,17 +34,16 @@ const pb_field_t openxc_CommandResponse_fields[3] = {
     PB_LAST_FIELD
 };
 
-const pb_field_t openxc_DiagnosticRequest_fields[11] = {
+const pb_field_t openxc_DiagnosticRequest_fields[10] = {
     PB_FIELD2(  1, INT32   , OPTIONAL, STATIC  , FIRST, openxc_DiagnosticRequest, bus, bus, 0),
     PB_FIELD2(  2, UINT32  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, message_id, bus, 0),
     PB_FIELD2(  3, UINT32  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, mode, message_id, 0),
     PB_FIELD2(  4, UINT32  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, pid, mode, 0),
     PB_FIELD2(  5, BYTES   , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, payload, pid, 0),
     PB_FIELD2(  6, BOOL    , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, multiple_responses, payload, 0),
-    PB_FIELD2(  7, DOUBLE  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, factor, multiple_responses, 0),
-    PB_FIELD2(  8, DOUBLE  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, offset, factor, 0),
-    PB_FIELD2(  9, DOUBLE  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, frequency, offset, 0),
-    PB_FIELD2( 10, STRING  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, name, frequency, 0),
+    PB_FIELD2(  7, DOUBLE  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, frequency, multiple_responses, 0),
+    PB_FIELD2(  8, STRING  , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, name, frequency, 0),
+    PB_FIELD2(  9, ENUM    , OPTIONAL, STATIC  , OTHER, openxc_DiagnosticRequest, decoded_type, name, 0),
     PB_LAST_FIELD
 };
 
index 82ab987..e70324f 100644 (file)
@@ -1,5 +1,5 @@
 /* Automatically generated nanopb header */
-/* Generated by nanopb-0.2.5 at Mon Mar 24 17:19:53 2014. */
+/* Generated by nanopb-0.2.5 at Wed Mar 26 09:29:06 2014. */
 
 #ifndef _PB_OPENXC_PB_H_
 #define _PB_OPENXC_PB_H_
@@ -24,6 +24,11 @@ typedef enum _openxc_ControlCommand_Type {
     openxc_ControlCommand_Type_DIAGNOSTIC = 3
 } openxc_ControlCommand_Type;
 
+typedef enum _openxc_DiagnosticRequest_DecodedType {
+    openxc_DiagnosticRequest_DecodedType_NONE = 1,
+    openxc_DiagnosticRequest_DecodedType_OBD2 = 2
+} openxc_DiagnosticRequest_DecodedType;
+
 typedef enum _openxc_DynamicField_Type {
     openxc_DynamicField_Type_STRING = 1,
     openxc_DynamicField_Type_NUM = 2,
@@ -65,14 +70,12 @@ typedef struct _openxc_DiagnosticRequest {
     openxc_DiagnosticRequest_payload_t payload;
     bool has_multiple_responses;
     bool multiple_responses;
-    bool has_factor;
-    double factor;
-    bool has_offset;
-    double offset;
     bool has_frequency;
     double frequency;
     bool has_name;
     char name[10];
+    bool has_decoded_type;
+    openxc_DiagnosticRequest_DecodedType decoded_type;
 } openxc_DiagnosticRequest;
 
 typedef struct {
@@ -168,10 +171,9 @@ typedef struct _openxc_VehicleMessage {
 #define openxc_DiagnosticRequest_pid_tag         4
 #define openxc_DiagnosticRequest_payload_tag     5
 #define openxc_DiagnosticRequest_multiple_responses_tag 6
-#define openxc_DiagnosticRequest_factor_tag      7
-#define openxc_DiagnosticRequest_offset_tag      8
-#define openxc_DiagnosticRequest_frequency_tag   9
-#define openxc_DiagnosticRequest_name_tag        10
+#define openxc_DiagnosticRequest_frequency_tag   7
+#define openxc_DiagnosticRequest_name_tag        8
+#define openxc_DiagnosticRequest_decoded_type_tag 9
 #define openxc_DiagnosticResponse_bus_tag        1
 #define openxc_DiagnosticResponse_message_id_tag 2
 #define openxc_DiagnosticResponse_mode_tag       3
@@ -205,17 +207,17 @@ extern const pb_field_t openxc_VehicleMessage_fields[7];
 extern const pb_field_t openxc_RawMessage_fields[4];
 extern const pb_field_t openxc_ControlCommand_fields[3];
 extern const pb_field_t openxc_CommandResponse_fields[3];
-extern const pb_field_t openxc_DiagnosticRequest_fields[11];
+extern const pb_field_t openxc_DiagnosticRequest_fields[10];
 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
 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               676
+#define openxc_VehicleMessage_size               664
 #define openxc_RawMessage_size                   27
-#define openxc_ControlCommand_size               88
+#define openxc_ControlCommand_size               76
 #define openxc_CommandResponse_size              137
-#define openxc_DiagnosticRequest_size            80
+#define openxc_DiagnosticRequest_size            68
 #define openxc_DiagnosticResponse_size           56
 #define openxc_DynamicField_size                 119
 #define openxc_TranslatedMessage_size            350
index 687e064..777acd0 100644 (file)
@@ -3365,50 +3365,40 @@ public final class BinaryMessages {
      */
     boolean getMultipleResponses();
 
-    // optional double factor = 7;
+    // optional double frequency = 7;
     /**
-     * <code>optional double factor = 7;</code>
-     */
-    boolean hasFactor();
-    /**
-     * <code>optional double factor = 7;</code>
-     */
-    double getFactor();
-
-    // optional double offset = 8;
-    /**
-     * <code>optional double offset = 8;</code>
-     */
-    boolean hasOffset();
-    /**
-     * <code>optional double offset = 8;</code>
-     */
-    double getOffset();
-
-    // optional double frequency = 9;
-    /**
-     * <code>optional double frequency = 9;</code>
+     * <code>optional double frequency = 7;</code>
      */
     boolean hasFrequency();
     /**
-     * <code>optional double frequency = 9;</code>
+     * <code>optional double frequency = 7;</code>
      */
     double getFrequency();
 
-    // optional string name = 10;
+    // optional string name = 8;
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     boolean hasName();
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     java.lang.String getName();
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     com.google.protobuf.ByteString
         getNameBytes();
+
+    // optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;
+    /**
+     * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+     */
+    boolean hasDecodedType();
+    /**
+     * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+     */
+    com.openxc.BinaryMessages.DiagnosticRequest.DecodedType getDecodedType();
   }
   /**
    * Protobuf type {@code openxc.DiagnosticRequest}
@@ -3493,22 +3483,23 @@ public final class BinaryMessages {
             }
             case 57: {
               bitField0_ |= 0x00000040;
-              factor_ = input.readDouble();
+              frequency_ = input.readDouble();
               break;
             }
-            case 65: {
+            case 66: {
               bitField0_ |= 0x00000080;
-              offset_ = input.readDouble();
-              break;
-            }
-            case 73: {
-              bitField0_ |= 0x00000100;
-              frequency_ = input.readDouble();
+              name_ = input.readBytes();
               break;
             }
-            case 82: {
-              bitField0_ |= 0x00000200;
-              name_ = input.readBytes();
+            case 72: {
+              int rawValue = input.readEnum();
+              com.openxc.BinaryMessages.DiagnosticRequest.DecodedType value = com.openxc.BinaryMessages.DiagnosticRequest.DecodedType.valueOf(rawValue);
+              if (value == null) {
+                unknownFields.mergeVarintField(9, rawValue);
+              } else {
+                bitField0_ |= 0x00000100;
+                decodedType_ = value;
+              }
               break;
             }
           }
@@ -3550,6 +3541,88 @@ public final class BinaryMessages {
       return PARSER;
     }
 
+    /**
+     * Protobuf enum {@code openxc.DiagnosticRequest.DecodedType}
+     */
+    public enum DecodedType
+        implements com.google.protobuf.ProtocolMessageEnum {
+      /**
+       * <code>NONE = 1;</code>
+       */
+      NONE(0, 1),
+      /**
+       * <code>OBD2 = 2;</code>
+       */
+      OBD2(1, 2),
+      ;
+
+      /**
+       * <code>NONE = 1;</code>
+       */
+      public static final int NONE_VALUE = 1;
+      /**
+       * <code>OBD2 = 2;</code>
+       */
+      public static final int OBD2_VALUE = 2;
+
+
+      public final int getNumber() { return value; }
+
+      public static DecodedType valueOf(int value) {
+        switch (value) {
+          case 1: return NONE;
+          case 2: return OBD2;
+          default: return null;
+        }
+      }
+
+      public static com.google.protobuf.Internal.EnumLiteMap<DecodedType>
+          internalGetValueMap() {
+        return internalValueMap;
+      }
+      private static com.google.protobuf.Internal.EnumLiteMap<DecodedType>
+          internalValueMap =
+            new com.google.protobuf.Internal.EnumLiteMap<DecodedType>() {
+              public DecodedType findValueByNumber(int number) {
+                return DecodedType.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.DiagnosticRequest.getDescriptor().getEnumTypes().get(0);
+      }
+
+      private static final DecodedType[] VALUES = values();
+
+      public static DecodedType 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 DecodedType(int index, int value) {
+        this.index = index;
+        this.value = value;
+      }
+
+      // @@protoc_insertion_point(enum_scope:openxc.DiagnosticRequest.DecodedType)
+    }
+
     private int bitField0_;
     // optional int32 bus = 1;
     public static final int BUS_FIELD_NUMBER = 1;
@@ -3657,65 +3730,33 @@ public final class BinaryMessages {
       return multipleResponses_;
     }
 
-    // optional double factor = 7;
-    public static final int FACTOR_FIELD_NUMBER = 7;
-    private double factor_;
-    /**
-     * <code>optional double factor = 7;</code>
-     */
-    public boolean hasFactor() {
-      return ((bitField0_ & 0x00000040) == 0x00000040);
-    }
-    /**
-     * <code>optional double factor = 7;</code>
-     */
-    public double getFactor() {
-      return factor_;
-    }
-
-    // optional double offset = 8;
-    public static final int OFFSET_FIELD_NUMBER = 8;
-    private double offset_;
-    /**
-     * <code>optional double offset = 8;</code>
-     */
-    public boolean hasOffset() {
-      return ((bitField0_ & 0x00000080) == 0x00000080);
-    }
-    /**
-     * <code>optional double offset = 8;</code>
-     */
-    public double getOffset() {
-      return offset_;
-    }
-
-    // optional double frequency = 9;
-    public static final int FREQUENCY_FIELD_NUMBER = 9;
+    // optional double frequency = 7;
+    public static final int FREQUENCY_FIELD_NUMBER = 7;
     private double frequency_;
     /**
-     * <code>optional double frequency = 9;</code>
+     * <code>optional double frequency = 7;</code>
      */
     public boolean hasFrequency() {
-      return ((bitField0_ & 0x00000100) == 0x00000100);
+      return ((bitField0_ & 0x00000040) == 0x00000040);
     }
     /**
-     * <code>optional double frequency = 9;</code>
+     * <code>optional double frequency = 7;</code>
      */
     public double getFrequency() {
       return frequency_;
     }
 
-    // optional string name = 10;
-    public static final int NAME_FIELD_NUMBER = 10;
+    // optional string name = 8;
+    public static final int NAME_FIELD_NUMBER = 8;
     private java.lang.Object name_;
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     public boolean hasName() {
-      return ((bitField0_ & 0x00000200) == 0x00000200);
+      return ((bitField0_ & 0x00000080) == 0x00000080);
     }
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     public java.lang.String getName() {
       java.lang.Object ref = name_;
@@ -3732,7 +3773,7 @@ public final class BinaryMessages {
       }
     }
     /**
-     * <code>optional string name = 10;</code>
+     * <code>optional string name = 8;</code>
      */
     public com.google.protobuf.ByteString
         getNameBytes() {
@@ -3748,6 +3789,22 @@ public final class BinaryMessages {
       }
     }
 
+    // optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;
+    public static final int DECODED_TYPE_FIELD_NUMBER = 9;
+    private com.openxc.BinaryMessages.DiagnosticRequest.DecodedType decodedType_;
+    /**
+     * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+     */
+    public boolean hasDecodedType() {
+      return ((bitField0_ & 0x00000100) == 0x00000100);
+    }
+    /**
+     * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+     */
+    public com.openxc.BinaryMessages.DiagnosticRequest.DecodedType getDecodedType() {
+      return decodedType_;
+    }
+
     private void initFields() {
       bus_ = 0;
       messageId_ = 0;
@@ -3755,10 +3812,9 @@ public final class BinaryMessages {
       pid_ = 0;
       payload_ = com.google.protobuf.ByteString.EMPTY;
       multipleResponses_ = false;
-      factor_ = 0D;
-      offset_ = 0D;
       frequency_ = 0D;
       name_ = "";
+      decodedType_ = com.openxc.BinaryMessages.DiagnosticRequest.DecodedType.NONE;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -3791,16 +3847,13 @@ public final class BinaryMessages {
         output.writeBool(6, multipleResponses_);
       }
       if (((bitField0_ & 0x00000040) == 0x00000040)) {
-        output.writeDouble(7, factor_);
+        output.writeDouble(7, frequency_);
       }
       if (((bitField0_ & 0x00000080) == 0x00000080)) {
-        output.writeDouble(8, offset_);
+        output.writeBytes(8, getNameBytes());
       }
       if (((bitField0_ & 0x00000100) == 0x00000100)) {
-        output.writeDouble(9, frequency_);
-      }
-      if (((bitField0_ & 0x00000200) == 0x00000200)) {
-        output.writeBytes(10, getNameBytes());
+        output.writeEnum(9, decodedType_.getNumber());
       }
       getUnknownFields().writeTo(output);
     }
@@ -3837,19 +3890,15 @@ public final class BinaryMessages {
       }
       if (((bitField0_ & 0x00000040) == 0x00000040)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeDoubleSize(7, factor_);
+          .computeDoubleSize(7, frequency_);
       }
       if (((bitField0_ & 0x00000080) == 0x00000080)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeDoubleSize(8, offset_);
+          .computeBytesSize(8, getNameBytes());
       }
       if (((bitField0_ & 0x00000100) == 0x00000100)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeDoubleSize(9, frequency_);
-      }
-      if (((bitField0_ & 0x00000200) == 0x00000200)) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(10, getNameBytes());
+          .computeEnumSize(9, decodedType_.getNumber());
       }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
@@ -3979,14 +4028,12 @@ public final class BinaryMessages {
         bitField0_ = (bitField0_ & ~0x00000010);
         multipleResponses_ = false;
         bitField0_ = (bitField0_ & ~0x00000020);
-        factor_ = 0D;
+        frequency_ = 0D;
         bitField0_ = (bitField0_ & ~0x00000040);
-        offset_ = 0D;
+        name_ = "";
         bitField0_ = (bitField0_ & ~0x00000080);
-        frequency_ = 0D;
+        decodedType_ = com.openxc.BinaryMessages.DiagnosticRequest.DecodedType.NONE;
         bitField0_ = (bitField0_ & ~0x00000100);
-        name_ = "";
-        bitField0_ = (bitField0_ & ~0x00000200);
         return this;
       }
 
@@ -4042,19 +4089,15 @@ public final class BinaryMessages {
         if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
           to_bitField0_ |= 0x00000040;
         }
-        result.factor_ = factor_;
+        result.frequency_ = frequency_;
         if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
           to_bitField0_ |= 0x00000080;
         }
-        result.offset_ = offset_;
+        result.name_ = name_;
         if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
           to_bitField0_ |= 0x00000100;
         }
-        result.frequency_ = frequency_;
-        if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
-          to_bitField0_ |= 0x00000200;
-        }
-        result.name_ = name_;
+        result.decodedType_ = decodedType_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -4089,20 +4132,17 @@ public final class BinaryMessages {
         if (other.hasMultipleResponses()) {
           setMultipleResponses(other.getMultipleResponses());
         }
-        if (other.hasFactor()) {
-          setFactor(other.getFactor());
-        }
-        if (other.hasOffset()) {
-          setOffset(other.getOffset());
-        }
         if (other.hasFrequency()) {
           setFrequency(other.getFrequency());
         }
         if (other.hasName()) {
-          bitField0_ |= 0x00000200;
+          bitField0_ |= 0x00000080;
           name_ = other.name_;
           onChanged();
         }
+        if (other.hasDecodedType()) {
+          setDecodedType(other.getDecodedType());
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -4351,115 +4391,49 @@ public final class BinaryMessages {
         return this;
       }
 
-      // optional double factor = 7;
-      private double factor_ ;
-      /**
-       * <code>optional double factor = 7;</code>
-       */
-      public boolean hasFactor() {
-        return ((bitField0_ & 0x00000040) == 0x00000040);
-      }
-      /**
-       * <code>optional double factor = 7;</code>
-       */
-      public double getFactor() {
-        return factor_;
-      }
-      /**
-       * <code>optional double factor = 7;</code>
-       */
-      public Builder setFactor(double value) {
-        bitField0_ |= 0x00000040;
-        factor_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>optional double factor = 7;</code>
-       */
-      public Builder clearFactor() {
-        bitField0_ = (bitField0_ & ~0x00000040);
-        factor_ = 0D;
-        onChanged();
-        return this;
-      }
-
-      // optional double offset = 8;
-      private double offset_ ;
-      /**
-       * <code>optional double offset = 8;</code>
-       */
-      public boolean hasOffset() {
-        return ((bitField0_ & 0x00000080) == 0x00000080);
-      }
-      /**
-       * <code>optional double offset = 8;</code>
-       */
-      public double getOffset() {
-        return offset_;
-      }
-      /**
-       * <code>optional double offset = 8;</code>
-       */
-      public Builder setOffset(double value) {
-        bitField0_ |= 0x00000080;
-        offset_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>optional double offset = 8;</code>
-       */
-      public Builder clearOffset() {
-        bitField0_ = (bitField0_ & ~0x00000080);
-        offset_ = 0D;
-        onChanged();
-        return this;
-      }
-
-      // optional double frequency = 9;
+      // optional double frequency = 7;
       private double frequency_ ;
       /**
-       * <code>optional double frequency = 9;</code>
+       * <code>optional double frequency = 7;</code>
        */
       public boolean hasFrequency() {
-        return ((bitField0_ & 0x00000100) == 0x00000100);
+        return ((bitField0_ & 0x00000040) == 0x00000040);
       }
       /**
-       * <code>optional double frequency = 9;</code>
+       * <code>optional double frequency = 7;</code>
        */
       public double getFrequency() {
         return frequency_;
       }
       /**
-       * <code>optional double frequency = 9;</code>
+       * <code>optional double frequency = 7;</code>
        */
       public Builder setFrequency(double value) {
-        bitField0_ |= 0x00000100;
+        bitField0_ |= 0x00000040;
         frequency_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional double frequency = 9;</code>
+       * <code>optional double frequency = 7;</code>
        */
       public Builder clearFrequency() {
-        bitField0_ = (bitField0_ & ~0x00000100);
+        bitField0_ = (bitField0_ & ~0x00000040);
         frequency_ = 0D;
         onChanged();
         return this;
       }
 
-      // optional string name = 10;
+      // optional string name = 8;
       private java.lang.Object name_ = "";
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public boolean hasName() {
-        return ((bitField0_ & 0x00000200) == 0x00000200);
+        return ((bitField0_ & 0x00000080) == 0x00000080);
       }
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public java.lang.String getName() {
         java.lang.Object ref = name_;
@@ -4473,7 +4447,7 @@ public final class BinaryMessages {
         }
       }
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public com.google.protobuf.ByteString
           getNameBytes() {
@@ -4489,41 +4463,77 @@ public final class BinaryMessages {
         }
       }
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public Builder setName(
           java.lang.String value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000200;
+  bitField0_ |= 0x00000080;
         name_ = value;
         onChanged();
         return this;
       }
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public Builder clearName() {
-        bitField0_ = (bitField0_ & ~0x00000200);
+        bitField0_ = (bitField0_ & ~0x00000080);
         name_ = getDefaultInstance().getName();
         onChanged();
         return this;
       }
       /**
-       * <code>optional string name = 10;</code>
+       * <code>optional string name = 8;</code>
        */
       public Builder setNameBytes(
           com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000200;
+  bitField0_ |= 0x00000080;
         name_ = value;
         onChanged();
         return this;
       }
 
+      // optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;
+      private com.openxc.BinaryMessages.DiagnosticRequest.DecodedType decodedType_ = com.openxc.BinaryMessages.DiagnosticRequest.DecodedType.NONE;
+      /**
+       * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+       */
+      public boolean hasDecodedType() {
+        return ((bitField0_ & 0x00000100) == 0x00000100);
+      }
+      /**
+       * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+       */
+      public com.openxc.BinaryMessages.DiagnosticRequest.DecodedType getDecodedType() {
+        return decodedType_;
+      }
+      /**
+       * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+       */
+      public Builder setDecodedType(com.openxc.BinaryMessages.DiagnosticRequest.DecodedType value) {
+        if (value == null) {
+          throw new NullPointerException();
+        }
+        bitField0_ |= 0x00000100;
+        decodedType_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional .openxc.DiagnosticRequest.DecodedType decoded_type = 9;</code>
+       */
+      public Builder clearDecodedType() {
+        bitField0_ = (bitField0_ & ~0x00000100);
+        decodedType_ = com.openxc.BinaryMessages.DiagnosticRequest.DecodedType.NONE;
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:openxc.DiagnosticRequest)
     }
 
@@ -7485,27 +7495,29 @@ public final class BinaryMessages {
       "Request\"2\n\004Type\022\013\n\007VERSION\020\001\022\r\n\tDEVICE_I" +
       "D\020\002\022\016\n\nDIAGNOSTIC\020\003\"M\n\017CommandResponse\022)" +
       "\n\004type\030\001 \001(\0162\033.openxc.ControlCommand.Typ" +
-      "e\022\017\n\007message\030\002 \001(\t\"\275\001\n\021DiagnosticRequest" +
+      "e\022\017\n\007message\030\002 \001(\t\"\375\001\n\021DiagnosticRequest" +
       "\022\013\n\003bus\030\001 \001(\005\022\022\n\nmessage_id\030\002 \001(\r\022\014\n\004mod",
       "e\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\016\n\006factor\030\007 \001(" +
-      "\001\022\016\n\006offset\030\010 \001(\001\022\021\n\tfrequency\030\t \001(\001\022\014\n\004" +
-      "name\030\n \001(\t\"\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\026negati" +
-      "ve_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\014stri" +
-      "ng_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\021TranslatedMessag" +
-      "e\022,\n\004type\030\001 \001(\0162\036.openxc.TranslatedMessa" +
-      "ge.Type\022\014\n\004name\030\002 \001(\t\022#\n\005value\030\003 \001(\0132\024.o" +
-      "penxc.DynamicField\022#\n\005event\030\004 \001(\0132\024.open" +
-      "xc.DynamicField\"\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003N" +
-      "UM\020\002\022\010\n\004BOOL\020\003\022\022\n\016EVENTED_STRING\020\004\022\017\n\013EV" +
-      "ENTED_NUM\020\005\022\020\n\014EVENTED_BOOL\020\006B\034\n\ncom.ope" +
-      "nxcB\016BinaryMessages"
+      "\022multiple_responses\030\006 \001(\010\022\021\n\tfrequency\030\007" +
+      " \001(\001\022\014\n\004name\030\010 \001(\t\022;\n\014decoded_type\030\t \001(\016" +
+      "2%.openxc.DiagnosticRequest.DecodedType\"" +
+      "!\n\013DecodedType\022\010\n\004NONE\020\001\022\010\n\004OBD2\020\002\"\241\001\n\022D" +
+      "iagnosticResponse\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" +
+      "\007success\030\005 \001(\010\022\036\n\026negative_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.D",
+      "ynamicField.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\004BOO" +
+      "L\020\003\"\367\001\n\021TranslatedMessage\022,\n\004type\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.DynamicFie" +
+      "ld\022#\n\005event\030\004 \001(\0132\024.openxc.DynamicField\"" +
+      "\\\n\004Type\022\n\n\006STRING\020\001\022\007\n\003NUM\020\002\022\010\n\004BOOL\020\003\022\022" +
+      "\n\016EVENTED_STRING\020\004\022\017\n\013EVENTED_NUM\020\005\022\020\n\014E" +
+      "VENTED_BOOL\020\006B\034\n\ncom.openxcB\016BinaryMessa",
+      "ges"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -7541,7 +7553,7 @@ public final class BinaryMessages {
           internal_static_openxc_DiagnosticRequest_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_openxc_DiagnosticRequest_descriptor,
-              new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Payload", "MultipleResponses", "Factor", "Offset", "Frequency", "Name", });
+              new java.lang.String[] { "Bus", "MessageId", "Mode", "Pid", "Payload", "MultipleResponses", "Frequency", "Name", "DecodedType", });
           internal_static_openxc_DiagnosticResponse_descriptor =
             getDescriptor().getMessageTypes().get(5);
           internal_static_openxc_DiagnosticResponse_fieldAccessorTable = new
index 1e2191d..f831230 100644 (file)
@@ -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\"\xa6\x01\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x35\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\"2\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\"M\n\x0f\x43ommandResponse\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\"\xbd\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\x0e\n\x06\x66\x61\x63tor\x18\x07 \x01(\x01\x12\x0e\n\x06offset\x18\x08 \x01(\x01\x12\x11\n\tfrequency\x18\t \x01(\x01\x12\x0c\n\x04name\x18\n \x01(\t\"\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\"\xa6\x01\n\x0e\x43ontrolCommand\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x35\n\x12\x64iagnostic_request\x18\x02 \x01(\x0b\x32\x19.openxc.DiagnosticRequest\"2\n\x04Type\x12\x0b\n\x07VERSION\x10\x01\x12\r\n\tDEVICE_ID\x10\x02\x12\x0e\n\nDIAGNOSTIC\x10\x03\"M\n\x0f\x43ommandResponse\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.openxc.ControlCommand.Type\x12\x0f\n\x07message\x18\x02 \x01(\t\"\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')
 
 
 
@@ -75,6 +75,27 @@ _CONTROLCOMMAND_TYPE = _descriptor.EnumDescriptor(
   serialized_end=659,
 )
 
+_DIAGNOSTICREQUEST_DECODEDTYPE = _descriptor.EnumDescriptor(
+  name='DecodedType',
+  full_name='openxc.DiagnosticRequest.DecodedType',
+  filename=None,
+  file=DESCRIPTOR,
+  values=[
+    _descriptor.EnumValueDescriptor(
+      name='NONE', index=0, number=1,
+      options=None,
+      type=None),
+    _descriptor.EnumValueDescriptor(
+      name='OBD2', index=1, number=2,
+      options=None,
+      type=None),
+  ],
+  containing_type=None,
+  options=None,
+  serialized_start=961,
+  serialized_end=994,
+)
+
 _DYNAMICFIELD_TYPE = _descriptor.EnumDescriptor(
   name='Type',
   full_name='openxc.DynamicField.Type',
@@ -96,8 +117,8 @@ _DYNAMICFIELD_TYPE = _descriptor.EnumDescriptor(
   ],
   containing_type=None,
   options=None,
-  serialized_start=1222,
-  serialized_end=1259,
+  serialized_start=1286,
+  serialized_end=1323,
 )
 
 _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor(
@@ -133,8 +154,8 @@ _TRANSLATEDMESSAGE_TYPE = _descriptor.EnumDescriptor(
   ],
   containing_type=None,
   options=None,
-  serialized_start=1417,
-  serialized_end=1509,
+  serialized_start=1481,
+  serialized_end=1573,
 )
 
 
@@ -365,30 +386,23 @@ _DIAGNOSTICREQUEST = _descriptor.Descriptor(
       is_extension=False, extension_scope=None,
       options=None),
     _descriptor.FieldDescriptor(
-      name='factor', full_name='openxc.DiagnosticRequest.factor', index=6,
+      name='frequency', full_name='openxc.DiagnosticRequest.frequency', index=6,
       number=7, type=1, cpp_type=5, label=1,
       has_default_value=False, default_value=0,
       message_type=None, enum_type=None, containing_type=None,
       is_extension=False, extension_scope=None,
       options=None),
     _descriptor.FieldDescriptor(
-      name='offset', full_name='openxc.DiagnosticRequest.offset', index=7,
-      number=8, type=1, cpp_type=5, label=1,
-      has_default_value=False, default_value=0,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='frequency', full_name='openxc.DiagnosticRequest.frequency', index=8,
-      number=9, type=1, cpp_type=5, label=1,
-      has_default_value=False, default_value=0,
+      name='name', full_name='openxc.DiagnosticRequest.name', index=7,
+      number=8, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=unicode("", "utf-8"),
       message_type=None, enum_type=None, containing_type=None,
       is_extension=False, extension_scope=None,
       options=None),
     _descriptor.FieldDescriptor(
-      name='name', full_name='openxc.DiagnosticRequest.name', index=9,
-      number=10, type=9, cpp_type=9, label=1,
-      has_default_value=False, default_value=unicode("", "utf-8"),
+      name='decoded_type', full_name='openxc.DiagnosticRequest.decoded_type', index=8,
+      number=9, type=14, cpp_type=8, label=1,
+      has_default_value=False, default_value=1,
       message_type=None, enum_type=None, containing_type=None,
       is_extension=False, extension_scope=None,
       options=None),
@@ -397,12 +411,13 @@ _DIAGNOSTICREQUEST = _descriptor.Descriptor(
   ],
   nested_types=[],
   enum_types=[
+    _DIAGNOSTICREQUEST_DECODEDTYPE,
   ],
   options=None,
   is_extendable=False,
   extension_ranges=[],
   serialized_start=741,
-  serialized_end=930,
+  serialized_end=994,
 )
 
 
@@ -478,8 +493,8 @@ _DIAGNOSTICRESPONSE = _descriptor.Descriptor(
   options=None,
   is_extendable=False,
   extension_ranges=[],
-  serialized_start=933,
-  serialized_end=1094,
+  serialized_start=997,
+  serialized_end=1158,
 )
 
 
@@ -528,8 +543,8 @@ _DYNAMICFIELD = _descriptor.Descriptor(
   options=None,
   is_extendable=False,
   extension_ranges=[],
-  serialized_start=1097,
-  serialized_end=1259,
+  serialized_start=1161,
+  serialized_end=1323,
 )
 
 
@@ -578,8 +593,8 @@ _TRANSLATEDMESSAGE = _descriptor.Descriptor(
   options=None,
   is_extendable=False,
   extension_ranges=[],
-  serialized_start=1262,
-  serialized_end=1509,
+  serialized_start=1326,
+  serialized_end=1573,
 )
 
 _VEHICLEMESSAGE.fields_by_name['type'].enum_type = _VEHICLEMESSAGE_TYPE
@@ -593,6 +608,8 @@ _CONTROLCOMMAND.fields_by_name['type'].enum_type = _CONTROLCOMMAND_TYPE
 _CONTROLCOMMAND.fields_by_name['diagnostic_request'].message_type = _DIAGNOSTICREQUEST
 _CONTROLCOMMAND_TYPE.containing_type = _CONTROLCOMMAND;
 _COMMANDRESPONSE.fields_by_name['type'].enum_type = _CONTROLCOMMAND_TYPE
+_DIAGNOSTICREQUEST.fields_by_name['decoded_type'].enum_type = _DIAGNOSTICREQUEST_DECODEDTYPE
+_DIAGNOSTICREQUEST_DECODEDTYPE.containing_type = _DIAGNOSTICREQUEST;
 _DYNAMICFIELD.fields_by_name['type'].enum_type = _DYNAMICFIELD_TYPE
 _DYNAMICFIELD_TYPE.containing_type = _DYNAMICFIELD;
 _TRANSLATEDMESSAGE.fields_by_name['type'].enum_type = _TRANSLATEDMESSAGE_TYPE
index daccea2..5b7e78b 100644 (file)
@@ -34,6 +34,8 @@ message CommandResponse {
 }
 
 message DiagnosticRequest {
+    enum DecodedType { NONE = 1; OBD2 = 2; }
+
     optional int32 bus = 1;
     optional uint32 message_id = 2;
     optional uint32 mode = 3;
@@ -42,10 +44,9 @@ message DiagnosticRequest {
     // support multi-frame responses
     optional bytes payload = 5;
     optional bool multiple_responses = 6;
-    optional double factor = 7;
-    optional double offset = 8;
-    optional double frequency = 9;
-    optional string name = 10;
+    optional double frequency = 7;
+    optional string name = 8;
+    optional DecodedType decoded_type = 9;
 }
 
 message DiagnosticResponse {