From 518241c3c9b573bb4cf538b0822336cdc60b28e0 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Tue, 23 Mar 2021 13:05:50 +0800 Subject: [PATCH] less logspam --- .../main/java/com/geeksville/mesh/service/SafeBluetooth.kt | 4 ++-- .../com/geeksville/mesh/service/SoftwareUpdateService.kt | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt index ee460c9c..283ed00f 100644 --- a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt +++ b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt @@ -325,7 +325,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD if (newWork.timeoutMillis != 0L) { activeTimeout = serviceScope.launch { - debug("Starting failsafe timer ${newWork.timeoutMillis}") + // debug("Starting failsafe timer ${newWork.timeoutMillis}") delay(newWork.timeoutMillis) errormsg("Failsafe BLE timer expired!") completeWork( @@ -415,7 +415,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD if (work == null) warn("wor completed, but we already killed it via failsafetimer? status=$status, res=$res") else { - debug("work ${work.tag} is completed, resuming status=$status, res=$res") + // debug("work ${work.tag} is completed, resuming status=$status, res=$res") if (status != 0) work.completion.resumeWithException( BLEStatusException( diff --git a/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt b/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt index b9050105..663070f8 100644 --- a/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt @@ -374,13 +374,17 @@ class SoftwareUpdateService : JobIntentService(), Logging { throw DeviceRejectedException() // Send all the blocks + var oldProgress = -1 // used to limit # of log spam while (firmwareNumSent < firmwareSize) { // If we are doing the spiffs partition, we limit progress to a max of 50%, so that the user doesn't think we are done // yet val maxProgress = if(flashRegion != FLASH_REGION_APPLOAD) 50 else 100 sendProgress(context, firmwareNumSent * maxProgress / firmwareSize, isAppload) - debug("sending block ${progress}%") + if(progress != oldProgress) { + debug("sending block ${progress}%") + oldProgress = progress; + } var blockSize = 512 - 3 // Max size MTU excluding framing if (blockSize > firmwareStream.available())