2016-09-14 15:59:10

by Don Zickus

[permalink] [raw]
Subject: using d-bus api to set security level

Hi,

I am trying to find the equivalent of using gatttool's --sec-level when
writing a python script to connect to an LE device over the d-bus API.

It seems like I have to set the Characteristic correctly. But I am missing
something obvious when looking through the doc/ api files.

Can someone point me to the right spot? Thanks!

Cheers,
Don



2016-09-15 21:27:50

by Don Zickus

[permalink] [raw]
Subject: Re: using d-bus api to set security level

On Wed, Sep 14, 2016 at 07:52:11PM +0300, Luiz Augusto von Dentz wrote:
> Hi Don,
>
> On Wed, Sep 14, 2016 at 6:59 PM, Don Zickus <[email protected]> wrote:
> > Hi,
> >
> > I am trying to find the equivalent of using gatttool's --sec-level when
> > writing a python script to connect to an LE device over the d-bus API.
> >
> > It seems like I have to set the Characteristic correctly. But I am missing
> > something obvious when looking through the doc/ api files.
> >
> > Can someone point me to the right spot? Thanks!
>
> You can call Device1.Pair if you want to authenticate, once the LTK is
> exchanged it will be used automatically in the next connections.

Hi Luiz,

Thanks for the response. I guess if the Pair() fails with Authentication
failure, that implies the device does not support it? I was playing with
this TI sensortag and wanted to double check how it was connecting.

So does the authentication get setup by the agent? And the Pair() to the
agent determines if the link will be encrypted?

Cheers,
Don

2016-09-14 16:52:11

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: using d-bus api to set security level

Hi Don,

On Wed, Sep 14, 2016 at 6:59 PM, Don Zickus <[email protected]> wrote:
> Hi,
>
> I am trying to find the equivalent of using gatttool's --sec-level when
> writing a python script to connect to an LE device over the d-bus API.
>
> It seems like I have to set the Characteristic correctly. But I am missing
> something obvious when looking through the doc/ api files.
>
> Can someone point me to the right spot? Thanks!

You can call Device1.Pair if you want to authenticate, once the LTK is
exchanged it will be used automatically in the next connections.


--
Luiz Augusto von Dentz