Add CommandResponse type to VehicleMessage (from VI to host).
[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 Thu Mar  6 16:21:37 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_DynamicField_Type {
28     openxc_DynamicField_Type_STRING = 1,
29     openxc_DynamicField_Type_NUM = 2,
30     openxc_DynamicField_Type_BOOL = 3
31 } openxc_DynamicField_Type;
32
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;
41
42 /* Struct definitions */
43 typedef struct _openxc_CommandResponse {
44     bool has_type;
45     openxc_ControlCommand_Type type;
46     bool has_message;
47     char message[128];
48 } openxc_CommandResponse;
49
50 typedef struct {
51     size_t size;
52     uint8_t bytes[8];
53 } openxc_DiagnosticRequest_payload_t;
54
55 typedef struct _openxc_DiagnosticRequest {
56     bool has_bus;
57     int32_t bus;
58     bool has_message_id;
59     uint32_t message_id;
60     bool has_mode;
61     uint32_t mode;
62     bool has_pid;
63     uint32_t pid;
64     bool has_payload;
65     openxc_DiagnosticRequest_payload_t payload;
66     bool has_parse_payload;
67     bool parse_payload;
68     bool has_factor;
69     double factor;
70     bool has_offset;
71     double offset;
72     bool has_frequency;
73     double frequency;
74 } openxc_DiagnosticRequest;
75
76 typedef struct {
77     size_t size;
78     uint8_t bytes[8];
79 } openxc_DiagnosticResponse_payload_t;
80
81 typedef struct _openxc_DiagnosticResponse {
82     bool has_bus;
83     int32_t bus;
84     bool has_message_id;
85     uint32_t message_id;
86     bool has_mode;
87     uint32_t mode;
88     bool has_pid;
89     uint32_t pid;
90     bool has_success;
91     bool success;
92     bool has_negative_response_code;
93     uint32_t negative_response_code;
94     bool has_payload;
95     openxc_DiagnosticResponse_payload_t payload;
96     bool has_value;
97     double value;
98 } openxc_DiagnosticResponse;
99
100 typedef struct _openxc_DynamicField {
101     bool has_type;
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;
108     bool boolean_value;
109 } openxc_DynamicField;
110
111 typedef struct {
112     size_t size;
113     uint8_t bytes[8];
114 } openxc_RawMessage_data_t;
115
116 typedef struct _openxc_RawMessage {
117     bool has_bus;
118     int32_t bus;
119     bool has_message_id;
120     uint32_t message_id;
121     bool has_data;
122     openxc_RawMessage_data_t data;
123 } openxc_RawMessage;
124
125 typedef struct _openxc_ControlCommand {
126     bool has_type;
127     openxc_ControlCommand_Type type;
128     bool has_diagnostic_request;
129     openxc_DiagnosticRequest diagnostic_request;
130 } openxc_ControlCommand;
131
132 typedef struct _openxc_TranslatedMessage {
133     bool has_type;
134     openxc_TranslatedMessage_Type type;
135     bool has_name;
136     char name[100];
137     bool has_value;
138     openxc_DynamicField value;
139     bool has_event;
140     openxc_DynamicField event;
141 } openxc_TranslatedMessage;
142
143 typedef struct _openxc_VehicleMessage {
144     bool has_type;
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;
157
158 /* Default values for struct fields */
159
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
199
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];
209
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
219
220 #ifdef __cplusplus
221 } /* extern "C" */
222 #endif
223
224 #endif