“java.io.IOException: okuma başarısız oldu, yuva kapalı veya zaman aşımı, ret: -1 oku” istisnası belirir Bluetooth ile Zebra ZD410 yazıcı ile android cihazımı bağlamaya çalışıyorum.Zebra yazıcı bağlantısı başarısız oldu “okuma başarısız oldu, yuva kapanmış veya zaman aşımı, okundu: -1”
try {
mmSocket.connect();
} catch (IOException e1) {
android.util.Log.e(TAG, e1.toString());
try {
android.util.Log.i(TAG, "Trying fallback...");
mmSocket =(BluetoothSocket) mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class}).invoke(mmDevice,1);
mmSocket.connect();
android.util.Log.i(TAG, "Connected");
} catch (Exception e2) {
android.util.Log.e(TAG, "Couldn't establish Bluetooth connection!");
try {
mmSocket.close();
} catch (IOException e3) {
android.util.Log.e(TAG, "unable to close() " + mSocketType + " socket during connection failure", e3);
}
connectionFailed();
return;
}
}
Geri dönüş soketi bağlantısıyla çözümü denedim ancak yardımcı olmadı. Bu kod Epson yazıcı ve diğer bazı cihazlar ile iyi çalışır, ancak Zebra ZD410 yazıcı ile uyumlu değildir. Bir sebep ne olabilir?