forked from openxc/openxc-message-format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openxc.proto
175 lines (149 loc) · 3.76 KB
/
openxc.proto
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
syntax = "proto3";
package openxc;
option java_package = "com.openxc";
option java_outer_classname = "BinaryMessages";
message VehicleMessage {
enum Type { UNUSED = 0; CAN = 1; SIMPLE = 2; DIAGNOSTIC = 3; CONTROL_COMMAND = 4;
COMMAND_RESPONSE = 5; }
Type type = 1;
CanMessage can_message = 2;
SimpleMessage simple_message = 3;
DiagnosticResponse diagnostic_response = 4;
ControlCommand control_command = 5;
CommandResponse command_response = 6;
uint64 timestamp = 7;
}
message CanMessage {
enum FrameFormat {
UNUSED = 0;
STANDARD = 1;
EXTENDED = 2;
}
int32 bus = 1;
uint32 id = 2;
bytes data = 3;
FrameFormat frame_format = 4;
}
message ControlCommand {
enum Type {
UNUSED = 0;
VERSION = 1;
DEVICE_ID = 2;
DIAGNOSTIC = 3;
PASSTHROUGH = 4;
ACCEPTANCE_FILTER_BYPASS = 5;
PAYLOAD_FORMAT = 6;
PREDEFINED_OBD2_REQUESTS = 7;
MODEM_CONFIGURATION = 8;
RTC_CONFIGURATION = 9;
SD_MOUNT_STATUS = 10;
PLATFORM = 11;
}
Type type = 1;
DiagnosticControlCommand diagnostic_request = 2;
PassthroughModeControlCommand passthrough_mode_request = 3;
AcceptanceFilterBypassCommand acceptance_filter_bypass_command = 4;
PayloadFormatCommand payload_format_command = 5;
PredefinedObd2RequestsCommand predefined_obd2_requests_command = 6;
ModemConfigurationCommand modem_configuration_command = 7;
RTCConfigurationCommand rtc_configuration_command = 8;
}
message DiagnosticControlCommand {
enum Action { UNUSED = 0; ADD = 1; CANCEL = 2; }
DiagnosticRequest request = 1;
Action action = 2;
}
message PassthroughModeControlCommand {
int32 bus = 1;
bool enabled = 2;
}
message AcceptanceFilterBypassCommand {
int32 bus = 1;
bool bypass = 2;
}
message PayloadFormatCommand {
enum PayloadFormat {
UNUSED = 0;
JSON = 1;
PROTOBUF = 2;
MESSAGEPACK = 3;
}
PayloadFormat format = 1;
}
message PredefinedObd2RequestsCommand {
bool enabled = 1;
}
message NetworkOperatorSettings {
enum OperatorSelectMode {
AUTOMATIC = 0;
MANUAL = 1;
DEREGISTER = 2;
SET_ONLY = 3;
MANUAL_AUTOMATIC = 4;
}
message NetworkDescriptor {
enum NetworkType {
GSM = 0;
UTRAN = 2;
}
uint32 PLMN = 1;
NetworkType networkType = 2;
}
bool allowDataRoaming = 1;
OperatorSelectMode operatorSelectMode = 2;
NetworkDescriptor networkDescriptor = 3;
}
message NetworkDataSettings {
string apn = 1;
}
message ServerConnectSettings {
string host = 1;
uint32 port = 2;
}
message ModemConfigurationCommand {
NetworkOperatorSettings networkOperatorSettings = 1;
NetworkDataSettings networkDataSettings = 2;
ServerConnectSettings serverConnectSettings = 3;
}
message RTCConfigurationCommand {
uint32 unix_time = 1;
}
message CommandResponse {
ControlCommand.Type type = 1;
string message = 2;
bool status = 3;
}
message DiagnosticRequest {
enum DecodedType { UNUSED = 0; NONE = 1; OBD2 = 2; }
int32 bus = 1;
uint32 message_id = 2;
uint32 mode = 3;
uint32 pid = 4;
bytes payload = 5;
bool multiple_responses = 6;
double frequency = 7;
string name = 8;
DecodedType decoded_type = 9;
}
message DiagnosticResponse {
int32 bus = 1;
uint32 message_id = 2;
uint32 mode = 3;
uint32 pid = 4;
bool success = 5;
uint32 negative_response_code = 6;
bytes payload = 7;
DynamicField value = 8;
}
message DynamicField {
enum Type { UNUSED = 0; STRING = 1; NUM = 2; BOOL = 3; }
Type type = 1;
string string_value = 2;
double numeric_value = 3;
bool boolean_value = 4;
}
message SimpleMessage {
string name = 1;
DynamicField value = 2;
DynamicField event = 3;
}