All of lore.kernel.org
 help / color / mirror / Atom feed
* getting address type from scan result
@ 2020-12-25  4:28 Ordit Gross
  2020-12-28 12:24 ` Ordit Gross
  2020-12-28 12:33 ` Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Ordit Gross @ 2020-12-25  4:28 UTC (permalink / raw)
  To: linux-bluetooth

hi,

Up till now the peripheral device we worked against was configured
with public address,
now it might also be random (both BDADDR_LE_RANDOM, BDADDR_LE_PUBLIC).
The type of address is needed to connect correctly to the device
(using l2cap_connect).

How can I get the address type from the scan report?
I'm currently using bluetoothctl, which seems not to expose this
information in Device1 interface.
thanks in advance! and happy holidays

--

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

* Re: getting address type from scan result
  2020-12-25  4:28 getting address type from scan result Ordit Gross
@ 2020-12-28 12:24 ` Ordit Gross
  2020-12-28 12:33 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Ordit Gross @ 2020-12-28 12:24 UTC (permalink / raw)
  To: linux-bluetooth

just to clarify, the needed information is:
> HCI Event: LE Meta Event (0x3e) plen 37                                                                                                                       #324 [hci0] 1064.855314
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: 5B:6C:86:BE:2C:40 (Resolvable)

the only way I could think of is by opening an hci socket.. is there
any other way?
thanks for your help!


On Fri, Dec 25, 2020 at 6:28 AM Ordit Gross <ordit.gross@orcam.com> wrote:
>
> hi,
>
> Up till now the peripheral device we worked against was configured
> with public address,
> now it might also be random (both BDADDR_LE_RANDOM, BDADDR_LE_PUBLIC).
> The type of address is needed to connect correctly to the device
> (using l2cap_connect).
>
> How can I get the address type from the scan report?
> I'm currently using bluetoothctl, which seems not to expose this
> information in Device1 interface.
> thanks in advance! and happy holidays
>
> --



--

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

* Re: getting address type from scan result
  2020-12-25  4:28 getting address type from scan result Ordit Gross
  2020-12-28 12:24 ` Ordit Gross
@ 2020-12-28 12:33 ` Marcel Holtmann
       [not found]   ` <CAB+bgRbsfGedvrQe-BjecUmhOA4-VpLyXEJ44_ninC_hw+YgrQ@mail.gmail.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2020-12-28 12:33 UTC (permalink / raw)
  To: Ordit Gross; +Cc: linux-bluetooth

Hi Ordit,

> Up till now the peripheral device we worked against was configured
> with public address,
> now it might also be random (both BDADDR_LE_RANDOM, BDADDR_LE_PUBLIC).
> The type of address is needed to connect correctly to the device
> (using l2cap_connect).
> 
> How can I get the address type from the scan report?
> I'm currently using bluetoothctl, which seems not to expose this
> information in Device1 interface.
> thanks in advance! and happy holidays

it is in the Device1 interface for the Identity Address. Why are you going to connect an L2CAP socket in the first place for a LE device.

Regards

Marcel


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

* Re: getting address type from scan result
       [not found]   ` <CAB+bgRbsfGedvrQe-BjecUmhOA4-VpLyXEJ44_ninC_hw+YgrQ@mail.gmail.com>
@ 2020-12-28 18:37     ` Ordit Gross
  0 siblings, 0 replies; 4+ messages in thread
From: Ordit Gross @ 2020-12-28 18:37 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

hi Marcel, appreciate your answer, I am using code sample
btgatt-client.c which uses function:
static int l2cap_le_att_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t
dst_type, int sec)
is there a way to implement connect without stating the dst_type?
thanks again


> On Mon, Dec 28, 2020 at 2:33 PM Marcel Holtmann <marcel@holtmann.org> wrote:
>>
>> Hi Ordit,
>>
>> > Up till now the peripheral device we worked against was configured
>> > with public address,
>> > now it might also be random (both BDADDR_LE_RANDOM, BDADDR_LE_PUBLIC).
>> > The type of address is needed to connect correctly to the device
>> > (using l2cap_connect).
>> >
>> > How can I get the address type from the scan report?
>> > I'm currently using bluetoothctl, which seems not to expose this
>> > information in Device1 interface.
>> > thanks in advance! and happy holidays
>>
>> it is in the Device1 interface for the Identity Address. Why are you going to connect an L2CAP socket in the first place for a LE device.
>>
>> Regards
>>
>> Marcel
>>
>
>
> --
>


--

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

end of thread, other threads:[~2020-12-28 18:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25  4:28 getting address type from scan result Ordit Gross
2020-12-28 12:24 ` Ordit Gross
2020-12-28 12:33 ` Marcel Holtmann
     [not found]   ` <CAB+bgRbsfGedvrQe-BjecUmhOA4-VpLyXEJ44_ninC_hw+YgrQ@mail.gmail.com>
2020-12-28 18:37     ` Ordit Gross

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.