Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid phones reporting invalid vendor/model in Bluetooth Device ID Profile and/or EIR
    text
    copied!<p>Working on an application that involves discovery of smartphones over Bluetooth I found out that many Android-based devices report back an invalid device ID.</p> <p>Some background: There is a Bluetooth Profile/Service called Device ID (UUID 0x1200) that is supposed to identify the particular device down to vendor, model and version. The vendor ID can be assigned by either the USB or the Bluetooth bodies. This service can be inquired over the Service Discovery Protocol (SDP) after device discovery. The same ID information can also be included in the Extended Inquiry Response (EIR), which is sent during the device discovery.</p> <p>The latest test subject, the Sony Xperia Go, running 2.3.7 reports back the following SDP record:</p> <pre><code>ID=0x0000,type=0x01,value=0x00010000 ID=0x0001,type=0x06[type=0x03,value={**0x1200**};] ID=0x0005,type=0x06[type=0x03,value={0x1002};] ID=0x0009,type=0x06[type=0x06;] ID=0x0200,type=0x01,value=0x0102 (Device ID Profile Specification 1.2) ID=0x0201,type=0x01,value=**0x000a (Vendor ID)** ID=0x0202,type=0x01,value=**0x0000 (Product ID)** ID=0x0203,type=0x01,value=**0x0000 (Version)** ID=0x0204,type=0x05,value=1 (Primary? = Yes) ID=0x0205,type=0x01,value=**0x0002 (VendorIDSource = USB Implementer's Forum)** </code></pre> <p>As you can see above, the Go reports back an invalid USB Vendor ID (0x000a) and null product and version. I got the same results on an Acer Cloud Mobile too. This made me think that the invalid IDs could stem from default value unmodified by phone Android OEMs.</p> <p>Sure enough, in the Android sources I recently checked out the bluez Bluetooth stack has the following parameter in main.conf:</p> <pre><code># Use vendor, product and version information for DID profile support. # The values are separated by ":" and VID, PID and version. DeviceID = android:generic:1.5 </code></pre> <p>If this parameter doesn't get modified by the OEM, it will get parsed by the start_sdp_server function:</p> <pre><code> vid = (uint16_t) strtol(ptr, NULL, 16); ptr = strchr(ptr, ':'); if (ptr) { pid = (uint16_t) strtol(ptr + 1, NULL, 16); ptr = strchr(ptr + 1, ':'); if (ptr) ver = (uint16_t) strtol(ptr + 1, NULL, 16); register_device_id(vid, pid, ver); } </code></pre> <p>And that is where the 0x000a vendor ID comes from. "a" from Android. How genius...</p> <p>I am trying to get into contact with Sony and Android developers to see how can this be fixed for future versions. So, if you are one of them, let me know.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload