aboutsummaryrefslogtreecommitdiff
path: root/src/main/proto/DolphinMessages.proto
blob: 8d648592d3ccca087c808b60f0216d9bb08148d1 (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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
syntax = "proto3";

package org.traccar.protobuf.dolphin.Messages;
option go_package = "dolphindevice";

import "DolphinConfig.proto";

// begin: Messages - defs ---------------------
enum MessageType {
	Timeout = 0;								/* Reserved for embedded system */
	
	DataPack_Request = 1;
	DataPack_Response = 2;

	Authentication_Request = 7;
	Authentication_Response = 8;
	
	OnlinePosition_Request = 9;

	/* Config messages */
	Config_Set_Request = 10;				/* Set configuration - from server */
	Config_Set_Response = 11;				/* Setting configuration ok - from device */
	Config_Get_Request = 12;				/* Get configuration from device - from server */
	Config_Get_Response = 13;				/* Packet has config data - from device */
	Config_Diff_Request = 14;				/* Configuration diff message - from server */
	Config_Diff_Response = 15;				/* Configuration diff response - from device */

	Config_SSLSetCertificate_Request = 16;
	Config_SSLSetCertificate_Response = 17;
	Config_SSLGetStatus_Request = 18;
	Config_SSLGetStatus_Response = 19;

	/* Firmware update */
	Firmware_Info_Request = 20;				/* from device */
	Firmware_Info_Response = 21;			/* from server */
	Firmware_Update_Start_Request = 22;		/* Starting firmware update - from server */
	Firmware_Update_Start_Response = 23;	/* Starting firmware update is ok - from device */
	Firmware_GetPack_Request = 24;			/* Packet get message - from device */
	Firmware_GetPack_Response = 25;			/* Pachet get response - from server */
	Firmware_Update_State = 26;				/* Update state - from device */

	/* Connection messages */
	Ping = 30;
	Pong = 31;
	Log_Start = 32;
	Log_End = 33;
	Log_Pack = 34;
	DeviceInfo_Request = 35;
	DeviceInfo_Response = 36;

	// Sensors
	Temperature_Request = 40;
	Temperature_Response = 41;

	TiltStatus_Request = 42;
	TiltStatus_Data = 43;

	// Commands
	Command_Request = 60;
	Command_Response = 61;

	// USSD Data
	USSDData_Request = 68;
		
	// Expansion Board
	ExpBoard_Data_Request = 70;
	ExpBoard_Data_Response = 71;
	ExpBoard_SetDigital_Request = 72;
	ExpBoard_SetDigital_Response = 73;

	// FMS Data
	FMS_DataLog_Start = 80;
	FMS_DataLog_End = 81;
	FMS_DataLog_Data = 82;

	// Crash Data
	Crash_Data_Request = 90;
	Crash_Data_Response = 91;

	// SIPAAD
	SIPAAD_SSL_GetStatus_Request = 100;
	SIPAAD_SSL_GetStatus_Response = 101;

	// DiagnosticsTroubleCodes
	DiagnosticsTroubleCodes_SaveCodes_Request = 110;
	DiagnosticsTroubleCodes_SaveCodes_Response = 111;
}

enum MessageFlags {
	Flag_None = 0;
	Flag_Compressed = 0x01;
}

// end: Messages defs   -------------------

// begin: Point - Statistics defs ---------------------
message IOData {
	Config.AlarmType ID = 1;
	uint64 Value = 2;
}

message DataPoint {
	float Latitude = 1;
	float Longitude = 2;
	float Altitude = 3;
	uint32 Satellites = 4;
	float Speed = 5;
	float Bearing = 6;
	uint32 HDOP = 7;
	fixed32 Timestamp = 8;
	Config.AlarmType Alarm = 9;

	// repeated IOData IO = 10 [deprecated = true];

	// Netw protocol IO
	repeated Config.AlarmType IOList_ID = 11;
	repeated uint64 IOList_Value = 12;
}

message DataPackRequest {
	repeated DataPoint Points = 1;
}

enum DataPackResponseCode {
	DataPack_Timeout = 0;
	DataPack_OK = 1;
	DataPack_UnknownError = 2;
	DataPack_Decode_Error = 3;
}

message DataPackResponse {
	DataPackResponseCode Response = 1;
}

// end: Point defs   -------------------

// Serial port --------------------
message DeviceInfo {
	string Name = 1;
	fixed64 IMEI = 2;
	string FirmwareVersion = 3;

	// System info
	fixed32 RTCTimestamp = 10;
	fixed32 LastStartTimestamp = 11;
	uint32 UpTime = 12;
	uint32 TotalUpTime = 13;
	
	// GNSS
	GNSSStatus GNSS_Status = 20;
	bool GNSS_Fix = 21;
	uint32 GNSS_TimeToFirstFix = 22;
	uint32 GNSS_TimeToLastFix = 23;
	uint32 GNSS_Packets = 25;
	float GNSS_Latitude = 26;
	float GNSS_Longitude = 27;
	uint32 GNSS_Altitude = 28;
	uint32 GNSS_Speed = 29;
	uint32 GNSS_Bearing = 30;
	uint32 GNSS_HDOP = 31;
	uint32 GNSS_PDOP = 32;
	uint32 GNSS_SatsInUse = 33;
	uint32 GNSS_GPSSats = 34;
	uint32 GNSS_GLONASSSats = 35;
	uint32 GNSS_GalileoSats = 36;
	uint32 GNSS_BeidouSats = 37;
	GNSS_JammingStatus GNSS_JammingStatus = 38;

	// GSM
	ModemStatus GSM_ModemStatus = 50;
	SIMStatus GSM_SIMStatus = 52;
	bool GSM_GPRSStatus = 53;
	string GSM_OperatorName = 54;
	uint32 GSM_OperatorCode = 55;
	uint32 GSM_LocationAreaCode = 56;
	uint32 GSM_CellID = 57;
	uint32 GSM_SignalStrength = 58;
	bool GSM_Jamming = 59;

	uint32 GSM_Records_SentCount = 60;
	uint32 GSM_Records_LastSentTime = 61;
	uint32 GSM_Records_LastServerResponseTime = 62;
	uint32 GSM_Records_Count = 63;

	uint32 GSM_GPRS_SentData = 65;
	uint32 GSM_GPRS_ReceivedData = 66;
	
	uint32 GSM_SMS_Sent = 69;
	uint32 GSM_SMS_Received = 70;

	bool GSM_Socket_State = 75;

	// Bluetooth
	BluetoothStatus Bluetooth_Status = 80;
	string Bluetooth_Name = 81;
	string Bluetooth_MAC = 82;
	bool Bluetooth_DataLink_ConnectStatus = 83;
	string Bluetooth_DataLink_Name = 84;
	string Bluetooth_DataLink_MAC = 85;
	BluetoothExtDeviceStatus Bluetooth_ExtDevice_Status = 86;
	string Bluetooth_ExtDevice_Name = 87;
	string Bluetooth_ExtDevice_MAC = 88;
	
	// IO
	repeated Config.AlarmType IOList_ID = 100;
	repeated uint64 IOList_Value = 101;
}

enum GNSSStatus {
	GNSS_Off = 0;
	GNSS_NotFixed = 1;
	GNSS_Fixed = 2;
	GNSS_Sleep = 3;
}

enum GNSS_JammingStatus {
	GNSS_UnknownJammingStatus = 0;
	GNSS_NoJamming = 1;
	GNSS_JammingWarning = 2;
	GNSS_JammingCritical = 3;
}

enum ModemStatus {
	ModemStatus_Off = 0;
	ModemStatus_NotRegistered = 1;
	ModemStatus_Searching = 2;
	ModemStatus_Registered = 3;
	ModemStatus_Roaming = 4;
}

enum SIMStatus {
	SIM_NotInserted = 0;
    SIM_Ready = 1;
    SIM_PIN_REQ = 2;
    SIM_PUK_REQ = 3;
    SIM_PH_PIN_REQ = 4;
    SIM_PH_PUK_REQ = 5;
    SIM_PIN2_REQ = 6;
    SIM_PUK2_REQ = 7;
    SIM_Busy = 8;
    SIM_NotReady = 9;
    SIM_Unspecified = 10;
}

enum BluetoothStatus {
	BL_Off = 0;
	BL_OnHidden = 1;
	BL_OnVisible = 2;
}

enum BluetoothExtDeviceStatus {
	BLExt_None = 0;
	BLExt_Scanning = 1;
	BLExt_Pairing = 2;
	BLExt_WaitForPair = 3;
	BLExt_Connecting = 4;
	BLExt_Connected = 5;
}

// --------------------------------

// Config ------------------------
enum ConfigResponseCode {
	OK = 0;
	Unknown_Error = 1;		/* Config error - from device */
	Protocol_Error = 2;		/* Config message protocol error - from device */
	Store_Error = 3;		/* Config store error - from device */
	Wrong_Password = 4;		/* Configuration password is wrong */
}

message ConfigSetRequest {
	string Password = 1;
	Config.Config Configuration = 2;
}

message ConfigSetResponse {
	ConfigResponseCode Response = 1;
}

message ConfigGetRequest {
	string Password = 1;
}

message ConfigGetResponse {
	ConfigResponseCode Response = 1;
	Config.Config Data = 2;
}

message ConfigDiffRequest {
	string Password = 1;
	Config.ConfigDiff ConfigDiff = 2;
}

// ----------------------------------

// Firmware update ---------------------
message FirmwareUpdateInfo_Request {
	string Channel = 1;
	uint32 HardwareVersion = 2;

	string Device_Version_Name = 10;
	uint32 Device_Version_Major = 11;
	uint32 Device_Version_Minor = 12;
	uint32 Device_Version_Revision = 13;
}

message FirmwareUpdateInfo_Response {
	string Version_Name = 1;
	uint32 Version_Major = 2;
	uint32 Version_Minor = 3;
	uint32 Version_Revision = 4;
	// Firmware ID
	uint32 FirmwareID = 5;
	// Firmware file total size in bytes
	uint32 TotalSize = 6;
}

enum FURespCode {
	FU_NONE = 0;						// Reserved for embedded system
	
	FU_UPDATE_START_OK = 1;
	FU_UPDATE_START_ERROR = 2;
	FU_UPDATE_START_ERROR_SIZE = 3;

	FU_GETPACK_OK = 4;
	FU_GETPACK_ERROR = 5;
	
	FU_UPDATE_STATE_INSTALLING = 6;
	FU_UPDATE_STATE_FINISHED = 7;
	FU_UPDATE_STATE_ERROR = 8;
	FU_UPDATE_STATE_ERROR_INVALID = 9;
	FU_UPDATE_STATE_ERROR_CRC = 10;
}

message  FirmwareUpdateResp {
	uint32 FirmwareID = 1;
	FURespCode Response = 2;

	string Firmware_Version_Name = 3;
	uint32 Firmware_Version_Major = 4;
	uint32 Firmware_Version_Minor = 5;
	uint32 Firmware_Version_Revision = 6;
}

message FUStartData {
	// Firmware ID
	uint32 FirmwareID = 1;
	// Firmware file total size in bytes
	uint32 TotalSize = 2;
}

message FUPackRequest {
	uint32 FirmwareID = 1;
	uint32 Start = 2;
	uint32 End = 3;
}

message FUPacket {
	uint32 FirmwareID = 1;
	FURespCode Response = 2;
	uint32 Start = 3;
	uint32 End = 4;
	bytes Data = 5;
}

// Log messages -----------------
enum LogLevel {
	LOG_LEVEL_NONE = 0;
	LOG_LEVEL_FATAL = 0x01;
	LOG_LEVEL_ERROR = 0x02;
	LOG_LEVEL_WARN = 0x04;
	LOG_LEVEL_INFO = 0x08;
	LOG_LEVEL_DEBUG = 0x10;
}

message LogMessage {
	fixed32 UnixTimestamp = 1;
	LogLevel Level = 2;
	string Message = 3;
}

message LogPack {
	repeated LogMessage Messages = 1;
}

message LogStart {
	LogLevel Level = 1;
}

// FMS -------------------------------------
message FMSData {
	repeated uint32 PGN_Id_List = 1;
	repeated uint64 PGN_Value_List = 2;
}

// System ----------------------------------
enum SystemResetType {
	SystemReset_PowerOn = 0;
	SystemReset_Sleep = 1;
	SystemReset_HardFault = 2;
	SystemReset_WatchDog = 3;
	SystemReset_FirmwareUpdate = 4;
	SystemReset_User = 5;
}


// Authenticate -----------------------
message AuthenticateRequest {
	string Code = 1;
}

enum AuthenticateResponseCode {
	Authenticate_Invalid = 0;
	Authenticate_Valid = 1;
}

message AuthenticateResponse {
	AuthenticateResponseCode Code = 1;
}

// Commands ---------------------------
message CommandRequest {
	string Command = 1;
}

message CommandResponse {
	string Response = 1;
}


message USSDData{
	uint32 ID = 1;
	string USSDCode = 2;
	string USSDResponse = 3;
	uint32 Timestamp = 4;
	bool ResponseStatus = 5;
}

// Crash
message CrashAccelData {
	uint64 Timestamp = 1;
	sint32 X = 2;
	sint32 Y = 3;
	sint32 Z = 4;
}

message CrashData {
	uint32 Timestamp = 1;
	uint32 Level = 2;
	repeated CrashAccelData AccelData = 3;
	repeated DataPoint PointData = 4;
}

message CrashDataResponse {
	CrashDataResponseCode Code = 1;
}

enum CrashDataResponseCode {
	CrashData_Error = 0;
	CrashData_OK = 1;
}

// Diagnostics Trouble Codes ----------
enum DTCResposneCode {
	DTC_RESPOSNE_NONE = 0;
	DTC_RESPOSNE_ERROR = 1;
	DTC_RESPOSNE_OK = 2;
}

message DTCResposne {
	DTCResposneCode DTCResposneCode = 1;
}

message DTCRequest {
	repeated DTCRecord DTCRecords = 1;
}

message DTCRecord {
	repeated DTCCode DTCCodes = 1;
	uint32 Timestamp = 2;

	// OBD Lamp status
	bool OBD_MalfunctionIndicatorLamp = 3;

	// FMS Lamp Status
	uint32 FMS_ProtectLamp = 4;
	uint32 FMS_AmberWarningLamp = 5;
	uint32 FMS_RedStopLamp = 6;
	uint32 FMS_MalfunctionIndicatorLamp = 7;

	uint32 FMS_SAELamp1 = 8;
	uint32 FMS_SAELamp2 = 9;
	uint32 FMS_SAELamp3 = 10;
	uint32 FMS_SAELamp4 = 11;
}

message DTCCode {
	DTCType DTCType = 1;
	uint32 Code = 2;
	uint32 Reason = 3;
	uint32 OccurrenceCount = 4;
	uint32 Source = 5;
}

enum DTCType {
	OBD_STORED_DTC = 0;
	OBD_PENDING_DTC = 1;
	OBD_PERMANENT_DTC = 2;
	FMS_DTC = 3;
	SCANIA_DTC = 4;
}