How can I find which version of a2dp is used by my Bluetooth headset device? - bluetooth

I know that one way to find this out is to have a look at the device specification. Most device specifications are reporting just that A2DP is supported. Is there another way to find which version of A2DP is used from a headset device?

I recommend using linux with either built in bluetooth or with a bluetooth dongle. Then you can use the bluez tool sdptool from the command line to get this information.
A protocol sniffer is not necessary as all a protocol sniffer does is decode the packets over the air (which is exactly what sdptool does already), and it is more difficult as you will need to find out the link key as well which, depending on the devices you are using, can be quite difficult.

Currently there are only 2 versions of A2DP - 1.0 and 1.2
The differences are only minor optimizations / adaptations. So from a user's point of view it really does not matter.
Both versions are compatible and will talk to each other.
Since the differences are minor technical documentation changes in the spec it is not marketed as different versions to the end user. (Its just A2DP)
To really know the versions you will have to hook up with a Protocol sniffer and look at the SDP (Service Discovery) Query which typically happens after pairing / initial connection.

Related

Can I send Bluetooth advertising packets with Constant Tone Extension from a smartphone?

Bluetooth 5.1 introduced the ability to include a "Constant Tone Extension" into an Advertising packet. On the receive side, a suitable device can perform Angle-of-Arrival estimation using this information. I have experimented with this technology using BLE EVK devices (Nordic).
My question is can I use a 5.1 compatible smartphone as the transmitter? How can I enable CTE in the advertising packet? Is it something that can be configured through a suitable app and android SDK, or do I need lower-level access to the phones Bluetooth modem (drivers)?
Thanks!
Since CTE is an optional feature for Bluetooth 5.1, the answer is clear: it depends.
Bluetooth direction finding is not yet supported by Android, so it would require a manufacturer-specific API to enable CTE (if it is supported by the smartphone hardware).

Get the supported Bluetooth Version in Android phones?(5 or 4.x)

Is there a way to know the Android Bluetooth Ver?( 5 or 4.x - 4.1 or 4.2?)
Currently as per
https://developer.android.com/about/versions/oreo/android-8.0-changes
Feature like Advertisement packet length ~ 60 bytes of more than usual (that is 31 bytes) or Support for LE Extended Advertising are features for Bluetooth 5.
Is checking these APIs below (for True) can guarantee that the Bluetooth 5 is supported?
Also is it possible to know the Bluetooth ( though they come in WiFI Combo) chip version?
isLe2MPhySupported()
isLeCodedPhySupported()
isLeExtendedAdvertisingSupported()
isLePeriodicAdvertisingSupported()
getLeMaximumAdvertisingDataLength() > 31 ( for Bluetooth 5)
I have read that by getting the Physical MAC of the device we can know to which Brand the chip-set is as different vendors have purchased these MACs from the Bluetooth Org?
Assist please !
Yes if any of the APIs listed above returns true, then your device supports Bluetooth v5. The reason that there isn't a clear cut 'version' API is that Bluetooth is now more about features than it is about hardware version. You can have a device that contains Bluetooth 5 hardware, but will not support any of the Bluetooth 5 features such as 2MPHY, CODED PHY, or LE Advertising Extensions. Therefore it is more useful to have a feature by feature check of your hardware.
You are correct in that different companies have different MAC addresses assigned to them. You can find the full list here. For example, theoretically speaking, Apple MAC Addresses should start with 00:4C:XX:XX:XX:XX. However, I say theoretically because not everyone abides by this, and as a user you sometimes have the option to change your MAC address, making this information redundant.
I hope this helps.

Is Bluetooth 4.0+ BLE?

I am trying to identify which android phones support Bluetooth Low Energy and I am a bit confused on whether or not a device with BTv4.0+ is BLE compatible.
To be more precise, I am looking at the device Samsung Galaxy J5. According to http://www.gsmarena.com/samsung_galaxy_j5-7184.php, the bluetooth version is 4.1 but it doesn't mention anything about BLE.
According to the bluetooth specification:
"Bluetooth Low Energy (LE) (also called Bluetooth Smart or Version 4.0+ of the Bluetooth specification) is the power- and application-friendly version of Bluetooth that was built for the Internet of Things (IoT).". According to this I would presume that 4.0+ is BLE.
However if you see the specs of Samsung Galaxy S6 (http://www.gsmarena.com/samsung_galaxy_s6-6849.php) it mentions that it supports both BTv4.1 and BLE. It therefore distinguishes the two BT specifications.
Any information would be very helpful
Edit
Additional reference information for interested parties:
from bluetooth.org: Two flavors of Bluetooth The two most prevalent implementations of the specification are Bluetooth Basic Rate/Enhanced Data Rate (BR/EDR), which was adopted as version 2.0/2.1, and Bluetooth with low energy (LE), which was adopted as version 4.0/4.1/4.2. Each implementation has different use cases and each implementation uses a different chipset to meet essential hardware requirements. Dual-mode chipsets are also available for applications that include both use cases. - See more at: https://www.bluetooth.com/specifications/bluetooth-core-specification#sthash.7X7IrtWy.dpuf
Instead of relying on gsmarena with unreliable information, you can refer to Bluetooth SIG's official information.
Based on this Bluetooth SIG's announcement and this one, BLE is a core specification of Bluetooth 4.0. Bluetooth 4.1 and 4.2 also adopt this core specification.
However, all this still depends on whether the manufacturers implement the firmware. To keep track of all this, Bluetooth SIG maintains a list of devices currently supporting any profile (for example GATT).
This crossed my mind myself as I saw it as a pointless advancement until I saw the low energy bLE (bluetooth low energy) side of it. In my pastime I tinker with various electronics and with various BLE 4.x modules and their pro's and cons are HUGE.
All in all, BLE is better as Bluetooth pretty much is battery drain on the most robust of phones.
I found a nice little writeup (pretty simple yet comprehensive) here: http://www.argenox.com/bluetooth-low-energy-ble-v4-0-development/library/a-guide-to-selecting-a-bluetooth-chipset/
Do cut my answer short, as the bag you linked shows it as being "NFC" compatible, then yet, it's BLE 4.x. (That's Near Field Communication i.e. similar to your your contactless bank card). The v4.1, A2DP which you mention is how one "audio device talks to another" via bluetooth. (dvanced Audio Distribution Profile).
If you're really bored, there's a long list of other profiles (other than A2D):
https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles
Hope this helps!
Happy bluetoothing!

bluetooth low energy stack for linux

How is bluetooth low energy implemented at a device driver level in linux?
Is there a new bluetooth stack code for every new bluetooth version ?
Bluez is the stack for Linux Bluetooth. New version of Bluetooth have resulted in changes in the code, but it's not a complete rewrite or anything drastic like that. Newer versions of Bluetooth are typically extensions of the existing protocol with the exception of Low Energy. Low Energy is completely supported at the kernel level in Linux, but there aren't a lot of convenience libraries for higher level interaction with LE.
Due to the incompleteness of Bluez with LE I've had to interact with the kernel code directly in order to implement functionality with LE. Also, I had to use older kernels that aren't supported by Bluez 5.x and had to use Bluez 4.x.
Already Tim and jhonnash have provided comprehensive information to your question. However, I would like to add one more information from Android Mobile point of view.
New version of Android uses Bluedroid as Bluetooth stack. This is quite different from Bluez.
Bluez has functionality distributed both in user space and kernel space. All the protocols like RFCOMM, HCI and L2CAP are implemented at kernel level and Profiles are implemented at User space. As Tim mentioned, to support Low energy, Bluez has to provide support at kernel level as well as at user space. This some times get difficult to track and understand. Any new changes may require modification in kernel as well as in user space code.
On the other hand, Bluedroid has some advantage over Bluez. Bluedroid has implemented its complete functionality at user space. Due to which any new functionality only needs to be added at user level code. No dependency on Kernel code.
Also, to answer your question of "Is there a new bluetooth stack code for every new bluetooth version ?" No complete rewrite is required for new version of Bluetooth as Bluetooth new versions are backward compatible, so only those portion of codes are added to the already existing stack which is new.
Regards
As your question is not completly clear that's why I also try to give all the possible protocols available to access bluetooth low enery stack for linux.
In UHID Driver "HoG (HID over GATT/Bluetooth-Low-Energy): GATT is a Bluetooth protocol implemented in user-space. When user-space opens an LE (low-energy) connection to a Bluetooth device, the device can advertise HID capabilities via GATT."
As GATT service is properly defined in this link.
There can be other protocols than GATT to access the Low-energy devices. HID Over GATT implementation is done in this manner.

Tools for bluetooth monitoring

For my project I have an Android phone and an Arduino device that communicate via Bluetooth. I was wondering if anyone knows any software tools I could use to monitor a bluetooth communications between two devices. Something like a packet eavesdropping. Preferably for Linux.
Take a look at ubertooth one. In the linked webpage there are instructions on how to build the dongle, as well as links to shops selling assembled dongles may be bought. Ubertooth one should work well with Kismet, and thus in Linux, by using a BT plugin (disclaimer: I have no personal experience on this).
Sounds like you are after a Bluetooth sniffer.
Bad news: They are almost exclusively Windows OS based and cost mega-$.
http://www.fte.com/products/bluetooth.aspx
If you were using BlueZ for one side of the communication you could use the BlueZ HCIDUMP app and Wireshark.
I don't think anyone has made a Linuz/Bluez Sniffer - could be wrong.

Resources