1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.3.1 at Sat Sep 27 19:56:19 2014. */
4 #ifndef PB_OPENXC_PB_H_INCLUDED
5 #define PB_OPENXC_PB_H_INCLUDED
8 #if PB_PROTO_HEADER_VERSION != 30
9 #error Regenerate this file with the current version of nanopb generator.
16 /* Enum definitions */
17 typedef enum _openxc_VehicleMessage_Type {
18 openxc_VehicleMessage_Type_RAW = 1,
19 openxc_VehicleMessage_Type_TRANSLATED = 2,
20 openxc_VehicleMessage_Type_DIAGNOSTIC = 3,
21 openxc_VehicleMessage_Type_CONTROL_COMMAND = 4,
22 openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5
23 } openxc_VehicleMessage_Type;
25 typedef enum _openxc_ControlCommand_Type {
26 openxc_ControlCommand_Type_VERSION = 1,
27 openxc_ControlCommand_Type_DEVICE_ID = 2,
28 openxc_ControlCommand_Type_DIAGNOSTIC = 3,
29 openxc_ControlCommand_Type_PASSTHROUGH = 4,
30 openxc_ControlCommand_Type_ACCEPTANCE_FILTER_BYPASS = 5,
31 openxc_ControlCommand_Type_MESSAGE_FORMAT = 6
32 } openxc_ControlCommand_Type;
34 typedef enum _openxc_DiagnosticControlCommand_Action {
35 openxc_DiagnosticControlCommand_Action_ADD = 1,
36 openxc_DiagnosticControlCommand_Action_CANCEL = 2
37 } openxc_DiagnosticControlCommand_Action;
39 typedef enum _openxc_MessageFormatCommand_MessageFormat {
40 openxc_MessageFormatCommand_MessageFormat_JSON = 1,
41 openxc_MessageFormatCommand_MessageFormat_BINARY = 2
42 } openxc_MessageFormatCommand_MessageFormat;
44 typedef enum _openxc_DiagnosticRequest_DecodedType {
45 openxc_DiagnosticRequest_DecodedType_NONE = 1,
46 openxc_DiagnosticRequest_DecodedType_OBD2 = 2
47 } openxc_DiagnosticRequest_DecodedType;
49 typedef enum _openxc_DynamicField_Type {
50 openxc_DynamicField_Type_STRING = 1,
51 openxc_DynamicField_Type_NUM = 2,
52 openxc_DynamicField_Type_BOOL = 3
53 } openxc_DynamicField_Type;
55 typedef enum _openxc_TranslatedMessage_Type {
56 openxc_TranslatedMessage_Type_STRING = 1,
57 openxc_TranslatedMessage_Type_NUM = 2,
58 openxc_TranslatedMessage_Type_BOOL = 3,
59 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
60 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
61 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
62 } openxc_TranslatedMessage_Type;
64 /* Struct definitions */
65 typedef struct _openxc_AcceptanceFilterBypassCommand {
70 } openxc_AcceptanceFilterBypassCommand;
72 typedef struct _openxc_CommandResponse {
74 openxc_ControlCommand_Type type;
79 } openxc_CommandResponse;
81 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticRequest_payload_t;
83 typedef struct _openxc_DiagnosticRequest {
93 openxc_DiagnosticRequest_payload_t payload;
94 bool has_multiple_responses;
95 bool multiple_responses;
100 bool has_decoded_type;
101 openxc_DiagnosticRequest_DecodedType decoded_type;
102 } openxc_DiagnosticRequest;
104 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticResponse_payload_t;
106 typedef struct _openxc_DiagnosticResponse {
117 bool has_negative_response_code;
118 uint32_t negative_response_code;
120 openxc_DiagnosticResponse_payload_t payload;
123 } openxc_DiagnosticResponse;
125 typedef struct _openxc_DynamicField {
127 openxc_DynamicField_Type type;
128 bool has_string_value;
129 char string_value[100];
130 bool has_numeric_value;
131 double numeric_value;
132 bool has_boolean_value;
134 } openxc_DynamicField;
136 typedef struct _openxc_MessageFormatCommand {
140 openxc_MessageFormatCommand_MessageFormat format;
141 } openxc_MessageFormatCommand;
143 typedef struct _openxc_PassthroughModeControlCommand {
148 } openxc_PassthroughModeControlCommand;
150 typedef PB_BYTES_ARRAY_T(8) openxc_RawMessage_data_t;
152 typedef struct _openxc_RawMessage {
158 openxc_RawMessage_data_t data;
161 typedef struct _openxc_DiagnosticControlCommand {
163 openxc_DiagnosticRequest request;
165 openxc_DiagnosticControlCommand_Action action;
166 } openxc_DiagnosticControlCommand;
168 typedef struct _openxc_TranslatedMessage {
170 openxc_TranslatedMessage_Type type;
174 openxc_DynamicField value;
176 openxc_DynamicField event;
177 } openxc_TranslatedMessage;
179 typedef struct _openxc_ControlCommand {
181 openxc_ControlCommand_Type type;
182 bool has_diagnostic_request;
183 openxc_DiagnosticControlCommand diagnostic_request;
184 bool has_passthrough_mode_request;
185 openxc_PassthroughModeControlCommand passthrough_mode_request;
186 bool has_acceptance_filter_bypass_command;
187 openxc_AcceptanceFilterBypassCommand acceptance_filter_bypass_command;
188 bool has_message_format_command;
189 openxc_MessageFormatCommand message_format_command;
190 } openxc_ControlCommand;
192 typedef struct _openxc_VehicleMessage {
194 openxc_VehicleMessage_Type type;
195 bool has_raw_message;
196 openxc_RawMessage raw_message;
197 bool has_translated_message;
198 openxc_TranslatedMessage translated_message;
199 bool has_diagnostic_response;
200 openxc_DiagnosticResponse diagnostic_response;
201 bool has_control_command;
202 openxc_ControlCommand control_command;
203 bool has_command_response;
204 openxc_CommandResponse command_response;
205 } openxc_VehicleMessage;
207 /* Default values for struct fields */
209 /* Initializer values for message structs */
210 #define openxc_VehicleMessage_init_default {false, (openxc_VehicleMessage_Type)0, false, openxc_RawMessage_init_default, false, openxc_TranslatedMessage_init_default, false, openxc_DiagnosticResponse_init_default, false, openxc_ControlCommand_init_default, false, openxc_CommandResponse_init_default}
211 #define openxc_RawMessage_init_default {false, 0, false, 0, false, {0, {0}}}
212 #define openxc_ControlCommand_init_default {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticControlCommand_init_default, false, openxc_PassthroughModeControlCommand_init_default, false, openxc_AcceptanceFilterBypassCommand_init_default, false, openxc_MessageFormatCommand_init_default}
213 #define openxc_DiagnosticControlCommand_init_default {false, openxc_DiagnosticRequest_init_default, false, (openxc_DiagnosticControlCommand_Action)0}
214 #define openxc_PassthroughModeControlCommand_init_default {false, 0, false, 0}
215 #define openxc_AcceptanceFilterBypassCommand_init_default {false, 0, false, 0}
216 #define openxc_MessageFormatCommand_init_default {false, 0, false, (openxc_MessageFormatCommand_MessageFormat)0}
217 #define openxc_CommandResponse_init_default {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
218 #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}
219 #define openxc_DiagnosticResponse_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
220 #define openxc_DynamicField_init_default {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
221 #define openxc_TranslatedMessage_init_default {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_default, false, openxc_DynamicField_init_default}
222 #define openxc_VehicleMessage_init_zero {false, (openxc_VehicleMessage_Type)0, false, openxc_RawMessage_init_zero, false, openxc_TranslatedMessage_init_zero, false, openxc_DiagnosticResponse_init_zero, false, openxc_ControlCommand_init_zero, false, openxc_CommandResponse_init_zero}
223 #define openxc_RawMessage_init_zero {false, 0, false, 0, false, {0, {0}}}
224 #define openxc_ControlCommand_init_zero {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticControlCommand_init_zero, false, openxc_PassthroughModeControlCommand_init_zero, false, openxc_AcceptanceFilterBypassCommand_init_zero, false, openxc_MessageFormatCommand_init_zero}
225 #define openxc_DiagnosticControlCommand_init_zero {false, openxc_DiagnosticRequest_init_zero, false, (openxc_DiagnosticControlCommand_Action)0}
226 #define openxc_PassthroughModeControlCommand_init_zero {false, 0, false, 0}
227 #define openxc_AcceptanceFilterBypassCommand_init_zero {false, 0, false, 0}
228 #define openxc_MessageFormatCommand_init_zero {false, 0, false, (openxc_MessageFormatCommand_MessageFormat)0}
229 #define openxc_CommandResponse_init_zero {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
230 #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}
231 #define openxc_DiagnosticResponse_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
232 #define openxc_DynamicField_init_zero {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
233 #define openxc_TranslatedMessage_init_zero {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_zero, false, openxc_DynamicField_init_zero}
235 /* Field tags (for use in manual encoding/decoding) */
236 #define openxc_AcceptanceFilterBypassCommand_bus_tag 1
237 #define openxc_AcceptanceFilterBypassCommand_bypass_tag 2
238 #define openxc_CommandResponse_type_tag 1
239 #define openxc_CommandResponse_message_tag 2
240 #define openxc_CommandResponse_status_tag 3
241 #define openxc_DiagnosticRequest_bus_tag 1
242 #define openxc_DiagnosticRequest_message_id_tag 2
243 #define openxc_DiagnosticRequest_mode_tag 3
244 #define openxc_DiagnosticRequest_pid_tag 4
245 #define openxc_DiagnosticRequest_payload_tag 5
246 #define openxc_DiagnosticRequest_multiple_responses_tag 6
247 #define openxc_DiagnosticRequest_frequency_tag 7
248 #define openxc_DiagnosticRequest_name_tag 8
249 #define openxc_DiagnosticRequest_decoded_type_tag 9
250 #define openxc_DiagnosticResponse_bus_tag 1
251 #define openxc_DiagnosticResponse_message_id_tag 2
252 #define openxc_DiagnosticResponse_mode_tag 3
253 #define openxc_DiagnosticResponse_pid_tag 4
254 #define openxc_DiagnosticResponse_success_tag 5
255 #define openxc_DiagnosticResponse_negative_response_code_tag 6
256 #define openxc_DiagnosticResponse_payload_tag 7
257 #define openxc_DiagnosticResponse_value_tag 8
258 #define openxc_DynamicField_type_tag 1
259 #define openxc_DynamicField_string_value_tag 2
260 #define openxc_DynamicField_numeric_value_tag 3
261 #define openxc_DynamicField_boolean_value_tag 4
262 #define openxc_MessageFormatCommand_bus_tag 1
263 #define openxc_MessageFormatCommand_format_tag 2
264 #define openxc_PassthroughModeControlCommand_bus_tag 1
265 #define openxc_PassthroughModeControlCommand_enabled_tag 2
266 #define openxc_RawMessage_bus_tag 1
267 #define openxc_RawMessage_message_id_tag 2
268 #define openxc_RawMessage_data_tag 3
269 #define openxc_DiagnosticControlCommand_request_tag 1
270 #define openxc_DiagnosticControlCommand_action_tag 2
271 #define openxc_TranslatedMessage_type_tag 1
272 #define openxc_TranslatedMessage_name_tag 2
273 #define openxc_TranslatedMessage_value_tag 3
274 #define openxc_TranslatedMessage_event_tag 4
275 #define openxc_ControlCommand_type_tag 1
276 #define openxc_ControlCommand_diagnostic_request_tag 2
277 #define openxc_ControlCommand_passthrough_mode_request_tag 3
278 #define openxc_ControlCommand_acceptance_filter_bypass_command_tag 4
279 #define openxc_ControlCommand_message_format_command_tag 5
280 #define openxc_VehicleMessage_type_tag 1
281 #define openxc_VehicleMessage_raw_message_tag 2
282 #define openxc_VehicleMessage_translated_message_tag 3
283 #define openxc_VehicleMessage_diagnostic_response_tag 4
284 #define openxc_VehicleMessage_control_command_tag 5
285 #define openxc_VehicleMessage_command_response_tag 6
287 /* Struct field encoding specification for nanopb */
288 extern const pb_field_t openxc_VehicleMessage_fields[7];
289 extern const pb_field_t openxc_RawMessage_fields[4];
290 extern const pb_field_t openxc_ControlCommand_fields[6];
291 extern const pb_field_t openxc_DiagnosticControlCommand_fields[3];
292 extern const pb_field_t openxc_PassthroughModeControlCommand_fields[3];
293 extern const pb_field_t openxc_AcceptanceFilterBypassCommand_fields[3];
294 extern const pb_field_t openxc_MessageFormatCommand_fields[3];
295 extern const pb_field_t openxc_CommandResponse_fields[4];
296 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
297 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
298 extern const pb_field_t openxc_DynamicField_fields[5];
299 extern const pb_field_t openxc_TranslatedMessage_fields[5];
301 /* Maximum encoded size of messages (where known) */
302 #define openxc_VehicleMessage_size 724
303 #define openxc_RawMessage_size 27
304 #define openxc_ControlCommand_size 133
305 #define openxc_DiagnosticControlCommand_size 76
306 #define openxc_PassthroughModeControlCommand_size 13
307 #define openxc_AcceptanceFilterBypassCommand_size 13
308 #define openxc_MessageFormatCommand_size 17
309 #define openxc_CommandResponse_size 139
310 #define openxc_DiagnosticRequest_size 68
311 #define openxc_DiagnosticResponse_size 56
312 #define openxc_DynamicField_size 119
313 #define openxc_TranslatedMessage_size 350