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?
If you want to get the UUID of a Bluetooth device in Android, there are a few different ways to do it. One way is to use the BluetoothAdapter. getRemoteDevice(String address) method. This will return a BluetoothDevice object, which has a getUuids() method that will return an array of UUIDs.
The UUID stands for Universally Unique Identifier. UUID is an simple 128 bit digit which uniquely distributed across the world. Bluetooth sends data over air and all nearby device can receive it.
Serial Port Profile (SPP) It's is one of the more fundamental Bluetooth profiles (Bluetooth's original purpose was to replace RS-232 cables after all). Using SPP, each connected device can send and receive data just as if there were RX and TX lines connected between them.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With