blob: 0b02cbbcfadc140e5710938bdc78e2c4c5d06d3a (
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
|
// @file sns_diag.proto
//
// Defines log messages used by the sensors diag service
//
// Copyright (c) 2016-2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
syntax = "proto2";
import "nanopb.proto";
import "sns_std.proto";
import "sns_std_sensor.proto";
import "sns_client.proto";
// Batch Sample Type
enum sns_diag_batch_sample_type
{
option (nanopb_enumopt).long_names = false;
// This is the only sample in the batch
SNS_DIAG_BATCH_SAMPLE_TYPE_ONLY = 0;
// This is the first sample of the batch
SNS_DIAG_BATCH_SAMPLE_TYPE_FIRST = 1;
// This is an intermediate sample of the batch
SNS_DIAG_BATCH_SAMPLE_TYPE_INTERMEDIATE = 2;
// This is the last sample of the batch
SNS_DIAG_BATCH_SAMPLE_TYPE_LAST = 3;
}
// Sensor Interrupts
enum sns_diag_interrupt
{
option (nanopb_enumopt).long_names = false;
// Interrupt caused by detection of a threshold being
// exceeded
SNS_DIAG_INTERRUPT_THRESHOLD = 0;
// Interrupt caused by detection of movement of the device
SNS_DIAG_INTERRUPT_MOTION = 1;
// Interrupt caused by detection of tilting of the device
SNS_DIAG_INTERRUPT_TILT = 2;
// Interrupt caused by detection of free fall
SNS_DIAG_INTERRUPT_FREE_FALL = 3;
// Interrupt caused by detection of double-tap
SNS_DIAG_INTERRUPT_DOUBLE_TAP= 4;
// Interrupt caused by detection of acceleration shock
SNS_DIAG_INTERRUPT_SHOCK = 5;
// Interrupt caused by CCD AMD
SNS_DIAG_INTERRUPT_CCD_AMD = 6;
// Interrupt caused by CCD WALK
SNS_DIAG_INTERRUPT_CCD_WALK = 7;
// Interrupt caused by CCD TILT
SNS_DIAG_INTERRUPT_CCD_TILT = 8;
// Interrupt caused by CCD TE0
SNS_DIAG_INTERRUPT_CCD_TE0 = 9;
// Interrupt caused by CCD TE1
SNS_DIAG_INTERRUPT_CCD_TE1 = 10;
// Interrupt caused by CCD TE2
SNS_DIAG_INTERRUPT_CCD_TE2 = 11;
}
// Opaque Payload
// This message defines the fields used to log an undefined payload
message sns_diag_opaque_payload
{
required bytes payload = 1;
}
// Batch Sample
// This message defines the fields used to log batched data.
message sns_diag_batch_sample
{
// Indicates if the sample is the first, intermediate, last or only
// sample of a batch
required sns_diag_batch_sample_type sample_type = 1 [default = SNS_DIAG_BATCH_SAMPLE_TYPE_ONLY];
// Timestamp of the sensor state data sample
required fixed64 timestamp = 2;
// Sensor state data sample
repeated float sample = 3;
// Data status.
required sns_std_sensor_sample_status status = 4 [default = SNS_STD_SENSOR_SAMPLE_STATUS_UNRELIABLE];
}
// Sensor State Hardware Interrupt Log Packet
// This message defines the fields used to log sensor state information
// pertaining to hardware interrupts
// This message is used as the payload field of sns_diag_sensor_log
message sns_diag_sensor_state_interrupt
{
// Type of sensor hardware interrupt
required sns_diag_interrupt interrupt = 1;
// Timestamp when the interrupt occurred
required fixed64 timestamp = 2;
}
// Sensor State Raw
// This message defines the fields used to log sensor state information
// pertaining to raw uncalibrated physical sensor data.
// This message is used as the payload field of sns_diag_sensor_log
message sns_diag_sensor_state_raw
{
repeated sns_diag_batch_sample sample = 1;
}
// Client API Response Message
message sns_diag_client_resp_msg
{
// The error response sent to the client
required sns_std_error error = 1;
}
// Client API log packet
// This message defines the fields to log all
// Request, Response and Event messages at the Client API
// This message is used as the payload field of sns_diag_sensor_log
message sns_diag_client_api_log
{
// The client id that identifies the client connection
required fixed64 client_id = 1;
// Data type of the source sensor
required string src_sensor_type = 2;
// The Client API log packet payload
oneof client_api_log_payload
{
// Client API Request message as defined in sns_client.proto
sns_client_request_msg request_payload = 100;
// Client API Event message as defined in sns_client.proto
sns_client_event_msg event_payload = 101;
// Client API Response message as defined in sns_diag.proto
sns_diag_client_resp_msg resp_payload = 102;
}
}
// Sensor API log packet
// This message defines the fields to log all Request and
// Event messages at the Sensor API
// This message is used as the payload field of sns_diag_sensor_log
message sns_diag_sensor_api_log
{
// The message id of the message being logged
required fixed32 message_id = 1;
// Timestamp associated with this message
required fixed64 timestamp = 2;
// Data stream associated with this message
optional fixed64 stream_id = 3;
// The Sensor API log packet payload
oneof sensor_api_log_payload
{
// Sensor API Event message containing sensor specific event message
// as defined in the sensor's proto api file
sns_diag_opaque_payload opaque_payload = 100;
// Sensor API Request message as defined in sns_std.proto
sns_std_request request_payload = 101;
}
}
// Sensor log packet
// This message defines the fields to log all sensor specific
// messages. This includes Sensor API messages, Client API messages,
// HW Interrupt messages, Sensor State messages
message sns_diag_sensor_log
{
// Log ID for the log packet
required fixed32 log_id = 1;
// Timestamp when log packet.was generated
required fixed64 timestamp = 2;
// Sensor UID for the log packet
required sns_std_suid suid = 3;
// Data type provided by the Sensor UID
required string sensor_type = 4;
// The instance id of the sensor to which this
// message was passed to or obtained from
required fixed64 instance_id = 5;
// The log packet payload
oneof sensor_log_payload
{
// Sensor specific Sensor State Algo message
sns_diag_opaque_payload opaque_payload = 100;
// Sensor API message
sns_diag_sensor_api_log sensor_api_payload = 101;
// Client API message
sns_diag_client_api_log client_api_payload = 102;
// Sensor State Raw message
sns_diag_sensor_state_raw sensor_state_raw_payload = 103;
// Sensor State Hardware Interrupt message
sns_diag_sensor_state_interrupt sensor_state_interrupt_payload = 104;
}
}
// Sensor Instance Mapping Log Packet
// This message defines the fields used to log sensor instance mapping
// information. This message is used as the payload field of sns_diag_fw_log
message sns_diag_instance_map_log
{
// The instance id of the source sensor instance
required fixed64 src_instance_id = 1;
// Array of destination Sensor Instance IDs or Sensor IDs that the
// source sensor instance is feeding to.
// If no destination instance ids are specified it signifies
// deletion of the source instance
repeated fixed64 dest_instance_id = 2;
// Array of data stream ids that the
// source sensor instance is feeding to
repeated fixed64 stream_id = 3;
}
// Island mode states
enum sns_diag_island_state
{
option (nanopb_enumopt).long_names = false;
// In Island mode
SNS_DIAG_ISLAND_STATE_IN_ISLAND_MODE = 0;
// Not in Island Mode
SNS_DIAG_ISLAND_STATE_NOT_IN_ISLAND_MODE = 1;
// Island mode disabled
SNS_DIAG_ISLAND_STATE_ISLAND_DISABLED = 2;
}
// Island mode transition Log Packet
// This message defines the fields used to log
// transitions into and out of island mode
//
// This log packet is generated each time the system transitions into or out
// of island mode or when island mode is disabled or when triggered by
// a request to the diag sensor
//
// This message is used as the payload field of sns_diag_fw_log
message sns_diag_island_transition_log
{
// Timestamp of the transition
//
// When logpacket is triggered, this timestamp will retain
// the timestamp when the current state became effective.
required fixed64 timestamp = 1;
// Island state after transition is completed
required sns_diag_island_state island_state = 2;
// User defined cookie
// Used by test scripts to identify logs triggered
// by messages sent to the SSC
optional fixed64 cookie = 3;
// Total time system spent in island since device boot(micro seconds)
optional fixed64 total_island_time = 4;
}
// Island exit vote Log Packet
// This message defines the fields used to log vote for island mode exits.
//
// This log packet is generated at each call to island_exit()
message sns_diag_island_exit_vote_log
{
// Timestamp
required fixed64 timestamp = 1;
// SUID of the Sensor responsible for the vote
optional sns_std_suid sensor = 2;
}
// Heap IDs
enum sns_diag_heap_id
{
option (nanopb_enumopt).long_names = false;
// Primary Heap
SNS_DIAG_HEAP_ID_HEAP_MAIN = 0;
// Island Heap
SNS_DIAG_HEAP_ID_HEAP_ISLAND = 1;
// PRAM Heap
SNS_DIAG_HEAP_ID_HEAP_PRAM = 2;
// EVENT Heap
SNS_DIAG_HEAP_ID_HEAP_EVENT = 3;
// BATCH Heap
SNS_DIAG_HEAP_ID_HEAP_BATCH = 4;
// Event buffer
SNS_DIAG_HEAP_ID_EVENT_BUFFER = 100;
}
// Memory status Log Packet
// This message defines the fields used to log the memory utilization
// This log packet is generated when a request is sent to the diag sensor
message sns_diag_mem_utilization_log
{
// Timestamp
required fixed64 timestamp = 1;
// Heap ID
required sns_diag_heap_id heap_id = 2;
// Total Memory
required fixed32 total_memory = 3;
// Used Memory
required fixed32 used_memory = 4;
// User defined cookie
// Used by test scripts to identify logs triggered
// by messages sent to the SSC
optional fixed64 cookie = 5;
}
// Event Service status Log Packet
// This message defines the fields used to log the memory utilization and
// other statistics from the Event Service.
// Used only for SW debug; *not guaranteed to be backward compatible*
// This log packet is generated when a request is sent to the diag sensor
message sns_diag_event_service_log
{
// Timestamp
required fixed64 timestamp = 1;
// User defined cookie
// Used by test scripts to identify logs triggered
// by messages sent to the SSC
optional fixed64 cookie = 2;
message heap_stats
{
enum sns_event_service_heap_id
{
SNS_EVENT_SERVICE_HEAP_ID_ISLAND = 0;
SNS_EVENT_SERVICE_HEAP_ID_MAIN = 1;
}
// Heap ID
required sns_event_service_heap_id heap_id = 1;
// Total memory available in heap (in blocks)
required fixed32 total_memory = 2;
// Current memory consumption (in blocks)
required fixed32 used_memory = 3;
// Maximum memory consumption since last log packet (in blocks)
required fixed32 max_memory = 4;
// Total clusters available
required fixed32 total_clusters = 5;
// Current number of clusters in use
required fixed32 used_clusters = 6;
// Maximum in-use clusters since last log packet
required fixed32 max_clusters = 7;
// Number of allocation failues since the last DIAG log packet
// If Island will result in island exit; else causes dropped samples
required fixed32 alloc_failures = 8;
// Largest event allocation since the last DIAG log packet (in bytes)
required fixed32 max_size = 9;
}
repeated heap_stats stats = 3;
}
// Framework log packet
// This message defines the fields to log all framework messages. This
// includes memory, island, instance mapping messages.
message sns_diag_fw_log
{
// Log ID for the log packet
required fixed32 log_id = 1;
// Timestamp when log packet.was generated
required fixed64 timestamp = 2;
// The log packet payload
oneof fw_log_payload
{
// Sensor Instance Map message
sns_diag_instance_map_log instance_map_payload = 100;
// Sensor Island Mode
sns_diag_island_transition_log island_mode_payload = 101;
// Sensors Island Exit vote
// NOT SUPPORTED YET.
sns_diag_island_exit_vote_log island_exit_vote_payload = 102;
// Sensors Memory Utilization
sns_diag_mem_utilization_log memory_utilization_payload = 103;
// Event Service status log
sns_diag_event_service_log event_service_payload = 104;
}
}
|