Hi,
I'm actually working on a project that has to inherit an enormous part of native code to interact with a special kind of remote device (an inverter) using a bluetooth-connection with a RFCOMM-Socket. The data that is exchanged between both devices is preprocessed through a library (in C) that I may not port for compatibility issues. As android uses the BlueZ-library, I thought it would be a good idea to directly access this on native level (even because the program should be compatible for Android 1.6 +), and that's where the problem appears.
I have used
this tutorial to start this up, and the device-inquiry with reading the remote devices' names works fine (
this shows how that works), but trying to connect to a remote devices causes an illogical error. Using " status = connect(s, (struct sockaddr *)&addr, sizeof(addr)); " (with "addr" being a sockaddr_rc) always sets "errno" to 113, also known as "EHOSTUNREACH" - tested on an Archos 5 (Android 1.6); Trying the same on a Nexus One (Android 2.1) causes a segmentation fault.
In the first case, it rather seems that the remote devices (I have checked out more than a dozen) do not event recognize that my devices tries to connect with them.
Has anyone got an idea why these errors might happen? At the moment, I am running out of reasons that may cause it...
I have already checked out the following:
- Hardware : Works fine.
- Remote address: correct (including the byte-order)
- Remote port: correct & accessable with other devices using other versions of my program
- Local port: also
- Connection family: settled correct
Another option may be to use the
backport-library, but that would require that I may exchange data from native code ( C ) to Java and send it without changing any bit - the remote device only works on native code and is extremly exakt on this. Is there any kind of type that may match this (e.g. byte) ? If the first option shown above would not work anyway, this might me an alternative, even if my principal does not like having to much Java-Code in programs ;)
Regards,
christian.l
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to
andro...@googlegroups.com.
To unsubscribe from this group, send email to
android-ndk...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.