Reputation: 857
What human-readable version number does the bluetooth_version returned by the Read Controller Information Command of the BlueZ Bluetooth Management API map to?
E.g. my controller returns 0x08. Is this Bluetooth 4.1 or 5.2 or 1.1 or ... ?
I can't find any info to this the mgmt-api.txt file. Searches for on google with "bluetooth version binary to string" didn't turn up anything helpful either. Also, the spec didn't turn up anything for "0x08" or "bluetooth version". Searching for version is pointless in there as each page header contains that word...
New insight
btmon seems to know...
@ MGMT Event: Command Comp.. (0x0001) plen 283 {0x0003} [hci0]
11:04:18.712443 Read Controller Information (0x0004) plen 280
Status: Success (0x00) Address: 00:25:CA:2A:08:38 (OUI 00-25-CA) Version: Bluetooth 4.2 (0x08)
Upvotes: 1
Views: 520
Reputation: 857
I also found a mapping in monitor/packet.c
:
void packet_print_version(const char *label, uint8_t version,
const char *sublabel, uint16_t subversion)
{
const char *str;
switch (version) {
case 0x00:
str = "Bluetooth 1.0b";
break;
case 0x01:
str = "Bluetooth 1.1";
break;
case 0x02:
str = "Bluetooth 1.2";
break;
case 0x03:
str = "Bluetooth 2.0";
break;
case 0x04:
str = "Bluetooth 2.1";
break;
case 0x05:
str = "Bluetooth 3.0";
break;
case 0x06:
str = "Bluetooth 4.0";
break;
case 0x07:
str = "Bluetooth 4.1";
break;
case 0x08:
str = "Bluetooth 4.2";
break;
case 0x09:
str = "Bluetooth 5.0";
break;
case 0x0a:
str = "Bluetooth 5.1";
break;
default:
str = "Reserved";
break;
}
if (sublabel)
print_field("%s: %s (0x%2.2x) - %s %d (0x%4.4x)",
label, str, version,
sublabel, subversion, subversion);
else
print_field("%s: %s (0x%2.2x)", label, str, version);
}
Upvotes: 0
Reputation: 18943
I don't know if and where Bluetooth version mapping is documented.
However such mapping can be found inside bluez lib/hci.c
source file:
/* Version mapping */
static hci_map ver_map[] = {
{ "1.0b", 0x00 },
{ "1.1", 0x01 },
{ "1.2", 0x02 },
{ "2.0", 0x03 },
{ "2.1", 0x04 },
{ "3.0", 0x05 },
{ "4.0", 0x06 },
{ "4.1", 0x07 },
{ "4.2", 0x08 },
{ "5.0", 0x09 },
{ "5.1", 0x0a },
{ NULL }
};
Upvotes: 1