Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] mgmt-api: add read Tx power level command
Date: Mon, 19 Mar 2012 10:44:17 -0700	[thread overview]
Message-ID: <1332179057.14217.215.camel@aeonflux> (raw)
In-Reply-To: <CA+XVXfcPy+N0JiJsJz5-sb+7re8Y6wSGfkygzSe68H0TtN3Z6A@mail.gmail.com>

Hi Arik,

> >>> >> +     Controller Index:       <controller id>
> >>> >> +     Command Parameters:     Address (6 Octets)
> >>> >> +                             Address_Type (1 Octet)
> >>> >> +                             Type (1 Octet)
> >>> >> +     Return Parameters:      Address (6 Octets)
> >>> >> +                             Address_Type (1 Octet)
> >>> >> +                             Status (1 Octet)
> >>> >> +                             Level (1 Octet)
> >>> >> +
> >>> >> +     Possible values for the Address_Type parameter:
> >>> >> +             0       BR/EDR
> >>> >> +             1       LE Public
> >>> >> +             2       LE Random
> >>> >> +
> >>> >> +     Possible values for the Type parameter:
> >>> >> +             0       Current Transmit Power Level
> >>> >> +             1       Maximum Transmit Power Level
> >>> >
> >>> > Which ones do you care about? And why not just read both and return both
> >>> > at the same time.
> >>> >
> >>> > I think that I made this pretty clear multiple times already. The mgmt
> >>> > API is not for stuffing random HCI commands into it. Please explain your
> >>> > usage pattern of the results clearly.
> >>> >
> >>> > Who is triggering this command and who is consuming the results?
> >>>
> >>> Well the proximity reporter and proximity monitor profiles are the
> >>> ones using this (with LE connections only). The proximity monitor can
> >>> query the reporter for the Tx power level. The spec claims there's no
> >>> point in polling for this, as the value doesn't change during an LE
> >>> connection.
> >>
> >> so why are we not just reading that value when creating a LE connection?
> >> What is the penalty for doing it on every LE connection?
> >
> > Well presumably it should only be read when the TPS profile if
> > enabled. The cost is sending another command to the controller on each
> > connection. Not sure it's very high.
> > Maybe we can even integrate it into the "device connected" event, and
> > just read it for all connecting devices.
> >
> > I guess it's a matter of personal preference.
> >
> > I think this API is better for future proofing - it gives the caller
> > the option to get the Tx power for BR/EDR devices as well, at
> > arbitrary times (since it can change during a BR connection).
> > Some earlier emails suggested it might be useful.
> >
> >>
> >>> Both profiles only care about the current Tx power level. I added the
> >>> type for flexibility. It can be removed of course.
> >>>
> >>> In the proposed implementation the reporter reads this value when a
> >>> device connects and caches it. When a remote device asks for this
> >>> value (via an ATT read as part of the TPS profile), we return the
> >>> cached value.
> >>
> >> So it gets always read anyway.
> >
> > Only when TPS server is enabled.
> 
> Is the current API acceptable?

I don't know yet. Send a new version with detailed explanation and I
have another look. I am currently not fully convinced. I have the
feeling we should be doing this differently.

Regards

Marcel



  reply	other threads:[~2012-03-19 17:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-11 22:10 [PATCH] mgmt-api: add read Tx power level command Arik Nemtsov
2012-03-12  0:42 ` Marcel Holtmann
2012-03-12  7:39   ` Arik Nemtsov
2012-03-12 17:29     ` Marcel Holtmann
2012-03-12 18:07       ` Arik Nemtsov
2012-03-19  9:00         ` Arik Nemtsov
2012-03-19 17:44           ` Marcel Holtmann [this message]
2012-03-20 16:07             ` Arik Nemtsov

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=1332179057.14217.215.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=arik@wizery.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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