Cordova-Plugin-BTPrinter
Cordova-Plugin-BTPrinter copied to clipboard
How the BTPrinter.connected() method work?
I wonder how exactly the BTPrinter.connected() method determines if the printer is still connected?
Looking at the Java code, the method is:
// Check if printer is already connected
boolean connected(CallbackContext callbackContext) {
try {
if (mmSocket == null) {
callbackContext.success("false");
return false;
} else if (mmSocket.isConnected()) {
callbackContext.success("true");
return true;
} else {
callbackContext.success("false");
return false;
}
} catch (Exception e) {
String errMsg = e.getMessage();
Log.e(LOG_TAG, errMsg);
e.printStackTrace();
callbackContext.error(errMsg);
}
return false;
}
However, in my case this method always return True after initial successful connection - even after the printer is turned OFF? Any ideas about this?
I have the same issue. Did you manage to fix ?
I have the same issue. Did you manage to fix ?
Unfortunately - not :(