1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Mon Aug 4 23:15:59 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_DiagnosticRequest_Action {
33 openxc_DiagnosticRequest_Action_CREATE = 1,
34 openxc_DiagnosticRequest_Action_UPDATE = 2,
35 openxc_DiagnosticRequest_Action_DELETE = 3
36 } openxc_DiagnosticRequest_Action;
38 typedef enum _openxc_DynamicField_Type {
39 openxc_DynamicField_Type_STRING = 1,
40 openxc_DynamicField_Type_NUM = 2,
41 openxc_DynamicField_Type_BOOL = 3
42 } openxc_DynamicField_Type;
44 typedef enum _openxc_TranslatedMessage_Type {
45 openxc_TranslatedMessage_Type_STRING = 1,
46 openxc_TranslatedMessage_Type_NUM = 2,
47 openxc_TranslatedMessage_Type_BOOL = 3,
48 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
49 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
50 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
51 } openxc_TranslatedMessage_Type;
53 /* Struct definitions */
54 typedef struct _openxc_CommandResponse {
56 openxc_ControlCommand_Type type;
59 } openxc_CommandResponse;
64 } openxc_DiagnosticRequest_payload_t;
66 typedef struct _openxc_DiagnosticRequest {
76 openxc_DiagnosticRequest_payload_t payload;
77 bool has_multiple_responses;
78 bool multiple_responses;
83 bool has_decoded_type;
84 openxc_DiagnosticRequest_DecodedType decoded_type;
86 openxc_DiagnosticRequest_Action action;
87 } openxc_DiagnosticRequest;
92 } openxc_DiagnosticResponse_payload_t;
94 typedef struct _openxc_DiagnosticResponse {
105 bool has_negative_response_code;
106 uint32_t negative_response_code;
108 openxc_DiagnosticResponse_payload_t payload;
111 } openxc_DiagnosticResponse;
113 typedef struct _openxc_DynamicField {
115 openxc_DynamicField_Type type;
116 bool has_string_value;
117 char string_value[100];
118 bool has_numeric_value;
119 double numeric_value;
120 bool has_boolean_value;
122 } openxc_DynamicField;
127 } openxc_RawMessage_data_t;
129 typedef struct _openxc_RawMessage {
135 openxc_RawMessage_data_t data;
138 typedef struct _openxc_ControlCommand {
140 openxc_ControlCommand_Type type;
141 bool has_diagnostic_request;
142 openxc_DiagnosticRequest diagnostic_request;
143 } openxc_ControlCommand;
145 typedef struct _openxc_TranslatedMessage {
147 openxc_TranslatedMessage_Type type;
151 openxc_DynamicField value;
153 openxc_DynamicField event;
154 } openxc_TranslatedMessage;
156 typedef struct _openxc_VehicleMessage {
158 openxc_VehicleMessage_Type type;
159 bool has_raw_message;
160 openxc_RawMessage raw_message;
161 bool has_translated_message;
162 openxc_TranslatedMessage translated_message;
163 bool has_diagnostic_response;
164 openxc_DiagnosticResponse diagnostic_response;
165 bool has_control_command;
166 openxc_ControlCommand control_command;
167 bool has_command_response;
168 openxc_CommandResponse command_response;
169 } openxc_VehicleMessage;
171 /* Default values for struct fields */
173 /* Field tags (for use in manual encoding/decoding) */
174 #define openxc_CommandResponse_type_tag 1
175 #define openxc_CommandResponse_message_tag 2
176 #define openxc_DiagnosticRequest_bus_tag 1
177 #define openxc_DiagnosticRequest_message_id_tag 2
178 #define openxc_DiagnosticRequest_mode_tag 3
179 #define openxc_DiagnosticRequest_pid_tag 4
180 #define openxc_DiagnosticRequest_payload_tag 5
181 #define openxc_DiagnosticRequest_multiple_responses_tag 6
182 #define openxc_DiagnosticRequest_frequency_tag 7
183 #define openxc_DiagnosticRequest_name_tag 8
184 #define openxc_DiagnosticRequest_decoded_type_tag 9
185 #define openxc_DiagnosticRequest_action_tag 10
186 #define openxc_DiagnosticResponse_bus_tag 1
187 #define openxc_DiagnosticResponse_message_id_tag 2
188 #define openxc_DiagnosticResponse_mode_tag 3
189 #define openxc_DiagnosticResponse_pid_tag 4
190 #define openxc_DiagnosticResponse_success_tag 5
191 #define openxc_DiagnosticResponse_negative_response_code_tag 6
192 #define openxc_DiagnosticResponse_payload_tag 7
193 #define openxc_DiagnosticResponse_value_tag 8
194 #define openxc_DynamicField_type_tag 1
195 #define openxc_DynamicField_string_value_tag 2
196 #define openxc_DynamicField_numeric_value_tag 3
197 #define openxc_DynamicField_boolean_value_tag 4
198 #define openxc_RawMessage_bus_tag 1
199 #define openxc_RawMessage_message_id_tag 2
200 #define openxc_RawMessage_data_tag 3
201 #define openxc_ControlCommand_type_tag 1
202 #define openxc_ControlCommand_diagnostic_request_tag 2
203 #define openxc_TranslatedMessage_type_tag 1
204 #define openxc_TranslatedMessage_name_tag 2
205 #define openxc_TranslatedMessage_value_tag 3
206 #define openxc_TranslatedMessage_event_tag 4
207 #define openxc_VehicleMessage_type_tag 1
208 #define openxc_VehicleMessage_raw_message_tag 2
209 #define openxc_VehicleMessage_translated_message_tag 3
210 #define openxc_VehicleMessage_diagnostic_response_tag 4
211 #define openxc_VehicleMessage_control_command_tag 5
212 #define openxc_VehicleMessage_command_response_tag 6
214 /* Struct field encoding specification for nanopb */
215 extern const pb_field_t openxc_VehicleMessage_fields[7];
216 extern const pb_field_t openxc_RawMessage_fields[4];
217 extern const pb_field_t openxc_ControlCommand_fields[3];
218 extern const pb_field_t openxc_CommandResponse_fields[3];
219 extern const pb_field_t openxc_DiagnosticRequest_fields[11];
220 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
221 extern const pb_field_t openxc_DynamicField_fields[5];
222 extern const pb_field_t openxc_TranslatedMessage_fields[5];
224 /* Maximum encoded size of messages (where known) */
225 #define openxc_VehicleMessage_size 670
226 #define openxc_RawMessage_size 27
227 #define openxc_ControlCommand_size 82
228 #define openxc_CommandResponse_size 137
229 #define openxc_DiagnosticRequest_size 74
230 #define openxc_DiagnosticResponse_size 56
231 #define openxc_DynamicField_size 119
232 #define openxc_TranslatedMessage_size 350