1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Wed Mar 26 09:29:06 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_COMMAND_RESPONSE = 5
19 } openxc_VehicleMessage_Type;
21 typedef enum _openxc_ControlCommand_Type {
22 openxc_ControlCommand_Type_VERSION = 1,
23 openxc_ControlCommand_Type_DEVICE_ID = 2,
24 openxc_ControlCommand_Type_DIAGNOSTIC = 3
25 } openxc_ControlCommand_Type;
27 typedef enum _openxc_DiagnosticRequest_DecodedType {
28 openxc_DiagnosticRequest_DecodedType_NONE = 1,
29 openxc_DiagnosticRequest_DecodedType_OBD2 = 2
30 } openxc_DiagnosticRequest_DecodedType;
32 typedef enum _openxc_DynamicField_Type {
33 openxc_DynamicField_Type_STRING = 1,
34 openxc_DynamicField_Type_NUM = 2,
35 openxc_DynamicField_Type_BOOL = 3
36 } openxc_DynamicField_Type;
38 typedef enum _openxc_TranslatedMessage_Type {
39 openxc_TranslatedMessage_Type_STRING = 1,
40 openxc_TranslatedMessage_Type_NUM = 2,
41 openxc_TranslatedMessage_Type_BOOL = 3,
42 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
43 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
44 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
45 } openxc_TranslatedMessage_Type;
47 /* Struct definitions */
48 typedef struct _openxc_CommandResponse {
50 openxc_ControlCommand_Type type;
53 } openxc_CommandResponse;
58 } openxc_DiagnosticRequest_payload_t;
60 typedef struct _openxc_DiagnosticRequest {
70 openxc_DiagnosticRequest_payload_t payload;
71 bool has_multiple_responses;
72 bool multiple_responses;
77 bool has_decoded_type;
78 openxc_DiagnosticRequest_DecodedType decoded_type;
79 } openxc_DiagnosticRequest;
84 } openxc_DiagnosticResponse_payload_t;
86 typedef struct _openxc_DiagnosticResponse {
97 bool has_negative_response_code;
98 uint32_t negative_response_code;
100 openxc_DiagnosticResponse_payload_t payload;
103 } openxc_DiagnosticResponse;
105 typedef struct _openxc_DynamicField {
107 openxc_DynamicField_Type type;
108 bool has_string_value;
109 char string_value[100];
110 bool has_numeric_value;
111 double numeric_value;
112 bool has_boolean_value;
114 } openxc_DynamicField;
119 } openxc_RawMessage_data_t;
121 typedef struct _openxc_RawMessage {
127 openxc_RawMessage_data_t data;
130 typedef struct _openxc_ControlCommand {
132 openxc_ControlCommand_Type type;
133 bool has_diagnostic_request;
134 openxc_DiagnosticRequest diagnostic_request;
135 } openxc_ControlCommand;
137 typedef struct _openxc_TranslatedMessage {
139 openxc_TranslatedMessage_Type type;
143 openxc_DynamicField value;
145 openxc_DynamicField event;
146 } openxc_TranslatedMessage;
148 typedef struct _openxc_VehicleMessage {
150 openxc_VehicleMessage_Type type;
151 bool has_raw_message;
152 openxc_RawMessage raw_message;
153 bool has_translated_message;
154 openxc_TranslatedMessage translated_message;
155 bool has_diagnostic_response;
156 openxc_DiagnosticResponse diagnostic_response;
157 bool has_control_command;
158 openxc_ControlCommand control_command;
159 bool has_command_response;
160 openxc_CommandResponse command_response;
161 } openxc_VehicleMessage;
163 /* Default values for struct fields */
165 /* Field tags (for use in manual encoding/decoding) */
166 #define openxc_CommandResponse_type_tag 1
167 #define openxc_CommandResponse_message_tag 2
168 #define openxc_DiagnosticRequest_bus_tag 1
169 #define openxc_DiagnosticRequest_message_id_tag 2
170 #define openxc_DiagnosticRequest_mode_tag 3
171 #define openxc_DiagnosticRequest_pid_tag 4
172 #define openxc_DiagnosticRequest_payload_tag 5
173 #define openxc_DiagnosticRequest_multiple_responses_tag 6
174 #define openxc_DiagnosticRequest_frequency_tag 7
175 #define openxc_DiagnosticRequest_name_tag 8
176 #define openxc_DiagnosticRequest_decoded_type_tag 9
177 #define openxc_DiagnosticResponse_bus_tag 1
178 #define openxc_DiagnosticResponse_message_id_tag 2
179 #define openxc_DiagnosticResponse_mode_tag 3
180 #define openxc_DiagnosticResponse_pid_tag 4
181 #define openxc_DiagnosticResponse_success_tag 5
182 #define openxc_DiagnosticResponse_negative_response_code_tag 6
183 #define openxc_DiagnosticResponse_payload_tag 7
184 #define openxc_DiagnosticResponse_value_tag 8
185 #define openxc_DynamicField_type_tag 1
186 #define openxc_DynamicField_string_value_tag 2
187 #define openxc_DynamicField_numeric_value_tag 3
188 #define openxc_DynamicField_boolean_value_tag 4
189 #define openxc_RawMessage_bus_tag 1
190 #define openxc_RawMessage_message_id_tag 2
191 #define openxc_RawMessage_data_tag 3
192 #define openxc_ControlCommand_type_tag 1
193 #define openxc_ControlCommand_diagnostic_request_tag 2
194 #define openxc_TranslatedMessage_type_tag 1
195 #define openxc_TranslatedMessage_name_tag 2
196 #define openxc_TranslatedMessage_value_tag 3
197 #define openxc_TranslatedMessage_event_tag 4
198 #define openxc_VehicleMessage_type_tag 1
199 #define openxc_VehicleMessage_raw_message_tag 2
200 #define openxc_VehicleMessage_translated_message_tag 3
201 #define openxc_VehicleMessage_diagnostic_response_tag 4
202 #define openxc_VehicleMessage_control_command_tag 5
203 #define openxc_VehicleMessage_command_response_tag 6
205 /* Struct field encoding specification for nanopb */
206 extern const pb_field_t openxc_VehicleMessage_fields[7];
207 extern const pb_field_t openxc_RawMessage_fields[4];
208 extern const pb_field_t openxc_ControlCommand_fields[3];
209 extern const pb_field_t openxc_CommandResponse_fields[3];
210 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
211 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
212 extern const pb_field_t openxc_DynamicField_fields[5];
213 extern const pb_field_t openxc_TranslatedMessage_fields[5];
215 /* Maximum encoded size of messages (where known) */
216 #define openxc_VehicleMessage_size 664
217 #define openxc_RawMessage_size 27
218 #define openxc_ControlCommand_size 76
219 #define openxc_CommandResponse_size 137
220 #define openxc_DiagnosticRequest_size 68
221 #define openxc_DiagnosticResponse_size 56
222 #define openxc_DynamicField_size 119
223 #define openxc_TranslatedMessage_size 350