Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Bluetooth Where can I get UUID?

I want to connect 3 devices via Bluetooth.

As for example I use BluetoothChat. So How I understand I should use different UUID for this devices. I have been trying to connect via such UUID=766c82f0-e1b4-11df-85ca-0800200c9a66, which I 've get it from Web UUID generator. But it doesn't work at all.

I have succesfully connected (to 1 device) if I used UUID=00001101-0000-1000-8000-00805F9B34FB

Where can I get UUID?

like image 736
vic Avatar asked Oct 27 '10 10:10

vic


1 Answers

Imagine, that u have a one or more services. Each service have its own UUID. UUID=00001101-0000-1000-8000-00805F9B34FB is special one for SPP. Some devices (for example, Bluetooth serial board) will not work if u not set SPP UUID. But for peer-to-peer connection between Android devices such as smartphones u may use your own generated UUID. Devices must set same UUID to found each other and connect. UUID format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x=[0,...,9]|[A,...,F]. Good idea is to set xxxxxxxx-xxxx-xxxx-xxxx- to Your generated unique id. Second part xxxxxxxxxxxx may be set to Your server MAC address without ":". On client side u may construct UUID from known generated unique id (embedded to Your app) and server MAC address without ":". You can get server MAC address during Bluetooth device discovery.

like image 91
NoAngel Avatar answered Sep 20 '22 14:09

NoAngel