summaryrefslogtreecommitdiffstats
path: root/gen/cpp/openxc.pb.h
blob: 389c09c93c4e792e2a9e2eb415d77b1158c43aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/* Automatically generated nanopb header */
/* Generated by nanopb-0.2.4-dev at Wed Oct 23 08:59:20 2013. */

#ifndef _PB_OPENXC_PB_H_
#define _PB_OPENXC_PB_H_
#include <pb.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Enum definitions */
typedef enum _openxc_VehicleMessage_Type {
    openxc_VehicleMessage_Type_RAW = 1,
    openxc_VehicleMessage_Type_STRING = 2,
    openxc_VehicleMessage_Type_BOOL = 3,
    openxc_VehicleMessage_Type_NUM = 4,
    openxc_VehicleMessage_Type_EVENTED_NUM = 5,
    openxc_VehicleMessage_Type_EVENTED_STRING = 6,
    openxc_VehicleMessage_Type_EVENTED_BOOL = 7
} openxc_VehicleMessage_Type;

/* Struct definitions */
typedef struct _openxc_BooleanMessage {
    bool has_name;
    char name[100];
    bool has_value;
    bool value;
} openxc_BooleanMessage;

typedef struct _openxc_EventedBooleanMessage {
    bool has_name;
    char name[100];
    bool has_value;
    char value[100];
    bool has_event;
    bool event;
} openxc_EventedBooleanMessage;

typedef struct _openxc_EventedNumericMessage {
    bool has_name;
    char name[100];
    bool has_value;
    char value[100];
    bool has_event;
    double event;
} openxc_EventedNumericMessage;

typedef struct _openxc_EventedStringMessage {
    bool has_name;
    char name[100];
    bool has_value;
    char value[100];
    bool has_event;
    char event[100];
} openxc_EventedStringMessage;

typedef struct _openxc_NumericMessage {
    bool has_name;
    char name[100];
    bool has_value;
    double value;
} openxc_NumericMessage;

typedef struct _openxc_RawMessage {
    bool has_bus;
    int32_t bus;
    bool has_message_id;
    uint32_t message_id;
} openxc_RawMessage;

typedef struct _openxc_StringMessage {
    bool has_name;
    char name[100];
    bool has_value;
    char value[100];
} openxc_StringMessage;

typedef struct _openxc_VehicleMessage {
    bool has_type;
    openxc_VehicleMessage_Type type;
    bool has_raw_message;
    openxc_RawMessage raw_message;
    bool has_string_message;
    openxc_StringMessage string_message;
    bool has_numeric_message;
    openxc_NumericMessage numeric_message;
    bool has_boolean_message;
    openxc_BooleanMessage boolean_message;
    bool has_evented_string_message;
    openxc_EventedStringMessage evented_string_message;
    bool has_evented_boolean_message;
    openxc_EventedBooleanMessage evented_boolean_message;
    bool has_evented_numeric_message;
    openxc_EventedNumericMessage evented_numeric_message;
} openxc_VehicleMessage;

/* Default values for struct fields */

/* Field tags (for use in manual encoding/decoding) */
#define openxc_BooleanMessage_name_tag           1
#define openxc_BooleanMessage_value_tag          2
#define openxc_EventedBooleanMessage_name_tag    1
#define openxc_EventedBooleanMessage_value_tag   2
#define openxc_EventedBooleanMessage_event_tag   3
#define openxc_EventedNumericMessage_name_tag    1
#define openxc_EventedNumericMessage_value_tag   2
#define openxc_EventedNumericMessage_event_tag   3
#define openxc_EventedStringMessage_name_tag     1
#define openxc_EventedStringMessage_value_tag    2
#define openxc_EventedStringMessage_event_tag    3
#define openxc_NumericMessage_name_tag           1
#define openxc_NumericMessage_value_tag          2
#define openxc_RawMessage_bus_tag                1
#define openxc_RawMessage_message_id_tag         2
#define openxc_StringMessage_name_tag            1
#define openxc_StringMessage_value_tag           2
#define openxc_VehicleMessage_type_tag           1
#define openxc_VehicleMessage_raw_message_tag    2
#define openxc_VehicleMessage_string_message_tag 3
#define openxc_VehicleMessage_numeric_message_tag 4
#define openxc_VehicleMessage_boolean_message_tag 5
#define openxc_VehicleMessage_evented_string_message_tag 6
#define openxc_VehicleMessage_evented_boolean_message_tag 7
#define openxc_VehicleMessage_evented_numeric_message_tag 8

/* Struct field encoding specification for nanopb */
extern const pb_field_t openxc_VehicleMessage_fields[9];
extern const pb_field_t openxc_RawMessage_fields[3];
extern const pb_field_t openxc_StringMessage_fields[3];
extern const pb_field_t openxc_NumericMessage_fields[3];
extern const pb_field_t openxc_BooleanMessage_fields[3];
extern const pb_field_t openxc_EventedStringMessage_fields[4];
extern const pb_field_t openxc_EventedBooleanMessage_fields[4];
extern const pb_field_t openxc_EventedNumericMessage_fields[4];

/* Maximum encoded size of messages (where known) */
#define openxc_VehicleMessage_size               1180
#define openxc_RawMessage_size                   12
#define openxc_StringMessage_size                204
#define openxc_NumericMessage_size               111
#define openxc_BooleanMessage_size               104
#define openxc_EventedStringMessage_size         306
#define openxc_EventedBooleanMessage_size        206
#define openxc_EventedNumericMessage_size        213

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif