Using a 6600 and Java, I am attempting to connect to multiple bluetooth devices serially to retrieve data. The process is:
1) search for bluetooth devices
2) search for service on first bluetooth device that was found
3) connect to bluetooth device via btspp
4) communicate with device
5) close the StreamConnection
6) repeat 2-5 for each additional device
The problem is that after closing the StreamConnection I attempt to search for services on the next bluetooth device and this always fails to find a service (even though the device is on and does support the service). I can see on the Nokia 6600 display that the bluetooth connection from the prior connection is still active. It takes 5 seconds or so for the graphic to dissappear from the phone ( it looks like open and close parens with a dot in the middle).
I have put a Thread.sleep(10000) call in before I do the service search and this works fine, but what a lame workaround. Why does the bluetooth connection not get cleaned up when I close the StreamConnection? Am I missing something? Is there something else I need to close in order to end the bluetooth connection? I don't see anything in javax.bluetooth.
Has anyone seen anything like this?
thanks.