linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Santiago Carot <sancane@gmail.com>
Cc: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 07/14] thermometer: Reformat MeasurementReceived description
Date: Fri, 28 Sep 2012 14:27:57 +0300	[thread overview]
Message-ID: <20120928112757.GA18423@x220> (raw)
In-Reply-To: <CACLukzLZGEbA-3pSqbutRrjb5WXJo7az+DydQ1Vph5bAnD0kdQ@mail.gmail.com>

Hi Santiago,

On Fri, Sep 28, 2012, Santiago Carot wrote:
> 2012/9/28 Johan Hedberg <johan.hedberg@gmail.com>:
> > Hi Andrzej,
> >
> > On Tue, Sep 25, 2012, Andrzej Kaczmarek wrote:
> >> +                     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).
> >
> > Why aren't we using the D-Bus DOUBLE type for this? For invalid/missing
> > data just leave out these values from the dict. No need to try to
> > brute-force a 1:1 mapping from the protocol to D-Bus.
> 
> We don't use double type here because these information is valuable
> for upper profiles implementing a IEE11073-20601 protocol layer. This
> fact is scarcely commented in HTP and better explained in former
> specification where there is a need to pack both values (mantissa and
> exponent) in special kind of APDUs. Of course we could provide the
> double value here, but there will remain the need to know when an
> special case occurs: NRes, NaN,INFINITY, -INFINITY.
> 
> Furthermore, providing a double value here will force to upper
> profiles to do extra stuff to calculate the mantissa and the exponent
> values in order to create APDUs, beside they will have to deal with
> impreccisions derivated to comparate float point numbers and so it
> might make difficult to check when a special case has happened.
> 
> these are, as far as I remember, the reasons which we did it in this
> way. We were already talking about this fact in the mailing list in
> the past but I don't find the thread right now. sorry

This is good enough as a justification. I remembered we had discussed
this before but for the details I needed to get my memory refreshed.
Thanks.

Johan

  reply	other threads:[~2012-09-28 11:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 14:52 [PATCH 00/14] Thermometer watchers API change + fixes Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 01/14] thermometer: Store thermometer devices per-adapter Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 02/14] thermometer: Register ThermometerManager interface on adapter path Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 03/14] thermometer: Move watcher logic to adapter interface Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 04/14] thermometer: Include remote device information in MeasurementReceived Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 05/14] thermometer: Update API document Andrzej Kaczmarek
2012-09-28 10:40   ` Johan Hedberg
2012-09-25 14:52 ` [PATCH 06/14] thermometer: Update test script Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 07/14] thermometer: Reformat MeasurementReceived description Andrzej Kaczmarek
2012-09-28 10:43   ` Johan Hedberg
2012-09-28 11:09     ` Santiago Carot
2012-09-28 11:27       ` Johan Hedberg [this message]
2012-09-25 14:52 ` [PATCH 08/14] thermometer: Update driver naming style Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 09/14] thermometer: Add constant definition for watcher interface name Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 10/14] thermometer: Add common function to write characteristics CCC Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 11/14] thermometer: Refactor processing of measurement characteristic value Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 12/14] thermometer: Fix whitespace Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 13/14] thermometer: Fix indentation Andrzej Kaczmarek
2012-09-25 14:52 ` [PATCH 14/14] thermometer: Fix missing braces Andrzej Kaczmarek
2012-09-25 15:21 ` [PATCH 00/14] Thermometer watchers API change + fixes Anderson Lizardo
2012-09-27 10:47   ` Andrzej Kaczmarek
2012-09-27 12:03     ` Anderson Lizardo
2012-10-01 11:44       ` Andrzej Kaczmarek
2012-10-01 11:51         ` Anderson Lizardo

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=20120928112757.GA18423@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=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).