detecting BLE compatibility of an adapter?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux