-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrip.avdl
61 lines (47 loc) · 1.41 KB
/
trip.avdl
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
@namespace("v0.1-example")
/*
* Example protocol definition for a fitness or hiking app where you that
* allows you to record the start and end of your trip.
* Exercise: Add a new file 'waypoint.avdl' that models annotating places
* along the way.
*/
protocol Trip {
enum TripType {
Hiking,
Biking
} = Hiking;
enum GeomType {
Point,
Polygon
} = Point;
/** Trip start message. */
record TripStart {
/** 'trip_start' */
string name;
/** Timestamp in ISO 8601 format, UTC */
string timestamp;
/* Could also be: Milliseconds since unix epoch, UTC. */
/* timestamp_ms timestamp; */
/** Trip ID, .e.g '06.1.2024'. */
string trip_id;
/** Hiking or biking? */
TripType trip_type;
/** Number of travellers */
int num_travellers;
/** Location where you started. geoJSON geometry type. Typically a
* Point but could also be a Polygon. */
GeomType coord_type;
/** geoJSON geometry coordinates, 1 element for Point, at least 4
* points for Polygon. */
array<array<double>> coordinates;
}
/** Trip end message. */
record TripEnd {
/** 'trip_end' */
string name;
/** Timestamp in ISO 8601 format, UTC */
string timestamp;
/** Trip ID, .e.g '06.1.2024'. */
string trip_id;
}
}