From f3c6e600a78866ed1663cba19caf3c8a670df916 Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Mon, 28 Sep 2020 18:10:59 +0200 Subject: [PATCH] NMEA: write on a dedicated thread, also flush --- src/tncproto/KenwoodProto.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tncproto/KenwoodProto.scala b/src/tncproto/KenwoodProto.scala index dcb6552..eb50326 100644 --- a/src/tncproto/KenwoodProto.scala +++ b/src/tncproto/KenwoodProto.scala @@ -78,7 +78,11 @@ class KenwoodProto(service : AprsService, is : InputStream, os : OutputStream) e if (output != null && (nmea.startsWith("$GPGGA") || nmea.startsWith("$GPRMC"))) { Log.d(TAG, "NMEA >>> " + nmea) try { - output.write(nmea) + implicit val ec = scala.concurrent.ExecutionContext.global + scala.concurrent.Future { + output.write(nmea) + output.flush() + } if (service.prefs.getBoolean("kenwood.gps_debug", false)) service.postAddPost(StorageDatabase.Post.TYPE_TX, R.string.p_conn_kwd, nmea.trim())