1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.3.1 at Sat Sep 27 19:43:38 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;
33 typedef enum _openxc_DiagnosticControlCommand_Action {
34 openxc_DiagnosticControlCommand_Action_ADD = 1,
35 openxc_DiagnosticControlCommand_Action_CANCEL = 2
36 } openxc_DiagnosticControlCommand_Action;
38 typedef enum _openxc_DiagnosticRequest_DecodedType {
39 openxc_DiagnosticRequest_DecodedType_NONE = 1,
40 openxc_DiagnosticRequest_DecodedType_OBD2 = 2
41 } openxc_DiagnosticRequest_DecodedType;
43 typedef enum _openxc_DynamicField_Type {
44 openxc_DynamicField_Type_STRING = 1,
45 openxc_DynamicField_Type_NUM = 2,
46 openxc_DynamicField_Type_BOOL = 3
47 } openxc_DynamicField_Type;
49 typedef enum _openxc_TranslatedMessage_Type {
50 openxc_TranslatedMessage_Type_STRING = 1,
51 openxc_TranslatedMessage_Type_NUM = 2,
52 openxc_TranslatedMessage_Type_BOOL = 3,
53 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
54 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
55 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
56 } openxc_TranslatedMessage_Type;
58 /* Struct definitions */
59 typedef struct _openxc_AcceptanceFilterBypassCommand {
64 } openxc_AcceptanceFilterBypassCommand;
66 typedef struct _openxc_CommandResponse {
68 openxc_ControlCommand_Type type;
73 } openxc_CommandResponse;
75 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticRequest_payload_t;
77 typedef struct _openxc_DiagnosticRequest {
87 openxc_DiagnosticRequest_payload_t payload;
88 bool has_multiple_responses;
89 bool multiple_responses;
94 bool has_decoded_type;
95 openxc_DiagnosticRequest_DecodedType decoded_type;
96 } openxc_DiagnosticRequest;
98 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticResponse_payload_t;
100 typedef struct _openxc_DiagnosticResponse {
111 bool has_negative_response_code;
112 uint32_t negative_response_code;
114 openxc_DiagnosticResponse_payload_t payload;
117 } openxc_DiagnosticResponse;
119 typedef struct _openxc_DynamicField {
121 openxc_DynamicField_Type type;
122 bool has_string_value;
123 char string_value[100];
124 bool has_numeric_value;
125 double numeric_value;
126 bool has_boolean_value;
128 } openxc_DynamicField;
130 typedef struct _openxc_PassthroughModeControlCommand {
135 } openxc_PassthroughModeControlCommand;
137 typedef PB_BYTES_ARRAY_T(8) openxc_RawMessage_data_t;
139 typedef struct _openxc_RawMessage {
145 openxc_RawMessage_data_t data;
148 typedef struct _openxc_DiagnosticControlCommand {
150 openxc_DiagnosticRequest request;
152 openxc_DiagnosticControlCommand_Action action;
153 } openxc_DiagnosticControlCommand;
155 typedef struct _openxc_TranslatedMessage {
157 openxc_TranslatedMessage_Type type;
161 openxc_DynamicField value;
163 openxc_DynamicField event;
164 } openxc_TranslatedMessage;
166 typedef struct _openxc_ControlCommand {
168 openxc_ControlCommand_Type type;
169 bool has_diagnostic_request;
170 openxc_DiagnosticControlCommand diagnostic_request;
171 bool has_passthrough_mode_request;
172 openxc_PassthroughModeControlCommand passthrough_mode_request;
173 bool has_acceptance_filter_bypass_command;
174 openxc_AcceptanceFilterBypassCommand acceptance_filter_bypass_command;
175 } openxc_ControlCommand;
177 typedef struct _openxc_VehicleMessage {
179 openxc_VehicleMessage_Type type;
180 bool has_raw_message;
181 openxc_RawMessage raw_message;
182 bool has_translated_message;
183 openxc_TranslatedMessage translated_message;
184 bool has_diagnostic_response;
185 openxc_DiagnosticResponse diagnostic_response;
186 bool has_control_command;
187 openxc_ControlCommand control_command;
188 bool has_command_response;
189 openxc_CommandResponse command_response;
190 } openxc_VehicleMessage;
192 /* Default values for struct fields */
194 /* Initializer values for message structs */
195 #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}
196 #define openxc_RawMessage_init_default {false, 0, false, 0, false, {0, {0}}}
197 #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}
198 #define openxc_DiagnosticControlCommand_init_default {false, openxc_DiagnosticRequest_init_default, false, (openxc_DiagnosticControlCommand_Action)0}
199 #define openxc_PassthroughModeControlCommand_init_default {false, 0, false, 0}
200 #define openxc_AcceptanceFilterBypassCommand_init_default {false, 0, false, 0}
201 #define openxc_CommandResponse_init_default {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
202 #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}
203 #define openxc_DiagnosticResponse_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
204 #define openxc_DynamicField_init_default {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
205 #define openxc_TranslatedMessage_init_default {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_default, false, openxc_DynamicField_init_default}
206 #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}
207 #define openxc_RawMessage_init_zero {false, 0, false, 0, false, {0, {0}}}
208 #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}
209 #define openxc_DiagnosticControlCommand_init_zero {false, openxc_DiagnosticRequest_init_zero, false, (openxc_DiagnosticControlCommand_Action)0}
210 #define openxc_PassthroughModeControlCommand_init_zero {false, 0, false, 0}
211 #define openxc_AcceptanceFilterBypassCommand_init_zero {false, 0, false, 0}
212 #define openxc_CommandResponse_init_zero {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
213 #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}
214 #define openxc_DiagnosticResponse_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
215 #define openxc_DynamicField_init_zero {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
216 #define openxc_TranslatedMessage_init_zero {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_zero, false, openxc_DynamicField_init_zero}
218 /* Field tags (for use in manual encoding/decoding) */
219 #define openxc_AcceptanceFilterBypassCommand_bus_tag 1
220 #define openxc_AcceptanceFilterBypassCommand_bypass_tag 2
221 #define openxc_CommandResponse_type_tag 1
222 #define openxc_CommandResponse_message_tag 2
223 #define openxc_CommandResponse_status_tag 3
224 #define openxc_DiagnosticRequest_bus_tag 1
225 #define openxc_DiagnosticRequest_message_id_tag 2
226 #define openxc_DiagnosticRequest_mode_tag 3
227 #define openxc_DiagnosticRequest_pid_tag 4
228 #define openxc_DiagnosticRequest_payload_tag 5
229 #define openxc_DiagnosticRequest_multiple_responses_tag 6
230 #define openxc_DiagnosticRequest_frequency_tag 7
231 #define openxc_DiagnosticRequest_name_tag 8
232 #define openxc_DiagnosticRequest_decoded_type_tag 9
233 #define openxc_DiagnosticResponse_bus_tag 1
234 #define openxc_DiagnosticResponse_message_id_tag 2
235 #define openxc_DiagnosticResponse_mode_tag 3
236 #define openxc_DiagnosticResponse_pid_tag 4
237 #define openxc_DiagnosticResponse_success_tag 5
238 #define openxc_DiagnosticResponse_negative_response_code_tag 6
239 #define openxc_DiagnosticResponse_payload_tag 7
240 #define openxc_DiagnosticResponse_value_tag 8
241 #define openxc_DynamicField_type_tag 1
242 #define openxc_DynamicField_string_value_tag 2
243 #define openxc_DynamicField_numeric_value_tag 3
244 #define openxc_DynamicField_boolean_value_tag 4
245 #define openxc_PassthroughModeControlCommand_bus_tag 1
246 #define openxc_PassthroughModeControlCommand_enabled_tag 2
247 #define openxc_RawMessage_bus_tag 1
248 #define openxc_RawMessage_message_id_tag 2
249 #define openxc_RawMessage_data_tag 3
250 #define openxc_DiagnosticControlCommand_request_tag 1
251 #define openxc_DiagnosticControlCommand_action_tag 2
252 #define openxc_TranslatedMessage_type_tag 1
253 #define openxc_TranslatedMessage_name_tag 2
254 #define openxc_TranslatedMessage_value_tag 3
255 #define openxc_TranslatedMessage_event_tag 4
256 #define openxc_ControlCommand_type_tag 1
257 #define openxc_ControlCommand_diagnostic_request_tag 2
258 #define openxc_ControlCommand_passthrough_mode_request_tag 3
259 #define openxc_ControlCommand_acceptance_filter_bypass_command_tag 4
260 #define openxc_VehicleMessage_type_tag 1
261 #define openxc_VehicleMessage_raw_message_tag 2
262 #define openxc_VehicleMessage_translated_message_tag 3
263 #define openxc_VehicleMessage_diagnostic_response_tag 4
264 #define openxc_VehicleMessage_control_command_tag 5
265 #define openxc_VehicleMessage_command_response_tag 6
267 /* Struct field encoding specification for nanopb */
268 extern const pb_field_t openxc_VehicleMessage_fields[7];
269 extern const pb_field_t openxc_RawMessage_fields[4];
270 extern const pb_field_t openxc_ControlCommand_fields[5];
271 extern const pb_field_t openxc_DiagnosticControlCommand_fields[3];
272 extern const pb_field_t openxc_PassthroughModeControlCommand_fields[3];
273 extern const pb_field_t openxc_AcceptanceFilterBypassCommand_fields[3];
274 extern const pb_field_t openxc_CommandResponse_fields[4];
275 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
276 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
277 extern const pb_field_t openxc_DynamicField_fields[5];
278 extern const pb_field_t openxc_TranslatedMessage_fields[5];
280 /* Maximum encoded size of messages (where known) */
281 #define openxc_VehicleMessage_size 704
282 #define openxc_RawMessage_size 27
283 #define openxc_ControlCommand_size 114
284 #define openxc_DiagnosticControlCommand_size 76
285 #define openxc_PassthroughModeControlCommand_size 13
286 #define openxc_AcceptanceFilterBypassCommand_size 13
287 #define openxc_CommandResponse_size 139
288 #define openxc_DiagnosticRequest_size 68
289 #define openxc_DiagnosticResponse_size 56
290 #define openxc_DynamicField_size 119
291 #define openxc_TranslatedMessage_size 350