diff options
Diffstat (limited to 'gen/cpp')
-rw-r--r-- | gen/cpp/openxc.pb | 72 | ||||
-rw-r--r-- | gen/cpp/openxc.pb.c | 82 | ||||
-rw-r--r-- | gen/cpp/openxc.pb.h | 184 |
3 files changed, 281 insertions, 57 deletions
diff --git a/gen/cpp/openxc.pb b/gen/cpp/openxc.pb index 88cf91aa..da312337 100644 --- a/gen/cpp/openxc.pb +++ b/gen/cpp/openxc.pb @@ -1,29 +1,77 @@ -è -openxc.protoopenxc"¼ +Ã +openxc.protoopenxc"” VehicleMessage) type (2.openxc.VehicleMessage.Type' raw_message (2.openxc.RawMessage5 -translated_message (2.openxc.TranslatedMessage" +translated_message (2.openxc.TranslatedMessage7 +diagnostic_response (2.openxc.DiagnosticResponse/ +control_command (2.openxc.ControlCommand1 +command_response (2.openxc.CommandResponse"Z Type RAW -TRANSLATED"; +TRANSLATED + +DIAGNOSTIC +CONTROL_COMMAND +COMMAND_RESPONSE"; RawMessage bus ( message_id (
-data ("µ +data ("¦ +ControlCommand) +type (2.openxc.ControlCommand.Type5 +diagnostic_request (2.openxc.DiagnosticRequest"2 +Type +VERSION
+ DEVICE_ID + +DIAGNOSTIC"M +CommandResponse) +type (2.openxc.ControlCommand.Type +message ( "ý +DiagnosticRequest +bus ( + +message_id (
+mode (
+pid (
+payload ( +multiple_responses ( + frequency ( +name ( ; +decoded_type (2%.openxc.DiagnosticRequest.DecodedType"! +DecodedType +NONE +OBD2"¡ +DiagnosticResponse +bus ( + +message_id (
+mode (
+pid (
+success ( +negative_response_code (
+payload (
+value ("¢ +DynamicField' +type (2.openxc.DynamicField.Type +string_value ( +
numeric_value ( +
boolean_value ("% +Type + +STRING +NUM +BOOL"÷ TranslatedMessage, type (2.openxc.TranslatedMessage.Type -name ( -string_value ( -
numeric_value ( -
boolean_value ( -string_event ( -
numeric_event ( -
boolean_event ("\ +name ( # +value (2.openxc.DynamicField# +event (2.openxc.DynamicField"\ Type STRING diff --git a/gen/cpp/openxc.pb.c b/gen/cpp/openxc.pb.c index 1625254e..e3be2570 100644 --- a/gen/cpp/openxc.pb.c +++ b/gen/cpp/openxc.pb.c @@ -1,44 +1,88 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.2.4-dev at Thu Oct 24 10:06:38 2013. */ +/* Generated by nanopb-0.2.5 at Wed Mar 26 09:29:06 2014. */ #include "openxc.pb.h" -const pb_field_t openxc_VehicleMessage_fields[4] = { - PB_FIELD2( 1, ENUM , OPTIONAL, STATIC, FIRST, openxc_VehicleMessage, type, type, 0), - PB_FIELD2( 2, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, raw_message, type, &openxc_RawMessage_fields), - PB_FIELD2( 3, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, translated_message, raw_message, &openxc_TranslatedMessage_fields), +const pb_field_t openxc_VehicleMessage_fields[7] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_VehicleMessage, type, type, 0), + PB_FIELD2( 2, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, raw_message, type, &openxc_RawMessage_fields), + PB_FIELD2( 3, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, translated_message, raw_message, &openxc_TranslatedMessage_fields), + PB_FIELD2( 4, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, diagnostic_response, translated_message, &openxc_DiagnosticResponse_fields), + PB_FIELD2( 5, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, control_command, diagnostic_response, &openxc_ControlCommand_fields), + PB_FIELD2( 6, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, command_response, control_command, &openxc_CommandResponse_fields), PB_LAST_FIELD }; const pb_field_t openxc_RawMessage_fields[4] = { - PB_FIELD2( 1, INT32 , OPTIONAL, STATIC, FIRST, openxc_RawMessage, bus, bus, 0), - PB_FIELD2( 2, UINT32 , OPTIONAL, STATIC, OTHER, openxc_RawMessage, message_id, bus, 0), - PB_FIELD2( 3, UINT64 , OPTIONAL, STATIC, OTHER, openxc_RawMessage, data, message_id, 0), + PB_FIELD2( 1, INT32 , OPTIONAL, STATIC , FIRST, openxc_RawMessage, bus, bus, 0), + PB_FIELD2( 2, UINT32 , OPTIONAL, STATIC , OTHER, openxc_RawMessage, message_id, bus, 0), + PB_FIELD2( 3, BYTES , OPTIONAL, STATIC , OTHER, openxc_RawMessage, data, message_id, 0), PB_LAST_FIELD }; -const pb_field_t openxc_TranslatedMessage_fields[9] = { - PB_FIELD2( 1, ENUM , OPTIONAL, STATIC, FIRST, openxc_TranslatedMessage, type, type, 0), - PB_FIELD2( 2, STRING , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, name, type, 0), - PB_FIELD2( 3, STRING , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, string_value, name, 0), - PB_FIELD2( 4, DOUBLE , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, numeric_value, string_value, 0), - PB_FIELD2( 5, BOOL , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, boolean_value, numeric_value, 0), - PB_FIELD2( 6, STRING , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, string_event, boolean_value, 0), - PB_FIELD2( 7, DOUBLE , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, numeric_event, string_event, 0), - PB_FIELD2( 8, BOOL , OPTIONAL, STATIC, OTHER, openxc_TranslatedMessage, boolean_event, numeric_event, 0), +const pb_field_t openxc_ControlCommand_fields[3] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_ControlCommand, type, type, 0), + PB_FIELD2( 2, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, diagnostic_request, type, &openxc_DiagnosticRequest_fields), + PB_LAST_FIELD +}; + +const pb_field_t openxc_CommandResponse_fields[3] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_CommandResponse, type, type, 0), + PB_FIELD2( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_CommandResponse, message, type, 0), + PB_LAST_FIELD +}; + +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, 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 +}; + +const pb_field_t openxc_DiagnosticResponse_fields[9] = { + PB_FIELD2( 1, INT32 , OPTIONAL, STATIC , FIRST, openxc_DiagnosticResponse, bus, bus, 0), + PB_FIELD2( 2, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, message_id, bus, 0), + PB_FIELD2( 3, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, mode, message_id, 0), + PB_FIELD2( 4, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, pid, mode, 0), + PB_FIELD2( 5, BOOL , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, success, pid, 0), + PB_FIELD2( 6, UINT32 , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, negative_response_code, success, 0), + PB_FIELD2( 7, BYTES , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, payload, negative_response_code, 0), + PB_FIELD2( 8, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_DiagnosticResponse, value, payload, 0), + PB_LAST_FIELD +}; + +const pb_field_t openxc_DynamicField_fields[5] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_DynamicField, type, type, 0), + PB_FIELD2( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_DynamicField, string_value, type, 0), + PB_FIELD2( 3, DOUBLE , OPTIONAL, STATIC , OTHER, openxc_DynamicField, numeric_value, string_value, 0), + PB_FIELD2( 4, BOOL , OPTIONAL, STATIC , OTHER, openxc_DynamicField, boolean_value, numeric_value, 0), + PB_LAST_FIELD +}; + +const pb_field_t openxc_TranslatedMessage_fields[5] = { + PB_FIELD2( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_TranslatedMessage, type, type, 0), + PB_FIELD2( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, name, type, 0), + PB_FIELD2( 3, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, value, name, &openxc_DynamicField_fields), + PB_FIELD2( 4, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_TranslatedMessage, event, value, &openxc_DynamicField_fields), PB_LAST_FIELD }; /* Check that field information fits in pb_field_t */ #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 256 && pb_membersize(openxc_VehicleMessage, translated_message) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_TranslatedMessage) +STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 256 && pb_membersize(openxc_VehicleMessage, translated_message) < 256 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 256 && pb_membersize(openxc_VehicleMessage, control_command) < 256 && pb_membersize(openxc_VehicleMessage, command_response) < 256 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 256 && pb_membersize(openxc_TranslatedMessage, value) < 256 && pb_membersize(openxc_TranslatedMessage, event) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_TranslatedMessage) #endif #if !defined(PB_FIELD_32BIT) -STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 65536 && pb_membersize(openxc_VehicleMessage, translated_message) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_TranslatedMessage) +STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, raw_message) < 65536 && pb_membersize(openxc_VehicleMessage, translated_message) < 65536 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 65536 && pb_membersize(openxc_VehicleMessage, control_command) < 65536 && pb_membersize(openxc_VehicleMessage, command_response) < 65536 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 65536 && pb_membersize(openxc_TranslatedMessage, value) < 65536 && pb_membersize(openxc_TranslatedMessage, event) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_RawMessage_openxc_ControlCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_TranslatedMessage) #endif /* On some platforms (such as AVR), double is really float. diff --git a/gen/cpp/openxc.pb.h b/gen/cpp/openxc.pb.h index 81a0779d..e70324f0 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.4-dev at Thu Oct 24 10:06:38 2013. */ +/* Generated by nanopb-0.2.5 at Wed Mar 26 09:29:06 2014. */ #ifndef _PB_OPENXC_PB_H_ #define _PB_OPENXC_PB_H_ @@ -12,9 +12,29 @@ extern "C" { /* Enum definitions */ typedef enum _openxc_VehicleMessage_Type { openxc_VehicleMessage_Type_RAW = 1, - openxc_VehicleMessage_Type_TRANSLATED = 2 + openxc_VehicleMessage_Type_TRANSLATED = 2, + openxc_VehicleMessage_Type_DIAGNOSTIC = 3, + openxc_VehicleMessage_Type_CONTROL_COMMAND = 4, + openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5 } openxc_VehicleMessage_Type; +typedef enum _openxc_ControlCommand_Type { + openxc_ControlCommand_Type_VERSION = 1, + openxc_ControlCommand_Type_DEVICE_ID = 2, + 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, + openxc_DynamicField_Type_BOOL = 3 +} openxc_DynamicField_Type; + typedef enum _openxc_TranslatedMessage_Type { openxc_TranslatedMessage_Type_STRING = 1, openxc_TranslatedMessage_Type_NUM = 2, @@ -25,32 +45,104 @@ typedef enum _openxc_TranslatedMessage_Type { } openxc_TranslatedMessage_Type; /* Struct definitions */ +typedef struct _openxc_CommandResponse { + bool has_type; + openxc_ControlCommand_Type type; + bool has_message; + char message[128]; +} openxc_CommandResponse; + +typedef struct { + size_t size; + uint8_t bytes[8]; +} openxc_DiagnosticRequest_payload_t; + +typedef struct _openxc_DiagnosticRequest { + bool has_bus; + int32_t bus; + bool has_message_id; + uint32_t message_id; + bool has_mode; + uint32_t mode; + bool has_pid; + uint32_t pid; + bool has_payload; + openxc_DiagnosticRequest_payload_t payload; + bool has_multiple_responses; + bool multiple_responses; + bool has_frequency; + double frequency; + bool has_name; + char name[10]; + bool has_decoded_type; + openxc_DiagnosticRequest_DecodedType decoded_type; +} openxc_DiagnosticRequest; + +typedef struct { + size_t size; + uint8_t bytes[8]; +} openxc_DiagnosticResponse_payload_t; + +typedef struct _openxc_DiagnosticResponse { + bool has_bus; + int32_t bus; + bool has_message_id; + uint32_t message_id; + bool has_mode; + uint32_t mode; + bool has_pid; + uint32_t pid; + bool has_success; + bool success; + bool has_negative_response_code; + uint32_t negative_response_code; + bool has_payload; + openxc_DiagnosticResponse_payload_t payload; + bool has_value; + double value; +} openxc_DiagnosticResponse; + +typedef struct _openxc_DynamicField { + bool has_type; + openxc_DynamicField_Type type; + bool has_string_value; + char string_value[100]; + bool has_numeric_value; + double numeric_value; + bool has_boolean_value; + bool boolean_value; +} openxc_DynamicField; + +typedef struct { + size_t size; + uint8_t bytes[8]; +} openxc_RawMessage_data_t; + typedef struct _openxc_RawMessage { bool has_bus; int32_t bus; bool has_message_id; uint32_t message_id; bool has_data; - uint64_t data; + openxc_RawMessage_data_t data; } openxc_RawMessage; +typedef struct _openxc_ControlCommand { + bool has_type; + openxc_ControlCommand_Type type; + bool has_diagnostic_request; + openxc_DiagnosticRequest diagnostic_request; +} openxc_ControlCommand; + typedef struct _openxc_TranslatedMessage { bool has_type; openxc_TranslatedMessage_Type type; bool has_name; char name[100]; - bool has_string_value; - char string_value[100]; - bool has_numeric_value; - double numeric_value; - bool has_boolean_value; - bool boolean_value; - bool has_string_event; - char string_event[100]; - bool has_numeric_event; - double numeric_event; - bool has_boolean_event; - bool boolean_event; + bool has_value; + openxc_DynamicField value; + bool has_event; + openxc_DynamicField event; } openxc_TranslatedMessage; typedef struct _openxc_VehicleMessage { @@ -60,35 +152,75 @@ typedef struct _openxc_VehicleMessage { openxc_RawMessage raw_message; bool has_translated_message; openxc_TranslatedMessage translated_message; + bool has_diagnostic_response; + openxc_DiagnosticResponse diagnostic_response; + bool has_control_command; + openxc_ControlCommand control_command; + bool has_command_response; + openxc_CommandResponse command_response; } openxc_VehicleMessage; /* Default values for struct fields */ /* Field tags (for use in manual encoding/decoding) */ +#define openxc_CommandResponse_type_tag 1 +#define openxc_CommandResponse_message_tag 2 +#define openxc_DiagnosticRequest_bus_tag 1 +#define openxc_DiagnosticRequest_message_id_tag 2 +#define openxc_DiagnosticRequest_mode_tag 3 +#define openxc_DiagnosticRequest_pid_tag 4 +#define openxc_DiagnosticRequest_payload_tag 5 +#define openxc_DiagnosticRequest_multiple_responses_tag 6 +#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 +#define openxc_DiagnosticResponse_pid_tag 4 +#define openxc_DiagnosticResponse_success_tag 5 +#define openxc_DiagnosticResponse_negative_response_code_tag 6 +#define openxc_DiagnosticResponse_payload_tag 7 +#define openxc_DiagnosticResponse_value_tag 8 +#define openxc_DynamicField_type_tag 1 +#define openxc_DynamicField_string_value_tag 2 +#define openxc_DynamicField_numeric_value_tag 3 +#define openxc_DynamicField_boolean_value_tag 4 #define openxc_RawMessage_bus_tag 1 #define openxc_RawMessage_message_id_tag 2 #define openxc_RawMessage_data_tag 3 +#define openxc_ControlCommand_type_tag 1 +#define openxc_ControlCommand_diagnostic_request_tag 2 #define openxc_TranslatedMessage_type_tag 1 #define openxc_TranslatedMessage_name_tag 2 -#define openxc_TranslatedMessage_string_value_tag 3 -#define openxc_TranslatedMessage_numeric_value_tag 4 -#define openxc_TranslatedMessage_boolean_value_tag 5 -#define openxc_TranslatedMessage_string_event_tag 6 -#define openxc_TranslatedMessage_numeric_event_tag 7 -#define openxc_TranslatedMessage_boolean_event_tag 8 +#define openxc_TranslatedMessage_value_tag 3 +#define openxc_TranslatedMessage_event_tag 4 #define openxc_VehicleMessage_type_tag 1 #define openxc_VehicleMessage_raw_message_tag 2 #define openxc_VehicleMessage_translated_message_tag 3 +#define openxc_VehicleMessage_diagnostic_response_tag 4 +#define openxc_VehicleMessage_control_command_tag 5 +#define openxc_VehicleMessage_command_response_tag 6 /* Struct field encoding specification for nanopb */ -extern const pb_field_t openxc_VehicleMessage_fields[4]; +extern const pb_field_t openxc_VehicleMessage_fields[7]; extern const pb_field_t openxc_RawMessage_fields[4]; -extern const pb_field_t openxc_TranslatedMessage_fields[9]; +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[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 368 -#define openxc_RawMessage_size 23 -#define openxc_TranslatedMessage_size 334 +#define openxc_VehicleMessage_size 664 +#define openxc_RawMessage_size 27 +#define openxc_ControlCommand_size 76 +#define openxc_CommandResponse_size 137 +#define openxc_DiagnosticRequest_size 68 +#define openxc_DiagnosticResponse_size 56 +#define openxc_DynamicField_size 119 +#define openxc_TranslatedMessage_size 350 #ifdef __cplusplus } /* extern "C" */ |