I have the following code for connecting my android application to Woosim printer WSP-R240.
String addressA = "74:F0:7D:E2:6A:DD";
String addressB = "00:15:0E:E2:92:42";
com.woosim.bt.WoosimPrinter woosim = new com.woosim.bt.WoosimPrinter();
int result = woosim.BTConnection(addressA, false);
if (result != 1)
{
result = woosim.BTConnection(addressB, false);
}
I have 2 printers A and B. I want to print by B if A is switched off.
When I set the string addressA
to a fake address, the woosim object connects to printer B successfully. But when addressA
is the address of a paired device and it is switched off so the result
is not 1, the woosim object does not connect to printer B.
What is wrong here?
I have tried using SystemClock.sleep(5000);
, but it did not solve the problem.