1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Tue Mar 4 15:25:22 2014. */
4 #ifndef _PB_OPENXC_PB_H_
5 #define _PB_OPENXC_PB_H_
12 /* Enum definitions */
13 typedef enum _openxc_VehicleMessage_Type {
14 openxc_VehicleMessage_Type_RAW = 1,
15 openxc_VehicleMessage_Type_TRANSLATED = 2,
16 openxc_VehicleMessage_Type_DIAGNOSTIC = 3,
17 openxc_VehicleMessage_Type_CONTROL_COMMAND = 4
18 } openxc_VehicleMessage_Type;
20 typedef enum _openxc_ControlCommand_Type {
21 openxc_ControlCommand_Type_VERSION = 1,
22 openxc_ControlCommand_Type_DEVICE_ID = 2,
23 openxc_ControlCommand_Type_DIAGNOSTIC = 3
24 } openxc_ControlCommand_Type;
26 typedef enum _openxc_DynamicField_Type {
27 openxc_DynamicField_Type_STRING = 1,
28 openxc_DynamicField_Type_NUM = 2,
29 openxc_DynamicField_Type_BOOL = 3
30 } openxc_DynamicField_Type;
32 typedef enum _openxc_TranslatedMessage_Type {
33 openxc_TranslatedMessage_Type_STRING = 1,
34 openxc_TranslatedMessage_Type_NUM = 2,
35 openxc_TranslatedMessage_Type_BOOL = 3,
36 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
37 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
38 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
39 } openxc_TranslatedMessage_Type;
41 /* Struct definitions */
45 } openxc_DiagnosticRequest_payload_t;
47 typedef struct _openxc_DiagnosticRequest {
57 openxc_DiagnosticRequest_payload_t payload;
58 bool has_parse_payload;
66 } openxc_DiagnosticRequest;
71 } openxc_DiagnosticResponse_payload_t;
73 typedef struct _openxc_DiagnosticResponse {
84 bool has_negative_response_code;
85 uint32_t negative_response_code;
87 openxc_DiagnosticResponse_payload_t payload;
90 } openxc_DiagnosticResponse;
92 typedef struct _openxc_DynamicField {
94 openxc_DynamicField_Type type;
95 bool has_string_value;
96 char string_value[100];
97 bool has_numeric_value;
99 bool has_boolean_value;
101 } openxc_DynamicField;
106 } openxc_RawMessage_data_t;
108 typedef struct _openxc_RawMessage {
114 openxc_RawMessage_data_t data;
117 typedef struct _openxc_ControlCommand {
119 openxc_ControlCommand_Type type;
120 bool has_diagnostic_request;
121 openxc_DiagnosticRequest diagnostic_request;
122 } openxc_ControlCommand;
124 typedef struct _openxc_TranslatedMessage {
126 openxc_TranslatedMessage_Type type;
130 openxc_DynamicField value;
132 openxc_DynamicField event;
133 } openxc_TranslatedMessage;
135 typedef struct _openxc_VehicleMessage {
137 openxc_VehicleMessage_Type type;
138 bool has_raw_message;
139 openxc_RawMessage raw_message;
140 bool has_translated_message;
141 openxc_TranslatedMessage translated_message;
142 bool has_diagnostic_response;
143 openxc_DiagnosticResponse diagnostic_response;
144 bool has_control_command;
145 openxc_ControlCommand control_command;
146 } openxc_VehicleMessage;
148 /* Default values for struct fields */
150 /* Field tags (for use in manual encoding/decoding) */
151 #define openxc_DiagnosticRequest_bus_tag 1
152 #define openxc_DiagnosticRequest_message_id_tag 2
153 #define openxc_DiagnosticRequest_mode_tag 3
154 #define openxc_DiagnosticRequest_pid_tag 4
155 #define openxc_DiagnosticRequest_payload_tag 5
156 #define openxc_DiagnosticRequest_parse_payload_tag 6
157 #define openxc_DiagnosticRequest_factor_tag 7
158 #define openxc_DiagnosticRequest_offset_tag 8
159 #define openxc_DiagnosticRequest_frequency_tag 9
160 #define openxc_DiagnosticResponse_bus_tag 1
161 #define openxc_DiagnosticResponse_message_id_tag 2
162 #define openxc_DiagnosticResponse_mode_tag 3
163 #define openxc_DiagnosticResponse_pid_tag 4
164 #define openxc_DiagnosticResponse_success_tag 5
165 #define openxc_DiagnosticResponse_negative_response_code_tag 6
166 #define openxc_DiagnosticResponse_payload_tag 7
167 #define openxc_DiagnosticResponse_value_tag 8
168 #define openxc_DynamicField_type_tag 1
169 #define openxc_DynamicField_string_value_tag 2
170 #define openxc_DynamicField_numeric_value_tag 3
171 #define openxc_DynamicField_boolean_value_tag 4
172 #define openxc_RawMessage_bus_tag 1
173 #define openxc_RawMessage_message_id_tag 2
174 #define openxc_RawMessage_data_tag 3
175 #define openxc_ControlCommand_type_tag 1
176 #define openxc_ControlCommand_diagnostic_request_tag 2
177 #define openxc_TranslatedMessage_type_tag 1
178 #define openxc_TranslatedMessage_name_tag 2
179 #define openxc_TranslatedMessage_value_tag 3
180 #define openxc_TranslatedMessage_event_tag 4
181 #define openxc_VehicleMessage_type_tag 1
182 #define openxc_VehicleMessage_raw_message_tag 2
183 #define openxc_VehicleMessage_translated_message_tag 3
184 #define openxc_VehicleMessage_diagnostic_response_tag 4
185 #define openxc_VehicleMessage_control_command_tag 5
187 /* Struct field encoding specification for nanopb */
188 extern const pb_field_t openxc_VehicleMessage_fields[6];
189 extern const pb_field_t openxc_RawMessage_fields[4];
190 extern const pb_field_t openxc_ControlCommand_fields[3];
191 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
192 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
193 extern const pb_field_t openxc_DynamicField_fields[5];
194 extern const pb_field_t openxc_TranslatedMessage_fields[5];
196 /* Maximum encoded size of messages (where known) */
197 #define openxc_VehicleMessage_size 524
198 #define openxc_RawMessage_size 27
199 #define openxc_ControlCommand_size 76
200 #define openxc_DiagnosticRequest_size 68
201 #define openxc_DiagnosticResponse_size 56
202 #define openxc_DynamicField_size 119
203 #define openxc_TranslatedMessage_size 350