summaryrefslogtreecommitdiff
path: root/doc/thermometer-api.txt
blob: 182881168e6d3f9e4c097b22369f6132bfbaf02c (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
BlueZ D-Bus Thermometer API description
***************************************

	Santiago Carot-Nemesio <sancane@gmail.com>

Health Thermometer Manager hierarchy
====================================

Service		org.bluez
Interface	org.bluez.ThermometerManager
Object path	[variable prefix]/{hci0,hci1,...}

Methods		RegisterWatcher(object agent)

			Registers a watcher to monitor scanned measurements.
			This agent will be notified about final temperature
			measurements.

			Possible Errors: org.bluez.Error.InvalidArguments

		UnregisterWatcher(object agent)

			Unregisters a watcher.

		EnableIntermediateMeasurement(object agent)

			Enables intermediate measurement notifications for this
			agent. Intermediate measurements will be enabled only
			for thermometers which support it.

			Possible Errors: org.bluez.Error.InvalidArguments

		DisableIntermediateMeasurement(object agent)

			Disables intermediate measurement notifications for this
			agent. It will disable notifications in thermometers
			when the last agent removes the watcher for intermediate
			measurements.

			Possible Errors: org.bluez.Error.InvalidArguments
					org.bluez.Error.NotFound

Health Thermometer Profile hierarchy
====================================

Service		org.bluez
Interface	org.bluez.Thermometer
Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX


Methods		void SetProperty(string name, variant value)

			Changes the value of the specified property. Only
			read-write properties can be changed. On success
			this will emit a PropertyChanged signal.

			Possible Errors: org.bluez.Error.InvalidArguments

		dict GetProperties()

			Returns all properties for the interface. See the
			Properties section for the available properties.

Signals		PropertyChanged(string name, variant value)

			This signal indicates a changed value of the given
			property.

Properties	boolean Intermediate [readonly]

			True if the thermometer supports intermediate measurement
			notifications.

		uint16 Interval (optional) [readwrite]

			The Measurement Interval defines the time (in seconds)
			between measurements. This interval is not related to
			the intermediate measurements and must be defined into
			a valid range. Setting it to zero means that no periodic
			measurements will be taken.

		uint16 Maximum (optional) [readonly]

			Defines the maximum value allowed for the interval
			between periodic measurements.

		uint16 Minimum (optional) [readonly]

			Defines the minimum value allowed for the interval
			between periodic measurements.


Health Thermometer Watcher hierarchy
====================================

Service		unique name
Interface	org.bluez.ThermometerWatcher
Object path	freely definable

Methods		void MeasurementReceived(dict measure)

			This callback gets called when a measure has been
			scanned	in the thermometer. The Time entry in the dict
			will be only present if the device supports storing of
			data. The time value is expressed in seconds since epoch.
			The value represented is (mantissa) x (10**exponent)
			See foot note for special values when treating with
			health devices. The Type entry is only present if the
			measurement type is known. Otherwise, it is undefined.

			Dict is defined as below:
			{
				"Exponent" : int8,
				"Mantissa" : int32,
				"Unit" : ("Celsius" or "Fahrenheit"),
				"Time" : uint64,
				"Type" : ("Armpit", "Body", "Ear", "Finger",
					"Intestines", "Mouth", "Rectum", "Toe",
					"Tympanum"),
				"Measurement" : ("Final" or "Intermediate"),
			}

			For special cases, the exponent shall always be zero and
			the mantissa should be one of following values:

			NRes = -(2**23)
			NaN = +(2**23-1)
			INFINITY = (2**23-2)
			-INFINITY = -(2**23-2)