-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.proto
162 lines (126 loc) · 3.89 KB
/
input.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
//package hello;
import "matrix.proto";
option java_package = "com.hello.suripu.api.input";
option java_outer_classname = "InputProtos";
// option optimize_for = SPEED;
message SensorSampleBatch {
message SensorSample {
enum SensorType {
AMBIENT_TEMPERATURE = 0;
AMBIENT_HUMIDITY = 1;
AMBIENT_LIGHT = 2;
AMBIENT_DECIBELS = 3;
AMBIENT_AIR_QUALITY = 4;
GPS = 5;
PHONE_ACCELERATION = 6;
PHONE_STEP_COUNT = 7;
}
optional SensorType sensor_type = 1;
optional int32 timestamp = 2;
optional bytes value = 3;
}
repeated SensorSample samples = 1;
optional string device_id = 2;
}
message MotionSensorBatch {
enum Manufacturer {
HELLO = 0;
}
message MotionSensor {
optional int64 timestamp = 1;
optional int32 value = 2;
}
optional Manufacturer manufacturer = 1;
repeated MotionSensor samples = 2;
}
message TrackerDataBatch {
message TrackerData {
optional string tracker_id = 1; // Do you think this is a good idea?
optional int64 timestamp = 2;
optional int32 offset_millis = 3;
optional int32 svm_no_gravity = 4;
}
repeated TrackerData samples = 1;
}
message SimpleSensorBatch {
message GpsInfo {
optional float latitude = 1;
optional float longitude = 2;
optional float accuracy = 3;
optional float speed = 4;
optional string provider = 5;
}
message SimpleSensorSample {
optional int64 timestamp = 1;
optional float ambient_temperature = 2; // deprecated
optional float ambient_humidity = 3; // deprecated
optional float ambient_light = 4; // deprecated
optional float ambient_decibels = 5;
optional float ambient_air_quality = 6; // deprecated
optional bytes device_data = 7; //
optional bytes device_data_signature = 8;
optional float sound_amplitude = 9;
optional GpsInfo gps = 10;
optional int32 offset_millis = 11;
}
optional string device_id = 1;
repeated SimpleSensorSample samples = 2;
}
message ActivationRequest {
optional string device_id = 1;
optional string account_id = 2;
optional int64 timestamp = 3;
optional string firmware_version = 4;
optional bytes signature = 5;
}
message ActivationResponse {
optional bool success = 1;
// TODO: do we need retry / rate-limiting exposed here?
// TODO: do we need another proof?
}
message SyncRequest {
optional string device_id = 1; // deprecated
optional string firmware_version = 2;
optional bytes signature = 3;
optional string something = 4;
}
// TODO:
message PillData {
optional string pill_id = 1;
optional string account_id = 2;
optional bytes data = 3;
}
// pill data msg in Kinesis
message PillDataKinesis {
optional string pill_id = 1;
optional string account_id = 2;
optional int64 timestamp = 3;
optional int64 value = 4; // data in milli-g
optional int32 offsetMillis = 5;
optional bytes encryptedData = 6;
optional int32 batteryLevel = 7;
optional int32 firmwareVersion = 8;
optional int64 pillIdLong = 9;
optional int64 accountIdLong = 10;
optional int32 upTime = 11;
}
message PillBlobHeader {
optional string first_sequence_number = 1;
optional string last_sequence_number = 2;
optional string first_sample_date = 3;
optional string last_sample_date = 4;
optional bytes compressed_bitmap_account_ids = 5;
optional string data_file_name = 6;
optional int32 num_items = 7;
}
message PillBlob {
repeated PillData items = 1;
}
message EventBatch{
message EventItem {
optional int64 start_timestamp = 1;
optional int64 end_timestamp = 2;
optional int32 offsetMillis = 3;
}
repeated EventItem events = 1;
}