22

I want to receive data from the serial port bluetooth device to android phone. But i don't know the UUID of that device how to find the UUID of that device?

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
user555910
  • 2,627
  • 6
  • 22
  • 28

7 Answers7

26

Extending what pwc said about the UUID being 0x1101, this is the 16 bit version of the UUID as far as I can tell. I could not work out how to instantiate an UUID with a 16 bit UUID. But as this post says you can do it by:

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

This worked for me to connect to a serial bluetooth module I bought from Deal Extreme

Community
  • 1
  • 1
Olly
  • 291
  • 3
  • 4
  • So what does all the rest of the UUID mean? I know 1101 means serial port protocol. – JPM Dec 05 '12 at 16:48
  • 3
    @JPM The rest of that UUID comes from the [base UUID](https://www.bluetooth.com/specifications/assigned-numbers/service-discovery). – Anthony Hilyard Jun 09 '16 at 20:10
7

If the device is using serial port profile, then yes, it is simply:

0x1101

For other pre-defined options, see the list of pre-defined UUIDs as listed in javax.bluetooth:

UUID.

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
MattF
  • 1,475
  • 3
  • 16
  • 18
6

The UUID for the SPP Serial Port service is defined by the Bluetooth SIG to be 0x1101.

pwc
  • 7,043
  • 3
  • 29
  • 32
0

From API level 15, you can query the supported features (UUIDs) of the remote device, use the method on the BluetoothDevice object obtained in the search:

public ParcelUuid[] getUuids ()
Tore Rudberg
  • 1,594
  • 15
  • 16
0

you can get Device UID by simple Calling

perticulerDevice.getUuids()[0].toString()
0

In the Android Bluetooth API documentation:

Create RFCOMM Socket to Service Record - UUID.

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
Martin
  • 17
  • 1
0

Just open your device in adb shell type sdptool and browse you got your device UUID

vidit
  • 177
  • 2
  • 11