fix compiler warnings

This commit is contained in:
Andrei Vereha 2021-07-31 20:17:59 +02:00
parent 657a8f149b
commit 26321344eb
3 changed files with 4 additions and 6 deletions

View file

@ -211,8 +211,8 @@ class BleCommCallbacks(
fun resetConnection() {
aapsLogger.debug(LTag.PUMPBTCOMM, "Reset connection")
connected?.countDown()
serviceDiscoveryComplete?.countDown()
connected.countDown()
serviceDiscoveryComplete.countDown()
connected = CountDownLatch(1)
serviceDiscoveryComplete = CountDownLatch(1)
flushConfirmationQueue()

View file

@ -37,8 +37,8 @@ class MessageIO(
fun sendMessage(msg: MessagePacket): MessageSendResult {
val foundRTS = cmdBleIO.flushIncomingQueue()
if (foundRTS) {
val msg = receiveMessage(false)
aapsLogger.warn(LTag.PUMPBTCOMM, "sendMessage received message=$msg")
val receivedMessage = receiveMessage(false)
aapsLogger.warn(LTag.PUMPBTCOMM, "sendMessage received message=$receivedMessage")
throw IllegalStateException("Received message while trying to send")
}
dataBleIO.flushIncomingQueue()

View file

@ -15,8 +15,6 @@ class BasalProgram(
fun hasZeroUnitSegments() = segments.any { it.basalRateInHundredthUnitsPerHour == 0 }
fun isZeroBasal() = segments.sumBy(Segment::basalRateInHundredthUnitsPerHour) == 0
fun rateAt(date: Date): Double {
val instance = Calendar.getInstance()
instance.time = date