2011-03-21 08:38:07

by Suraj Sumangala

[permalink] [raw]
Subject: accessing Link key within the Bluetooth module

Hi,

I am working on a Bluetooth AMP manager module (linked to l2cap module)
that require access to the Link key of the connected(paired) device.

I am trying to use the hci_find_link_key() call with the BDADDR of the
remote device as parameter without success. It looks like the list
"hci_dev.link_keys" is not getting populated in the first place.

Note: The device is already paired with the local device, so the link
key should be available( I do see the link_key_notify_evt getting called).

is there any way to access the link key of a paired device inside the
Bluetooth module?

Regards
Suraj


2011-03-22 17:16:43

by Gustavo Padovan

[permalink] [raw]
Subject: Re: accessing Link key within the Bluetooth module

Hi Suraj,

* Suraj Sumangala <[email protected]> [2011-03-22 09:59:59 +0530]:

> Hi Johan,
>
> On 3/21/2011 7:18 PM, Johan Hedberg wrote:
> > Hi Suraj,
> >
> > That list only gets populated if you've enabled the management interface
> > (enable_mgmt=1 module option) and have a matching user space version
> > with management interface support.
>
> Thanks,
> The link key is required for creating an AMP connection.
>
> Does it make sense to depend the AMP module on the "enable_mgmt" feature?

Yes, but does not use enable_mgmt in your code.

--
Gustavo F. Padovan
http://profusion.mobi

2011-03-22 04:29:59

by Suraj Sumangala

[permalink] [raw]
Subject: Re: accessing Link key within the Bluetooth module

Hi Johan,

On 3/21/2011 7:18 PM, Johan Hedberg wrote:
> Hi Suraj,
>
> That list only gets populated if you've enabled the management interface
> (enable_mgmt=1 module option) and have a matching user space version
> with management interface support.

Thanks,
The link key is required for creating an AMP connection.

Does it make sense to depend the AMP module on the "enable_mgmt" feature?
Or
Add an new link key variable to the "struct hci_conn" and update it by
handling the LINK KEY related HCI (Link key request/reply) events?
>
> Johan

Regards
Suraj

2011-03-21 13:48:33

by Johan Hedberg

[permalink] [raw]
Subject: Re: accessing Link key within the Bluetooth module

Hi Suraj,

On Mon, Mar 21, 2011, Suraj Sumangala wrote:
> I am working on a Bluetooth AMP manager module (linked to l2cap
> module) that require access to the Link key of the connected(paired)
> device.
>
> I am trying to use the hci_find_link_key() call with the BDADDR of
> the remote device as parameter without success. It looks like the
> list "hci_dev.link_keys" is not getting populated in the first
> place.

That list only gets populated if you've enabled the management interface
(enable_mgmt=1 module option) and have a matching user space version
with management interface support.

Johan