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