Bluetooth Pairing

b0x?

New member
Hi!

I am wondering if any of you out there has experience with pairing an Android phone (a HTC Hero runnig Android 1.5 in my case) with random bluetooth devices. I am not talking about pushing files over OBEX or other use cases, only the pairing process.

My goal is to use a serial communication over bluetooth to some piece of hardware I have here. The serial communication should be possible with the unofficial bluetooth API (http://code.google.com/p/android-bluetooth/).

The only (and major) problem is that pairing with my device does not seem to work. Actually it is configured to be used without any PIN (and I can not reconfigure it to require a PIN), but Android requires me to input a PIN. Of course then pairing fails.

My question to you: Did you successfully pair your Android phone with different devices? Or do you have any clue on why it does not work in my case
 
UPDATE:

I managed to pair my hardware with the HTC Hero by finally finding out how to configure the hardware. It was necessary to use security mode "Service" and a PIN.

However, I am still having trouble to establish a connection with the device. The status in Android's bluetooth settings is "Paired but not connected". I thought that this connection can be established with the unofficial bluetooth API by opening a socket and getting an In/Outputstream (RFCOMM), but writing to the stream fails with the message "Transport endpoint is not connected"

The bluetooth documentation says that RFCOMM uses L2CAP as transport layer, so I guess the L2CAP connection is not yet established.

I then experimented with setting my hardware to different device and service classes. Android supports Handsets by default, so I thought it is a good idea to try setting my hardware to be an audio device. Android then believed, that it is an audio device and also offered the option to connect, but the connection failed.


To cut it short:
Does anybody know what must be done to use a bluetooth device together with Android via RFCOMM (serial connection over bluetooth)? Pairing already worked, but the error "Transport endpoint is not connected" is the dealbreaker right now..
 
im interested in this "security mode service" you mention. how did you enable this mode?

i picked up a mini blutooth keyboard here: http://cgi.ebay.co.uk/360293085911

i later read that it isnt compatible with android 2.x, only 1.6+ ??

very strange. whats different in 2.x that makes this not work? i paired with my mac and the mac had me type a code on the keyboard to pair. this worked. my droid X asks me to enter a PIN to pair, which i dont have for the device. what is my mac doing to pair that the droid is not? what did droid 1.6 do that would pair that 2.x is not?

Q
 
UPDATE:

perhaps this method will help those trying to pair a device that times out during the process.

for this keyboard, i select 'pair with device' on the droid x. it asked for a pin, so i entered 0000 and tapped OK. then, on the keyboard, i entered 0000 ENTER. the droid received the response and paired immediately.

it seems the device doesnt auto-respond to the request, so entering a reply and pressing enter did the trick.

However, the connection times out every 30 seconds or so, even during typing, and re-pairing it is needed with the passkey again and again. how to keep the device paired???

Cheers.
 
Back
Top