1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Thu Mar 6 16:21:37 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_DynamicField_Type {
28 openxc_DynamicField_Type_STRING = 1,
29 openxc_DynamicField_Type_NUM = 2,
30 openxc_DynamicField_Type_BOOL = 3
31 } openxc_DynamicField_Type;
33 typedef enum _openxc_TranslatedMessage_Type {
34 openxc_TranslatedMessage_Type_STRING = 1,
35 openxc_TranslatedMessage_Type_NUM = 2,
36 openxc_TranslatedMessage_Type_BOOL = 3,
37 openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
38 openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
39 openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
40 } openxc_TranslatedMessage_Type;
42 /* Struct definitions */
43 typedef struct _openxc_CommandResponse {
45 openxc_ControlCommand_Type type;
48 } openxc_CommandResponse;
53 } openxc_DiagnosticRequest_payload_t;
55 typedef struct _openxc_DiagnosticRequest {
65 openxc_DiagnosticRequest_payload_t payload;
66 bool has_parse_payload;
74 } openxc_DiagnosticRequest;
79 } openxc_DiagnosticResponse_payload_t;
81 typedef struct _openxc_DiagnosticResponse {
92 bool has_negative_response_code;
93 uint32_t negative_response_code;
95 openxc_DiagnosticResponse_payload_t payload;
98 } openxc_DiagnosticResponse;
100 typedef struct _openxc_DynamicField {
102 openxc_DynamicField_Type type;
103 bool has_string_value;
104 char string_value[100];
105 bool has_numeric_value;
106 double numeric_value;
107 bool has_boolean_value;
109 } openxc_DynamicField;
114 } openxc_RawMessage_data_t;
116 typedef struct _openxc_RawMessage {
122 openxc_RawMessage_data_t data;
125 typedef struct _openxc_ControlCommand {
127 openxc_ControlCommand_Type type;
128 bool has_diagnostic_request;
129 openxc_DiagnosticRequest diagnostic_request;
130 } openxc_ControlCommand;
132 typedef struct _openxc_TranslatedMessage {
134 openxc_TranslatedMessage_Type type;
138 openxc_DynamicField value;
140 openxc_DynamicField event;
141 } openxc_TranslatedMessage;
143 typedef struct _openxc_VehicleMessage {
145 openxc_VehicleMessage_Type type;
146 bool has_raw_message;
147 openxc_RawMessage raw_message;
148 bool has_translated_message;
149 openxc_TranslatedMessage translated_message;
150 bool has_diagnostic_response;
151 openxc_DiagnosticResponse diagnostic_response;
152 bool has_control_command;
153 openxc_ControlCommand control_command;
154 bool has_command_response;
155 openxc_CommandResponse command_response;
156 } openxc_VehicleMessage;
158 /* Default values for struct fields */
160 /* Field tags (for use in manual encoding/decoding) */
161 #define openxc_CommandResponse_type_tag 1
162 #define openxc_CommandResponse_message_tag 2
163 #define openxc_DiagnosticRequest_bus_tag 1
164 #define openxc_DiagnosticRequest_message_id_tag 2
165 #define openxc_DiagnosticRequest_mode_tag 3
166 #define openxc_DiagnosticRequest_pid_tag 4
167 #define openxc_DiagnosticRequest_payload_tag 5
168 #define openxc_DiagnosticRequest_parse_payload_tag 6
169 #define openxc_DiagnosticRequest_factor_tag 7
170 #define openxc_DiagnosticRequest_offset_tag 8
171 #define openxc_DiagnosticRequest_frequency_tag 9
172 #define openxc_DiagnosticResponse_bus_tag 1
173 #define openxc_DiagnosticResponse_message_id_tag 2
174 #define openxc_DiagnosticResponse_mode_tag 3
175 #define openxc_DiagnosticResponse_pid_tag 4
176 #define openxc_DiagnosticResponse_success_tag 5
177 #define openxc_DiagnosticResponse_negative_response_code_tag 6
178 #define openxc_DiagnosticResponse_payload_tag 7
179 #define openxc_DiagnosticResponse_value_tag 8
180 #define openxc_DynamicField_type_tag 1
181 #define openxc_DynamicField_string_value_tag 2
182 #define openxc_DynamicField_numeric_value_tag 3
183 #define openxc_DynamicField_boolean_value_tag 4
184 #define openxc_RawMessage_bus_tag 1
185 #define openxc_RawMessage_message_id_tag 2
186 #define openxc_RawMessage_data_tag 3
187 #define openxc_ControlCommand_type_tag 1
188 #define openxc_ControlCommand_diagnostic_request_tag 2
189 #define openxc_TranslatedMessage_type_tag 1
190 #define openxc_TranslatedMessage_name_tag 2
191 #define openxc_TranslatedMessage_value_tag 3
192 #define openxc_TranslatedMessage_event_tag 4
193 #define openxc_VehicleMessage_type_tag 1
194 #define openxc_VehicleMessage_raw_message_tag 2
195 #define openxc_VehicleMessage_translated_message_tag 3
196 #define openxc_VehicleMessage_diagnostic_response_tag 4
197 #define openxc_VehicleMessage_control_command_tag 5
198 #define openxc_VehicleMessage_command_response_tag 6
200 /* Struct field encoding specification for nanopb */
201 extern const pb_field_t openxc_VehicleMessage_fields[7];
202 extern const pb_field_t openxc_RawMessage_fields[4];
203 extern const pb_field_t openxc_ControlCommand_fields[3];
204 extern const pb_field_t openxc_CommandResponse_fields[3];
205 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
206 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
207 extern const pb_field_t openxc_DynamicField_fields[5];
208 extern const pb_field_t openxc_TranslatedMessage_fields[5];
210 /* Maximum encoded size of messages (where known) */
211 #define openxc_VehicleMessage_size 664
212 #define openxc_RawMessage_size 27
213 #define openxc_ControlCommand_size 76
214 #define openxc_CommandResponse_size 137
215 #define openxc_DiagnosticRequest_size 68
216 #define openxc_DiagnosticResponse_size 56
217 #define openxc_DynamicField_size 119
218 #define openxc_TranslatedMessage_size 350