Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Find the UUID of a specific bluetooth device

I'm starting to work on Bluetooth in Android recently. I want to build an application that can read the data recorded by a sensor through bluetooth.

I have some sample code, but looks like I need another UUID of a different device.It looks like this:

private static final UUID MY_UUID = UUID
                .fromString("00001101-0000-1000-8000-00805F9B34FB");

Later on in the code, it uses this UUID to make a connection:

tmp = device.createRfcommSocketToServiceRecord(MY_UUID);

I have done some research online, like [here][1]. I think I need a different UUID number for the new device I'm working on. How do I get the UUID number?

On the device, there are two lines of number saying:

SN: 1201L0023
BT: 10:00:E8:C5:16:85

Thanks in advance!

Jake

like image 799
checai Avatar asked Dec 28 '12 14:12

checai


People also ask

How do I find the UUID of a Bluetooth device Android?

Set<BluetoothDevice> devices = BluetoothAdapter. getDefaultAdapter(). getBondedDevices(); BluetoothDevice glass = null; for (BluetoothDevice d : devices { ParcelUuid[] uuids = d. getUuids(); for (ParcelUuid p : uuids) { System.

How do I find my Ble UUID device?

Each service and characteristic has a universally unique id (UUID). You use these ids when setting up the communication with the BLE device from JavaScript. The UUIDs are usually found in the device documentation provided by the manufacturer.

Does Bluetooth have unique ID?

Every single Bluetooth device has a unique 48-bit address, commonly abbreviated BD_ADDR. This will usually be presented in the form of a 12-digit hexadecimal value. The most-significant half (24 bits) of the address is an organization unique identifier (OUI), which identifies the manufacturer.


1 Answers

UUIDs are not tied to particular devices. They identify software services. Some UUIDs for defined profiles are set by BT. The UUIDs used with RFCOMM sockets like your example are arbitrary. You just need both sides to use the same one. In general, devices connect and then use service discovery protocol to find out what services (UUIDs) are supported on the remote device.

like image 72
TJD Avatar answered Sep 23 '22 05:09

TJD