When I run the following code on my Nokia 6682, it throws a BluetoothStateException:
Code:// Called when a new device has been discovered public void deviceDiscovered(RemoteDevice remote, DeviceClass devclass) { try { System.out.println("DD: " + remote.getFriendlyName(false) + " at " + remote.getBluetoothAddress()); Log.append("Found device: " + remote.getFriendlyName(false) + " at " + remote.getBluetoothAddress(), null); if(remote.getFriendlyName(false).equals(devicename)) { foundDevice = true; agent.cancelInquiry(this); Log.append("SSS: " + remote.getFriendlyName(false) + " at " + remote.getBluetoothAddress(), null); agent.searchServices( null, new javax.bluetooth.UUID[]{ new javax.bluetooth.UUID(0x0100) }, remote, this); } } catch(BluetoothStateException e) { Log.append("BSE while SS TEST", null); }
All this code does is search for services with UUID 0x0100 on a device with a given device name. Why does it throw this exception and how can I fix it?
If you can please cc responses to vargasv@msoe.edu
Thanks much.



