/
mainpage.h
710 lines (566 loc) · 35.6 KB
/
mainpage.h
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
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
/**
@mainpage Sensor Framework API documentation
@section introsection Introduction
Sensor Framework provides access to hardware sensors and additional
logical products calculated from them.
<hr>
@section devinfosection Sensorfw Developer Info
@ref developer
@ref dbusinterface
<a href="classes.html">Class Index</a>
<a href="annotated.html">Class List</a>
@subsection apisubsection Public API
- <a href="classSensorManagerInterface.html">SensorManagerInterface</a>
- <a href="classLocalSensorManagerInterface.html">LocalSensorManagerInterface</a>
- <a href="classAbstractSensorChannelInterface.html">AbstractSensorChannelInterface</a>
- <a href="classAccelerometerSensorChannelInterface.html">AccelerometerSensorChannelInterface</a>
- <a href="classALSSensorChannelInterface.html">ALSSensorChannelInterface</a>
- <a href="classCompassSensorChannelInterface.html">CompassSensorChannelInterface</a>
- <a href="classGyroscopeSensorInterface.html">GyroscopeSensorChannelInterface</a>
- <a href="classMagnetometerSensorChannelInterface.html">MagnetometerSensorChannelInterface</a>
- <a href="classOrientationSensorChannelInterface.html">OrientationSensorChannelInterface</a>
- <a href="classProximitySensorChannelInterface.html">ProximitySensorChannelInterface</a>
- <a href="classRotationSensorChannelInterface.html">RotationSensorChannelInterface</a>
- <a href="classTapSensorChannelInterface.html">TapSensorChannelInterface</a>
- <a href="classSensorManagerInterface.html">SensorManagerInterface</a>
@page dbusinterface Dbus Interface
Sensorfw has a dbus interface for control
@code
qdbus --system com.nokia.SensorService
/
qdbus --system com.nokia.SensorService /
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager
qdbus --system com.nokia.SensorService /SensorManager
property read int local.SensorManager.errorCodeInt
property read QString local.SensorManager.errorString
property readwrite int local.SensorManager.magneticDeviation
signal void local.SensorManager.errorSignal(int error)
method bool local.SensorManager.loadPlugin(QString name)
method double local.SensorManager.magneticDeviation()
method bool local.SensorManager.releaseSensor(QString id, int sessionId, qlonglong pid)
method int local.SensorManager.requestSensor(QString id, qlonglong pid)
method void local.SensorManager.setMagneticDeviation(double level)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/accelerometersensor
qdbus --system com.nokia.SensorService /SensorManager/accelerometersensor
property read uint local.AccelerometerSensor.bufferInterval
property read uint local.AccelerometerSensor.bufferSize
property read QString local.AccelerometerSensor.description
property read int local.AccelerometerSensor.errorCodeInt
property read QString local.AccelerometerSensor.errorString
property read bool local.AccelerometerSensor.hwBuffering
property read QString local.AccelerometerSensor.id
property read uint local.AccelerometerSensor.interval
property read bool local.AccelerometerSensor.isValid
property read bool local.AccelerometerSensor.standbyOverride
property read QString local.AccelerometerSensor.type
property read QDBusRawType::(tiii) local.AccelerometerSensor.xyz
signal void local.AccelerometerSensor.dataAvailable(QDBusRawType::(tiii) data)
signal void local.AccelerometerSensor.propertyChanged(QString name)
method uint local.AccelerometerSensor.bufferInterval()
method uint local.AccelerometerSensor.bufferSize()
method QString local.AccelerometerSensor.description()
method QString local.AccelerometerSensor.errorString()
method QDBusRawType::a(uu) local.AccelerometerSensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.AccelerometerSensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.AccelerometerSensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.AccelerometerSensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.AccelerometerSensor.getCurrentDataRange()
method bool local.AccelerometerSensor.hwBuffering()
method QString local.AccelerometerSensor.id()
method uint local.AccelerometerSensor.interval()
method bool local.AccelerometerSensor.isValid()
method void local.AccelerometerSensor.removeDataRangeRequest(int sessionId)
method void local.AccelerometerSensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.AccelerometerSensor.setBufferInterval(int sessionId, uint value)
method void local.AccelerometerSensor.setBufferSize(int sessionId, uint value)
method bool local.AccelerometerSensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.AccelerometerSensor.setDefaultInterval(int sessionId)
method void local.AccelerometerSensor.setDownsampling(int sessionId, bool value)
method void local.AccelerometerSensor.setInterval(int sessionId, int value)
method bool local.AccelerometerSensor.setStandbyOverride(int sessionId, bool value)
method bool local.AccelerometerSensor.standbyOverride()
method void local.AccelerometerSensor.start(int sessionId)
method void local.AccelerometerSensor.stop(int sessionId)
method QString local.AccelerometerSensor.type()
method QDBusRawType::(tiii) local.AccelerometerSensor.xyz()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/alssensor
qdbus --system com.nokia.SensorService /SensorManager/alssensor
property read uint local.ALSSensor.bufferInterval
property read uint local.ALSSensor.bufferSize
property read QString local.ALSSensor.description
property read int local.ALSSensor.errorCodeInt
property read QString local.ALSSensor.errorString
property read bool local.ALSSensor.hwBuffering
property read QString local.ALSSensor.id
property read uint local.ALSSensor.interval
property read bool local.ALSSensor.isValid
property read QDBusRawType::(tu) local.ALSSensor.lux
property read bool local.ALSSensor.standbyOverride
property read QString local.ALSSensor.type
signal void local.ALSSensor.ALSChanged(QDBusRawType::(tu) value)
signal void local.ALSSensor.propertyChanged(QString name)
method uint local.ALSSensor.bufferInterval()
method uint local.ALSSensor.bufferSize()
method QString local.ALSSensor.description()
method QString local.ALSSensor.errorString()
method QDBusRawType::a(uu) local.ALSSensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.ALSSensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.ALSSensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.ALSSensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.ALSSensor.getCurrentDataRange()
method bool local.ALSSensor.hwBuffering()
method QString local.ALSSensor.id()
method uint local.ALSSensor.interval()
method bool local.ALSSensor.isValid()
method QDBusRawType::(tu) local.ALSSensor.lux()
method void local.ALSSensor.removeDataRangeRequest(int sessionId)
method void local.ALSSensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.ALSSensor.setBufferInterval(int sessionId, uint value)
method void local.ALSSensor.setBufferSize(int sessionId, uint value)
method bool local.ALSSensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.ALSSensor.setDefaultInterval(int sessionId)
method void local.ALSSensor.setDownsampling(int sessionId, bool value)
method void local.ALSSensor.setInterval(int sessionId, int value)
method bool local.ALSSensor.setStandbyOverride(int sessionId, bool value)
method bool local.ALSSensor.standbyOverride()
method void local.ALSSensor.start(int sessionId)
method void local.ALSSensor.stop(int sessionId)
method QString local.ALSSensor.type()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/gyroscopesensor
qdbus --system com.nokia.SensorService /SensorManager/gyroscopesensor
property read uint local.GyroscopeSensor.bufferInterval
property read uint local.GyroscopeSensor.bufferSize
property read QString local.GyroscopeSensor.description
property read int local.GyroscopeSensor.errorCodeInt
property read QString local.GyroscopeSensor.errorString
property read bool local.GyroscopeSensor.hwBuffering
property read QString local.GyroscopeSensor.id
property read uint local.GyroscopeSensor.interval
property read bool local.GyroscopeSensor.isValid
property read bool local.GyroscopeSensor.standbyOverride
property read QString local.GyroscopeSensor.type
property read QDBusRawType::(tiii) local.GyroscopeSensor.value
signal void local.GyroscopeSensor.dataAvailable(QDBusRawType::(tiii) data)
signal void local.GyroscopeSensor.propertyChanged(QString name)
method uint local.GyroscopeSensor.bufferInterval()
method uint local.GyroscopeSensor.bufferSize()
method QString local.GyroscopeSensor.description()
method QString local.GyroscopeSensor.errorString()
method QDBusRawType::a(uu) local.GyroscopeSensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.GyroscopeSensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.GyroscopeSensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.GyroscopeSensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.GyroscopeSensor.getCurrentDataRange()
method bool local.GyroscopeSensor.hwBuffering()
method QString local.GyroscopeSensor.id()
method uint local.GyroscopeSensor.interval()
method bool local.GyroscopeSensor.isValid()
method void local.GyroscopeSensor.removeDataRangeRequest(int sessionId)
method void local.GyroscopeSensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.GyroscopeSensor.setBufferInterval(int sessionId, uint value)
method void local.GyroscopeSensor.setBufferSize(int sessionId, uint value)
method bool local.GyroscopeSensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.GyroscopeSensor.setDefaultInterval(int sessionId)
method void local.GyroscopeSensor.setDownsampling(int sessionId, bool value)
method void local.GyroscopeSensor.setInterval(int sessionId, int value)
method bool local.GyroscopeSensor.setStandbyOverride(int sessionId, bool value)
method bool local.GyroscopeSensor.standbyOverride()
method void local.GyroscopeSensor.start(int sessionId)
method void local.GyroscopeSensor.stop(int sessionId)
method QString local.GyroscopeSensor.type()
method QDBusRawType::(tiii) local.GyroscopeSensor.value()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/magnetometersensor
qdbus --system com.nokia.SensorService /SensorManager/magnetometersensor
property read uint local.MagnetometerSensor.bufferInterval
property read uint local.MagnetometerSensor.bufferSize
property read QString local.MagnetometerSensor.description
property read int local.MagnetometerSensor.errorCodeInt
property read QString local.MagnetometerSensor.errorString
property read bool local.MagnetometerSensor.hwBuffering
property read QString local.MagnetometerSensor.id
property read uint local.MagnetometerSensor.interval
property read bool local.MagnetometerSensor.isValid
property read QDBusRawType::(tiiiiiii) local.MagnetometerSensor.magneticField
property read bool local.MagnetometerSensor.standbyOverride
property read QString local.MagnetometerSensor.type
signal void local.MagnetometerSensor.dataAvailable(QDBusRawType::(tiiiiiii) data)
signal void local.MagnetometerSensor.propertyChanged(QString name)
method uint local.MagnetometerSensor.bufferInterval()
method uint local.MagnetometerSensor.bufferSize()
method QString local.MagnetometerSensor.description()
method QString local.MagnetometerSensor.errorString()
method QDBusRawType::a(uu) local.MagnetometerSensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.MagnetometerSensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.MagnetometerSensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.MagnetometerSensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.MagnetometerSensor.getCurrentDataRange()
method bool local.MagnetometerSensor.hwBuffering()
method QString local.MagnetometerSensor.id()
method uint local.MagnetometerSensor.interval()
method bool local.MagnetometerSensor.isValid()
method QDBusRawType::(tiiiiiii) local.MagnetometerSensor.magneticField()
method void local.MagnetometerSensor.removeDataRangeRequest(int sessionId)
method void local.MagnetometerSensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.MagnetometerSensor.reset()
method void local.MagnetometerSensor.setBufferInterval(int sessionId, uint value)
method void local.MagnetometerSensor.setBufferSize(int sessionId, uint value)
method bool local.MagnetometerSensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.MagnetometerSensor.setDefaultInterval(int sessionId)
method void local.MagnetometerSensor.setDownsampling(int sessionId, bool value)
method void local.MagnetometerSensor.setInterval(int sessionId, int value)
method bool local.MagnetometerSensor.setStandbyOverride(int sessionId, bool value)
method bool local.MagnetometerSensor.standbyOverride()
method void local.MagnetometerSensor.start(int sessionId)
method void local.MagnetometerSensor.stop(int sessionId)
method QString local.MagnetometerSensor.type()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/orientationsensor
qdbus --system com.nokia.SensorService /SensorManager/orientationsensor
property read uint local.OrientationSensor.bufferInterval
property read uint local.OrientationSensor.bufferSize
property read QString local.OrientationSensor.description
property read int local.OrientationSensor.errorCodeInt
property read QString local.OrientationSensor.errorString
property read bool local.OrientationSensor.hwBuffering
property read QString local.OrientationSensor.id
property read uint local.OrientationSensor.interval
property read bool local.OrientationSensor.isValid
property read QDBusRawType::(tu) local.OrientationSensor.orientation
property read bool local.OrientationSensor.standbyOverride
property readwrite int local.OrientationSensor.threshold
property read QString local.OrientationSensor.type
signal void local.OrientationSensor.orientationChanged(QDBusRawType::(tu) orientation)
signal void local.OrientationSensor.propertyChanged(QString name)
method uint local.OrientationSensor.bufferInterval()
method uint local.OrientationSensor.bufferSize()
method QString local.OrientationSensor.description()
method QString local.OrientationSensor.errorString()
method QDBusRawType::a(uu) local.OrientationSensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.OrientationSensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.OrientationSensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.OrientationSensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.OrientationSensor.getCurrentDataRange()
method bool local.OrientationSensor.hwBuffering()
method QString local.OrientationSensor.id()
method uint local.OrientationSensor.interval()
method bool local.OrientationSensor.isValid()
method QDBusRawType::(tu) local.OrientationSensor.orientation()
method void local.OrientationSensor.removeDataRangeRequest(int sessionId)
method void local.OrientationSensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.OrientationSensor.setBufferInterval(int sessionId, uint value)
method void local.OrientationSensor.setBufferSize(int sessionId, uint value)
method bool local.OrientationSensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.OrientationSensor.setDefaultInterval(int sessionId)
method void local.OrientationSensor.setDownsampling(int sessionId, bool value)
method void local.OrientationSensor.setInterval(int sessionId, int value)
method bool local.OrientationSensor.setStandbyOverride(int sessionId, bool value)
method void local.OrientationSensor.setThreshold(int value)
method bool local.OrientationSensor.standbyOverride()
method void local.OrientationSensor.start(int sessionId)
method void local.OrientationSensor.stop(int sessionId)
method int local.OrientationSensor.threshold()
method QString local.OrientationSensor.type()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
/SensorManager/proximitysensor
qdbus --system com.nokia.SensorService /SensorManager/proximitysensor
property read uint local.ProximitySensor.bufferInterval
property read uint local.ProximitySensor.bufferSize
property read QString local.ProximitySensor.description
property read int local.ProximitySensor.errorCodeInt
property read QString local.ProximitySensor.errorString
property read bool local.ProximitySensor.hwBuffering
property read QString local.ProximitySensor.id
property read uint local.ProximitySensor.interval
property read bool local.ProximitySensor.isValid
property read QDBusRawType::(tu) local.ProximitySensor.proximity
property read bool local.ProximitySensor.standbyOverride
property read QString local.ProximitySensor.type
signal void local.ProximitySensor.dataAvailable(QDBusRawType::(tu) data)
signal void local.ProximitySensor.propertyChanged(QString name)
method uint local.ProximitySensor.bufferInterval()
method uint local.ProximitySensor.bufferSize()
method QString local.ProximitySensor.description()
method QString local.ProximitySensor.errorString()
method QDBusRawType::a(uu) local.ProximitySensor.getAvailableBufferIntervals()
method QDBusRawType::a(uu) local.ProximitySensor.getAvailableBufferSizes()
method QDBusRawType::a(ddd) local.ProximitySensor.getAvailableDataRanges()
method QDBusRawType::a(ddd) local.ProximitySensor.getAvailableIntervals()
method QDBusRawType::(ddd) local.ProximitySensor.getCurrentDataRange()
method bool local.ProximitySensor.hwBuffering()
method QString local.ProximitySensor.id()
method uint local.ProximitySensor.interval()
method bool local.ProximitySensor.isValid()
method QDBusRawType::(tu) local.ProximitySensor.proximity()
method void local.ProximitySensor.removeDataRangeRequest(int sessionId)
method void local.ProximitySensor.requestDataRange(int sessionId, QDBusRawType::(ddd) range)
method void local.ProximitySensor.setBufferInterval(int sessionId, uint value)
method void local.ProximitySensor.setBufferSize(int sessionId, uint value)
method bool local.ProximitySensor.setDataRangeIndex(int sessionId, int rangeIndex)
method bool local.ProximitySensor.setDefaultInterval(int sessionId)
method void local.ProximitySensor.setDownsampling(int sessionId, bool value)
method void local.ProximitySensor.setInterval(int sessionId, int value)
method bool local.ProximitySensor.setStandbyOverride(int sessionId, bool value)
method bool local.ProximitySensor.standbyOverride()
method void local.ProximitySensor.start(int sessionId)
method void local.ProximitySensor.stop(int sessionId)
method QString local.ProximitySensor.type()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()
@endcode
@page developer Developer Documentation
@section driverguide Sensor driver guideline
Sensord has been built to be easily adaptable to different driver interfaces
sensor drivers may expose. However, the following generic guidelines or
requests could be made for the driver implementations:
- Try to follow upstream conventions and standards when available.
- Avoid busy-polling by providing interrupts from driver handle
- Power down the sensor if nobody is attached to the driver handle.
- Provide easy way to configure sensor (sampling range, frequenzy, etc.),
preferably using sysfs.
Kernels input (evdev) system handles most of the above quite nicely.
@section plugins Instructions For Writing Plug-ins for Sensor Framework
@subsection pluginsubsection Plug-ins
A plug-in for sensor framework can provide one (or more) of the following:
- Device adaptor
- Chain
- Sensor
- Filter
Device adaptors are responsible for interfacing the framework with data sources (generally device
drivers). Adaptors are connected to chains or sensors, which contain a varying number of filters.
Filters are used for calculating things from received samples. Sensors provide an interface to the
resulting data for client applications, while chains are used as internal datasources for
calculations shared by several sensors.
@subsubsection writingpluginsub Writing a Plug-in
A plug-in by itself is responsible for very few things. It contains an adaptor/sensor/chain/filter
(or several), and introduces them to SensorManager.
In addition, plug-ins may specify that they need another plug-in for functioning. E.g.
orientationchain (provides device orientation calculations) requires accelerometeradaptor
(provides data from accelerometer) to function.
Plugin dependencies are based on meta-names. Any plugin that requires, e.g. sampleplugin, will
specify the dependency as 'sampleplugin'. In reality, with varying platforms the real plugin could
be called sampleplugin-ascii, sampleplugin-superior, sampleplugin-inputdev, etc. See the section
'configuration files' for further details.
The naming convention is roughly:
@a \<type_of_sensor\>\<type_of_node\>plugin-\<specifier\>
For adaptors, the specifier has been agreed to be related to the type of underlying driver
interface. Thus, we could for example have:
accelerometeradaptorplugin-inputdev
Not all plugins currently adhere to these rules, and there is no clear rule on what to use for the
\<specifier\> in cases other than adaptors.
See the commented codes in examples/*/*plugin.[h|cpp] for plug-in construction.
@subsection writingadaptorsub Writing an Adaptor
A device adaptors is responsible for reading data from a source (usually a device driver interface)
and pushing it into the processing chain in sensor framework.
The easiest way to create a new device adaptor is to extend SysfsAdaptor. The base class will then
handle most things as long as the adaptor class itself provides the interface specific details.
What needs to be implemented:
* Select busypoll or interrupt based approach0
* Create and name an outputbuffer(s).
* Function for reading and propagating data.
* Specify metadata
@subsubsection pollparagraph Interrupt based or busypoll
Files can be monitored either in SelectMode or IntervalMode. SelectMode uses epoll() to monitor for
interrupts, while IntervalMode just busypolls with specified delay. Using SelectMode is encouraged
due to power saving reasons as long as driver interface provides interrupts.
In case the driver interface provides possibility to control hardware sampling frequency
(implies SelectMode), interval() and setInterval() should be reimplemented to
make use of the functionality.
In case the driver initiates hardware measurement when the interface is read, the IntervalMode
handles everything related to interval handling already (except specifying the allowed values).
@subsubsection bufferparagraph Buffers
An adaptor can have any number of output buffers. Usually there is only one, but if an adaptor
monitors several filehandles, or a filehandle provides more than one type of output, it might
occasionally make sense to provide several output buffers. The buffers are named and are searched
by listeners based on the name.
@subsubsection readingdataparagraph Reading data from driver
SysfsAdaptor provides method addPath() for registering filehandles for listening. The path can also
be set as constructor parameter. There can be any number of paths added, but mode of the
adaptor will be the same for all of them, as well as the interval setting.
Whenever a registered filehandle has new data (signalled either by interrupt or by timeout),
processSample(int pathId, int fd) gets called. Data can be read from fd, and pathId is used
to separate which file the handle points to.
The function should be implemented to read data from fd and propagate it to listeners by writing
to buffer.
@subsubsection metadataparagraph Metadata
Metadata for adaptors should represent the capabilities of the hardware and driver.
See section 'Metadata' at the end for generic details.
See examples/sampleadaptor/ for adaptor construction.
@subsubsection adaptorshardway Implementing A Device Adaptor - the hardway
If you wish to go all the way, adaptors are expected to implement the following things:
- Provide an output buffer. Create a buffer, introduce it with
void addAdaptedSensor(const QString& name, const QString& description, RingBufferBase* buffer);
where "name" is the id for the buffer. The name is used by the next node in the filtering chain to
locate the buffer. Currently these names are hardcoded in the layers above, so if the created adaptor
is a replacement for an existing one, the same buffer name(s) should be used. Adaptors and their
buffer names and types are listed below.
- Set adaptor description with setDescription() and list possible dataRanges for the adaptor with
introduceAvailableDataRange(). DataRange options are defined as (min value, max value, accuracy).
If the adaptor supports more than one data range, introduce all ranges and implement setDataRange()
to allow the client to switch between ranges. The NodeBase class will take care of queuing the range
requests (first come, first served).
- Implement startAdaptor() and stopAdaptor(). These are leftovers from something that is not very
valid at the moment, but might come handy in the future. These are called on construction and
destruction of the adaptor (by sensormanager). One could use these for example to do some
preliminary setup for sensor connection. Current adaptors don't do much. Calling startAdaptor()
should not make the sensor consume power (unless really
necessary, think BT connection)
- Implement startSensor() and stopSensor(). These are the functions used to start the sensor
dataflow into the named buffer. They should take care of reference counting for themselves, so
that the adapted sensor (aka. the buffer) will run as long as there is someone expecting data.
The AdaptedSensorEntry class provides help in reference counting. Whenever the sensor is stopped,
it should not consume any power. (quite sensor specific what is released here and what is released
with stopAdaptor()).
- Implement standby() and resume(). These are called when display blanks / unblanks. The expected
functionality is to stop on standby, and start again on resume (goal is to save power). The
difference to start and stop is that the release of hardware should be invisible to layers above.
They can adjust properties and call start/stop, but these will only take effect after the adaptor
has resumed.
- In case the rate of the sensor can be adjusted, re-implement getPollingInterval() and
setPollingInterval(). [need to revise the code here, may have too many hardcodings to original
setup to make this work in a reasonable way]
@subsection writingfilter Writing a Filter
A filter is responsible for processing data.
A new filter should be created by inheriting from QObject and Filter.
Then what need to be implemented are:
- In the header file
- Override the static factoryMethod() function and return a new instance of the filter
- Define a private filter() function which can be called anything, as long as it matches
the nam-e in class constructor
Implement the filter() function in the source file and do the necessary filtering operation
there
See examples/samplefilter/ for filter construction.
@subsection writingsensorsection Writing a Sensor
To create a new sensor, the following four steps should be done
- implementation of AbstractSensorChannel
- implementation of AbstractSensorChannelAdaptor
- implementation of AbstractSensorChannelInterface
- implementation of datatypes if sensor introduces new ones
AbstractSensorChannel is the end-node in the sensor graph.
AbstractSensorChannelAdaptor is the DBus interface of the sensor.
AbstractSensorChannelInterface is the client API for managing sensor through DBus and reading
datastream from the socket.
See examples/samplesensor/ for sensor channel construction.
@subsection writingchain Writing a Chain
A chain is responsible for adapting filters into the data flow between an adaptor and a sensor.
A new chain is created by inheriting from AbstractChain.
Then what need to be implemented are:
- In the header file
- Override the static factoryMethod() function and return a new instance of the chain
- In the constructor
- Get an instance of SensorManager
- Get a pointer (refcounted) to the adaptor from sensor manager
- Create a reader for the adaptor
- Create and name output buffer
- Create a new bin and add elements into it with names
- Make connections between the elements in the Bin
- Connect the reader to the adaptor
- Setup metadata
- Do the cleaning up in the destructor
- Override start() function to start chain
- Override stop() function to stop chain
See examples/samplechain/ for chain construction.
@subsection metadatasubsection Metadata
Each node (adaptor/chain/sensor, not filters) should define metadata for itself. The following
things are included:
- Description
- Interval range(s)
- Data range(s)
- Standby override sources (sort of metadata)
- Buffer size
- Buffer interval
@subsection metadatasubsection Description
Description should provide a human readable string that describes what is the output from the node.
@subsection rangesubsection Interval range(s)
Interval ranges define the possible rates at which this node can provide output. They are given
with min/max pairs, where any value between min and max is allowed. Resolution parameter is ignored.
Base class takes care of queuing and sorting the interval requests. Each node just needs to provide
accepted ranges and set/get methods. Interval is specified as milliseconds between samples. The
real used value will be the smallest value, ensuring that data is measured as fast as required.
This behavior can be modified for a node, in case smallest == fastest does not apply for its sources.
For adaptors, the interval should represent the real capabilities of the hardware and driver.
Chains and sensors have more possibilities. In simplest case, they just delegate the interval for
the source node by using setIntervalSource(). Then any requests are directly moved to the source
node.
If a node has more than one source whose output affect the rate of the output for the node itself,
setInterval() and interval() should be reimplemented to merge the requests into wanted rate.
@subsection datarangesubsection Data range(s)
Data ranges tell the possible min and max values and accuracy of measurements. Setting them closely
resembles interval setting. The largest difference is that datarates are set with
first-come-first-serve basis. The first requester of data range gets to keep the setting.
Currently there are no examples of sensors that would make use of multiple dataranges. For the sake
of information, the rates should be described with introduceAvailableDataRange() or taken from a
source with setIntervalSource().
@subsection standbysubsection Standby override
Default behavior is to turn off all sensors when display goes blank.
Client can request a sensor to stay on in such a case by setting the standbyOverride -property to
true. In practise, nodes specify which sources should stay on with addStandbyOverrideSource().
In adaptors, display blank will result in all filehandles being released. Setting the property to
true prevents this from happening.
The property should be used with care and only when required in order to minimize power consumption.
@subsection buffersubsection Buffer size and interval
Buffering means two things:
- sensor driver of chip may have internal buffer for storing data. In that case adaptor will
implement setBufferSize() virtual function to configure the driver and implement
getAvailableBufferSizes() virtual function to list available buffer sizes.
- if adaptor doesn't support buffering then sensorfw uses internal buffering to send data in
bursts to the clients. These modes are mutually exclusive for single sensor.
Buffer interval can be used to configure the time limit for long we will wait for buffer to get
full before flushing the content to the user. For driver/chip supported interval handling adaptor
will implement setBufferInterval() virtual function to configure the driver and implement
getAvailableBufferIntervals() virtual function to list available intervals.
By default buffering is disabled for client sessions.
@section configurationsection Configuration Files
Sensorfw supports multiple configuration files. There are two locations:
(1) /etc/sensorfw/sensord.conf
(2) /etc/sensorfw/sensord.conf.d/
Any option set in (1) will override options set in any of the files in (2). Files in (2) are
processed in alpha-numerical order, and later files can override settings from earlier files.
Using double-digits as the beginning of the filename for clarity is encouraged.
Configuration files contain sections for different HW. These sections should connect plugin
metanames (sampleadaptor) with the real plugin that should be used (sampleadaptor-inputdev).
The configuration file also contains option 'deviceId', which specifies which section should be
used. This will be removed once we have automatic detection of underlying HW in place.
The structure of the configuration files is likely to change in the future to contain better
separation between different platforms.
*/