Bluetooth Device Not Discoverable
Solution 1:
I was able to work around the issue not by changing things at the Android end but by changing the class of the bluetooth adapter. I know this doesn't solve the original issue of class 0x00 devices being blocked, but at least you can use a BT serial device with android despite the bug.
I bought a Bluetooth serial converter from ebay (link here: http://www.ebay.co.uk/itm/Bluetooth-RS232-serial-Converter-Module-Adapter-Board-/190508188703?pt=LH_DefaultDomain_0&hash=item2c5b2c441f ) which, as expected, wasn't recognized by my HTC Desire in its default configuration.
I didn't want to try the app by Zorn software mentioned above, because some people reported it messing up their HTC phones. Instead, I found from the BT device's AT commands datasheet that you can change, among other parameters, the device's class number by using an UART connection and a terminal program.
It took me a while to figure out that you can't use the Bluetooth serial connection to access the configuration interface, but that you must use the physical RX and TX pins on the device instead. You also need to connect the pin named "Key" to Vcc to activate the command mode. So I used an AVR serial programmer device's RS232 to UART interface to connect to the RX/TX pins and used Realterm as the terminal program. This got the AT command interface working once I had the right baudrate, 38400, and swapped the RX and TX leads which I initially connected the wrong way around.
I used the generator here http://bluetooth-pentest.narod.ru/software/bluetooth_class_of_device-service_generator.html to get a valid non-zero class number (I used object transfer/computer/desktop workstation, which amounts to 0x100104), and entered it to the device with the command
at+class=100104\r\n
where \r\n indicates Enter (see the datasheet).
After switching the BT adapter off, disconnecting the "Key" pin and switching on again, I was able to pair it with my phone the normal way. Data transfer also worked. I again used the AVR programmer's UART and Realterm to send some data (a Hello World message in ASCII) to the RX/TX pins of the adapter. In the Android end, I used the app SENA Bterm to receive the data.
I hope this helps someone do interesting things with their phones and embedded systems.
Solution 2:
Ok after some research on the web, for those who want to develop a Bluetooth application on Android (tested on 2.1 Eclair I don't know for other versions) It seems that some phone manufacturer decided to ignore any bluetooth device which advertises itself as class 0×00 and wont allow connections, fire off Intents on discovery or even list it on the bluetooth settings page. Here what it looks like in debugging mode in the LogCat section of Eclipse
DTUN_HCID Device [00:09:EF:58:04:38] classis0x00 - skip it
I tried it on a Samsung Galaxy 3 teos and a HTC Wildfire. Apparently it works fine on the Nexus One. Well too bad Google stopped selling it. If some of you tested on other phones and it works please let us know.
Lorenth
Solution 3:
I have tested BlueTooth connections to a serial (Class 0x00) device on some different flavours of Android, with these results:
Android 2.1 (Orange or O2, can't remmeber) : pairs ok Toshiba Netbook running Android 2.2 : pairs ok HTC Desire, Vodafone, Android 2.2 : fails to discover device HTC Desire HD, Vodafone, Android 2.2 : fails to discover device
So it is quite possible that some phone companies have blocked 0x00 access. I am in touch with Vodafone to a) get clarification and b) persuade them if possible to fix this. I'll post if I get anything useful.
David
Solution 4:
UPDATE:This solution relies on access to read logcat from within your app, so will not work on modern versions of Android (> about 3.0). Answer left here with updated link in case someone is using Android v2.x.
Assuming you are writing an app for your phone, I have written a class that works around this issue:
http://zornsoftware.codenature.info/blog/pairing-spp-bluetooth-devices-with-android-phones.html
I can confirm the LG Optimus One, and also the Samsung Galaxy S (both Android 2.2) both suffer from this problem. I have contacted LG and Samsung about it and will post back any results i hear.
Post a Comment for "Bluetooth Device Not Discoverable"