aboutsummaryrefslogtreecommitdiffstats
path: root/gen
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-17 14:31:39 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-17 14:31:39 -0500
commit59f06d99530676c638495d9cde0748f7653e33e5 (patch)
tree188aec6639890a17d1f385e18f11fec9d89c450f /gen
parent40127285861b290ad596bf713cf6d21e7f2072c1 (diff)
Store diagnostic response payload as a byte array in protobuf.
Diffstat (limited to 'gen')
-rw-r--r--gen/cpp/openxc.pb2
-rw-r--r--gen/cpp/openxc.pb.c4
-rw-r--r--gen/cpp/openxc.pb.h11
-rw-r--r--gen/java/com/openxc/BinaryMessages.java95
-rw-r--r--gen/python/openxc_pb2.py6
5 files changed, 83 insertions, 35 deletions
diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb
index 2267f21c..82bfdd4f 100644
--- a/gen/cpp/openxc.pb
+++ b/gen/cpp/openxc.pb
@@ -23,7 +23,7 @@ message_id ( 
pid ( 
success (
negative_response_code ( 
-payload ("µ
+payload ( "µ
TranslatedMessage,
type (2.openxc.TranslatedMessage.Type
name ( 
diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c
index da616556..7e2d390d 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.2.5 at Fri Jan 17 14:12:22 2014. */
+/* Generated by nanopb-0.2.5 at Fri Jan 17 14:31:26 2014. */
#include "openxc.pb.h"
@@ -26,7 +26,7 @@ const pb_field_t openxc_DiagnosticMessage_fields[8] = {
PB_FIELD2( 4, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, pid, mode, 0),
PB_FIELD2( 5, BOOL , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, success, pid, 0),
PB_FIELD2( 6, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, negative_response_code, success, 0),
- PB_FIELD2( 7, UINT64 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, payload, negative_response_code, 0),
+ PB_FIELD2( 7, BYTES , OPTIONAL, STATIC , OTHER, openxc_DiagnosticMessage, payload, negative_response_code, 0),
PB_LAST_FIELD
};
diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h
index e4619ce1..f5f117e4 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.2.5 at Fri Jan 17 14:12:22 2014. */
+/* Generated by nanopb-0.2.5 at Fri Jan 17 14:31:26 2014. */
#ifndef _PB_OPENXC_PB_H_
#define _PB_OPENXC_PB_H_
@@ -25,6 +25,11 @@ typedef enum _openxc_TranslatedMessage_Type {
} openxc_TranslatedMessage_Type;
/* Struct definitions */
+typedef struct {
+ size_t size;
+ uint8_t bytes[8];
+} openxc_DiagnosticMessage_payload_t;
+
typedef struct _openxc_DiagnosticMessage {
bool has_bus;
int32_t bus;
@@ -39,7 +44,7 @@ typedef struct _openxc_DiagnosticMessage {
bool has_negative_response_code;
uint32_t negative_response_code;
bool has_payload;
- uint64_t payload;
+ openxc_DiagnosticMessage_payload_t payload;
} openxc_DiagnosticMessage;
typedef struct _openxc_RawMessage {
@@ -113,7 +118,7 @@ extern const pb_field_t openxc_TranslatedMessage_fields[9];
/* Maximum encoded size of messages (where known) */
#define openxc_VehicleMessage_size 373
#define openxc_RawMessage_size 28
-#define openxc_DiagnosticMessage_size 48
+#define openxc_DiagnosticMessage_size 47
#define openxc_TranslatedMessage_size 334
#ifdef __cplusplus
diff --git a/gen/java/com/openxc/BinaryMessages.java b/gen/java/com/openxc/BinaryMessages.java
index a22dfe1f..749ed5a8 100644
--- a/gen/java/com/openxc/BinaryMessages.java
+++ b/gen/java/com/openxc/BinaryMessages.java
@@ -1500,15 +1500,25 @@ public final class BinaryMessages {
*/
int getNegativeResponseCode();
- // optional uint64 payload = 7;
+ // optional bytes payload = 7;
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
boolean hasPayload();
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
- long getPayload();
+ com.google.protobuf.ByteString getPayload();
}
/**
* Protobuf type {@code openxc.DiagnosticMessage}
@@ -1591,9 +1601,9 @@ public final class BinaryMessages {
negativeResponseCode_ = input.readUInt32();
break;
}
- case 56: {
+ case 58: {
bitField0_ |= 0x00000040;
- payload_ = input.readUInt64();
+ payload_ = input.readBytes();
break;
}
}
@@ -1732,19 +1742,29 @@ public final class BinaryMessages {
return negativeResponseCode_;
}
- // optional uint64 payload = 7;
+ // optional bytes payload = 7;
public static final int PAYLOAD_FIELD_NUMBER = 7;
- private long payload_;
+ private com.google.protobuf.ByteString payload_;
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
public boolean hasPayload() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
- public long getPayload() {
+ public com.google.protobuf.ByteString getPayload() {
return payload_;
}
@@ -1755,7 +1775,7 @@ public final class BinaryMessages {
pid_ = 0;
success_ = false;
negativeResponseCode_ = 0;
- payload_ = 0L;
+ payload_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -1788,7 +1808,7 @@ public final class BinaryMessages {
output.writeUInt32(6, negativeResponseCode_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
- output.writeUInt64(7, payload_);
+ output.writeBytes(7, payload_);
}
getUnknownFields().writeTo(output);
}
@@ -1825,7 +1845,7 @@ public final class BinaryMessages {
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
- .computeUInt64Size(7, payload_);
+ .computeBytesSize(7, payload_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
@@ -1955,7 +1975,7 @@ public final class BinaryMessages {
bitField0_ = (bitField0_ & ~0x00000010);
negativeResponseCode_ = 0;
bitField0_ = (bitField0_ & ~0x00000020);
- payload_ = 0L;
+ payload_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@@ -2275,35 +2295,58 @@ public final class BinaryMessages {
return this;
}
- // optional uint64 payload = 7;
- private long payload_ ;
+ // optional bytes payload = 7;
+ private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY;
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
public boolean hasPayload() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
- public long getPayload() {
+ public com.google.protobuf.ByteString getPayload() {
return payload_;
}
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
- public Builder setPayload(long value) {
- bitField0_ |= 0x00000040;
+ public Builder setPayload(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000040;
payload_ = value;
onChanged();
return this;
}
/**
- * <code>optional uint64 payload = 7;</code>
+ * <code>optional bytes payload = 7;</code>
+ *
+ * <pre>
+ * TODO we are capping this at 8 bytes for now - need to change when we
+ * support multi-frame responses
+ * </pre>
*/
public Builder clearPayload() {
bitField0_ = (bitField0_ & ~0x00000040);
- payload_ = 0L;
+ payload_ = getDefaultInstance().getPayload();
onChanged();
return this;
}
@@ -3673,7 +3716,7 @@ public final class BinaryMessages {
"iagnosticMessage\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\007" +
"success\030\005 \001(\010\022\036\n\026negative_response_code\030",
- "\006 \001(\r\022\017\n\007payload\030\007 \001(\004\"\265\002\n\021TranslatedMes" +
+ "\006 \001(\r\022\017\n\007payload\030\007 \001(\014\"\265\002\n\021TranslatedMes" +
"sage\022,\n\004type\030\001 \001(\0162\036.openxc.TranslatedMe" +
"ssage.Type\022\014\n\004name\030\002 \001(\t\022\024\n\014string_value" +
"\030\003 \001(\t\022\025\n\rnumeric_value\030\004 \001(\001\022\025\n\rboolean" +
diff --git a/gen/python/openxc_pb2.py b/gen/python/openxc_pb2.py
index 59791cf2..62918919 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\"\xbc\x01\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\"\x1f\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\";\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(\x04\"\x91\x01\n\x11\x44iagnosticMessage\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(\x04\"\xb5\x02\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0cstring_value\x18\x03 \x01(\t\x12\x15\n\rnumeric_value\x18\x04 \x01(\x01\x12\x15\n\rboolean_value\x18\x05 \x01(\x08\x12\x14\n\x0cstring_event\x18\x06 \x01(\t\x12\x15\n\rnumeric_event\x18\x07 \x01(\x01\x12\x15\n\rboolean_event\x18\x08 \x01(\x08\"\\\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\"\xbc\x01\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\"\x1f\n\x04Type\x12\x07\n\x03RAW\x10\x01\x12\x0e\n\nTRANSLATED\x10\x02\";\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(\x04\"\x91\x01\n\x11\x44iagnosticMessage\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\"\xb5\x02\n\x11TranslatedMessage\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.openxc.TranslatedMessage.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0cstring_value\x18\x03 \x01(\t\x12\x15\n\rnumeric_value\x18\x04 \x01(\x01\x12\x15\n\rboolean_value\x18\x05 \x01(\x08\x12\x14\n\x0cstring_event\x18\x06 \x01(\t\x12\x15\n\rnumeric_event\x18\x07 \x01(\x01\x12\x15\n\rboolean_event\x18\x08 \x01(\x08\"\\\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')
@@ -212,8 +212,8 @@ _DIAGNOSTICMESSAGE = _descriptor.Descriptor(
options=None),
_descriptor.FieldDescriptor(
name='payload', full_name='openxc.DiagnosticMessage.payload', index=6,
- number=7, type=4, cpp_type=4, label=1,
- has_default_value=False, default_value=0,
+ number=7, type=12, cpp_type=9, label=1,
+ has_default_value=False, default_value="",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),