Android Question BT Printer - Serial Error "java.io.IOException: Broken pipe"

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,
I have the following problem:

I have a Bluetooth printer with which I can print texts as normal as normal, but the app checks when the printer is connected, when it is switched on, it shows "Printer Connection OK", but when I turn the printer off and on prints Go comes no error that the device is not more connected but "java.io.IOException: Broken pipe" and the app is closed.

Is there a possibility to check later whether the connection still exists?

With "if connected then" I already tried, the app thinks it is still connected to the printer although the already is offline ...
 

hasexxl1988

Active Member
Licensed User
Longtime User
You should handle AStream_Error and Terminated events.
If there is no possibility as with Visual Basic with the command "On Error Resume XY" or "On Error Resume Next"?


I have solved the problem now with Try, Catch ..
 
Last edited:
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
I do not know how to install the AsyncStream into the serial function. Or do I have the serial works completely omit and only work on AsyncStream?
 
Upvote 0

hasexxl1988

Active Member
Licensed User
Longtime User
You initialize AsyncStreams with Serial.InputStream and Serial.OutputStream.

The NewData event will be raised when there is new data. You can write with AStream.Write.
Nice.
Implementation did not take 10 minutes.

Thank you: D
 
Upvote 0
Top