linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: Marcel Holtmann <marcel@holtmann.org>, linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 1/6] Bluetooth: Add HCI_RSSI_INVALID for unknown RSSI value
Date: Thu, 4 Dec 2014 14:08:04 +0200	[thread overview]
Message-ID: <20141204120804.GA14367@t440s.lan> (raw)
In-Reply-To: <1611731.nCHCGk9HKZ@uw000953>

Hi Szymon,

On Thu, Dec 04, 2014, Szymon Janc wrote:
> On Thursday 04 of December 2014 11:38:35 Marcel Holtmann wrote:
> > Hi Szymon,
> > 
> > >>>>> The Bluetooth core specification defines the value 127 as invalid for
> > >>>>> RSSI values. So instead of hard coding it, lets add a constant for it.
> > >>>>> 
> > >>>>> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> > >>>>> ---
> > >>>>> include/net/bluetooth/hci.h | 1 +
> > >>>>> 1 file changed, 1 insertion(+)
> > >>>>> 
> > >>>>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > >>>>> index 569c077778b6..b6f7be1eb919 100644
> > >>>>> --- a/include/net/bluetooth/hci.h
> > >>>>> +++ b/include/net/bluetooth/hci.h
> > >>>>> @@ -412,6 +412,7 @@ enum {
> > >>>>> 
> > >>>>> /* The core spec defines 127 as the "not available" value */
> > >>>>> #define HCI_TX_POWER_INVALID	127
> > >>>>> +#define HCI_RSSI_INVALID	127
> > >>>> 
> > >>>> Isn't that value depending on command, event, link and controller type?
> > >>> 
> > >>> we use it for the mgmt side of things and there it is whatever we want it to be.
> > >> 
> > >> At least for inquiry result (no RSSI) 0 is passed to mgmt_device_found() and that seems
> > >> to be used by userspace as RSSI unavailable.
> > > 
> > > Which is strange btw, since both for LE and BR/EDR this is legal RSSI value...
> > 
> > I checked for LE. There is clearly says 127 means RSSI not available.
> 
> I meant that 0 RSSI is legal for both LE and BR/EDR but it is used in mgmt device
> found event as 'RSSI not available'.

On adapters that generate such events you will never see any other type
of discovery results (because the HW isn't capable of it), so what the
value is doesn't really matter if all the events have the same one. For
consistency however we could change this from 0 to 127.

Johan

  reply	other threads:[~2014-12-04 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  9:13 [RFC 1/6] Bluetooth: Add HCI_RSSI_INVALID for unknown RSSI value Marcel Holtmann
2014-12-04  9:59 ` Szymon Janc
2014-12-04 10:13   ` Marcel Holtmann
2014-12-04 10:24     ` Szymon Janc
2014-12-04 10:25       ` Szymon Janc
2014-12-04 10:38         ` Marcel Holtmann
2014-12-04 11:13           ` Szymon Janc
2014-12-04 12:08             ` Johan Hedberg [this message]
2014-12-04 13:57               ` Szymon Janc
2014-12-04 14:26                 ` Johan Hedberg

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=20141204120804.GA14367@t440s.lan \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=szymon.janc@tieto.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).