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

[Android] - the timeout parameter has no effect on the printerInstance.connect() method #185

Open
aleks-khomenko opened this issue Oct 10, 2024 · 0 comments

Comments

@aleks-khomenko
Copy link

aleks-khomenko commented Oct 10, 2024

Description

according to the Printer Api connect(timeout?: string): Promise<void> method documentation
timeout - specifies maximum wait time before an error is returned (in milliseconds).

Steps to reproduce

  1. Run android from the example folder
  2. Connect to the printer and printSimpleReceipt to ensure that it works
  3. Modify handler and leave only connect() method
const printSimpleReceipt = async () => {
    try {
      setPrinting(true);

      await printerInstance.connect(1500);

    } catch (e) {
      console.log("=>(SimplePrint.tsx:132) e", e);
      await printerInstance.disconnect();
    } finally {
      setPrinting(false);
    }
  };
  1. Turn off the printer
  2. Try to print. You will catch an error after default 15 seconds but expect 1,5 seconds

react-native-esc-pos-printer version

4.2.0

React Native version

0.72.6

Platforms

Android

Workflow

React Native

Architecture

None

Build type

Debug app & dev bundle

Device

Real device

Device model

Samsung Galaxy A34

Acknowledgements

Yes

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

1 participant