Early return on setBolus failure

This commit is contained in:
jbr7rr 2023-06-27 13:27:21 +02:00
parent 94e6189ab3
commit 345ae0f9b2

View file

@ -286,6 +286,11 @@ class MedtrumService : DaggerService(), BLECommCallback {
if (!isConnected) return false
val insulin = detailedBolusInfo.insulin
val result = sendPacketAndGetResponse(SetBolusPacket(injector, insulin))
if (result == false) {
aapsLogger.error(LTag.PUMPCOMM, "Failed to set bolus")
commandQueue.loadEvents(null) // make sure if anything is delivered (which is highly unlikely at this point) we get it
return false
}
val bolusStart = System.currentTimeMillis()