1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.3.1 at Tue Sep 16 23:03:27 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;
31 typedef enum _openxc_ControlCommand_Action {
32 openxc_ControlCommand_Action_ADD = 1,
33 openxc_ControlCommand_Action_CANCEL = 2
34 } openxc_ControlCommand_Action;
36 typedef enum _openxc_DiagnosticRequest_DecodedType {
37 openxc_DiagnosticRequest_DecodedType_NONE = 1,
38 openxc_DiagnosticRequest_DecodedType_OBD2 = 2
39 } openxc_DiagnosticRequest_DecodedType;
41 typedef enum _openxc_DynamicField_Type {
42 openxc_DynamicField_Type_STRING = 1,
43 openxc_DynamicField_Type_NUM = 2,
44 openxc_DynamicField_Type_BOOL = 3
45 } openxc_DynamicField_Type;
47 typedef enum _openxc_TranslatedMessage_Type {
48 openxc_TranslatedMessage_Type_STRING = 1,
49 openxc_TranslatedMessage_Type_NUM = 2,
50 openxc_TranslatedMessage_Type_BOOL = 3,
51 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
52 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
53 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
54 } openxc_TranslatedMessage_Type;
56 /* Struct definitions */
57 typedef struct _openxc_CommandResponse {
59 openxc_ControlCommand_Type type;
64 } openxc_CommandResponse;
66 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticRequest_payload_t;
68 typedef struct _openxc_DiagnosticRequest {
78 openxc_DiagnosticRequest_payload_t payload;
79 bool has_multiple_responses;
80 bool multiple_responses;
85 bool has_decoded_type;
86 openxc_DiagnosticRequest_DecodedType decoded_type;
87 } openxc_DiagnosticRequest;
89 typedef PB_BYTES_ARRAY_T(8) openxc_DiagnosticResponse_payload_t;
91 typedef struct _openxc_DiagnosticResponse {
102 bool has_negative_response_code;
103 uint32_t negative_response_code;
105 openxc_DiagnosticResponse_payload_t payload;
108 } openxc_DiagnosticResponse;
110 typedef struct _openxc_DynamicField {
112 openxc_DynamicField_Type type;
113 bool has_string_value;
114 char string_value[100];
115 bool has_numeric_value;
116 double numeric_value;
117 bool has_boolean_value;
119 } openxc_DynamicField;
121 typedef PB_BYTES_ARRAY_T(8) openxc_RawMessage_data_t;
123 typedef struct _openxc_RawMessage {
129 openxc_RawMessage_data_t data;
132 typedef struct _openxc_ControlCommand {
134 openxc_ControlCommand_Type type;
135 bool has_diagnostic_request;
136 openxc_DiagnosticRequest diagnostic_request;
138 openxc_ControlCommand_Action action;
139 } openxc_ControlCommand;
141 typedef struct _openxc_TranslatedMessage {
143 openxc_TranslatedMessage_Type type;
147 openxc_DynamicField value;
149 openxc_DynamicField event;
150 } openxc_TranslatedMessage;
152 typedef struct _openxc_VehicleMessage {
154 openxc_VehicleMessage_Type type;
155 bool has_raw_message;
156 openxc_RawMessage raw_message;
157 bool has_translated_message;
158 openxc_TranslatedMessage translated_message;
159 bool has_diagnostic_response;
160 openxc_DiagnosticResponse diagnostic_response;
161 bool has_control_command;
162 openxc_ControlCommand control_command;
163 bool has_command_response;
164 openxc_CommandResponse command_response;
165 } openxc_VehicleMessage;
167 /* Default values for struct fields */
169 /* Initializer values for message structs */
170 #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}
171 #define openxc_RawMessage_init_default {false, 0, false, 0, false, {0, {0}}}
172 #define openxc_ControlCommand_init_default {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticRequest_init_default, false, (openxc_ControlCommand_Action)0}
173 #define openxc_CommandResponse_init_default {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
174 #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}
175 #define openxc_DiagnosticResponse_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
176 #define openxc_DynamicField_init_default {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
177 #define openxc_TranslatedMessage_init_default {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_default, false, openxc_DynamicField_init_default}
178 #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}
179 #define openxc_RawMessage_init_zero {false, 0, false, 0, false, {0, {0}}}
180 #define openxc_ControlCommand_init_zero {false, (openxc_ControlCommand_Type)0, false, openxc_DiagnosticRequest_init_zero, false, (openxc_ControlCommand_Action)0}
181 #define openxc_CommandResponse_init_zero {false, (openxc_ControlCommand_Type)0, false, "", false, 0}
182 #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}
183 #define openxc_DiagnosticResponse_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, {0, {0}}, false, 0}
184 #define openxc_DynamicField_init_zero {false, (openxc_DynamicField_Type)0, false, "", false, 0, false, 0}
185 #define openxc_TranslatedMessage_init_zero {false, (openxc_TranslatedMessage_Type)0, false, "", false, openxc_DynamicField_init_zero, false, openxc_DynamicField_init_zero}
187 /* Field tags (for use in manual encoding/decoding) */
188 #define openxc_CommandResponse_type_tag 1
189 #define openxc_CommandResponse_message_tag 2
190 #define openxc_CommandResponse_status_tag 3
191 #define openxc_DiagnosticRequest_bus_tag 1
192 #define openxc_DiagnosticRequest_message_id_tag 2
193 #define openxc_DiagnosticRequest_mode_tag 3
194 #define openxc_DiagnosticRequest_pid_tag 4
195 #define openxc_DiagnosticRequest_payload_tag 5
196 #define openxc_DiagnosticRequest_multiple_responses_tag 6
197 #define openxc_DiagnosticRequest_frequency_tag 7
198 #define openxc_DiagnosticRequest_name_tag 8
199 #define openxc_DiagnosticRequest_decoded_type_tag 9
200 #define openxc_DiagnosticResponse_bus_tag 1
201 #define openxc_DiagnosticResponse_message_id_tag 2
202 #define openxc_DiagnosticResponse_mode_tag 3
203 #define openxc_DiagnosticResponse_pid_tag 4
204 #define openxc_DiagnosticResponse_success_tag 5
205 #define openxc_DiagnosticResponse_negative_response_code_tag 6
206 #define openxc_DiagnosticResponse_payload_tag 7
207 #define openxc_DiagnosticResponse_value_tag 8
208 #define openxc_DynamicField_type_tag 1
209 #define openxc_DynamicField_string_value_tag 2
210 #define openxc_DynamicField_numeric_value_tag 3
211 #define openxc_DynamicField_boolean_value_tag 4
212 #define openxc_RawMessage_bus_tag 1
213 #define openxc_RawMessage_message_id_tag 2
214 #define openxc_RawMessage_data_tag 3
215 #define openxc_ControlCommand_type_tag 1
216 #define openxc_ControlCommand_diagnostic_request_tag 2
217 #define openxc_ControlCommand_action_tag 3
218 #define openxc_TranslatedMessage_type_tag 1
219 #define openxc_TranslatedMessage_name_tag 2
220 #define openxc_TranslatedMessage_value_tag 3
221 #define openxc_TranslatedMessage_event_tag 4
222 #define openxc_VehicleMessage_type_tag 1
223 #define openxc_VehicleMessage_raw_message_tag 2
224 #define openxc_VehicleMessage_translated_message_tag 3
225 #define openxc_VehicleMessage_diagnostic_response_tag 4
226 #define openxc_VehicleMessage_control_command_tag 5
227 #define openxc_VehicleMessage_command_response_tag 6
229 /* Struct field encoding specification for nanopb */
230 extern const pb_field_t openxc_VehicleMessage_fields[7];
231 extern const pb_field_t openxc_RawMessage_fields[4];
232 extern const pb_field_t openxc_ControlCommand_fields[4];
233 extern const pb_field_t openxc_CommandResponse_fields[4];
234 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
235 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
236 extern const pb_field_t openxc_DynamicField_fields[5];
237 extern const pb_field_t openxc_TranslatedMessage_fields[5];
239 /* Maximum encoded size of messages (where known) */
240 #define openxc_VehicleMessage_size 672
241 #define openxc_RawMessage_size 27
242 #define openxc_ControlCommand_size 82
243 #define openxc_CommandResponse_size 139
244 #define openxc_DiagnosticRequest_size 68
245 #define openxc_DiagnosticResponse_size 56
246 #define openxc_DynamicField_size 119
247 #define openxc_TranslatedMessage_size 350