All of lore.kernel.org
 help / color / mirror / Atom feed
* detecting BLE compatibility of an adapter?
@ 2015-08-22  7:35 Daniel Lenski
  2015-08-24  8:30 ` Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Lenski @ 2015-08-22  7:35 UTC (permalink / raw)
  To: linux-bluetooth

Hi,
Does Bluez provide a way to detect the compatibility of a Bluetooth
adapter with Bluetooth 4.0/Low Energy?

I have written some command-line tools to interact with BLE devices
and have received a couple of bug reports from users who don't realize
that they don't have Bluetooth 4.0 adapters.

It appears that connect() with a BLE destination address results in
errno=EBADRQC. Is this errno value a reliable way to detect an
incompatible adapter? Is it possible to query the hci device to detect
compatibility without trying and failing?

    struct sockaddr_l2 srcaddr, dstaddr;

    memset(&dstaddr, 0, sizeof(dstaddr));
    dstaddr.l2_family = AF_BLUETOOTH;
    dstaddr.l2_cid = htobs(4); // ATT_CID
    dstaddr.l2_bdaddr_type = BDADDR_LE_RANDOM;
    ...
    connect(sock, (struct sockaddr *) &dstaddr, sizeof(dstaddr))

Thanks,
Dan

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

end of thread, other threads:[~2015-08-24 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-22  7:35 detecting BLE compatibility of an adapter? Daniel Lenski
2015-08-24  8:30 ` Johan Hedberg
2015-08-24 17:46   ` Daniel Lenski
2015-08-24 18:09     ` Marcel Holtmann
2015-08-24 21:11       ` Daniel Lenski

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.