NMEA: write on a dedicated thread, also flush

android11 1.6.0c
Georg Lukas 2020-09-28 18:10:59 +02:00
rodzic 233c62d9ba
commit f3c6e600a7
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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())