227127095346134cd25b34d5d000c2cc009f5d22
[framework/connectivity/bluez.git] / doc / thermometer-api.txt
1 BlueZ D-Bus Thermometer API description
2 ****************************************
3
4         Santiago Carot-Nemesio <sancane@gmail.com>
5
6 Health Thermometer Profile hierarchy
7 =====================================
8
9 Service         org.bluez
10 Interface       org.bluez.Thermometer
11 Object path     [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
12
13
14 Methods         void SetProperty(string name, variant value)
15
16                         Changes the value of the specified property. Only
17                         read-write properties can be changed. On success
18                         this will emit a PropertyChanged signal.
19
20                         Possible Errors: org.bluez.Error.InvalidArguments
21
22                 dict GetProperties()
23
24                         Returns all properties for the interface. See the
25                         Properties section for the available properties.
26
27                 RegisterWatcher(object agent)
28
29                         Registers a watcher to monitor scanned measurements.
30                         This agent will be notified about final temperature
31                         measurements.
32
33                         Possible Errors: org.bluez.Error.InvalidArguments
34
35                 UnregisterWatcher(object agent)
36
37                         Unregisters a watcher.
38
39                         Final and intermediate temperatures won't be notified to
40                         this agent any more.
41
42                         Possible Errors: org.bluez.Error.InvalidArguments
43                                         org.bluez.Error.NotFound
44
45                 EnableIntermediateMeasurement(object agent)
46
47                         Enables intermediate measurement notifications for this
48                         agent if the thermometer supports it.
49
50                         Possible Errors: org.bluez.Error.InvalidArguments
51                                         org.bluez.Error.NotSupported
52
53                 DisableIntermediateMeasurement(object agent)
54
55                         Disables intermediate measurement notifications for this
56                         agent. It will disable notifications in the thermometer
57                         when the last agent removes the watcher for intermediate
58                         measurements.
59
60                         Possible Errors: org.bluez.Error.InvalidArguments
61                                         org.bluez.Error.NotFound
62
63 Signals         PropertyChanged(string name, variant value)
64
65                         This signal indicates a changed value of the given
66                         property.
67
68 Properties      boolean Intermediate [readonly]
69
70                         True if the thermometer supports intermediate measurement
71                         notifications.
72
73                 uint16 Interval (optional) [readwrite]
74
75                         The Measurement Interval defines the time (in seconds)
76                         between measurements. This interval is not related to
77                         the intermediate measurements and must be defined into
78                         a valid range. Setting it to zero means that no periodic
79                         measurements will be taken.
80
81                 uint16 Maximum (optional) [readonly]
82
83                         Defines the maximum value allowed for the interval
84                         between periodic measurements.
85
86                 uint16 Minimum (optional) [readonly]
87
88                         Defines the minimum value allowed for the interval
89                         between periodic measurements.
90
91
92 Health Thermometer Watcher hierarchy
93 ====================================
94 Service         unique name
95 Interface       org.bluez.ThermometerWatcher
96 Object path     freely definable
97
98 Methods         void MeasurementReceived(dict measure)
99
100                         This callback gets called when a measure has been
101                         scanned in the thermometer. The Time entry in the dict
102                         will be only present if the device supports storing of
103                         data. The time value is expressed in seconds since epoch.
104                         The value represented is (mantissa) x (10**exponent)
105                         See foot note for special values when treating with
106                         health devices. The Type entry is only present if the
107                         measurement type is known. Otherwise, it is undefined.
108
109                         Dict is defined as below:
110                         {
111                                 "Exponent" : int8,
112                                 "Mantissa" : int32,
113                                 "Unit" : ("Celsius" or "Fahrenheit"),
114                                 "Time" : uint64,
115                                 "Type" : ("Armpit", "Body", "Ear", "Finger",
116                                         "Intestines", "Mouth", "Rectum", "Toe",
117                                         "Tympanum"),
118                                 "Measurement" : ("Final" or "Intermediate"),
119                         }
120
121                         For special cases, the exponent shall always be zero and
122                         the mantissa should be one of following values:
123
124                         NRes = -(2**23)
125                         NaN = +(2**23-1)
126                         INFINITY = (2**23-2)
127                         -INFINITY = -(2**23-2)