// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.communication.bluetooth; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.os.Handler; import android.os.Message; import com.olio.util.ALog; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; // Referenced classes of package com.olio.communication.bluetooth: // BluetoothConnection private class mmOutStream extends Thread { private final InputStream mmInStream; private final OutputStream mmOutStream; private final BluetoothSocket mmSocket; final BluetoothConnection this$0; public void cancel() { try { mmSocket.close(); return; } catch (IOException ioexception) { ALog.e("close() of connect socket failed", ioexception, new Object[0]); return; } catch (NullPointerException nullpointerexception) { ALog.e("Null pointer in BluetoothConnection Connected thread. Probably disconnection.", nullpointerexception, new Object[0]); } } public void run() { ALog.i("BEGIN mConnectedThread", new Object[0]); byte abyte0[] = new byte[2048]; if (mmInStream == null || mmOutStream == null) { BluetoothConnection.access$300(BluetoothConnection.this); return; } try { do { int i = mmInStream.read(abyte0); byte abyte1[] = Arrays.copyOf(abyte0, i); ALog.v((new StringBuilder()).append("Read ").append(i).append(" bytes from device: ").append(mmSocket.getRemoteDevice().getName()).append(" at address: ").append(mmSocket.getRemoteDevice().getAddress()).toString(), new Object[0]); BluetoothConnection.access$600(BluetoothConnection.this).obtainMessage(2, i, -1, abyte1).sendToTarget(); } while (true); } catch (IOException ioexception) { ALog.e("disconnected", ioexception, new Object[0]); BluetoothConnection.access$300(BluetoothConnection.this); return; } catch (NullPointerException nullpointerexception) { ALog.e("Null pointer in BluetoothConnection Connected thread. Probably disconnection.", nullpointerexception, new Object[0]); } BluetoothConnection.access$300(BluetoothConnection.this); } public boolean write(byte abyte0[]) { try { mmOutStream.write(abyte0); ALog.v((new StringBuilder()).append("Wrote: ").append(abyte0.length).append(" bytes to device: ").append(mmSocket.getRemoteDevice().getName()).append("at address: ").append(mmSocket.getRemoteDevice().getAddress()).toString(), new Object[0]); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { ALog.e("Exception during write", abyte0, new Object[0]); return false; } // Misplaced declaration of an exception variable catch (byte abyte0[]) { ALog.e("Null pointer in BluetoothConnection Connected thread. Probably disconnection.", abyte0, new Object[0]); return false; } return true; } public (BluetoothSocket bluetoothsocket, String s) { BluetoothConnection bluetoothconnection1; Object obj; this$0 = BluetoothConnection.this; super(); ALog.d((new StringBuilder()).append("create ConnectedThread: ").append(s).toString(), new Object[0]); mmSocket = bluetoothsocket; bluetoothconnection1 = null; s = null; obj = null; bluetoothconnection = bluetoothsocket.getInputStream(); s = BluetoothConnection.this; bluetoothconnection1 = BluetoothConnection.this; try { bluetoothsocket = bluetoothsocket.getOutputStream(); } // Misplaced declaration of an exception variable catch (BluetoothConnection bluetoothconnection) { ALog.e("temp sockets not created", BluetoothConnection.this, new Object[0]); bluetoothconnection = s; bluetoothsocket = obj; } // Misplaced declaration of an exception variable catch (BluetoothConnection bluetoothconnection) { ALog.e("Null pointer in BluetoothConnection Connected thread. Probably disconnection.", BluetoothConnection.this, new Object[0]); bluetoothconnection = bluetoothconnection1; bluetoothsocket = obj; } mmInStream = BluetoothConnection.this; mmOutStream = bluetoothsocket; return; } }