Condense string/number/bool trio into a field.
[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 Tue Mar  4 15:25:22 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;
19
20 typedef enum _openxc_ControlCommand_Type {
21     openxc_ControlCommand_Type_VERSION = 1,
22     openxc_ControlCommand_Type_DEVICE_ID = 2,
23     openxc_ControlCommand_Type_DIAGNOSTIC = 3
24 } openxc_ControlCommand_Type;
25
26 typedef enum _openxc_DynamicField_Type {
27     openxc_DynamicField_Type_STRING = 1,
28     openxc_DynamicField_Type_NUM = 2,
29     openxc_DynamicField_Type_BOOL = 3
30 } openxc_DynamicField_Type;
31
32 typedef enum _openxc_TranslatedMessage_Type {
33     openxc_TranslatedMessage_Type_STRING = 1,
34     openxc_TranslatedMessage_Type_NUM = 2,
35     openxc_TranslatedMessage_Type_BOOL = 3,
36     openxc_TranslatedMessage_Type_EVENTED_STRING = 4,
37     openxc_TranslatedMessage_Type_EVENTED_NUM = 5,
38     openxc_TranslatedMessage_Type_EVENTED_BOOL = 6
39 } openxc_TranslatedMessage_Type;
40
41 /* Struct definitions */
42 typedef struct {
43     size_t size;
44     uint8_t bytes[8];
45 } openxc_DiagnosticRequest_payload_t;
46
47 typedef struct _openxc_DiagnosticRequest {
48     bool has_bus;
49     int32_t bus;
50     bool has_message_id;
51     uint32_t message_id;
52     bool has_mode;
53     uint32_t mode;
54     bool has_pid;
55     uint32_t pid;
56     bool has_payload;
57     openxc_DiagnosticRequest_payload_t payload;
58     bool has_parse_payload;
59     bool parse_payload;
60     bool has_factor;
61     double factor;
62     bool has_offset;
63     double offset;
64     bool has_frequency;
65     double frequency;
66 } openxc_DiagnosticRequest;
67
68 typedef struct {
69     size_t size;
70     uint8_t bytes[8];
71 } openxc_DiagnosticResponse_payload_t;
72
73 typedef struct _openxc_DiagnosticResponse {
74     bool has_bus;
75     int32_t bus;
76     bool has_message_id;
77     uint32_t message_id;
78     bool has_mode;
79     uint32_t mode;
80     bool has_pid;
81     uint32_t pid;
82     bool has_success;
83     bool success;
84     bool has_negative_response_code;
85     uint32_t negative_response_code;
86     bool has_payload;
87     openxc_DiagnosticResponse_payload_t payload;
88     bool has_value;
89     double value;
90 } openxc_DiagnosticResponse;
91
92 typedef struct _openxc_DynamicField {
93     bool has_type;
94     openxc_DynamicField_Type type;
95     bool has_string_value;
96     char string_value[100];
97     bool has_numeric_value;
98     double numeric_value;
99     bool has_boolean_value;
100     bool boolean_value;
101 } openxc_DynamicField;
102
103 typedef struct {
104     size_t size;
105     uint8_t bytes[8];
106 } openxc_RawMessage_data_t;
107
108 typedef struct _openxc_RawMessage {
109     bool has_bus;
110     int32_t bus;
111     bool has_message_id;
112     uint32_t message_id;
113     bool has_data;
114     openxc_RawMessage_data_t data;
115 } openxc_RawMessage;
116
117 typedef struct _openxc_ControlCommand {
118     bool has_type;
119     openxc_ControlCommand_Type type;
120     bool has_diagnostic_request;
121     openxc_DiagnosticRequest diagnostic_request;
122 } openxc_ControlCommand;
123
124 typedef struct _openxc_TranslatedMessage {
125     bool has_type;
126     openxc_TranslatedMessage_Type type;
127     bool has_name;
128     char name[100];
129     bool has_value;
130     openxc_DynamicField value;
131     bool has_event;
132     openxc_DynamicField event;
133 } openxc_TranslatedMessage;
134
135 typedef struct _openxc_VehicleMessage {
136     bool has_type;
137     openxc_VehicleMessage_Type type;
138     bool has_raw_message;
139     openxc_RawMessage raw_message;
140     bool has_translated_message;
141     openxc_TranslatedMessage translated_message;
142     bool has_diagnostic_response;
143     openxc_DiagnosticResponse diagnostic_response;
144     bool has_control_command;
145     openxc_ControlCommand control_command;
146 } openxc_VehicleMessage;
147
148 /* Default values for struct fields */
149
150 /* Field tags (for use in manual encoding/decoding) */
151 #define openxc_DiagnosticRequest_bus_tag         1
152 #define openxc_DiagnosticRequest_message_id_tag  2
153 #define openxc_DiagnosticRequest_mode_tag        3
154 #define openxc_DiagnosticRequest_pid_tag         4
155 #define openxc_DiagnosticRequest_payload_tag     5
156 #define openxc_DiagnosticRequest_parse_payload_tag 6
157 #define openxc_DiagnosticRequest_factor_tag      7
158 #define openxc_DiagnosticRequest_offset_tag      8
159 #define openxc_DiagnosticRequest_frequency_tag   9
160 #define openxc_DiagnosticResponse_bus_tag        1
161 #define openxc_DiagnosticResponse_message_id_tag 2
162 #define openxc_DiagnosticResponse_mode_tag       3
163 #define openxc_DiagnosticResponse_pid_tag        4
164 #define openxc_DiagnosticResponse_success_tag    5
165 #define openxc_DiagnosticResponse_negative_response_code_tag 6
166 #define openxc_DiagnosticResponse_payload_tag    7
167 #define openxc_DiagnosticResponse_value_tag      8
168 #define openxc_DynamicField_type_tag             1
169 #define openxc_DynamicField_string_value_tag     2
170 #define openxc_DynamicField_numeric_value_tag    3
171 #define openxc_DynamicField_boolean_value_tag    4
172 #define openxc_RawMessage_bus_tag                1
173 #define openxc_RawMessage_message_id_tag         2
174 #define openxc_RawMessage_data_tag               3
175 #define openxc_ControlCommand_type_tag           1
176 #define openxc_ControlCommand_diagnostic_request_tag 2
177 #define openxc_TranslatedMessage_type_tag        1
178 #define openxc_TranslatedMessage_name_tag        2
179 #define openxc_TranslatedMessage_value_tag       3
180 #define openxc_TranslatedMessage_event_tag       4
181 #define openxc_VehicleMessage_type_tag           1
182 #define openxc_VehicleMessage_raw_message_tag    2
183 #define openxc_VehicleMessage_translated_message_tag 3
184 #define openxc_VehicleMessage_diagnostic_response_tag 4
185 #define openxc_VehicleMessage_control_command_tag 5
186
187 /* Struct field encoding specification for nanopb */
188 extern const pb_field_t openxc_VehicleMessage_fields[6];
189 extern const pb_field_t openxc_RawMessage_fields[4];
190 extern const pb_field_t openxc_ControlCommand_fields[3];
191 extern const pb_field_t openxc_DiagnosticRequest_fields[10];
192 extern const pb_field_t openxc_DiagnosticResponse_fields[9];
193 extern const pb_field_t openxc_DynamicField_fields[5];
194 extern const pb_field_t openxc_TranslatedMessage_fields[5];
195
196 /* Maximum encoded size of messages (where known) */
197 #define openxc_VehicleMessage_size               524
198 #define openxc_RawMessage_size                   27
199 #define openxc_ControlCommand_size               76
200 #define openxc_DiagnosticRequest_size            68
201 #define openxc_DiagnosticResponse_size           56
202 #define openxc_DynamicField_size                 119
203 #define openxc_TranslatedMessage_size            350
204
205 #ifdef __cplusplus
206 } /* extern "C" */
207 #endif
208
209 #endif