diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java index 7f459a4d..fe8868a1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleIoThread.java @@ -473,7 +473,7 @@ class PebbleIoThread extends GBDeviceIoThread { mOutStream.flush(); } } catch (IOException e) { - LOG.error("Error writing.", e); + LOG.error("Error writing.", e.getMessage()); } try { Thread.sleep(100); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java index 97aaaad5..84acd650 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/ble/PebbleLESupport.java @@ -82,6 +82,10 @@ public class PebbleLESupport { mPipedInputStream.close(); } catch (IOException ignore) { } + try { + mPipedOutputStream.close(); + } catch (IOException ignore) { + } } void setMTU(int mtu) { @@ -126,18 +130,20 @@ public class PebbleLESupport { } Thread.sleep(500); // FIXME ugly wait 0.5s after each pebble package send to the pebble (we do not wait for the GATT chunks) - } catch (InterruptedIOException | InterruptedException e) { + } catch (IOException | InterruptedException e) { + LOG.info(e.getMessage()); Thread.currentThread().interrupt(); break; - } catch (IOException ignore) { } } + LOG.info("Pipereader thread shut down"); } @Override public void interrupt() { super.interrupt(); try { + LOG.info("closing piped inputstream"); mPipedInputStream.close(); } catch (IOException ignore) { }