Did you try using the Bluetooth Chat example without modification
except for changing the UUID?   That is what I did and it worked for
me.

On Feb 26, 1:53 am, Jamie <jamie.higg...@gmail.com> wrote:
> I am trying to establish a connection to another Bluetooth device on
> my Nexus One (2.1) with the following code, which occurs when on the
> broadcast receiver when a device is found.
>
> BluetoothDevice device = (BluetoothDevice)
> intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
> BluetoothSocket btSocket = null;
>
> try
> {
>     btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
>     BluetoothClass btClass = device.getBluetoothClass();
>     Log.d("BLUETOOTH", "------ createRfcommSocketToServiceRecord
> WORKED: " + btClass.toString());
>     btSocket.connect();
>     Log.e("BLUETOOTH", "ON RESUME: BT connection established, data
> transfer link");}
>
> catch (IOException e)
> {
>     Log.e("BLUETOOTH", "IOException: " + e);
>
> }
>
> I have tried both the following UUIDs for both the SPP and OOP
> profiles:
>
> private static final UUID MY_UUID =
> UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
> private static final UUID MY_UUID =
> UUID.fromString("00001105-0000-1000-8000-00805F9B34FB");
>
> Every time I call the connect command I get an IOException with
> "Service discovery failed". I have tried connecting to a G1, iPhone
> and a Nokia phone all with the same results.
>
> What am I doing wrong?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to