Health Thermometer Profile API
RFC 1/1 Health Thermometer Profile API
--- doc/thermometer.txt | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 111 insertions(+), 0 deletions(-) create mode 100644 doc/thermometer.txt
doc/thermometer.txt new file +111 -0
@@ -0,0 +1,111 @@ +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. + + Possible Errors: org.bluez.Error.InvalidArguments + + dict GetProperties() + + Returns all properties for the interface. See the + Properties section for the available properties. + + RegisterThermometerWatcher(object agent) + + Register a watcher to monitor scanned measures. + + The agent registered for the health thermometer + service will be notified about measures scanned. + + Possible Errors: org.bluez.Error.InvalidArguments + + UnregisterThermometerWatcher(object agent) + + Unregister a watcher. + + Final and intermediate temperatures won't be notified to + the agent any more. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFound + + EnableIntermediateMeasures(object agent) + + Enable notifications about intermediate measures. Agent + should have registered a watcher for health thermometer + service before to enable this feature. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotAllowed + + DisableIntermediateMeasures(object agent) + + Disable intermediate temperatures. It will disable + intermediate measure notifications in the device when + the last agent disables this feature. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFound + +Signals PropertyChanged(string name, variant value) + + This signal indicates a changed value of the given + property. + +Properties 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. + + uint16 Minimum (optional) [readonly] + + Defines the maximum value allowed for the interval + between periodic measurements. + + uint16 Maximum (optional) [readonly] + + Defines the minimuum 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 MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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. + + Dict is defined as below: + { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit"), + "Time" : uint64, + "Type" : ("Armpit", "Body", "Ear", "Finger", + "Intestines", "Mouth", "Rectum", "Toe", + "Tympanum"), + "Measurement" : ("Final" or "Intermediate"), + }
Signature · 1 line
1.7.5.2
Quoted 63 lines · Santiago Carot-Nemesio
---
doc/thermometer.txt| 111 +++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 111 insertions(+), 0 deletions(-)create mode 100644
doc/thermometer.txtdoc/thermometer.txt new file +52
-0@@ -0,0 +1,111 @@ +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. + + Possible Errors: org.bluez.Error.InvalidArguments + + dict GetProperties() + + Returns all properties for the interface. See the + Properties section for the available properties. + + RegisterThermometerWatcher(object agent) + + Register a watcher to monitor scanned measures. + + The agent registered for the health thermometer + service will be notified about measures scanned. + + Possible Errors: org.bluez.Error.InvalidArguments + + UnregisterThermometerWatcher(object agent) + + Unregister a watcher. + + Final and intermediate temperatures won't be notified to + the agent any more. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFound + + EnableIntermediateMeasures(object agent) + + Enable notifications about intermediate measures. Agent + should have registered a watcher for health thermometer + service before to enable this feature. + + Possible Errors: org.bluez.Error.InvalidArguments
doc/thermometer.txt line 62
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ org.bluez.Error.NotAllowed + + DisableIntermediateMeasures(object agent) + + Disable intermediate temperatures. It will disable + intermediate measure notifications in the device when + the last agent disables this feature. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFound
Not sure whether there is a need to have these. Out of simplicity we could just accept that intermediate temperatures will be notified, if the thermometer provides this feature.
In the other hand, a good reason to keep this would be saving energy when intermediate measures are not needed. LE profiles to into great lengths to save a couple bytes of traffic (literally).
Quoted 13 lines
doc/thermometer.txt new file +13
-0+ +Signals PropertyChanged(string name, variant value) + + This signal indicates a changed value of the given + property. + +Properties 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 85
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ + uint16 Minimum (optional) [readonly] + + Defines the maximum value allowed for the interval + between periodic measurements. + + uint16 Maximum (optional) [readonly] + + Defines the minimuum value allowed for the interval + between periodic measurements.
I would still like to have temperature (final and intermediate) among properties so an app could read them out without having to register an agent, either to take a single measurement or to update display upon loading. (That's why the respective GATT characteristics support read along with notification.) Reading the property provokes actual characteristic reading.
Disvantage: generating PropertyChanged signals along with agent calls, which puts the usefulness of the agent into question.
Another option would be to guarantee that MeasureReceived() is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).
Quoted 5 lines
doc/thermometer.txt new file +5
-0+ + +Health Thermometer Watcher hierarchy +==================================== +Service unique name
doc/thermometer.txt line 100
Quoted 10 lines
doc/thermometer.txt new file +10
-0+Interface org.bluez.ThermometerWatcher +Object path freely definable + +Methods void MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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.
Using such a special type (FLOAT) looks funny. Not sure whether it is the best option for this API.
At the very least, a description of FLOAT type should be added to the API, since IEEE 11073 specs are not public/free, and API users would have to resort to unofficial source to learn it.
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
Quoted 18 lines
doc/thermometer.txt new file +11
-0+ + Dict is defined as below: + { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit"), + "Time" : uint64, + "Type" : ("Armpit", "Body", "Ear", "Finger", + "Intestines", "Mouth", "Rectum", "Toe", + "Tympanum"), + "Measurement" : ("Final" or "Intermediate"), + }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
Hello Elvis,
2011/6/21 Elvis Pfutzenreuter <[email protected]>:
Quoted 81 lines · Santiago Carot-Nemesio
Quoted 64 lines
---
doc/thermometer.txt| 111 +++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 111 insertions(+), 0 deletions(-)create mode 100644
doc/thermometer.txtdoc/thermometer.txt new file +52
-0@@ -0,0 +1,111 @@ +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. + + Possible Errors: org.bluez.Error.InvalidArguments + + dict GetProperties() + + Returns all properties for the interface. See the + Properties section for the available properties. + + RegisterThermometerWatcher(object agent) + + Register a watcher to monitor scanned measures. + + The agent registered for the health thermometer + service will be notified about measures scanned. + + Possible Errors: org.bluez.Error.InvalidArguments + + UnregisterThermometerWatcher(object agent) + + Unregister a watcher. + + Final and intermediate temperatures won't be notified to + the agent any more. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFound + + EnableIntermediateMeasures(object agent) + + Enable notifications about intermediate measures. Agent + should have registered a watcher for health thermometer + service before to enable this feature. + + Possible Errors: org.bluez.Error.InvalidArgumentsdoc/thermometer.txt line 62
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ org.bluez.Error.NotAllowed + + DisableIntermediateMeasures(object agent) + + Disable intermediate temperatures. It will disable + intermediate measure notifications in the device when + the last agent disables this feature. + + Possible Errors: org.bluez.Error.InvalidArguments + org.bluez.Error.NotFoundNot sure whether there is a need to have these. Out of simplicity we could just accept that intermediate temperatures will be notified, if the thermometer provides this feature.
Quoted 3 lines
In the other hand, a good reason to keep this would be saving energy when intermediate measures are not needed. LE profiles to into great lengths to save a couple bytes of traffic (literally).
That's the reason which I put them in the API but I was just wondering if we could use the Final and Intermediate properties for that as you suggest below.
Quoted 31 lines
Quoted 14 lines
doc/thermometer.txt new file +13
-0+ +Signals PropertyChanged(string name, variant value) + + This signal indicates a changed value of the given + property. + +Properties 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 85
Quoted 10 lines
doc/thermometer.txt new file +10
-0+ + uint16 Minimum (optional) [readonly] + + Defines the maximum value allowed for the interval + between periodic measurements. + + uint16 Maximum (optional) [readonly] + + Defines the minimuum value allowed for the interval + between periodic measurements.I would still like to have temperature (final and intermediate) among properties so an app could read them out without having to register an agent, either to take a single measurement or to update display upon loading. (That's why the respective GATT characteristics support read along with notification.) Reading the property provokes actual characteristic reading.
Quoted 7 lines
Disvantage: generating PropertyChanged signals along with agent calls, which puts the usefulness of the agent into question.
Another option would be to guarantee that
MeasureReceived()is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).
I would prefer to use the Final and Intermediate properties too. The problem that we should address occurs when an application wich hasn't got a watcher registered sets Intermediate or Final measurement property and the last watcher is removed. I think that the best option may be turn off measurments for power safe due that no watcher will get the measures.
We can change the API to do that. What do you think?
Quoted 20 lines
Quoted 6 lines
doc/thermometer.txt new file +5
-0+ + +Health Thermometer Watcher hierarchy +==================================== +Service unique namedoc/thermometer.txt line 100
Quoted 10 lines
doc/thermometer.txt new file +10
-0+Interface org.bluez.ThermometerWatcher +Object path freely definable + +Methods void MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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.Using such a special type (FLOAT) looks funny. Not sure whether it is the best option for this API.
Quoted 8 lines
At the very least, a description of FLOAT type should be added to the API, since IEEE 11073 specs are not public/free, and API users would have to resort to unofficial source to learn it.
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
...or we can split the value in their exponent and mantissa components. Any suggestion?
Quoted 21 lines
Quoted 19 lines
doc/thermometer.txt new file +11
-1+ + Dict is defined as below: + { + "Value" : uint32, + "Unit" : ("Celsius" or "Fahrenheit"), + "Time" : uint64, + "Type" : ("Armpit", "Body", "Ear", "Finger", + "Intestines", "Mouth", "Rectum", "Toe", + "Tympanum"), + "Measurement" : ("Final" or "Intermediate"), + } --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
On Jun 21, 2011, at 12:56 PM, Santiago Carot wrote:
(cut)
Quoted 6 lines
Quoted 5 lines
Another option would be to guarantee that
MeasureReceived()is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).
Quoted 6 lines
I would prefer to use the Final and Intermediate properties too. The problem that we should address occurs when an application wich hasn't got a watcher registered sets Intermediate or Final measurement property and the last watcher is removed. I think that the best option may be turn off measurments for power safe due that no watcher will get the measures.
I'm not sure I follow. Enabling intermediate and/or final notifications is done per-agent basis; if any of active agents needs intermediate measurements, device is configured to send them. Disabling it on one agent should not hurt another.
Quoted 28 lines
We can change the API to do that. What do you think?
Quoted 24 lines
Quoted 6 lines
doc/thermometer.txt new file +5
-0+ + +Health Thermometer Watcher hierarchy +==================================== +Service unique namedoc/thermometer.txt line 100
Quoted 10 lines
doc/thermometer.txt new file +10
-0+Interface org.bluez.ThermometerWatcher +Object path freely definable + +Methods void MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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.Using such a special type (FLOAT) looks funny. Not sure whether it is the best option for this API.
At the very least, a description of FLOAT type should be added to the API, since IEEE 11073 specs are not public/free, and API users would have to resort to unofficial source to learn it.
Quoted 7 lines
Quoted 4 lines
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
...or we can split the value in their exponent and mantissa components. Any suggestion?
I'd go for that, but we need to take a look on special values to see if it makes sense. It would be really ugly to say something like "if mantissa=5 and exponent=-3 then temperature is actually zero" :)
Hi,
2011/6/21 Elvis Pfutzenreuter <[email protected]>:
Quoted 17 lines · Santiago Carot
(cut)
Quoted 6 lines
Quoted 5 lines
Another option would be to guarantee that
MeasureReceived()is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).Quoted 6 lines
I would prefer to use the Final and Intermediate properties too. The problem that we should address occurs when an application wich hasn't got a watcher registered sets Intermediate or Final measurement property and the last watcher is removed. I think that the best option may be turn off measurments for power safe due that no watcher will get the measures.
Quoted 5 lines
I'm not sure I follow. Enabling intermediate and/or final notifications is done per-agent basis; if any of active agents needs intermediate measurements, device is configured to send them. Disabling it on one agent should not hurt another.
I mean the case when a process (it is not neccesary it has to be an agent) is enabling intermediate and/or final notifications through setProperty method in D-Bus API. Please, note that any process can do this in current API because no extra control is done for this operation.
May be I'm misundertanding what you want to said with per-agent basis but as far as I see the only way to manage enabling/disabling properties in this way is by adding a new parameter in setProperty method with the agent path and checkicng if it is already registered before enabling or disabling intermediate and final notifications. IMO If we do this we would break the BlueZ APIs where no extra parameters are required in such methods. I'm not sure if this would be a problem but I don't feel comfortable with this solution.
On the other hands, if we discard adding the agent parameter in that method (which I think that it fits better in BlueZ API), we can ignore the case when there aren't any agents registered for the thermometer service and a process enables some of this properties. In this case it wouldn't be necessary to activate these properties since no one will receive notifications for the measures.
Quoted 33 lines
Quoted 33 lines
We can change the API to do that. What do you think?
Quoted 28 lines
Quoted 6 lines
doc/thermometer.txt new file +5
-0+ + +Health Thermometer Watcher hierarchy +==================================== +Service unique namedoc/thermometer.txt line 100
Quoted 10 lines
doc/thermometer.txt new file +10
-0+Interface org.bluez.ThermometerWatcher +Object path freely definable + +Methods void MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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.Using such a special type (FLOAT) looks funny. Not sure whether it is the best option for this API.
At the very least, a description of FLOAT type should be added to the API, since IEEE 11073 specs are not public/free, and API users would have to resort to unofficial source to learn it.
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
Quoted 6 lines
Quoted 2 lines
...or we can split the value in their exponent and mantissa components. Any suggestion?
I'd go for that, but we need to take a look on special values to see if it makes sense. It would be really ugly to say something like "if mantissa=5 and exponent=-3 then temperature is actually zero" :)
We could provide special values in the API so that end users can know when they are treating with those special cases. As far as I remember the only special cases are NaN, NRes, +INIFINITY, - INFINITY and RFU. Do you see anything else?
Waiting for comments
Regards.
Quoted 41 lines · Santiago Carot
Hi,
2011/6/21 Elvis Pfutzenreuter <[email protected]>:
Quoted 17 lines · Santiago Carot
(cut)
Quoted 6 lines
Quoted 5 lines
Another option would be to guarantee that
MeasureReceived()is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).Quoted 6 lines
I would prefer to use the Final and Intermediate properties too. The problem that we should address occurs when an application wich hasn't got a watcher registered sets Intermediate or Final measurement property and the last watcher is removed. I think that the best option may be turn off measurments for power safe due that no watcher will get the measures.
Quoted 5 lines
I'm not sure I follow. Enabling intermediate and/or final notifications is done per-agent basis; if any of active agents needs intermediate measurements, device is configured to send them. Disabling it on one agent should not hurt another.
I mean the case when a process (it is not neccesary it has to be an agent) is enabling intermediate and/or final notifications through setProperty method in D-Bus API. Please, note that any process can do this in current API because no extra control is done for this operation.
May be I'm misundertanding what you want to said with per-agent basis but as far as I see the only way to manage enabling/disabling properties in this way is by adding a new parameter in setProperty method with the agent path and checkicng if it is already registered before enabling or disabling intermediate and final notifications. IMO If we do this we would break the BlueZ APIs where no extra parameters are required in such methods. I'm not sure if this would be a problem but I don't feel comfortable with this solution.
Quoted 6 lines
On the other hands, if we discard adding the agent parameter in that method (which I think that it fits better in BlueZ API), we can ignore the case when there aren't any agents registered for the thermometer service and a process enables some of this properties. In this case it wouldn't be necessary to activate these properties since no one will receive notifications for the measures.
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.
So, inside the driver, final measurement indications are enabled if there is at least one agent; and intermediate notifications are enabled if at least one agent has requested it.
Quoted 37 lines
Quoted 37 lines
Quoted 36 lines
We can change the API to do that. What do you think?
Quoted 20 lines
Quoted 6 lines
doc/thermometer.txt new file +5
-0+ + +Health Thermometer Watcher hierarchy +==================================== +Service unique namedoc/thermometer.txt line 100
Quoted 10 lines
doc/thermometer.txt new file +10
-0+Interface org.bluez.ThermometerWatcher +Object path freely definable + +Methods void MeasureReceived(dict measure) + + This callback gets called when a measure has been + scanned in the thermometer. The Value entry corresponds + to IEEE-11073 32-bit FLOAT.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.Using such a special type (FLOAT) looks funny. Not sure whether it is the best option for this API.
Quoted 8 lines
At the very least, a description of FLOAT type should be added to the API, since IEEE 11073 specs are not public/free, and API users would have to resort to unofficial source to learn it.
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
...or we can split the value in their exponent and mantissa components. Any suggestion?
Quoted 8 lines
Quoted 3 lines
I'd go for that, but we need to take a look on special values to see if it makes sense. It would be really ugly to say something like "if mantissa=5 and exponent=-3 then temperature is actually zero" :)
We could provide special values in the API so that end users can know when they are treating with those special cases. As far as I remember the only special cases are NaN, NRes, +INIFINITY, - INFINITY and RFU. Do you see anything else?
I think that these are all. Can't see a way to represent those special values in a clean fashion. For the next RFC just include the mantissa/exponent pairs related to them, and see if someone else complains.
Hi,
2011/6/22 Elvis Pfutzenreuter <[email protected]>:
Quoted 54 lines · Santiago Carot
Quoted 42 lines
Hi,
2011/6/21 Elvis Pfutzenreuter <[email protected]>:
Quoted 17 lines · Santiago Carot
(cut)
Quoted 6 lines
Quoted 5 lines
Another option would be to guarantee that
MeasureReceived()is called right after agent registering, in order to give the client an initial value to show (having in mind that notification interval might be very long).Quoted 6 lines
I would prefer to use the Final and Intermediate properties too. The problem that we should address occurs when an application wich hasn't got a watcher registered sets Intermediate or Final measurement property and the last watcher is removed. I think that the best option may be turn off measurments for power safe due that no watcher will get the measures.
Quoted 5 lines
I'm not sure I follow. Enabling intermediate and/or final notifications is done per-agent basis; if any of active agents needs intermediate measurements, device is configured to send them. Disabling it on one agent should not hurt another.
I mean the case when a process (it is not neccesary it has to be an agent) is enabling intermediate and/or final notifications through setProperty method in D-Bus API. Please, note that any process can do this in current API because no extra control is done for this operation.
May be I'm misundertanding what you want to said with per-agent basis but as far as I see the only way to manage enabling/disabling properties in this way is by adding a new parameter in setProperty method with the agent path and checkicng if it is already registered before enabling or disabling intermediate and final notifications. IMO If we do this we would break the BlueZ APIs where no extra parameters are required in such methods. I'm not sure if this would be a problem but I don't feel comfortable with this solution.
Quoted 6 lines
On the other hands, if we discard adding the agent parameter in that method (which I think that it fits better in BlueZ API), we can ignore the case when there aren't any agents registered for the thermometer service and a process enables some of this properties. In this case it wouldn't be necessary to activate these properties since no one will receive notifications for the measures.
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
Any suggestion?
Regards.
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.
Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
In terms of minimizing energy consumption and API methods, the 'best' would be:
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
Main problem would be having a "toothless" agent. Looks funny.
Hi,
Quoted 37 lines · Elvis Pfutzenreuter
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
Quoted 8 lines
In terms of minimizing energy consumption and API methods, the 'best' would be:
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
[MT] Final temperature can only be indicated and intermediate temperature can only be notified. Client can't read them from server, according to the Thermometer profile spec.
Quoted 8 lines
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
[MT] Once indication or notification is enabled, client has to be ready to receive notification or indication as soon as the physical link is established with the temperature sensor.
Quoted 6 lines
Main problem would be having a "toothless" agent. Looks funny.
--
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
Hi all,
2011/6/22 mike tsai <[email protected]>:
Quoted 43 lines
Hi,
Quoted 40 lines · Elvis Pfutzenreuter
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
In terms of minimizing energy consumption and API methods, the 'best' would be:
Quoted 8 lines
Quoted 5 lines
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
[MT] Final temperature can only be indicated and intermediate temperature can only be notified. Client can't read them from server, according to the Thermometer profile spec.
With reference to final measurement, I think that the best solution may be a mix between previous RFC and this one. We could have a feature "Final" that applications can enable through SetProperty method. If some process change its value the proper signal is emmited as usual. When the final measure arrived, the callack and propertychange signal is emmited too indicating that its value has changed from true to False and no more final measures will be scanned. In this way, everybody could get final measures without have to set periodic intervals.
Of course, we can ignore this action if some process set this property and no watchers are registered. In this way we can save GATT traffic and power consumption because in this case there are'nt agents interested in getting measures.
Quoted 7 lines
Quoted 7 lines
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
It seems a mix between both RFCs. What do you think if I prepare a new API to send it to the mailing list during the day?
Regards
Quoted 43 lines · mike tsai
Hi,
Quoted 40 lines · Elvis Pfutzenreuter
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
In terms of minimizing energy consumption and API methods, the 'best' would be:
Quoted 8 lines
Quoted 5 lines
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
[MT] Final temperature can only be indicated and intermediate temperature can only be notified. Client can't read them from server, according to the Thermometer profile spec.
Glup, that is true :\
In other profiles people are taking care of making notifiable characteristics readable as well, but it slipped for thermometer.
In this case, the only reason one could argue using properties for temperatures would be to reuse the PropertyChanged for notifications and indications. BlueZ could store the last temperature locally, should some app wants it immediately. (The special IEEE FLOAT values take care of the case where a measurement hasn't been taken yet.)
Quoted 4 lines
Quoted 4 lines
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
Quoted 8 lines
Quoted 5 lines
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
[MT] Once indication or notification is enabled, client has to be ready to receive notification or indication as soon as the physical link is established with the temperature sensor.
Ok, but we can disable it when no agent is active, right?
Hi Elvis,
Quoted 74 lines · Elvis Pfutzenreuter
Quoted 43 lines · mike tsai
Hi,
Quoted 40 lines · Elvis Pfutzenreuter
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
In terms of minimizing energy consumption and API methods, the 'best' would be:
Quoted 8 lines
Quoted 5 lines
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
[MT] Final temperature can only be indicated and intermediate temperature can only be notified. Client can't read them from server, according to the Thermometer profile spec.
Glup, that is true :\
In other profiles people are taking care of making notifiable characteristics readable as well, but it slipped for thermometer.
In this case, the only reason one could argue using properties for temperatures would be to reuse the PropertyChanged for notifications and indications. BlueZ could store the last temperature locally, should some app wants it immediately. (The special IEEE FLOAT values take care of the case where a measurement hasn't been taken yet.)
Quoted 9 lines
Quoted 9 lines
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
Quoted 5 lines
Quoted 3 lines
[MT] Once indication or notification is enabled, client has to be ready to receive notification or indication as soon as the physical link is established with the temperature sensor.
Ok, but we can disable it when no agent is active, right?
Actually, from "Health" thermometer profile point of view, the desire processing should be like this.
Application registers with profile (or agent?)
Application decides to connect to thermometer, bond and enable indication/notification(Profile shall return OK immediately if device was bonded before)
Profile should add thermometer device into white list Application disconnects thermometer
Application ends (user exits the application)
User press a button in Health thermometer sensor to measure the temperature Thermometer starts directed connectable advertising, then indirected connectable advertising
Profile does white list selective connection and connects to thermometer thermometer sends intermediate temperature (if enabled) notification Profile invokes application(s) and passes the intermediate temperature Application processes the intermediate temperature (display as number or draw a graphic)
Profile sends final measurement to application
User sees the data and ends the application
So, since the current architecture has thermometer profile as part of bluetoothd, then it shall remember the registered application(s) and invoke it(or them) automatically.
Hi,
2011/6/23 Elvis Pfutzenreuter <[email protected]>:
Quoted 56 lines · mike tsai
Quoted 44 lines
Hi,
Quoted 40 lines · Elvis Pfutzenreuter
Quoted 15 lines
Quoted 6 lines
Quoted 1 line
(cut)
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Quoted 8 lines
A pair of Enable/DisableIntermediate methods taking an agent as parameter would be more adequate.
IMHO there would not be a need of such
methods for final measure, because the final measurement (which is the only one guaranteed to be precise) is the final objective, there is no point in registering an agent and not wanting a final measurement.Quoted 6 lines
They werent in this RFC. I only see a problem now, for example if an agent wants to get only a single *final* measure without setting an interval and after a while the same agents decides that it wants to get a new single measure without setting an interval for periodic measurements. I don't see how it could do this with current API (where get final measure methods are not present).
For that, having temperature as one of the properties would be great (allowing apps unable/unwilling to set up an agent to read it).
Or setting a convention that, if you register an agent, a GATT read is fired and you get a measurement right after. (It seems that you said something in that direction below.) Disvantage is that registering and unregistering agents just to get 1 measurement would cycle GATT indications needlessly.
Quoted 5 lines
We could think that an agent is only registered during the time it is interested in being notified about final measures, after that, it should unregister itself from the service. In that scenario we can set notify property for final measures each time an agent is registered (if not periodic interval is already set).
In terms of minimizing energy consumption and API methods, the 'best' would be:
Quoted 8 lines
Quoted 5 lines
a) intermediate and final temperatures being properties (intermediate property is there only if thermometer supports it).
b) There are GATT reads on them when some app reads the property;
[MT] Final temperature can only be indicated and intermediate temperature can only be notified. Client can't read them from server, according to the Thermometer profile spec.
Glup, that is true :\
Quoted 8 lines
In other profiles people are taking care of making notifiable characteristics readable as well, but it slipped for thermometer.
In this case, the only reason one could argue using properties for temperatures would be to reuse the PropertyChanged for notifications and indications. BlueZ could store the last temperature locally, should some app wants it immediately. (The special IEEE FLOAT values take care of the case where a measurement hasn't been taken yet.)
I would prefer not to use properties for the measures for several reasons. First of them is because of we should have to store the last temperature locally, Sometimes the device does not include time stamp in the measure because is not mandatory. if the device does not support storing of data we should to include a timestamp because after a while an application may want to read the last measure. That is not severe but we are adding extra information to the data that it isn't provided by the thermometer, IMO it seems a little ugly. The same case for intermediate temperature.
On the other hands, a new PropertyChange signal would be triggered on the bus each time a measure arrives, I think that it may be too heavy specially in the case of intermediate measures where the rate of updates is higher.
For above reasons I think that we should use a callback in the agent side whenever it is possible.
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
c) those properties generate PropertyChanged signals only when notifications are enabled for one or another, or there was a GATT read;
Quoted 8 lines
Quoted 5 lines
d) applications signal interest in notifications by registering an agent (or by some other way). Registering an agent automatically means interest in final temp notifications, an additional method enables/disables interest in intermediate temp notifications.
[MT] Once indication or notification is enabled, client has to be ready to receive notification or indication as soon as the physical link is established with the temperature sensor.
Ok, but we can disable it when no agent is active, right?
Hi,
(cut)
Quoted 22 lines
Quoted 15 lines
I mean the case when a process (it is not neccesary it has to be an agent) is enabling intermediate and/or final notifications through setProperty method in D-Bus API. Please, note that any process can do this in current API because no extra control is done for this operation.
May be I'm misundertanding what you want to said with per-agent basis but as far as I see the only way to manage enabling/disabling properties in this way is by adding a new parameter in setProperty method with the agent path and checkicng if it is already registered before enabling or disabling intermediate and final notifications. IMO If we do this we would break the BlueZ APIs where no extra parameters are required in such methods. I'm not sure if this would be a problem but I don't feel comfortable with this solution.
Quoted 6 lines
On the other hands, if we discard adding the agent parameter in that method (which I think that it fits better in BlueZ API), we can ignore the case when there aren't any agents registered for the thermometer service and a process enables some of this properties. In this case it wouldn't be necessary to activate these properties since no one will receive notifications for the measures.
Quoted 3 lines
True, I did not remember that those were properties. They would have to go, otherwise it is too easy for an app to "break" another, by disabling notifications.
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
For this reason I think that the Thermometer API should be the most permissive possible. If any application disable intermediate or final measures, the PropertyChanged signal will be triggered, well, there is no problem, if there are agents interested in such measures they only will have to enable the proterty in the API once again as usual.
To summarize, I think we should add the properties to enable and disable intermediate and final measures and to leave to applications to take deccisions about how they are going to behave when this stuff happen.
Waiting for you comments before sending a new RFC.
Regards.
Quoted 6 lines
Quoted 1 line
(cut)
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Ok, but then the risk is clear. My feeling is that people are already "toning down" this API because of this. (One of the reasons my patch to add descriptor manipulation capability was rejected is that it was not meant to be a complete API and effort should go to profile-specific APIs. Without this, you can't toggle notifications and indications using generic GATT API anyway.)
Quoted 8 lines
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
Quoted 5 lines
For this reason I think that the Thermometer API should be the most permissive possible. If any application disable intermediate or final measures, the PropertyChanged signal will be triggered, well, there is no problem, if there are agents interested in such measures they only will have to enable the proterty in the API once again as usual.
I can see two apps monitoring PropertyChanged to enforce opposite states of notification. It would create a lot of heat.
Quoted 4 lines
To summarize, I think we should add the properties to enable and disable intermediate and final measures and to leave to applications to take deccisions about how they are going to behave when this stuff happen.
I remember Marcel saying once that applications always do the wrong thing when given the chance :) In this respect, our opinions are pretty much opposite; IMHO one application must not have a way to create a problem to others. Notification interval is impossible to insulate, for there is just one per device, but we can do better for toggling of notifications.
It would be nice to have more opinions on this.
Quoted 36 lines · Elvis Pfutzenreuter
Quoted 6 lines
Quoted 1 line
(cut)
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Ok, but then the risk is clear. My feeling is that people are already "toning down" this API because of this. (One of the reasons my patch to add descriptor manipulation capability was rejected is that it was not meant to be a complete API and effort should go to profile-specific APIs. Without this, you can't toggle notifications and indications using generic GATT API anyway.)
Quoted 8 lines
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
Quoted 5 lines
For this reason I think that the Thermometer API should be the most permissive possible. If any application disable intermediate or final measures, the PropertyChanged signal will be triggered, well, there is no problem, if there are agents interested in such measures they only will have to enable the proterty in the API once again as usual.
I can see two apps monitoring PropertyChanged to enforce opposite states of notification. It would create a lot of heat.
Quoted 4 lines
To summarize, I think we should add the properties to enable and disable intermediate and final measures and to leave to applications to take deccisions about how they are going to behave when this stuff happen.
Quoted 8 lines
I remember Marcel saying once that applications always do the wrong thing when given the chance :) In this respect, our opinions are pretty much opposite; IMHO one application must not have a way to create a problem to others. Notification interval is impossible to insulate, for there is just one per device, but we can do better for toggling of notifications.
It would be nice to have more opinions on this.
could we apply an 'OR' logic to this inside the profile? Each application will have its own property setting.
So if App-A enables both, then it will receive both immediate/.final temperatures indication/notification.
if App-B enables only final, then it receives final temperature indication only. There are still the issue of how profile can "wake up" application(s) when notification/indication come.
Quoted 5 lines
--
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
Quoted 44 lines · mike tsai
Quoted 43 lines · Elvis Pfutzenreuter
Quoted 6 lines
Quoted 1 line
(cut)
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Ok, but then the risk is clear. My feeling is that people are already "toning down" this API because of this. (One of the reasons my patch to add descriptor manipulation capability was rejected is that it was not meant to be a complete API and effort should go to profile-specific APIs. Without this, you can't toggle notifications and indications using generic GATT API anyway.)
Quoted 8 lines
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
Quoted 5 lines
For this reason I think that the Thermometer API should be the most permissive possible. If any application disable intermediate or final measures, the PropertyChanged signal will be triggered, well, there is no problem, if there are agents interested in such measures they only will have to enable the proterty in the API once again as usual.
I can see two apps monitoring PropertyChanged to enforce opposite states of notification. It would create a lot of heat.
Quoted 4 lines
To summarize, I think we should add the properties to enable and disable intermediate and final measures and to leave to applications to take deccisions about how they are going to behave when this stuff happen.
I remember Marcel saying once that applications always do the wrong thing when given the chance :) In this respect, our opinions are pretty much opposite; IMHO one application must not have a way to create a problem to others. Notification interval is impossible to insulate, for there is just one per device, but we can do better for toggling of notifications.
Quoted 8 lines
Quoted 1 line
It would be nice to have more opinions on this.
could we apply an 'OR' logic to this inside the profile? Each application will have its own property setting.
So if App-A enables both, then it will receive both immediate/.final temperatures indication/notification.
if App-B enables only final, then it receives final temperature indication only. There are still the issue of how profile can "wake up" application(s) when notification/indication come.
It is a tempting alternative, would render a very clean API.
Thing is, you need to show each client app process a different 'view' of those D-Bus properties. It is feasible, but it is a new trick, not employed in other APIs.
Hi,
2011/6/25 Elvis Pfutzenreuter <[email protected]>:
Quoted 55 lines · mike tsai
Quoted 45 lines · Elvis Pfutzenreuter
Quoted 43 lines
Quoted 6 lines
Quoted 1 line
(cut)
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Ok, but then the risk is clear. My feeling is that people are already "toning down" this API because of this. (One of the reasons my patch to add descriptor manipulation capability was rejected is that it was not meant to be a complete API and effort should go to profile-specific APIs. Without this, you can't toggle notifications and indications using generic GATT API anyway.)
Quoted 8 lines
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
Quoted 5 lines
For this reason I think that the Thermometer API should be the most permissive possible. If any application disable intermediate or final measures, the PropertyChanged signal will be triggered, well, there is no problem, if there are agents interested in such measures they only will have to enable the proterty in the API once again as usual.
I can see two apps monitoring PropertyChanged to enforce opposite states of notification. It would create a lot of heat.
Quoted 4 lines
To summarize, I think we should add the properties to enable and disable intermediate and final measures and to leave to applications to take deccisions about how they are going to behave when this stuff happen.
I remember Marcel saying once that applications always do the wrong thing when given the chance :) In this respect, our opinions are pretty much opposite; IMHO one application must not have a way to create a problem to others. Notification interval is impossible to insulate, for there is just one per device, but we can do better for toggling of notifications.
Quoted 8 lines
Quoted 1 line
It would be nice to have more opinions on this.
could we apply an 'OR' logic to this inside the profile? Each application will have its own property setting.
So if App-A enables both, then it will receive both immediate/.final temperatures indication/notification.
if App-B enables only final, then it receives final temperature indication only. There are still the issue of how profile can "wake up" application(s) when notification/indication come.
Quoted 5 lines
It is a tempting alternative, would render a very clean API.
Thing is, you need to show each client app process a different 'view' of those D-Bus properties. It is feasible, but it is a new trick, not employed in other APIs.
I think that it may work for Final and Intermediate but not for the Interval property that is common for all agents. Besides, this characteristic can be readed/writed through the D-Bus attribute API too as Anderson said.
IMO we should adopt a refcount like behavior for notifications/indications. On the other hands, we can assume that there will be agents registered during the time they are interested for final measures so we can activate this notification whenever there are agents registered for the health thermometer service.
Opinions?
Best regards.
Quoted 10 lines
Quoted 5 lines
(cut)
Thing is, you need to show each client app process a different 'view' of those D-Bus properties. It is feasible, but it is a new trick, not employed in other APIs.
I think that it may work for Final and Intermediate but not for the Interval property that is common for all agents. Besides, this characteristic can be readed/writed through the D-Bus attribute API too as Anderson said.
Agreed. Interval is unsolvable; there is only one per device.
Hi Santiago,
Quoted 4 lines · Santiago Carot
Coming back to this issue. I was just wondering that we may not need worried about this issue because the same case may occurs at GATT level. I mean, an application using GATT could disturb the behaviour of other one when it enables/disables characteristics.
Actually, the current D-Bus "generic" GATT API does not enable/disable notifications (it assumes it has been enabled by some other mean, e.g. using gatttool). I had a patch to enable it when the first D-Bus client was interested on a characteristic (disabling was not possible yet), but it has not been submitted upstream (we are currently focusing on the core API for profiles AKA "attio driver").
So, as of now, some application using the generic D-Bus API will not affect the profile specific behavior, as it can only read/write characteristic values, and watch for already enabled notifications/indications.
Quoted 6 lines
Because of any application can enable/disable characteristics we don't need to worry about to manage this in the Thermometer API. Remember that in other threads in the mailing list people were speaking about making a D-Bus API for GATT. Those applications using GATT could enable notification for measures and disable it. On account of this, it will be inevitable collisions in the use cases.
I think we should adopt a refcount like behavior for notifications/indications, and bluez core should manage this. IOW, applications registered over d-bus grab a counter, on the first ref() the notification/indication is enabled on peer device, on last unref() it is disabled.
My two cents,
Signature · 3 lines
Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil
Hi Elvis,
(cut)
Quoted 5 lines
I understand why you used this type (keeps the thermometer transcodable through this API and there are the special values), so BTW the lack of device information service access through this API should at least be mentioned, so we ammend that later (either here or adding another API).
I don't forget the DIS issue but so far I think it's better address a part of the problem, when we fix the thermomether API we must treat this one. Let's split the problem in subproblems ;)
Regards.