From: Szymon Janc <szymon.janc@codecoup.pl>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 4/9] tools/btpclient: Store index along with adapter proxy
Date: Fri, 08 Dec 2017 11:12:55 +0100 [thread overview]
Message-ID: <79623423.t27RlUlLFK@ix> (raw)
In-Reply-To: <CABBYNZ+Nw0KLgbEfU6F9f6kE4FAgTPspphFO5yW3Qs47hh05Sg@mail.gmail.com>
Hi Luiz,
On Thursday, 7 December 2017 18:42:55 CET Luiz Augusto von Dentz wrote:
> Hi Szymon,
>
> On Thu, Dec 7, 2017 at 12:21 PM, Szymon Janc <szymon.janc@codecoup.pl>
wrote:
> > ---
> >
> > tools/btpclient.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/tools/btpclient.c b/tools/btpclient.c
> > index c7ff239b0..3a4971eeb 100644
> > --- a/tools/btpclient.c
> > +++ b/tools/btpclient.c
> > @@ -37,6 +37,7 @@
> >
> > struct btp_adapter {
> >
> > struct l_dbus_proxy *proxy;
> >
> > + unsigned int index;
> >
> > };
> >
> > struct btp_device {
> >
> > @@ -157,9 +158,18 @@ static void proxy_added(struct l_dbus_proxy *proxy,
> > void *user_data)>
> > if (!strcmp(interface, "org.bluez.Adapter1")) {
> >
> > struct btp_adapter *adapter;
> >
> > + unsigned int index;
> > +
> > + /* TODO should we rely on path for index or use other
> > mapping + * like queue size?
> > + */
> > + if (sscanf(l_dbus_proxy_get_path(proxy),
> > "/org/bluez/hci%u", +
> > &index) != 1) + return;
>
> Usually, we don't operate by index over D-Bus so if all operation are
> over D-Bus knowing the index shall not be needed, if this is for BTP
> then we could perhaps just map directly to the queue directly but Im
> not sure why would BTP have an adapter index?
This is only for BTP to identify adapter, I'll just simple counter. If adapter
is gone we terminate anyway. And index is part of BTP header for historical
reasons:)
>
> > adapter = l_new(struct btp_adapter, 1);
> > adapter->proxy = proxy;
> >
> > + adapter->index = index;
> >
> > l_queue_push_tail(adapters, adapter);
> > return;
> >
> > --
> > 2.14.3
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
--
pozdrawiam
Szymon Janc
next prev parent reply other threads:[~2017-12-08 10:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 14:21 [PATCH 0/9] Initial code for BTP client Szymon Janc
2017-12-07 14:21 ` [PATCH 1/9] shared/btp: Add initial code for library Szymon Janc
2017-12-07 14:21 ` [PATCH 2/9] tools/btpclient: Add initial code Szymon Janc
2017-12-07 14:21 ` [PATCH 3/9] shared/btp: Add definitions for GAP service Szymon Janc
2017-12-07 14:21 ` [PATCH 4/9] tools/btpclient: Store index along with adapter proxy Szymon Janc
2017-12-07 17:42 ` Luiz Augusto von Dentz
2017-12-08 10:12 ` Szymon Janc [this message]
2017-12-07 14:21 ` [PATCH 5/9] tools/btpclient: Add initial support for GAP service Szymon Janc
2017-12-07 14:21 ` [PATCH 6/9] tools/btpclient: Add initial support for read controller info command Szymon Janc
2017-12-07 14:21 ` [PATCH 7/9] tools/btpclient: Get initial values for adapter setttings Szymon Janc
2017-12-07 14:21 ` [PATCH 8/9] tools/btpclient: Add support for tracking mutable adapter settings Szymon Janc
2017-12-07 14:21 ` [PATCH 9/9] tools/btpclient: Add support for configuring " Szymon Janc
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=79623423.t27RlUlLFK@ix \
--to=szymon.janc@codecoup.pl \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@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).