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

connect: read failed, socket might closed or timeout, read ret: -1 code 71248565 #27

Open
biloo-dev opened this issue Nov 8, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@biloo-dev
Copy link

biloo-dev commented Nov 8, 2023

i hade this error in my xPrinter Xp-p323B connect with pin code 0000;

When I try to connect to a printer with a pin code, the connection is closed immediately before the pin code is entered

W/BluetoothAdapter(17303): getBluetoothService() called with no BluetoothManagerCallback
D/====> print: (17303): connect: read failed, socket might closed or timeout, read ret: -1 code 42882209
I/flutter (17303): result status connect: false
I/flutter (17303): state conected false

i'm using the example of this package

It would be great if you could add new features

This feature allows the connection to be made without the user having to write the device's PIN, being set programmatically with the connectWithPin() method, being necessary to pass the pin of the device to be connected (Android only).

Example:
await device.connectWithPin("1234")

https://github.com/pauldemarco/flutter_blue/pull/747

@andresperezmelo andresperezmelo added the enhancement New feature or request label Nov 8, 2023
@andresperezmelo
Copy link
Owner

Thanks I will look for a device that requires pin to try to implement the option.

@biloo-dev
Copy link
Author

Thank you. I appreciate your interaction
Can you do me a favor please ?
can you add a timeout argument to connect function as optional parameter just for avoid timeout
As long as the pin number is not added, please add connect with timeout thanks
String mac = "66:02:BD:06:18:7B"; final bool result = await PrintBluetoothThermal.connect(macPrinterAddress: mac,timeout:35);

@andresperezmelo
Copy link
Owner

That's another good suggestion, to set the waiting time, I had thought about that, thanks.

@biloo-dev
Copy link
Author

Thank you @andresperezmelo, I'm looking forward to new features Thanks

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

No branches or pull requests

2 participants