set initial basalProgram. fix handshaking state
This commit is contained in:
parent
32183aff37
commit
f9aa967b46
3 changed files with 8 additions and 3 deletions
|
@ -200,11 +200,12 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isConnecting(): Boolean {
|
override fun isConnecting(): Boolean {
|
||||||
return stopConnecting != null && podStateManager.bluetoothConnectionState == OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTING
|
return stopConnecting != null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isHandshakeInProgress(): Boolean {
|
override fun isHandshakeInProgress(): Boolean {
|
||||||
return stopConnecting != null
|
return stopConnecting != null &&
|
||||||
|
podStateManager.bluetoothConnectionState == OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTED
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun finishHandshaking() {
|
override fun finishHandshaking() {
|
||||||
|
@ -212,6 +213,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
|
|
||||||
override fun connect(reason: String) {
|
override fun connect(reason: String) {
|
||||||
aapsLogger.info(LTag.PUMP, "connect reason=$reason")
|
aapsLogger.info(LTag.PUMP, "connect reason=$reason")
|
||||||
|
podStateManager.bluetoothConnectionState = OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTING
|
||||||
thread(
|
thread(
|
||||||
start = true,
|
start = true,
|
||||||
name = "ConnectionThread",
|
name = "ConnectionThread",
|
||||||
|
@ -437,7 +439,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
// TODO: what do we have to answer here if delivery is suspended?
|
// TODO: what do we have to answer here if delivery is suspended?
|
||||||
val running = podStateManager.basalProgram
|
val running = podStateManager.basalProgram
|
||||||
val equal = (mapProfileToBasalProgram(profile) == running)
|
val equal = (mapProfileToBasalProgram(profile) == running)
|
||||||
aapsLogger.info(LTag.PUMP, "isThisProfileSet: $equal")
|
aapsLogger.info(LTag.PUMP, "set: $equal. profile=$profile, running=$running")
|
||||||
return equal
|
return equal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override var bluetoothConnectionState: OmnipodDashPodStateManager.BluetoothConnectionState
|
override var bluetoothConnectionState: OmnipodDashPodStateManager.BluetoothConnectionState
|
||||||
|
@Synchronized
|
||||||
get() = podState.bluetoothConnectionState
|
get() = podState.bluetoothConnectionState
|
||||||
|
@Synchronized
|
||||||
set(bluetoothConnectionState) {
|
set(bluetoothConnectionState) {
|
||||||
podState.bluetoothConnectionState = bluetoothConnectionState
|
podState.bluetoothConnectionState = bluetoothConnectionState
|
||||||
rxBus.send(EventOmnipodDashPumpValuesChanged())
|
rxBus.send(EventOmnipodDashPumpValuesChanged())
|
||||||
|
|
|
@ -73,6 +73,7 @@ class DashInsertCannulaViewModel @Inject constructor(
|
||||||
},
|
},
|
||||||
onComplete = {
|
onComplete = {
|
||||||
logger.debug("Pod activation part 2 completed")
|
logger.debug("Pod activation part 2 completed")
|
||||||
|
podStateManager.basalProgram = basalProgram
|
||||||
pumpSync.connectNewPump()
|
pumpSync.connectNewPump()
|
||||||
pumpSync.insertTherapyEventIfNewWithTimestamp(
|
pumpSync.insertTherapyEventIfNewWithTimestamp(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
|
|
Loading…
Reference in a new issue