1 /* Automatically generated nanopb header */
2 /* Generated by nanopb-0.2.5 at Mon Mar 3 15:48:39 2014. */
4 #ifndef _PB_OPENXC_PB_H_
5 #define _PB_OPENXC_PB_H_
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;
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;
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;
34 /* Struct definitions */
38 } openxc_DiagnosticRequest_payload_t;
40 typedef struct _openxc_DiagnosticRequest {
50 openxc_DiagnosticRequest_payload_t payload;
51 bool has_parse_payload;
59 } openxc_DiagnosticRequest;
64 } openxc_DiagnosticResponse_payload_t;
66 typedef struct _openxc_DiagnosticResponse {
77 bool has_negative_response_code;
78 uint32_t negative_response_code;
80 openxc_DiagnosticResponse_payload_t payload;
83 } openxc_DiagnosticResponse;
88 } openxc_RawMessage_data_t;
90 typedef struct _openxc_RawMessage {
96 openxc_RawMessage_data_t data;
99 typedef struct _openxc_TranslatedMessage {
101 openxc_TranslatedMessage_Type type;
104 bool has_string_value;
105 char string_value[100];
106 bool has_numeric_value;
107 double numeric_value;
108 bool has_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;
116 } openxc_TranslatedMessage;
118 typedef struct _openxc_ControlCommand {
120 openxc_ControlCommand_Type type;
121 bool has_diagnostic_request;
122 openxc_DiagnosticRequest diagnostic_request;
123 } openxc_ControlCommand;
125 typedef struct _openxc_VehicleMessage {
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;
136 /* Default values for struct fields */
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
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];
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