2

Is it possible to check if a connected device is manufactured by Apple / runs macOS?

I saw some info on the UUID might containing that information but I haven't found a way to extract that information from it. https://www.bluetooth.com/specifications/assigned-numbers/

There are assigned numbers but I haven't found out if I can rely on the UUID always having that information and if it even contains a way to check.

In my case I'm developing an Android App, but I guess that and the programming language doesn't matter here. If given a UUID, how do I check if it's manufactured by apple?

So I either need a general way to figure out if a UUID is from apple, or an Android specific way of getting that information, mostly only having access to a BluetoothDevice object (without advertising or other lower level stuff because I don't access the connection directly)

To be more specific, I am using BluetoothHidDevice for the connection https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice


Edit: I am provided with a device.uuids variable, that hold multiple UUIDs

Each one of them has the following methods: UUids

What exactly can I do with the values to check if the manufacturer is apple. The toString method generates a uuid String as expected

So to give an example, a Windows device has multiple UUIDS, one of which looks like this:

toString: 0000111f-0000-1000-8000-00805f9b34fb

leastSignificantBits: -9223371485494954757

mostSignificantBits: 18824841662464

There are around 32 UUIDs provided

Merthan Erdem
  • 5,598
  • 2
  • 22
  • 29
  • The Company Identifier Codes are most often seen in Manufacturer Specific Advertising Data when scanning for devices. Typically Bluetooth doesn't care about what the OS of the remote device is, just what data is available. The Apple id is, for example, partly how iBeacons are identified from the advertising data. – ukBaz May 30 '21 at 21:44
  • If your device advertising you can, at least, easy detect Windows PCs/Laptops. – Mike Petrichenko May 31 '21 at 03:21
  • Are you using classic Bluetooth or Bluetooth Low Energy? If you're using classic Bluetooth then please note that Apple has limited classic Bluetooth support that is still not fully mature. If you are using BLE then your BluetoothHidDevice API wont work as that is for classic Bluetooth only. – Youssif Saeed Jun 06 '21 at 09:26
  • Yeah, using classic Bluetooth – Merthan Erdem Jun 06 '21 at 12:20

3 Answers3

1

I found a hackish way to do this, but the devices must have Bluetooth discovery activated, what you can do using android is to call upon the method startDiscovery() that allows you to scan nearby discoverable devices. This allows you to create a list of Bluetooth names that you can filter using regex to search whatever contains the term mac, macos, osx, macbook, etc., considering that most people don't really change their Bluetooth device name, this could be a good enough solution to your problem.

Here's a very detailed answer from another question that might help you find what you need Find all Bluetooth devices (headsets, phones etc) nearby, without forcing the devices in discoverable mode

MathieuAuclair
  • 1,229
  • 11
  • 41
1

I don't think apple would violate the Bluetooth Specifications, so I think it is safe to assume that the company identifier in the UUID is a reliable source of information. You can check the UUID for the Assigned Company Identifiers as provided by Bluetooth SIG. The Apple identifier is 0x004C. I don't see a way you could get hold of information regarding the operating system though. Maybe if you further described your use case, there might be a more convenient way to what you intend.

fxweidinger
  • 173
  • 2
  • 11
  • Thanks, please look at the edit, I'm not sure how exactly I use the allocated IDs to find that out. And if I need to check ALL provided device UUIDs or just one – Merthan Erdem Jun 09 '21 at 11:49
1

Please open this 16-bit UUID Numbers Document. Here on 3rd page you can see a table of UUID Allocation with Allocated devices. You can use 16-bit UUID for Members list to know which device is connected i.e. Apple, Samsung, Huawei etc. So we can find Apple based 16-Bit UUIDs as Apple is only platform to use IOS. All others UUIDs will relatively Android, Windows or Ubuntu etc. devices.

Atif Zia
  • 777
  • 2
  • 11
  • 28