Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
pikipirs
Old
#1  
Senior Member - OP
Thanks Meter 61
Posts: 308
Join Date: Jan 2009

 
DONATE TO ME
Default Help with bluetooth! hci_get_route returns ERNODEV

Hi!

I am developing an application which connects a Wiimote to a bluetooth enabled android phone/device.

I did this by interfacing with the native bluez bluetooth library directly, rather than via the Android API. The reason for this is that Android API doesn't support HID devices, which a Wiimote is.

A problem now is that on some devices, mostly those sold by HTC, my app simply doesn't work. After calling the hci_get_route(NULL), this function should return an id of the first bluetooth device available (most likely 0), but instead returns ERNODEV (-1) as if no bluetooth device is available.

I suspect it has something to do with our beloved HTC grossly modifying something in the libbluetooth library to make this fail to work.

Has anyone ever done this kind of bluetooth interfacing?
How could I make this work?
Rooting the phone and replacing a library or two would be fine too.

For a list of working and non-working devices, check out the 2nd post of this thread.
Dumb phones --> SE XPERIA X1 --> Google Nexus One --> HTC Desire HD --> Samsung Galaxy S III. Wow what a phone!

Apps that I've developed:
* WiimoteController 0.6 Beta for Android
* Mario Live Wallpaper 0.94b for Android
* Video Live Wallpaper 0.84b for Android
* App Dialer 3.0 for Android
Do you like my development? Please consider buying me a cup of coffee (or a pizza).
You could also help me by getting a free Dropbox account using this link (both of us get extra 250 MB).
 
waffles004
Old
#2  
Junior Member
Thanks Meter 0
Posts: 5
Join Date: May 2010
Default HTC support

I just sent a customer service message to HTC about this issue. I hope they can get back to me with a "we'll work on it" message, or something. I really want this on my incredible. I'm new to coding like this, but could you disguise the Wiimote as another kind of device?
 
cauli
Old
#3  
Senior Member
Thanks Meter 0
Posts: 316
Join Date: Mar 2010
Just a response from someone equally interested in a solution. I'm trying to set up a bluetooth keyboard (Freedom Pro) with my gsm Hero running the 1.5 based MCR 3.2. Available drivers (Freedom's own, BlueInput & KeyPro) should work with 1.5, but HTC devices, especially the Hero, seem to be lacking something that is present in most 1.5 builds.

Investigating, I find the same issue of no route to device, because there is no known device. AIUI when bluetooth is turned on hciattach is used to establish a link to the hardware. At that point an hciconfig should list the hci0 device as present but down. However I find this list remains empty at all times.
 
waffles004
Old
(Last edited by waffles004; 12th May 2010 at 06:46 PM.)
#4  
Junior Member
Thanks Meter 0
Posts: 5
Join Date: May 2010
I found this for keyboards.
Since I can't post the link, it's called "KeyPro for Android"
Google "keypro android" and click the first link.

Maybe that could help. It says it works with any android device above 1.5, however, I did read that some keyboards use a different type of bluetooth profile, SPP rather than HID.

I haven't heard back form HTC yet either.

EDIT: Upon reading your post again, you have tried this. Sorry, my bad.
 
cauli
Old
#5  
Senior Member
Thanks Meter 0
Posts: 316
Join Date: Mar 2010
Thanks for looking though The Freedom Pro is switchable between spp & hid profiles, so I figured I was safe, lol. Not with HTC's butchered 1.5 bt it seems.
 
tobren
Old
(Last edited by tobren; 14th May 2010 at 12:05 PM.)
#6  
Junior Member
Thanks Meter 1
Posts: 14
Join Date: Mar 2008
Did you ever try to use the most likely id 0 on an HTC device? Even though the call to get the id fails?
Maybe you could use also the Android API to synchronize if a device is present and then use the id that Android API gives you?

Just some thoughts since I would love to see that App running on my Desire with Snesoid
 
tobren
Old
(Last edited by tobren; 14th May 2010 at 12:04 PM.) Reason: Double Post
#7  
Junior Member
Thanks Meter 1
Posts: 14
Join Date: Mar 2008
Edit: Double post
 
pikipirs
Old
#8  
Senior Member - OP
Thanks Meter 61
Posts: 308
Join Date: Jan 2009

 
DONATE TO ME
Quote:
Originally Posted by tobren View Post
Did you ever try to use the most likely id 0 on an HTC device? Even though the call to get the id fails?
Maybe you could use also the Android API to synchronize if a device is present and then use the id that Android API gives you?

Just some thoughts since I would love to see that App running on my Desire with Snesoid
Believe it or not, I actually tried this. Unfortunately, the next command (to bind the bluetooth adapter) also fails, and of course every command after that one because the adapter is not bound.

Thanks for the idea anyway.
Dumb phones --> SE XPERIA X1 --> Google Nexus One --> HTC Desire HD --> Samsung Galaxy S III. Wow what a phone!

Apps that I've developed:
* WiimoteController 0.6 Beta for Android
* Mario Live Wallpaper 0.94b for Android
* Video Live Wallpaper 0.84b for Android
* App Dialer 3.0 for Android
Do you like my development? Please consider buying me a cup of coffee (or a pizza).
You could also help me by getting a free Dropbox account using this link (both of us get extra 250 MB).
 
rubber soul
Old
#9  
Member
Thanks Meter 0
Posts: 30
Join Date: May 2010
Location: Dayton, OH
Default usb

does the wii remote have usb connectivity? could it be possible to have the communication pass through that connection rather than bluetooth? one advantage of this would be increased battery life and probably better compatibility across models.

i'm sure some people would prefer bluetooth, but i figure i'll always be using it very close to my phone so i can see the screen, so the wired option is actually a bit more attractive (considering battery performance).

i know ps3 has usb connectivity as well, you just might need an adapter (mini to micro).
 
cauli
Old
(Last edited by cauli; 25th May 2010 at 09:07 PM.)
#10  
Senior Member
Thanks Meter 0
Posts: 316
Join Date: Mar 2010
Quote:
Originally Posted by rubber soul View Post
does the wii remote have usb connectivity? could it be possible to have the communication pass through that connection rather than bluetooth?
[snip]
i know ps3 has usb connectivity as well, you just might need an adapter (mini to micro).
I'm pretty sure the first answer is no - our wii is round at a friend's atm. However even if it was yes, you'd need more than an adapter. USB operates with one device as master & the other as slave. To allow you to connect slave devices to your phone it would need to be in host mode. Some mobile phone hardware implementations support this, however I don't know of any mainstream Android kernels which do. Even if you workaround that, you're left with the huge issue that slave devices can assume it's safe to draw power from the USB bus which could do nasty things (tm) to a lower power device like a mobile. This can be worked around via a powered hub, but it all gets very messy.

I looked into this a few months ago, hoping I'd be able to use a usb keyboard with my Hero. I ended up with a BT keyboard instead. Of course that doesn't work either but for completely different reasons, as hinted at by this thread. Hopefully a 2.1 ROM will solve that, but that's the subject of numerous other threads.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Boot Animation Paradise for your Android Device

The default boot animations on any device, no matter whichmanufacturer, are generally pretty … more

Flash Custom ROM and Recovery to Samsung Galaxy S 4

After reading about Dan Rosenberg’s bootloader exploit for the Samsung Galaxy S 4,I … more