linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
To: Santiago Carot <sancane@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH v2 07/15] thermometer: Reformat MeasurementReceived description
Date: Mon, 1 Oct 2012 13:32:09 +0200	[thread overview]
Message-ID: <50697F39.90008@tieto.com> (raw)
In-Reply-To: <CACLukzL99YF13_+V9wemKgWVQGC8Wcj_v+41A8DWrxnK2=cfoQ@mail.gmail.com>

Hi Santiago,

On 10/01/2012 11:43 AM, Santiago Carot wrote:
> Hi Andrzej
>
> 2012/10/1 Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>:
>> MeasurementReceived method description is reformatted to be more
>> readable and consistent with other API documents.
>>
>> Special values for Exponent and Mantissa fields specify now only NaN
>> value as this is only special value defined by HTS specification for
>> measurement.
>> ---
>>   doc/thermometer-api.txt | 67 +++++++++++++++++++++++++++----------------------
>>   1 file changed, 37 insertions(+), 30 deletions(-)
>>
>> diff --git a/doc/thermometer-api.txt b/doc/thermometer-api.txt
>> index 1828811..0fb28f5 100644
>> --- a/doc/thermometer-api.txt
>> +++ b/doc/thermometer-api.txt
>> @@ -97,33 +97,40 @@ Service             unique name
>>   Interface      org.bluez.ThermometerWatcher
>>   Object path    freely definable
>>
>> -Methods                void MeasurementReceived(dict measure)
>> -
>> -                       This callback gets called when a measure has been
>> -                       scanned in the thermometer. The Time entry in the dict
>> -                       will be only present if the device supports storing of
>> -                       data. The time value is expressed in seconds since epoch.
>> -                       The value represented is (mantissa) x (10**exponent)
>> -                       See foot note for special values when treating with
>> -                       health devices. The Type entry is only present if the
>> -                       measurement type is known. Otherwise, it is undefined.
>> -
>> -                       Dict is defined as below:
>> -                       {
>> -                               "Exponent" : int8,
>> -                               "Mantissa" : int32,
>> -                               "Unit" : ("Celsius" or "Fahrenheit"),
>> -                               "Time" : uint64,
>> -                               "Type" : ("Armpit", "Body", "Ear", "Finger",
>> -                                       "Intestines", "Mouth", "Rectum", "Toe",
>> -                                       "Tympanum"),
>> -                               "Measurement" : ("Final" or "Intermediate"),
>> -                       }
>> -
>> -                       For special cases, the exponent shall always be zero and
>> -                       the mantissa should be one of following values:
>> -
>> -                       NRes = -(2**23)
>> -                       NaN = +(2**23-1)
>> -                       INFINITY = (2**23-2)
>> -                       -INFINITY = -(2**23-2)
>> +Methods                void MeasurementReceived(dict measurement)
>> +
>> +                       This callback gets called when a measurement has been
>> +                       scanned in the thermometer.
>> +
>> +                       Measurement:
>> +
>> +                               int16 Exponent:
>> +                               int32 Mantissa:
>> +
>> +                                       Measurement value is calculated as
>> +                                       (Mantissa) x (10^Exponent)
>> +
>> +                                       In case of invalid or missing data,
>> +                                       Exponent is set to 0 and Mantissa is
>> +                                       set to 2^23-1 (0x7FFFFF hexadecimal).
>
> Mantissa values must not always be 2^23-1 on special cases.
> Information provided here is required for upper profiles which are
> implementing an 11073-20601 protocol layer because they have to
> differentiate among these values. In my opinion, documentation about
> passible values for the mantissa should remain as they are.

HTS specification states (see quote below) that measurement value field 
may be NaN in case sensor is not able to provide valid measurement. So I 
assume here that either it has valid data or NaN otherwise and thus 
there's no need to specify other special values as they should not be 
received here.

<quote>
The Temperature Measurement Value field may contain special float value 
NaN (0x007FFFFF) defined in IEEE 11073-20601 [4] to report an invalid 
result from a computation step or missing data due to the hardware’s 
inability to provide a valid measurement.
</quote>


BR,
Andrzej

  reply	other threads:[~2012-10-01 11:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01  9:23 [PATCH v2 00/15] Thermometer watchers API changes + fixes Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 01/15] thermometer: Store thermometer devices per-adapter Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 02/15] thermometer: Register ThermometerManager interface on adapter path Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 03/15] thermometer: Move watcher logic to adapter interface Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 04/15] thermometer: Include remote device information in MeasurementReceived Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 05/15] thermometer: Update API document Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 06/15] thermometer: Update test script Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 07/15] thermometer: Reformat MeasurementReceived description Andrzej Kaczmarek
2012-10-01  9:43   ` Santiago Carot
2012-10-01 11:32     ` Andrzej Kaczmarek [this message]
2012-10-01 12:08       ` Santiago Carot
2012-10-02  8:52         ` Andrzej Kaczmarek
2012-10-03  7:41           ` Santiago Carot
2012-10-01  9:23 ` [PATCH v2 08/15] thermometer: Change string properties to lower-case Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 09/15] thermometer: Update driver naming style Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 10/15] thermometer: Add constant definition for watcher interface name Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 11/15] thermometer: Add common function to write characteristics CCC Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 12/15] thermometer: Refactor processing of measurement characteristic value Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 13/15] thermometer: Fix whitespace Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 14/15] thermometer: Fix indentation Andrzej Kaczmarek
2012-10-01  9:23 ` [PATCH v2 15/15] thermometer: Fix missing braces Andrzej Kaczmarek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50697F39.90008@tieto.com \
    --to=andrzej.kaczmarek@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sancane@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).