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() { fun resetConnection() {
aapsLogger.debug(LTag.PUMPBTCOMM, "Reset connection") aapsLogger.debug(LTag.PUMPBTCOMM, "Reset connection")
connected?.countDown() connected.countDown()
serviceDiscoveryComplete?.countDown() serviceDiscoveryComplete.countDown()
connected = CountDownLatch(1) connected = CountDownLatch(1)
serviceDiscoveryComplete = CountDownLatch(1) serviceDiscoveryComplete = CountDownLatch(1)
flushConfirmationQueue() flushConfirmationQueue()

View file

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

View file

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