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