Bump java lib versions to 13
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / AltosBluetooth.java
index 15efc0e2a72294765626ce97fa5ace879f4b8702..0d09abd88051fba1ebe631613849d15ad6f38f59 100644 (file)
@@ -4,7 +4,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -30,7 +31,7 @@ import android.bluetooth.BluetoothSocket;
 import android.os.Handler;
 //import android.os.Message;
 
-import org.altusmetrum.altoslib_10.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBluetooth extends AltosDroidLink {
 
@@ -199,6 +200,8 @@ public class AltosBluetooth extends AltosDroidLink {
        }
 
        int write(byte[] buffer, int len) {
+               if (output == null)
+                       return -1;
                try {
                        output.write(buffer, 0, len);
                } catch (IOException ie) {
@@ -208,6 +211,8 @@ public class AltosBluetooth extends AltosDroidLink {
        }
 
        int read(byte[] buffer, int len) {
+               if (input == null)
+                       return -1;
                try {
                        return input.read(buffer, 0, len);
                } catch (IOException ie) {