X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FAltosBluetooth.java;h=0d09abd88051fba1ebe631613849d15ad6f38f59;hp=15efc0e2a72294765626ce97fa5ace879f4b8702;hb=297eb795b24ec31f6599f48bc8c3769557a7ec6f;hpb=21d176f161b90f18f236ef887cef9676d712eee3 diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java index 15efc0e2..0d09abd8 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java @@ -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) {