Merge pull request #2742 from jbr7rr/medtrum-fixes
Medtrum: Allow time for notifications to update sequence number
This commit is contained in:
commit
89ad5f18b2
1 changed files with 4 additions and 1 deletions
|
@ -373,11 +373,14 @@ class MedtrumService : DaggerService(), BLECommCallback {
|
||||||
|
|
||||||
bolusingEvent.percent = 99
|
bolusingEvent.percent = 99
|
||||||
val bolusDurationInMSec = (insulin * 60 * 1000)
|
val bolusDurationInMSec = (insulin * 60 * 1000)
|
||||||
val expectedEnd = bolusStart + bolusDurationInMSec + 2000
|
val expectedEnd = bolusStart + bolusDurationInMSec + 1000
|
||||||
while (System.currentTimeMillis() < expectedEnd && !medtrumPump.bolusDone) {
|
while (System.currentTimeMillis() < expectedEnd && !medtrumPump.bolusDone) {
|
||||||
SystemClock.sleep(1000)
|
SystemClock.sleep(1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow time for notification packet with new sequnce number to arrive
|
||||||
|
SystemClock.sleep(2000)
|
||||||
|
|
||||||
bolusingEvent.t = medtrumPump.bolusingTreatment
|
bolusingEvent.t = medtrumPump.bolusingTreatment
|
||||||
medtrumPump.bolusingTreatment = null
|
medtrumPump.bolusingTreatment = null
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue