X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FAltosBluetooth.java;h=8e65e1d01cd2b724becfba5b670f3637520c3799;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hp=03ae5cb84a55281bb3fb5046d0809293e06a5f7f;hpb=643c2fb03833d658320f476ef731bbb06fe3cc31;p=fw%2Faltos diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java index 03ae5cb8..8e65e1d0 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_7.*; +import org.altusmetrum.altoslib_11.*; 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) {