Recently I tried to get a pairing process to work programatically and I succeded. But I recently found out that the users of my application can be connected to several of "interesting" devices. So I have to prompt the user to choose a device to connect to
So I have to connect the user to a already paired bluetooth device. But none of my efforts work. I tried running the pairing process again using the:
tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
and also the following:
Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
mmSocket = (BluetoothSocket) m.invoke(mmDevice, 1);
which is the one I've implemented and the only working way to pair my phone with my embedded bluetooth device
So my question is:
- Is it possible for me to disconnect a paired device and then connect to another embedded device? I tried.. to simply connect to the new device but I can't get that to work