Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How the BTPrinter.connected() method work? #67

Open
wencywww opened this issue Jan 21, 2023 · 2 comments
Open

How the BTPrinter.connected() method work? #67

wencywww opened this issue Jan 21, 2023 · 2 comments

Comments

@wencywww
Copy link

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?

@Vacalexis
Copy link

I have the same issue. Did you manage to fix ?

@wencywww
Copy link
Author

wencywww commented Aug 8, 2024

I have the same issue. Did you manage to fix ?

Unfortunately - not :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants