Health Thermometer Profile API
RFC 1/1 Health Thermometer Profile API
--- doc/thermometer.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 101 insertions(+), 0 deletions(-) create mode 100644 doc/thermometer.txt
doc/thermometer.txt new file +101 -0
@@ -0,0 +1,101 @@ +BlueZ D-Bus Thermomether API description +**************************************** + + Santiago Carot-Nemesio <[email protected]> + +Health Thermomether 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. + + 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. + + MeasureReceived(dict measure) + + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below: + { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16, + "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8 + } + "Type" : uint8, + "Measurement" : ("Final", "Intermediate") + } + +Properties boolean Enable [readwrite] + + Switch notification of a measure on or off. + + boolean Intermediate (optional) [readwrite] + + Switch notification of intermediates measures on or off. + + uint16 Interval (optional) [readwrite] + + The Measurement Interval defines the time (in seconds) + between measurements. This interval is not related to + the intermediates measures and must be defined into + a valid range. Setting it to zero meaning that no + periodic measurements will be taken. + + dict Range (optional) [readonly] + + Defines the valid range for the interval between + periodic measurements. + + Dict is defined as below: + { + "Minimum" : uint16, + "Maximum" : uint16, + } + + uint8 Type (optional) [readonly] + + Describes the type of the temperature measurement in + relation to the thermometer location. If this property + is present, the measure type won't be provided with the + measure received signal. The value corresponds to the + descriptions used in ISO/IEEE 11073-10408-2008. + Possible values: + 0 -> Reserved for future use + 1 -> Armpit + 2 -> Body (general) + 3 -> Ear (usually lobe) + 4 -> Finger + 5 -> Gastro-intestinal Tract + 6 -> Mouth + 7 -> Rectum + 8 -> Toe + 9 -> Tympanum (ear drum) + 10-255 -> Reserved for future use
Signature · 1 line
1.7.5.2
Luiz Augusto von Dentz
maintainerHi,
Quoted 52 lines · Santiago Carot-Nemesio
---
doc/thermometer.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 101 insertions(+), 0 deletions(-)create mode 100644
doc/thermometer.txtdoc/thermometer.txt new file +41
-0@@ -0,0 +1,101 @@ +BlueZ D-Bus Thermomether API description +**************************************** + + Santiago Carot-Nemesio <[email protected]> + +Health Thermomether 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. + + 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. + + MeasureReceived(dict measure) + + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below: + {
doc/thermometer.txt line 51
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16, + "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8 + }
I would try not got past the Dict, so the Time we could just use a timestamp.
doc/thermometer.txt line 52
Quoted 1 line
doc/thermometer.txt new file +1
-0+ "Type" : uint8,
Hmm, what values can Type assume? Also be aware that D-Bus don't have enum type so it is a bit inconvenient in some bindings, so perhaps we should try to avoid them and always convert to human readable string.
Quoted 19 lines
doc/thermometer.txt new file +19
-0+ "Measurement" : ("Final", "Intermediate") + } + +Properties boolean Enable [readwrite] + + Switch notification of a measure on or off. + + boolean Intermediate (optional) [readwrite] + + Switch notification of intermediates measures on or off. + + uint16 Interval (optional) [readwrite] + + The Measurement Interval defines the time (in seconds) + between measurements. This interval is not related to + the intermediates measures and must be defined into + a valid range. Setting it to zero meaning that no + periodic measurements will be taken. +
doc/thermometer.txt line 81
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ dict Range (optional) [readonly] + + Defines the valid range for the interval between + periodic measurements. + + Dict is defined as below: + { + "Minimum" : uint16, + "Maximum" : uint16, + }
I guess we can just use them directly as properties.
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ + uint8 Type (optional) [readonly] + + Describes the type of the temperature measurement in + relation to the thermometer location. If this property + is present, the measure type won't be provided with the + measure received signal. The value corresponds to the + descriptions used in ISO/IEEE 11073-10408-2008. + Possible values: + 0 -> Reserved for future use
doc/thermometer.txt line 101
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ 1 -> Armpit + 2 -> Body (general) + 3 -> Ear (usually lobe) + 4 -> Finger + 5 -> Gastro-intestinal Tract + 6 -> Mouth + 7 -> Rectum + 8 -> Toe + 9 -> Tympanum (ear drum) + 10-255 -> Reserved for future use
Not sure why you need MeasureReceived and PropertyChanged here, I would use one or another but not both to avoid possible inconsistencies.
Signature · 1 line
Luiz Augusto von Dentz
Hi Luiz
2011/6/20 Luiz Augusto von Dentz <[email protected]>:
Quoted 60 lines
Hi,
Quoted 56 lines · Santiago Carot-Nemesio
---
doc/thermometer.txt | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 101 insertions(+), 0 deletions(-)create mode 100644
doc/thermometer.txtdoc/thermometer.txt new file +45
-0@@ -0,0 +1,101 @@ +BlueZ D-Bus Thermomether API description +**************************************** + + Santiago Carot-Nemesio <[email protected]> + +Health Thermomether 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. + + 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. + + MeasureReceived(dict measure) + + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below: + { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16,
Quoted 8 lines
doc/thermometer.txt line 51
Quoted 6 lines
doc/thermometer.txt new file +6
-0+ "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8 + }I would try not got past the Dict, so the Time we could just use a timestamp.
I did it thinking in ISO/IEEE11073-20601 integration. Personal health devices transcoding whitepaper talk about it. Transcoder components should get this information when it is present to compose the appropriate APDUs to use this kind of devices in a 20601 ecosystem. I though that providing the time fields through a dict makes easy for both kind of application (20601 compatible applications and non-20601 compatible ones) get the time and make the appropriate internal representation. I do not oppose your proposal if we can get all these information from the time stamp too.
so no problem to me.
Quoted 6 lines
doc/thermometer.txt line 52
Quoted 2 lines
doc/thermometer.txt new file +1
-0+ "Type" : uint8,Hmm, what values can Type assume? Also be aware that D-Bus don't have enum type so it is a bit inconvenient in some bindings, so perhaps we should try to avoid them and always convert to human readable string.
I don't recommend it because type is defined by the upper layer protocol so I wouldn't do that thinking in the maintainability. The Type values may change (adding or removing new ones) in the IEEE specification so we should constantly update this stuff whenever the upper protocol changes to fullfil with that specification which IMO is out of Bluetooth scope. I suggest to keep indepence between both worlds.
Quoted 24 lines
Quoted 24 lines
doc/thermometer.txt new file +23
-0+ "Measurement" : ("Final", "Intermediate") + } + +Properties boolean Enable [readwrite] + + Switch notification of a measure on or off. + + boolean Intermediate (optional) [readwrite] + + Switch notification of intermediates measures on or off. + + uint16 Interval (optional) [readwrite] + + The Measurement Interval defines the time (in seconds) + between measurements. This interval is not related to + the intermediates measures and must be defined into + a valid range. Setting it to zero meaning that no + periodic measurements will be taken. + + dict Range (optional) [readonly] + + Defines the valid range for the interval between + periodic measurements.
Quoted 8 lines
doc/thermometer.txt line 81
Quoted 6 lines
doc/thermometer.txt new file +6
-0+ + Dict is defined as below: + { + "Minimum" : uint16, + "Maximum" : uint16, + }I guess we can just use them directly as properties.
I considered it too but at the end I choose the dict way thinking that Range is a property by itself with minimum and maximum values. But we can split in two properties if all you think that it fits better in the API.
Quoted 17 lines
Quoted 17 lines
doc/thermometer.txt new file +16
-0+ + uint8 Type (optional) [readonly] + + Describes the type of the temperature measurement in + relation to the thermometer location. If this property + is present, the measure type won't be provided with the + measure received signal. The value corresponds to the + descriptions used in ISO/IEEE 11073-10408-2008. + Possible values: + 0 -> Reserved for future use + 1 -> Armpit + 2 -> Body (general) + 3 -> Ear (usually lobe) + 4 -> Finger + 5 -> Gastro-intestinal Tract + 6 -> Mouth
Quoted 8 lines
doc/thermometer.txt line 101
Quoted 4 lines
doc/thermometer.txt new file +4
-0+ 7 -> Rectum + 8 -> Toe + 9 -> Tympanum (ear drum) + 10-255 -> Reserved for future useNot sure why you need MeasureReceived and PropertyChanged here, I would use one or another but not both to avoid possible inconsistencies.
The idea is that there may be two kinds of thermometers. Static ones wich are designed for a kind of measurement and non-static ones wich can be used in different locations. From application side, wherever a device provides this property is due that it only will provide static measures so it doesn't need to provide it in all measures scanned (to keep bandwich), if this property is not present is because of it can scan for measures in several places and it will provide this information to you when the measure arrives.
We can remove this roperty from the API if it is confused and always provide this information in the MeasureReceived signal. It looks fine to me too.
Thanks for your comments, they are very appreciated.
Let's wait for more suggestions. I'll send other patch including the changes if nobody says anything about the API in next days.
Regards.
Hi Santiago,
Quoted 51 lines · Santiago Carot-Nemesio
---
doc/thermometer.txt| 101 +++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 101 insertions(+), 0 deletions(-)create mode 100644
doc/thermometer.txtdoc/thermometer.txt new file +40
-0@@ -0,0 +1,101 @@ +BlueZ D-Bus Thermomether API description +**************************************** + + Santiago Carot-Nemesio <[email protected]> + +Health Thermomether 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. + + 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. + + MeasureReceived(dict measure) + + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below:
doc/thermometer.txt line 50
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16, + "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8
We don't really need to mimic the timestamp structure used in spec. We could go for a simple int with time() format (we should look into other BlueZ APIs to see which format they use for date or time).
A value for no-timestamp case should be defined, too.
doc/thermometer.txt line 54
Quoted 4 lines
doc/thermometer.txt new file +4
-0+ } + "Type" : uint8, + "Measurement" : ("Final", "Intermediate") + }
I would favor an agent for this case instead of signals, because it makes it implicit whether there is someone interested in getting temperature notifications. I mean, if some app a) enables notification properties and b) leaves, notification will keep being done, burning both devices' batteries. That's LE, after all :)
Turning off upon exit is not an option because some other app may be interested, too. The agent is a natural 'reference counter', too.
Another option would be to create some kind of handle, like HealthApplication, that allows BlueZ to detect when the client app is gone. That would avoid creating another agent API and PropertyChanged signal would be emitted when there is at least one interested party.
doc/thermometer.txt line 62
Quoted 8 lines
doc/thermometer.txt new file +8
-0+ +Properties boolean Enable [readwrite] + + Switch notification of a measure on or off. + + boolean Intermediate (optional) [readwrite] + + Switch notification of intermediates measures on or off.
Those would go if agent was used.
Quoted 9 lines
doc/thermometer.txt new file +9
-0+ + uint16 Interval (optional) [readwrite] + + The Measurement Interval defines the time (in seconds) + between measurements. This interval is not related to + the intermediates measures and must be defined into + a valid range. Setting it to zero meaning that no + periodic measurements will be taken. +
doc/thermometer.txt line 81
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ dict Range (optional) [readonly] + + Defines the valid range for the interval between + periodic measurements. + + Dict is defined as below: + { + "Minimum" : uint16, + "Maximum" : uint16, + }
I'd go for two properties: MinimumInterval and MaximumInterval, or some like that.
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ + uint8 Type (optional) [readonly] + + Describes the type of the temperature measurement in + relation to the thermometer location. If this property + is present, the measure type won't be provided with the + measure received signal. The value corresponds to the + descriptions used in ISO/IEEE 11073-10408-2008. + Possible values: + 0 -> Reserved for future use
doc/thermometer.txt line 101
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ 1 -> Armpit + 2 -> Body (general) + 3 -> Ear (usually lobe) + 4 -> Finger + 5 -> Gastro-intestinal Tract + 6 -> Mouth + 7 -> Rectum + 8 -> Toe + 9 -> Tympanum (ear drum) + 10-255 -> Reserved for future use
Regardless of signal/agent discussion, there should be Temperature and Intermediate Temperature properties. If intermediate temp property does not show, this implicitly means that thermometer does not support it.
All notifiable characteristics of thermometer are also readable; this allows an app to update its screen and state immediately. (Imagine a thermometer that takes samples once every 240 seconds.)
Quoted 7 lines
Signature · 6 lines
1.7.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
We have the issue of Device Information Servce. In order to be transcodable to IEEE 11073, the API must include Device Information Service data.
We have two options:
a) Adding DIS this very API, making it feature-complete and 1:1 with health thermometer profile, but that would have to be replicated for every LE health device API, because every one will have DIS, too.
b) Adding a separate DIS API. This is 'cleaner' and avoids duplication (at documentation level at least; internally, it could just forward calls to a single DIS plug-in). But then e.g. the Thermometer API is not 1:1 with profile, you need that API plus DIS API to cover the whole profile.
Hi,
Quoted 26 lines · Elvis Pfutzenreuter
Quoted 11 lines
+ MeasureReceived(dict measure)
doc/thermometer.txt new file +10
-0+ + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below:doc/thermometer.txt line 50
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16, + "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8We don't really need to mimic the timestamp structure used in spec. We could go for a simple int with
time()format (we should look into other BlueZ APIs to see which format they use for date or time).
Quoted 1 line
A value for no-timestamp case should be defined, too.
For reference, this is from doc/clock-api.txt in connman (which has architecture similar to BlueZ:
[...]
Properties uint64 Time [readonly or readwrite]
Current system time in seconds since epoch.
[...]
Quoted 6 lines
Quoted 5 lines
+ }
+ "Type" : uint8,
+ "Measurement" : ("Final", "Intermediate")
+ }
Quoted 7 lines
I would favor an agent for this case instead of signals, because it makes it implicit whether there is someone interested in getting temperature notifications. I mean, if some app a) enables notification properties and b) leaves, notification will keep being done, burning both devices' batteries. That's LE, after all :)
Turning off upon exit is not an option because some other app may be interested, too. The agent is a natural 'reference counter', too.
In general, if you want/need to support multiple users of the D-Bus API, something like an agent is necessary IMHO. Otherwise, it would be necessary to return some "busy" error to avoid other users disabling intermediate measurements while another user is interested on them.
Regards,
Signature · 3 lines
Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil
Hi all,
2011/6/20 Anderson Lizardo <[email protected]>:
Quoted 53 lines
Hi,
Quoted 26 lines · Elvis Pfutzenreuter
Quoted 11 lines
+ MeasureReceived(dict measure)
doc/thermometer.txt new file +10
-0+ + This signal is emmited when a measure has been scanned + by the thermometer. The Time entry in the dict will be + only present if the device supports storing of data. + The Type entry is optional and it will be provided if + the measure type is non-static. For static measures the + property Type will be provided. The Value entry + corresponds to IEEE-11073 32-bit FLOAT. + + Dict is defined as below:doc/thermometer.txt line 50
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit") + "Time" : { + "Year" : uint16, + "Month" : uint8, + "Day" : uint8, + "Hours" : uint8, + "Minutes" : uint8, + "Seconds" : uint8We don't really need to mimic the timestamp structure used in spec. We could go for a simple int with
time()format (we should look into other BlueZ APIs to see which format they use for date or time).Quoted 1 line
A value for no-timestamp case should be defined, too.
For reference, this is from
doc/clock-api.txtin connman (which has architecture similar to BlueZ:[...]
Properties uint64 Time [readonly or readwrite]Current system time in seconds since epoch. [...]
Quoted 11 lines
Quoted 5 lines
+ }
+ "Type" : uint8,
+ "Measurement" : ("Final", "Intermediate")
+ }I would favor an agent for this case instead of signals, because it makes it implicit whether there is someone interested in getting temperature notifications. I mean, if some app a) enables notification properties and b) leaves, notification will keep being done, burning both devices' batteries. That's LE, after all :)
Quoted 7 lines
Quoted 2 lines
Turning off upon exit is not an option because some other app may be interested, too. The agent is a natural 'reference counter', too.
In general, if you want/need to support multiple users of the D-Bus API, something like an agent is necessary IMHO. Otherwise, it would be necessary to return some "busy" error to avoid other users disabling intermediate measurements while another user is interested on them.
Ok, I think the agent style API will fit better with multi-user use cases. I'm going to work in these changes and I'll submit a new patch when it's ready.
Regards.