I want to develop an application that use the Linux Bluetooth API Bluez by mean allow an Android device to send and receive data.
For the PC side i have looked at this code: http://people.csail.mit.edu/albert/bluez-intro/x502.html because Android use RFCOMM protocol, or i guess that since is impossible to set manually the protocol.
Since in Android is only possible to use the Java API (Bluez API locked) and the SDP in not working very well i have to use this call:
InsecureBluetooth.createRfcommSocket(BlueDevice , Channel , false);
When i set the channel for example to 0xC (12) that is one of the channel returned by the command:
sdptool browse local | grep Channel
the android application can connect correctly to the PC.
The problem is that i can't figure out what are the parameter to allow the two applications to communicate. To the PC side i have only a port number with value 1. To the Android side i have a channel that is assigned to a service available by SDP. But SDP is not working in Android so how i can do that ?
Any help is appreciated. Thanks
I know this doesn't answer your question, I think bluecove (http://bluecove.org/) would be better choice for this. It supports most operating systems, and provides decent library for Java.
I don't think bluez will work for Windows, you need a WIDCOMM or BlueSoleil stack for it, and bluecove will use appropriate stack for you.