Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth -> service discovery failed

I'm writing an application that is able to communicate with my PC. I have used the Bluetooth functionalities of the SDK 2.1.

I can find devices, get their MAC address, create an RFCOMM socket, but when I start the connection, I get the following error message.

Service discovery failed.

  1. Is it because of the UUID, which is not the same on my application and on my PC?
  2. How can I get the correct UUID on my PC?

If I write a such application, is my Nexus One the client or the server?

like image 414
Kaiser Avatar asked Feb 05 '10 14:02

Kaiser


3 Answers

OK, I got the same problem, but I think I can answer a few of your questions. If your PC opened an SPP Port, for example, by using "sdptool add --channel=3 SP" your Android phone would be the client opening a socket and connecting with this socket to the server (your PC or any other Bluetooth device, for example, GPS, mouse, etc.).

You can get this information by reading the article Bluetooth, the definition of a client did I take out of this article.

If you are opening an SPP Port on the server (your PC, etc.) you are offering a standard service and there is a special UUID assigned to this service. This would be: 00001101-0000-1000-8000-00805F9B34FB if I'm not mistaken.

So I think we should get a qualified answer from an Android developer. Or ask this question on Thursday during the IRC office hours.

like image 132
4 revs, 4 users 69% Avatar answered Oct 19 '22 03:10

4 revs, 4 users 69%


Hint: If you are connecting to a Bluetooth serial board then try using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. However if you are connecting to an Android peer then please generate your own unique UUID.

The Link

like image 29
Dev Perfecular Avatar answered Oct 19 '22 03:10

Dev Perfecular


Although it could be your UUID, I would also suggest you make sure the Bluetooth MAC is accurate and upper-case.

I would also suggest running hcidump -X in a terminal on the Linux box, and see if you can see any two-way traffic between your Linux machine and phone throughout the process.

like image 24
Brad Hein Avatar answered Oct 19 '22 03:10

Brad Hein