Medtrum: Allow time for notifications to update sequence number
before loadEvents()
This commit is contained in:
parent
06c1ab0ec3
commit
1ef885b5fe
|
@ -373,11 +373,14 @@ class MedtrumService : DaggerService(), BLECommCallback {
|
|||
|
||||
bolusingEvent.percent = 99
|
||||
val bolusDurationInMSec = (insulin * 60 * 1000)
|
||||
val expectedEnd = bolusStart + bolusDurationInMSec + 2000
|
||||
val expectedEnd = bolusStart + bolusDurationInMSec + 1000
|
||||
while (System.currentTimeMillis() < expectedEnd && !medtrumPump.bolusDone) {
|
||||
SystemClock.sleep(1000)
|
||||
}
|
||||
|
||||
// Allow time for notification packet with new sequnce number to arrive
|
||||
SystemClock.sleep(2000)
|
||||
|
||||
bolusingEvent.t = medtrumPump.bolusingTreatment
|
||||
medtrumPump.bolusingTreatment = null
|
||||
|
||||
|
|
Loading…
Reference in a new issue