0

Is it possible to get more information about bondedDevices besides the name and the MAC Address? So you can, for example, determine what device it exactly is (like a Gear S3 or Samsung Wireless Earbuds ect..). I can't seem to get this information but it must be possible, right?

Emil
  • 16,784
  • 2
  • 41
  • 52
Jeroen Beljaars
  • 137
  • 1
  • 10
  • 1
    Related: [List of company IDs for manufacturer specific data in BLE advertising packets](https://stackoverflow.com/q/23626871/295004) – Morrison Chang Feb 08 '20 at 22:43
  • Thanks! Thant's indeed related, however I would like to go a step further and actually get information like the model number, or any other identifiers. – Jeroen Beljaars Feb 08 '20 at 22:50

1 Answers1

1

Not for "classic Bluetooth devices", as opposed to Bluetooth Low Energy (BLE) devices.

Information such as model number, manufacturer name, etc. are considered to be standard "GATT characteristics" of BLE devices.

Typically, you can "discover" all sort of information on the device after you've connected to its GATT server. Part of the connection process involves specifying a callback interface from which you can send requests for information on the GATT server's:

  • GATT services
  • GATT characteristics (for each GATT service)

A Bluetooth device that has been bonded-to will not contain the extra information you seek, other than name and MAC address.

What's more, I've found that it is unreliable (if not impossible) to truly bond with a BLE device.

To get the info you seek, you need to "discover" the GATT services and then for each service, list their GATT characteristics. Once you've mapped out the characteristics, you can then send read requests. Everything is done asynchronously, which is why your app must provide a callback interface to the initial 'BluetoothDevice.connectGatt' command.

If you need to hold on to this info for the future (when the device is not powered up), it is up to your app to save the discovered information somewhere (SQLite database, etc.)

One observation I've made, and much to my dismay, is that despite the fact that the Bluetooth Core Specification defines standard GATT characteristics, it doesn't mean that the device's manufacturer will follow the standard.

For instance, many of the Bluetooth (BLE) devices that measure "health" data don't use the GATT characteristics defined specifically for that purpose. They tend to define their own custom characteristics.

That being said, model number, manufacturer name, SW/HW/FW version numbers are pretty much standard.

El Stepherino
  • 600
  • 6
  • 18
  • When you say "model number, manufacturer name, SW/HW/FW version numbers are pretty much standard" do you mean readable by client devices, not readable by client devices, or depends on manufacturer? – Morrison Chang Feb 09 '20 at 01:35
  • @Morrison Chang: They are readable by an Android App that has successfully connected to the Bluetooth (BLE) device. I haven't yet run into a device that did not implement these GATT characteristics. – El Stepherino Feb 09 '20 at 17:57