remove maybeMarkActiveCommandFailed. this logic was moved in "updateActiveCommand"
This commit is contained in:
parent
a20cc1cca3
commit
e867b1397d
2 changed files with 6 additions and 13 deletions
|
@ -70,7 +70,6 @@ interface OmnipodDashPodStateManager {
|
||||||
fun createActiveCommand(historyId: String): Single<ActiveCommand>
|
fun createActiveCommand(historyId: String): Single<ActiveCommand>
|
||||||
fun updateActiveCommand(): Maybe<CommandConfirmed>
|
fun updateActiveCommand(): Maybe<CommandConfirmed>
|
||||||
fun observeNoActiveCommand(): Observable<PodEvent>
|
fun observeNoActiveCommand(): Observable<PodEvent>
|
||||||
fun maybeMarkActiveCommandFailed()
|
|
||||||
|
|
||||||
data class ActiveCommand(
|
data class ActiveCommand(
|
||||||
val sequence: Short,
|
val sequence: Short,
|
||||||
|
|
|
@ -228,16 +228,6 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized
|
|
||||||
override fun maybeMarkActiveCommandFailed() {
|
|
||||||
podState.activeCommand?.run {
|
|
||||||
if (sentRealtime < createdRealtime) {
|
|
||||||
// command was not sent
|
|
||||||
podState.activeCommand = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun updateActiveCommand() = Maybe.create<CommandConfirmed> { source ->
|
override fun updateActiveCommand() = Maybe.create<CommandConfirmed> { source ->
|
||||||
podState.activeCommand?.run {
|
podState.activeCommand?.run {
|
||||||
|
@ -246,8 +236,12 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
||||||
"lastResponse=$lastStatusResponseReceived " +
|
"lastResponse=$lastStatusResponseReceived " +
|
||||||
"$sequenceNumberOfLastProgrammingCommand $historyId"
|
"$sequenceNumberOfLastProgrammingCommand $historyId"
|
||||||
)
|
)
|
||||||
if (createdRealtime >= lastStatusResponseReceived)
|
if (sentRealtime < createdRealtime) {
|
||||||
// we did not receive a valid response yet
|
// command was not sent, clear it up
|
||||||
|
podState.activeCommand = null
|
||||||
|
source.onComplete()
|
||||||
|
} else if (createdRealtime >= lastStatusResponseReceived)
|
||||||
|
// we did not receive a valid response yet
|
||||||
source.onComplete()
|
source.onComplete()
|
||||||
else {
|
else {
|
||||||
podState.activeCommand = null
|
podState.activeCommand = null
|
||||||
|
|
Loading…
Reference in a new issue