b8b605744cb21f96362b87759fed58c7f22f98c0
[apps/agl-service-can-low-level.git] / gen / cpp / openxc.pb.h
1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Mon Aug 11 23:26:24 2014. */
3
4 #ifndef _PB_OPENXC_PB_H_
5 #define _PB_OPENXC_PB_H_
6 #include <pb.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
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;
20
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;
26
27 typedef enum _openxc_ControlCommand_Action {
28     openxc_ControlCommand_Action_ADD = 1,
29     openxc_ControlCommand_Action_CANCEL = 2
30 } openxc_ControlCommand_Action;
31
32 typedef enum _openxc_DiagnosticRequest_DecodedType {
33     openxc_DiagnosticRequest_DecodedType_NONE = 1,
34     openxc_DiagnosticRequest_DecodedType_OBD2 = 2
35 } openxc_DiagnosticRequest_DecodedType;
36
37 typedef enum _openxc_DynamicField_Type {
38     openxc_DynamicField_Type_STRING = 1,
39     openxc_DynamicField_Type_NUM = 2,
40     openxc_DynamicField_Type_BOOL = 3
41 } openxc_DynamicField_Type;
42
43 typedef enum _openxc_TranslatedMessage_Type {
44     openxc_TranslatedMessage_Type_STRING = 1,
45     openxc_TranslatedMessage_Type_NUM = 2,
46     openxc_TranslatedMessage_Type_BOOL = 3,
47     openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
48     openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
49     openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
50 } openxc_TranslatedMessage_Type;
51
52 /* Struct definitions */
53 typedef struct _openxc_CommandResponse {
54     bool has_type;
55     openxc_ControlCommand_Type type;
56     bool has_message;
57     char message[128];
58     bool has_status;
59     bool status;
60 } openxc_CommandResponse;
61
62 typedef struct {
63     size_t size;
64     uint8_t bytes[8];
65 } openxc_DiagnosticRequest_payload_t;
66
67 typedef struct _openxc_DiagnosticRequest {
68     bool has_bus;
69     int32_t bus;
70     bool has_message_id;
71     uint32_t message_id;
72     bool has_mode;
73     uint32_t mode;
74     bool has_pid;
75     uint32_t pid;
76     bool has_payload;
77     openxc_DiagnosticRequest_payload_t payload;
78     bool has_multiple_responses;
79     bool multiple_responses;
80     bool has_frequency;
81     double frequency;
82     bool has_name;
83     char name[10];
84     bool has_decoded_type;
85     openxc_DiagnosticRequest_DecodedType decoded_type;
86 } openxc_DiagnosticRequest;
87
88 typedef struct {
89     size_t size;
90     uint8_t bytes[8];
91 } openxc_DiagnosticResponse_payload_t;
92
93 typedef struct _openxc_DiagnosticResponse {
94     bool has_bus;
95     int32_t bus;
96     bool has_message_id;
97     uint32_t message_id;
98     bool has_mode;
99     uint32_t mode;
100     bool has_pid;
101     uint32_t pid;
102     bool has_success;
103     bool success;
104     bool has_negative_response_code;
105     uint32_t negative_response_code;
106     bool has_payload;
107     openxc_DiagnosticResponse_payload_t payload;
108     bool has_value;
109     double value;
110 } openxc_DiagnosticResponse;
111
112 typedef struct _openxc_DynamicField {
113     bool has_type;
114     openxc_DynamicField_Type type;
115     bool has_string_value;
116     char string_value[100];
117     bool has_numeric_value;
118     double numeric_value;
119     bool has_boolean_value;
120     bool boolean_value;
121 } openxc_DynamicField;
122
123 typedef struct {
124     size_t size;
125     uint8_t bytes[8];
126 } openxc_RawMessage_data_t;
127
128 typedef struct _openxc_RawMessage {
129     bool has_bus;
130     int32_t bus;
131     bool has_message_id;
132     uint32_t message_id;
133     bool has_data;
134     openxc_RawMessage_data_t data;
135 } openxc_RawMessage;
136
137 typedef struct _openxc_ControlCommand {
138     bool has_type;
139     openxc_ControlCommand_Type type;
140     bool has_diagnostic_request;
141     openxc_DiagnosticRequest diagnostic_request;
142     bool has_action;
143     openxc_ControlCommand_Action action;
144 } openxc_ControlCommand;
145
146 typedef struct _openxc_TranslatedMessage {
147     bool has_type;
148     openxc_TranslatedMessage_Type type;
149     bool has_name;
150     char name[100];
151     bool has_value;
152     openxc_DynamicField value;
153     bool has_event;
154     openxc_DynamicField event;
155 } openxc_TranslatedMessage;
156
157 typedef struct _openxc_VehicleMessage {
158     bool has_type;
159     openxc_VehicleMessage_Type type;
160     bool has_raw_message;
161     openxc_RawMessage raw_message;
162     bool has_translated_message;
163     openxc_TranslatedMessage translated_message;
164     bool has_diagnostic_response;
165     openxc_DiagnosticResponse diagnostic_response;
166     bool has_control_command;
167     openxc_ControlCommand control_command;
168     bool has_command_response;
169     openxc_CommandResponse command_response;
170 } openxc_VehicleMessage;
171
172 /* Default values for struct fields */
173
174 /* Field tags (for use in manual encoding/decoding) */
175 #define openxc_CommandResponse_type_tag          1
176 #define openxc_CommandResponse_message_tag       2
177 #define openxc_CommandResponse_status_tag        3
178 #define openxc_DiagnosticRequest_bus_tag         1
179 #define openxc_DiagnosticRequest_message_id_tag  2
180 #define openxc_DiagnosticRequest_mode_tag        3
181 #define openxc_DiagnosticRequest_pid_tag         4
182 #define openxc_DiagnosticRequest_payload_tag     5
183 #define openxc_DiagnosticRequest_multiple_responses_tag 6
184 #define openxc_DiagnosticRequest_frequency_tag   7
185 #define openxc_DiagnosticRequest_name_tag        8
186 #define openxc_DiagnosticRequest_decoded_type_tag 9
187 #define openxc_DiagnosticResponse_bus_tag        1
188 #define openxc_DiagnosticResponse_message_id_tag 2
189 #define openxc_DiagnosticResponse_mode_tag       3
190 #define openxc_DiagnosticResponse_pid_tag        4
191 #define openxc_DiagnosticResponse_success_tag    5
192 #define openxc_DiagnosticResponse_negative_response_code_tag 6
193 #define openxc_DiagnosticResponse_payload_tag    7
194 #define openxc_DiagnosticResponse_value_tag      8
195 #define openxc_DynamicField_type_tag             1
196 #define openxc_DynamicField_string_value_tag     2
197 #define openxc_DynamicField_numeric_value_tag    3
198 #define openxc_DynamicField_boolean_value_tag    4
199 #define openxc_RawMessage_bus_tag                1
200 #define openxc_RawMessage_message_id_tag         2
201 #define openxc_RawMessage_data_tag               3
202 #define openxc_ControlCommand_type_tag           1
203 #define openxc_ControlCommand_diagnostic_request_tag 2
204 #define openxc_ControlCommand_action_tag         3
205 #define openxc_TranslatedMessage_type_tag        1
206 #define openxc_TranslatedMessage_name_tag        2
207 #define openxc_TranslatedMessage_value_tag       3
208 #define openxc_TranslatedMessage_event_tag       4
209 #define openxc_VehicleMessage_type_tag           1
210 #define openxc_VehicleMessage_raw_message_tag    2
211 #define openxc_VehicleMessage_translated_message_tag 3
212 #define openxc_VehicleMessage_diagnostic_response_tag 4
213 #define openxc_VehicleMessage_control_command_tag 5
214 #define openxc_VehicleMessage_command_response_tag 6
215
216 /* Struct field encoding specification for nanopb */
217 extern const pb_field_t openxc_VehicleMessage_fields[7];
218 extern const pb_field_t openxc_RawMessage_fields[4];
219 extern const pb_field_t openxc_ControlCommand_fields[4];
220 extern const pb_field_t openxc_CommandResponse_fields[4];
221 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
222 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
223 extern const pb_field_t openxc_DynamicField_fields[5];
224 extern const pb_field_t openxc_TranslatedMessage_fields[5];
225
226 /* Maximum encoded size of messages (where known) */
227 #define openxc_VehicleMessage_size               672
228 #define openxc_RawMessage_size                   27
229 #define openxc_ControlCommand_size               82
230 #define openxc_CommandResponse_size              139
231 #define openxc_DiagnosticRequest_size            68
232 #define openxc_DiagnosticResponse_size           56
233 #define openxc_DynamicField_size                 119
234 #define openxc_TranslatedMessage_size            350
235
236 #ifdef __cplusplus
237 } /* extern "C" */
238 #endif
239
240 #endif