linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Barry Byford <31baz66@gmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>
Subject: Re: low energy: does gatt client/server work in current version? How to test?
Date: Sun, 14 Oct 2018 23:40:07 +0200	[thread overview]
Message-ID: <20181014214007.GA17602@amd> (raw)
In-Reply-To: <CABBYNZ+R5M+gDyFZ6+fuJyXtNbvPiM7bh+BVeYQOn8oP9JJgSQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]

Hi!

> > > Using hciconfig while bluetoothd is running sounds kind-of
> > > dangerous. Stackoverflow (2) suggests using btmgmt (3) instead, and
> > > things got slightly different, but did not start to work for me. Is
> > > there documentation how to get this to work somewhere?
> 
> Have a look at bluetoothctl first, all the necessary commands are
> there to enable to act as peripheral:

First, thanks a lot. With bluetoothctl, it indeed works.

> > > (3)
> > > sudo tools/btmgmt -i hci0 power off
> > > sudo tools/btmgmt -i hci0 le on
> > > sudo tools/btmgmt -i hci0 connectable on
> > > sudo tools/btmgmt -i hci0 name "some friendly name"
> > > sudo tools/btmgmt -i hci0 advertising on
> > > sudo tools/btmgmt -i hci0 power on
> > > tools/btgatt-server -i hci0 -s low -t public -r -v
> 
> No need to use btmgmt, applications should use the D-Bus API which has
> pretty much everything you are doing with btmgmt.

Pretty much, yes.

There's one piece I'm missing. I need to use "random address", because
that's what other side of link wants to talk to. "privacy on" from
btmgmt does randomize address (and sets the right bit). I have not
found equivalent in bluetoothctl.

Plus... I'd really like to use "random, but fixed for given machine"
address, as this is device other side is expected to pair with.

Ideas woudl be welcome.

> > >     def up(m):
> > >         print("Starting up BLEE")
> > >         os.system("sudo ../bluez/src/bluetoothd -d -n &")
> > >         time.sleep(2)
> > >         os.system("sudo ./gatt-server &")
> 
> bluetoothd is already acting as a GATT server.

I may have misnamed the component, but something needs to tell which
attributes to implement to bluetoothd.

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2018-10-14 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 10:24 low energy: does gatt client/server work in current version? How to test? Pavel Machek
2018-10-01 13:53 ` Barry Byford
2018-10-02  8:53   ` Luiz Augusto von Dentz
2018-10-02 12:26     ` Pavel Machek
2018-10-05  9:15     ` Pavel Machek
2018-10-14 21:40     ` Pavel Machek [this message]
2018-10-02 12:09   ` Pavel Machek

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=20181014214007.GA17602@amd \
    --to=pavel@ucw.cz \
    --cc=31baz66@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.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;
as well as URLs for NNTP newsgroup(s).