Require an 'action' in diagnostic requests.
[apps/low-level-can-service.git] / gen / cpp / openxc.pb.h
1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Mon Aug  4 23:15:59 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_DiagnosticRequest_DecodedType {
28     openxc_DiagnosticRequest_DecodedType_NONE = 1,
29     openxc_DiagnosticRequest_DecodedType_OBD2 = 2
30 } openxc_DiagnosticRequest_DecodedType;
31
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;
37
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;
43
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;
52
53 /* Struct definitions */
54 typedef struct _openxc_CommandResponse {
55     bool has_type;
56     openxc_ControlCommand_Type type;
57     bool has_message;
58     char message[128];
59 } openxc_CommandResponse;
60
61 typedef struct {
62     size_t size;
63     uint8_t bytes[8];
64 } openxc_DiagnosticRequest_payload_t;
65
66 typedef struct _openxc_DiagnosticRequest {
67     bool has_bus;
68     int32_t bus;
69     bool has_message_id;
70     uint32_t message_id;
71     bool has_mode;
72     uint32_t mode;
73     bool has_pid;
74     uint32_t pid;
75     bool has_payload;
76     openxc_DiagnosticRequest_payload_t payload;
77     bool has_multiple_responses;
78     bool multiple_responses;
79     bool has_frequency;
80     double frequency;
81     bool has_name;
82     char name[10];
83     bool has_decoded_type;
84     openxc_DiagnosticRequest_DecodedType decoded_type;
85     bool has_action;
86     openxc_DiagnosticRequest_Action action;
87 } openxc_DiagnosticRequest;
88
89 typedef struct {
90     size_t size;
91     uint8_t bytes[8];
92 } openxc_DiagnosticResponse_payload_t;
93
94 typedef struct _openxc_DiagnosticResponse {
95     bool has_bus;
96     int32_t bus;
97     bool has_message_id;
98     uint32_t message_id;
99     bool has_mode;
100     uint32_t mode;
101     bool has_pid;
102     uint32_t pid;
103     bool has_success;
104     bool success;
105     bool has_negative_response_code;
106     uint32_t negative_response_code;
107     bool has_payload;
108     openxc_DiagnosticResponse_payload_t payload;
109     bool has_value;
110     double value;
111 } openxc_DiagnosticResponse;
112
113 typedef struct _openxc_DynamicField {
114     bool has_type;
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;
121     bool boolean_value;
122 } openxc_DynamicField;
123
124 typedef struct {
125     size_t size;
126     uint8_t bytes[8];
127 } openxc_RawMessage_data_t;
128
129 typedef struct _openxc_RawMessage {
130     bool has_bus;
131     int32_t bus;
132     bool has_message_id;
133     uint32_t message_id;
134     bool has_data;
135     openxc_RawMessage_data_t data;
136 } openxc_RawMessage;
137
138 typedef struct _openxc_ControlCommand {
139     bool has_type;
140     openxc_ControlCommand_Type type;
141     bool has_diagnostic_request;
142     openxc_DiagnosticRequest diagnostic_request;
143 } openxc_ControlCommand;
144
145 typedef struct _openxc_TranslatedMessage {
146     bool has_type;
147     openxc_TranslatedMessage_Type type;
148     bool has_name;
149     char name[100];
150     bool has_value;
151     openxc_DynamicField value;
152     bool has_event;
153     openxc_DynamicField event;
154 } openxc_TranslatedMessage;
155
156 typedef struct _openxc_VehicleMessage {
157     bool has_type;
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;
170
171 /* Default values for struct fields */
172
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
213
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];
223
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
233
234 #ifdef __cplusplus
235 } /* extern "C" */
236 #endif
237
238 #endif