Skip to content

Commit b90d33d

Browse files
authored
Merge pull request #3 from sprintf/race-data-to-pits
lastest changes
2 parents c3ccb4e + 63fa4d2 commit b90d33d

File tree

3 files changed

+70
-9
lines changed

3 files changed

+70
-9
lines changed

car-data.proto

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/empty.proto";
4+
import "race-flag-status.proto";
5+
6+
option java_package = "com.normtronix.meringue";
7+
8+
// Car Data service provides an open api for retrieving a car's position in the race,
9+
// as well as other telemetry that is available
10+
service CarDataService {
11+
12+
rpc ping(google.protobuf.Empty) returns (google.protobuf.Empty);
13+
14+
rpc getCarData(CarDataRequest) returns (CarDataResponse);
15+
16+
rpc streamCarData(CarDataRequest) returns (stream CarDataResponse);
17+
18+
rpc getRaceField(RaceFieldRequest) returns (RaceFieldResponse);
19+
20+
}
21+
22+
message CarDataRequest {
23+
string trackCode = 1;
24+
string carNumber = 2;
25+
}
26+
27+
message CarDataResponse {
28+
string carNumber = 1;
29+
int64 timestamp = 2;
30+
RaceFlagStatus flagStatus = 3;
31+
int32 lapCount = 4;
32+
int32 position = 5;
33+
int32 positionInClass = 6;
34+
float lastLapTime = 7;
35+
string gap = 8;
36+
int32 coolantTemp = 9;
37+
int32 fuelRemainingPercent = 10;
38+
string driverMessage = 11;
39+
string carAhead = 12;
40+
string carBehind = 13;
41+
int32 fastestLap = 14;
42+
float fastestLapTime = 15;
43+
}
44+
45+
message RaceFieldRequest {
46+
string trackCode = 1;
47+
}
48+
49+
message RaceFieldResponse {
50+
repeated RaceParticipant participants = 1;
51+
}
52+
53+
message RaceParticipant {
54+
string carNumber = 1;
55+
string teamName = 2;
56+
}
57+

lemon-pi.proto

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
syntax = "proto3";
22

33
import "google/protobuf/empty.proto";
4+
import "race-flag-status.proto";
45

56
option java_package = "com.normtronix.meringue";
67

@@ -59,15 +60,6 @@ message DriverMessage {
5960

6061
}
6162

62-
enum RaceFlagStatus {
63-
UNKNOWN = 0;
64-
GREEN = 1;
65-
YELLOW = 2;
66-
RED = 3;
67-
BLACK = 4;
68-
FINISH = 5;
69-
}
70-
7163
// the race status. Only sent when it changes
7264

7365
message RaceStatus {

race-flag-status.proto

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto3";
2+
3+
option java_package = "com.normtronix.meringue";
4+
5+
enum RaceFlagStatus {
6+
UNKNOWN = 0;
7+
GREEN = 1;
8+
YELLOW = 2;
9+
RED = 3;
10+
BLACK = 4;
11+
FINISH = 5;
12+
}

0 commit comments

Comments
 (0)