All of lore.kernel.org
 help / color / mirror / Atom feed
* D-Bus for LE
@ 2011-03-03 17:33 Marco Sinigaglia
  2011-03-03 17:51 ` Anderson Lizardo
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Sinigaglia @ 2011-03-03 17:33 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

Hi All,

I am looking the D-Bus API for low energy and I cannot find a way to run 
a discover for LE devices and connect to them.
Are these API implemented? if not, are they going to be?


Looking the attribute-api it should be possible to do some stuff on the 
local device but, on my box, it looks like not working.
I am sure that the blutoothd is kicking off the attribute server 
(sdptool is showing the le profiles), nevertheless the test-attrib is 
showing nothing:

 >sudo ./test-attrib  -i hci0
[nothing]

Cheers
Marco


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: D-Bus for LE
  2011-03-03 17:33 D-Bus for LE Marco Sinigaglia
@ 2011-03-03 17:51 ` Anderson Lizardo
  0 siblings, 0 replies; 2+ messages in thread
From: Anderson Lizardo @ 2011-03-03 17:51 UTC (permalink / raw)
  To: Marco Sinigaglia; +Cc: linux-bluetooth@vger.kernel.org

Hi,

On Thu, Mar 3, 2011 at 1:33 PM, Marco Sinigaglia
<marco.sinigaglia@csr.com> wrote:
> Hi All,
>
> I am looking the D-Bus API for low energy and I cannot find a way to run a
> discover for LE devices and connect to them.
> Are these API implemented? if not, are they going to be?
>
>
> Looking the attribute-api it should be possible to do some stuff on the
> local device but, on my box, it looks like not working.
> I am sure that the blutoothd is kicking off the attribute server (sdptool is
> showing the le profiles), nevertheless the test-attrib is showing nothing:
>
>>sudo ./test-attrib  -i hci0
> [nothing]

Did you connect to the remote first using "test-device create" ? Also
make sure the remote is advertising with Flags = 0x06 (bits "BR/EDR
not supported" and "general discoverable mode") if the remove is dual
mode, otherwise it will attempt a BR/EDR connection.

In summary:

1) On the remote device enable advertising and (if a dual mode) set
flags to 0x06:

hcitool -i hciX cmd 0x08 0x0008 03 02 01 06
hciconfig hciX leadv

2) on the local side, start discovery (so the adv data is saved by
bluez) followed by test-device create:

test-discovery (wait for it to finish or at least show the device you
will connect to)
test-device create <bdaddr>

3) not the tricky part: you need to reenable advertising on the remote
side (see step #1) for test-attrib to work. This is because remote
disabled advertising after the LE connection during test-device create
was done, and IIRC test-device create does not keep connection open.
test-attrib will them open a new connection which only works with
advertising enabled on remote side.

3) you can now run test-attrib:

./test-attrib -i hciX

Note this API is ongoing some changes and most of the steps above will
be automatic. See the "TODO" file on BlueZ source for the planned
changes.

HTH,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-03 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 17:33 D-Bus for LE Marco Sinigaglia
2011-03-03 17:51 ` Anderson Lizardo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.