save bolusPulsesRemainig

This commit is contained in:
Andrei Vereha 2021-06-06 21:25:40 +02:00
parent 95c9bd94a1
commit f6d0520fe2

View file

@ -323,10 +323,11 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
} }
override fun updateFromDefaultStatusResponse(response: DefaultStatusResponse) { override fun updateFromDefaultStatusResponse(response: DefaultStatusResponse) {
logger.debug(LTag.PUMPBTCOMM, "Default status reponse :$response") logger.debug(LTag.PUMPBTCOMM, "Default status response :$response")
podState.deliveryStatus = response.deliveryStatus podState.deliveryStatus = response.deliveryStatus
podState.podStatus = response.podStatus podState.podStatus = response.podStatus
podState.pulsesDelivered = response.totalPulsesDelivered podState.pulsesDelivered = response.totalPulsesDelivered
podState.bolusPulsesRemaining = response.bolusPulsesRemaining
if (response.reservoirPulsesRemaining < 1023) { if (response.reservoirPulsesRemaining < 1023) {
podState.pulsesRemaining = response.reservoirPulsesRemaining podState.pulsesRemaining = response.reservoirPulsesRemaining
} }
@ -397,6 +398,8 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
podState.deliveryStatus = response.deliveryStatus podState.deliveryStatus = response.deliveryStatus
podState.podStatus = response.podStatus podState.podStatus = response.podStatus
podState.pulsesDelivered = response.totalPulsesDelivered podState.pulsesDelivered = response.totalPulsesDelivered
podState.bolusPulsesRemaining = response.bolusPulsesRemaining
if (response.reservoirPulsesRemaining < 1023) { if (response.reservoirPulsesRemaining < 1023) {
podState.pulsesRemaining = response.reservoirPulsesRemaining podState.pulsesRemaining = response.reservoirPulsesRemaining
} }
@ -462,6 +465,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
var bluetoothAddress: String? = null var bluetoothAddress: String? = null
var ltk: ByteArray? = null var ltk: ByteArray? = null
var eapAkaSequenceNumber: Long = 1 var eapAkaSequenceNumber: Long = 1
var bolusPulsesRemaining: Short = 0
var bleVersion: SoftwareVersion? = null var bleVersion: SoftwareVersion? = null
var firmwareVersion: SoftwareVersion? = null var firmwareVersion: SoftwareVersion? = null