3
votes

Well im desperately trying to connect my android app to a blood pressure device. I've realized that the amount of examples of this are few . Right now I am stuck at the connection point. It keeps failing with

 12-21 18:00:38.796: E/Connection Failed(2207): java.io.IOException: Service discovery failed

Im following the steps :

1 - getting the default adapter

mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

2 - getting the device

mBluetoothDevice = mBluetoothAdapter.getRemoteDevice(DEVICE_MAC_ADD);

3- creating a socket

mBtSocket = device.createInsecureRfcommSocketToServiceRecord(
                                UUID);

4 - Canceling discovery and connect to device

mBluetoothAdapter.cancelDiscovery();

mBtSocket.connect();

It fails on the connect method with the exception above. Well im kind of lost trying to know why this happens . Im using the UUID 00001101-0000-1000-8000-00805F9B34FB as referenced in other threads. The bluetooth permissions on the manifest are correct. Can someone give me a little help?

Thank you, Pedro Ferreira

1

1 Answers

2
votes

If your blood pressure device is compatible with HDP profile, then you can use the health profile supported in android 4.0 to do this job.

Take a look: BluetoothHDP Demo