resolve rireylink -> pump-common dependency
This commit is contained in:
parent
ed91df6341
commit
936192b0de
111 changed files with 307 additions and 252 deletions
|
@ -200,6 +200,7 @@ dependencies {
|
|||
implementation project(':insight')
|
||||
implementation project(':pump:medtronic')
|
||||
implementation project(':pump:pump-common')
|
||||
implementation project(':pump:pump-core')
|
||||
implementation project(':pump:rileylink')
|
||||
implementation project(':pump:omnipod-common')
|
||||
implementation project(':pump:omnipod-eros')
|
||||
|
|
|
@ -21,6 +21,7 @@ dependencies {
|
|||
implementation project(':app-wear-shared:shared')
|
||||
implementation project(':core')
|
||||
implementation project(':pump:pump-common')
|
||||
implementation project(':pump:pump-core')
|
||||
implementation project(':pump:rileylink')
|
||||
implementation project(':interfaces')
|
||||
}
|
||||
|
|
|
@ -13,9 +13,6 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged
|
|||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.rx.events.EventRefreshButtonState
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
|
||||
|
@ -29,19 +26,22 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.rx.events.EventQueueChanged
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.WarnColors
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventExtendedBolusChange
|
||||
import info.nightscout.rx.events.EventQueueChanged
|
||||
import info.nightscout.rx.events.EventRefreshButtonState
|
||||
import info.nightscout.rx.events.EventTempBasalChange
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm
|
||||
|
||||
import android.os.SystemClock
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst
|
||||
|
@ -10,7 +9,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.Radi
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage
|
||||
|
@ -36,6 +34,8 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.createByteArray
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.getByteArrayFromUnsignedShort
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import org.joda.time.LocalDateTime
|
||||
import java.util.Calendar
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpConfigurationGroup
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import org.joda.time.IllegalFieldValueException
|
||||
|
@ -119,8 +119,9 @@ class MedtronicConverter @Inject constructor(
|
|||
addSettingToMap("PCFG_MAX_BOLUS", "" + decodeMaxBolus(rd), PumpConfigurationGroup.Bolus, map)
|
||||
addSettingToMap(
|
||||
"PCFG_MAX_BASAL", ""
|
||||
+ decodeBasalInsulin(ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(),
|
||||
rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map)
|
||||
+ decodeBasalInsulin(
|
||||
ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(),
|
||||
rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map)
|
||||
addSettingToMap("CFG_BASE_CLOCK_MODE", if (rd[settingIndexTimeDisplayFormat].toInt() == 0) "12h" else "24h",
|
||||
PumpConfigurationGroup.General, map)
|
||||
addSettingToMap("PCFG_BASAL_PROFILES_ENABLED", parseResultEnable(rd[10].toInt()), PumpConfigurationGroup.Basal, map)
|
||||
|
@ -152,14 +153,15 @@ class MedtronicConverter @Inject constructor(
|
|||
addSettingToMap("PCFG_AUDIO_BOLUS_ENABLED", parseResultEnable(rd[2].toInt()), PumpConfigurationGroup.Bolus, map)
|
||||
if (rd[2].toInt() == 1) {
|
||||
addSettingToMap("PCFG_AUDIO_BOLUS_STEP_SIZE", "" + decodeBolusInsulin(ByteUtil.asUINT8(rd[3])),
|
||||
PumpConfigurationGroup.Bolus, map)
|
||||
PumpConfigurationGroup.Bolus, map)
|
||||
}
|
||||
addSettingToMap("PCFG_VARIABLE_BOLUS_ENABLED", parseResultEnable(rd[4].toInt()), PumpConfigurationGroup.Bolus, map)
|
||||
addSettingToMap("PCFG_MAX_BOLUS", "" + decodeMaxBolus(rd), PumpConfigurationGroup.Bolus, map)
|
||||
addSettingToMap(
|
||||
"PCFG_MAX_BASAL", ""
|
||||
+ decodeBasalInsulin(ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(),
|
||||
rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map)
|
||||
+ decodeBasalInsulin(
|
||||
ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(),
|
||||
rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map)
|
||||
addSettingToMap("CFG_BASE_CLOCK_MODE", if (rd[settingIndexTimeDisplayFormat].toInt() == 0) "12h" else "24h",
|
||||
PumpConfigurationGroup.General, map)
|
||||
if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) {
|
||||
|
@ -201,7 +203,7 @@ class MedtronicConverter @Inject constructor(
|
|||
val map = decodeSettings512(rd)
|
||||
addSettingToMap("PCFG_MM_RESERVOIR_WARNING_TYPE_TIME", if (rd[18].toInt() != 0) "PCFG_MM_RESERVOIR_WARNING_TYPE_TIME" else "PCFG_MM_RESERVOIR_WARNING_TYPE_UNITS", PumpConfigurationGroup.Other, map)
|
||||
addSettingToMap("PCFG_MM_SRESERVOIR_WARNING_POINT", "" + ByteUtil.asUINT8(rd[19]),
|
||||
PumpConfigurationGroup.Other, map)
|
||||
PumpConfigurationGroup.Other, map)
|
||||
addSettingToMap("CFG_MM_KEYPAD_LOCKED", parseResultEnable(rd[20].toInt()), PumpConfigurationGroup.Other, map)
|
||||
if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) {
|
||||
addSettingToMap("PCFG_BOLUS_SCROLL_STEP_SIZE", "" + rd[21], PumpConfigurationGroup.Bolus, map)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
@ -16,7 +16,8 @@ import org.apache.commons.lang3.StringUtils
|
|||
*/
|
||||
abstract class MedtronicHistoryDecoder<T : MedtronicHistoryEntry?>(var aapsLogger: AAPSLogger,
|
||||
var medtronicUtil: MedtronicUtil,
|
||||
var bitUtils: ByteUtil) : MedtronicHistoryDecoderInterface<T> {
|
||||
var bitUtils: ByteUtil
|
||||
) : MedtronicHistoryDecoderInterface<T> {
|
||||
|
||||
// STATISTICS (remove at later time or not)
|
||||
protected var statisticsEnabled = true
|
||||
|
@ -112,7 +113,7 @@ abstract class MedtronicHistoryDecoder<T : MedtronicHistoryEntry?>(var aapsLogge
|
|||
}
|
||||
|
||||
fun getFormattedFloat(value: Float, decimals: Int): String {
|
||||
return StringUtil.getFormatedValueUS(value, decimals)
|
||||
return StringUtil.getFormattedValueUS(value, decimals)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
|
||||
/**
|
||||
* This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.CRC
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import java.util.Arrays
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryEntry
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.joda.time.LocalDateTime
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms.CGMSHistoryEntryType.Companion.getByCode
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import okhttp3.internal.and
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus
|
||||
|
@ -13,6 +12,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import java.util.Locale
|
||||
|
@ -426,15 +426,15 @@ class MedtronicPumpHistoryDecoder @Inject constructor(
|
|||
val data = entry.head
|
||||
if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) {
|
||||
bolus = BolusDTO(atechDateTime = entry.atechDateTime,
|
||||
requestedAmount = ByteUtil.toInt(data.get(0), data.get(1)) / 40.0,
|
||||
deliveredAmount = ByteUtil.toInt(data.get(2), data.get(3)) / 40.0,
|
||||
duration = data.get(6) * 30)
|
||||
requestedAmount = ByteUtil.toInt(data.get(0), data.get(1)) / 40.0,
|
||||
deliveredAmount = ByteUtil.toInt(data.get(2), data.get(3)) / 40.0,
|
||||
duration = data.get(6) * 30)
|
||||
bolus.insulinOnBoard = ByteUtil.toInt(data.get(4), data.get(5)) / 40.0
|
||||
} else {
|
||||
bolus = BolusDTO(atechDateTime = entry.atechDateTime,
|
||||
requestedAmount = ByteUtil.asUINT8(data.get(0)) / 10.0,
|
||||
deliveredAmount = ByteUtil.asUINT8(data.get(1)) / 10.0,
|
||||
duration = ByteUtil.asUINT8(data.get(2)) * 30)
|
||||
requestedAmount = ByteUtil.asUINT8(data.get(0)) / 10.0,
|
||||
deliveredAmount = ByteUtil.asUINT8(data.get(1)) / 10.0,
|
||||
duration = ByteUtil.asUINT8(data.get(2)) * 30)
|
||||
}
|
||||
bolus.bolusType = if (bolus.duration > 0) PumpBolusType.Extended else PumpBolusType.Normal
|
||||
entry.addDecodedData("Object", bolus)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryEntry
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BolusDTO
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import java.util.*
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
import java.util.Objects
|
||||
|
||||
/**
|
||||
* This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.message
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import kotlin.experimental.and
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.message
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
|
||||
/**
|
||||
* Created by geoff on 5/29/16.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.message
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import kotlin.math.min
|
||||
|
@ -62,7 +62,7 @@ class PumpMessage : RLMessage {
|
|||
}
|
||||
if (rxData.size > 5) {
|
||||
messageBody = MedtronicCommandType.constructMessageBody(commandType,
|
||||
ByteUtil.substring(rxData, 5, rxData.size - 5))
|
||||
ByteUtil.substring(rxData, 5, rxData.size - 5))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
|
||||
|
@ -12,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicUIRespons
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
@ -155,10 +155,12 @@ class MedtronicUITask {
|
|||
postprocessor.postProcessData(this)
|
||||
}
|
||||
if (responseType === MedtronicUIResponseType.Invalid) {
|
||||
rxBus.send(EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating,
|
||||
rxBus.send(EventRileyLinkDeviceStatusChange(
|
||||
PumpDeviceState.ErrorWhenCommunicating,
|
||||
"Unsupported command in MedtronicUITask"))
|
||||
} else if (responseType === MedtronicUIResponseType.Error) {
|
||||
rxBus.send(EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating,
|
||||
rxBus.send(EventRileyLinkDeviceStatusChange(
|
||||
PumpDeviceState.ErrorWhenCommunicating,
|
||||
errorDescription))
|
||||
} else {
|
||||
rxBus.send(EventMedtronicPumpValuesChanged())
|
||||
|
|
|
@ -6,16 +6,13 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntry
|
||||
import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryBolus
|
||||
import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR
|
||||
import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.R
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
|
||||
|
@ -33,9 +30,12 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.joda.time.LocalDateTime
|
||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
|
|||
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import org.joda.time.Instant
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
|
||||
/**
|
||||
* Application: GGC - GNU Gluco Control
|
||||
|
@ -73,7 +73,7 @@ class BolusDTO constructor(atechDateTime: Long,
|
|||
}
|
||||
|
||||
override fun getFormattedDecimal(value: Double): String {
|
||||
return StringUtil.getFormatedValueUS(value, 2)
|
||||
return StringUtil.getFormattedValueUS(value, 2)
|
||||
}
|
||||
|
||||
val bolusKey: String
|
||||
|
|
|
@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
|
|||
|
||||
//import info.nightscout.androidaps.db.TDD
|
||||
import com.google.gson.annotations.Expose
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder
|
||||
import java.util.*
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Created by andy on 11/3/18.
|
||||
|
@ -56,16 +56,16 @@ class DailyTotalsDTO(var entry: PumpHistoryEntry) {
|
|||
private var bolusCountCorr: Int? = null
|
||||
private fun setDisplayable() {
|
||||
if (insulinBasal == 0.0) {
|
||||
entry.displayableValue = "Total Insulin: " + StringUtil.getFormatedValueUS(insulinTotal, 2)
|
||||
entry.displayableValue = "Total Insulin: " + StringUtil.getFormattedValueUS(insulinTotal, 2)
|
||||
} else {
|
||||
entry.displayableValue = ("Basal Insulin: " + StringUtil.getFormatedValueUS(insulinBasal, 2)
|
||||
+ ", Total Insulin: " + StringUtil.getFormatedValueUS(insulinTotal, 2))
|
||||
entry.displayableValue = ("Basal Insulin: " + StringUtil.getFormattedValueUS(insulinBasal, 2)
|
||||
+ ", Total Insulin: " + StringUtil.getFormattedValueUS(insulinTotal, 2))
|
||||
}
|
||||
}
|
||||
|
||||
private fun decodeEndResultsTotals(entry: PumpHistoryEntry) {
|
||||
val totals = ByteUtil.toInt(entry.head[0].toInt(), entry.head[1].toInt(), entry.head[2].toInt(),
|
||||
entry.head[3].toInt(), ByteUtil.BitConversion.BIG_ENDIAN) * 0.025
|
||||
entry.head[3].toInt(), ByteUtil.BitConversion.BIG_ENDIAN) * 0.025
|
||||
insulinTotal = totals
|
||||
entry.addDecodedData("Totals", totals)
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ class DailyTotalsDTO(var entry: PumpHistoryEntry) {
|
|||
val j1 = ByteUtil.toInt(data[i + 1], data[i])
|
||||
val k1: Int = ByteUtil.toInt(data[i + 2], data[i + 1], data[i])
|
||||
println(String.format(Locale.ENGLISH,
|
||||
"index: %d, number=%d, del/40=%.3f, del/10=%.3f, singular=%d, sing_hex=%s", i, j, j / 40.0, j / 10.0,
|
||||
data[i], ByteUtil.shortHexString(data[i])))
|
||||
"index: %d, number=%d, del/40=%.3f, del/10=%.3f, singular=%d, sing_hex=%s", i, j, j / 40.0, j / 10.0,
|
||||
data[i], ByteUtil.shortHexString(data[i])))
|
||||
println(String.format(Locale.ENGLISH, " number[k,j1,k1]=%d / %d /%d, del/40=%.3f, del/40=%.3f, del/40=%.3f",
|
||||
k, j1, k1, k / 40.0, j1 / 40.0, k1 / 40.0))
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil
|
||||
import info.nightscout.pump.core.utils.StringUtil
|
||||
|
||||
/**
|
||||
* Created by andy on 6/2/18.
|
||||
|
@ -11,6 +11,6 @@ open class PumpTimeStampedRecord constructor(var atechDateTime: Long = 0) {
|
|||
// var atechDateTime: Long = 0
|
||||
|
||||
open fun getFormattedDecimal(value: Double): String? {
|
||||
return StringUtil.getFormatedValueUS(value, decimalPrecission)
|
||||
return StringUtil.getFormattedValueUS(value, decimalPrecission)
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import java.util.Locale
|
||||
|
|
|
@ -3,13 +3,13 @@ package info.nightscout.androidaps.plugins.pump.medtronic.di
|
|||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUIComm
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.driver
|
||||
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
|
@ -12,7 +10,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.BasalProfileStatus
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import java.util.Calendar
|
||||
import java.util.GregorianCalendar
|
||||
|
|
|
@ -4,13 +4,11 @@ import android.content.Intent
|
|||
import android.content.res.Configuration
|
||||
import android.os.Binder
|
||||
import android.os.IBinder
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.R
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager
|
||||
|
@ -19,8 +17,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceTyp
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.medtronic.util
|
||||
|
||||
import com.google.gson.GsonBuilder
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.ClockDTO
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.RLHistoryItemMedtronic
|
||||
|
@ -16,9 +13,12 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandTy
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificationType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import org.joda.time.LocalTime
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
|
|
|
@ -4,18 +4,18 @@ import dagger.android.AndroidInjector
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.PumpSync
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.TestAapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLoggerTest
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
|
|
|
@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm
|
|||
|
||||
import android.util.Log
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
|
||||
|
@ -13,6 +12,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceTyp
|
|||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.androidaps.utils.serialisation.SealedClassHelper.gson
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.rx.TestAapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import org.junit.Before
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump
|
|||
|
||||
//import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
|
|
@ -32,6 +32,7 @@ dependencies {
|
|||
implementation project(':libraries')
|
||||
implementation project(':core')
|
||||
implementation project(':pump:pump-common')
|
||||
implementation project(':pump:pump-core')
|
||||
implementation project(':pump:rileylink')
|
||||
implementation project(':pump:omnipod-common')
|
||||
implementation project(':interfaces')
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.CancelDeliveryCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.GetStatusCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType;
|
||||
|
@ -15,6 +14,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Po
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.CrcMismatchException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.MessageDecodingException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.NotEnoughDataException;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
import info.nightscout.rx.logging.AAPSLogger;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodCrc;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PacketType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.CrcMismatchException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalPacketTypeException;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
/**
|
||||
* Created by andy on 6/1/18.
|
||||
|
|
|
@ -4,11 +4,11 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import java.util.Collections;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class AcknowledgeAlertsCommand extends NonceResyncableMessageBlock {
|
||||
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BasalScheduleExtraCommand extends MessageBlock {
|
||||
private final boolean acknowledgementBeep;
|
||||
|
|
|
@ -4,10 +4,10 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BeepConfigCommand extends MessageBlock {
|
||||
private final BeepConfigType beepType;
|
||||
|
|
|
@ -2,10 +2,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BolusExtraCommand extends MessageBlock {
|
||||
private final boolean acknowledgementBeep;
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class CancelDeliveryCommand extends NonceResyncableMessageBlock {
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class ConfigureAlertsCommand extends NonceResyncableMessageBlock {
|
||||
private final List<AlertConfiguration> configurations;
|
||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class DeactivatePodCommand extends NonceResyncableMessageBlock {
|
||||
private int nonce;
|
||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class FaultConfigCommand extends NonceResyncableMessageBlock {
|
||||
private final byte tab5sub16;
|
||||
|
|
|
@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
|
@ -12,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.sc
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BolusDeliverySchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.DeliverySchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.TempBasalDeliverySchedule;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock {
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class SetupPodCommand extends MessageBlock {
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@ import org.joda.time.Duration;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class TempBasalExtraCommand extends MessageBlock {
|
||||
private final boolean acknowledgementBeep;
|
||||
|
|
|
@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class ErrorResponse extends MessageBlock {
|
||||
public static final byte ERROR_RESPONSE_CODE_BAD_NONCE = (byte) 0x14;
|
||||
|
|
|
@ -5,13 +5,13 @@ import org.joda.time.Duration;
|
|||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class StatusResponse extends MessageBlock implements StatusUpdatableResponse {
|
||||
private static final int MESSAGE_LENGTH = 10;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FirmwareVersion;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class VersionResponse extends MessageBlock {
|
||||
private static final int ASSIGN_ADDRESS_VERSION_RESPONSE_LENGTH = 0x15;
|
||||
|
|
|
@ -5,10 +5,10 @@ import org.joda.time.Duration;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoActiveAlerts extends PodInfo {
|
||||
private static final int MINIMUM_MESSAGE_LENGTH = 11;
|
||||
|
|
|
@ -6,9 +6,9 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoDataLog extends PodInfo {
|
||||
private static final int MINIMUM_MESSAGE_LENGTH = 8;
|
||||
|
|
|
@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusUpdatableResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
|
@ -11,6 +10,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Fa
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoDetailedStatus extends PodInfo implements StatusUpdatableResponse {
|
||||
private static final int MINIMUM_MESSAGE_LENGTH = 21;
|
||||
|
|
|
@ -6,8 +6,8 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoOlderPulseLog extends PodInfo {
|
||||
private static final int MINIMUM_MESSAGE_LENGTH = 3;
|
||||
|
|
|
@ -6,8 +6,8 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoRecentPulseLog extends PodInfo {
|
||||
private static final int MINIMUM_MESSAGE_LENGTH = 3;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoResponse extends MessageBlock {
|
||||
private final PodInfoType subType;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class AlertConfiguration {
|
||||
private final AlertType alertType;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public final class ErrorEventInfo {
|
||||
private final boolean insulinStateTableCorruption;
|
||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.s
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BasalDeliverySchedule extends DeliverySchedule implements IRawRepresentable {
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.s
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BasalTableEntry implements IRawRepresentable {
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BolusDeliverySchedule extends DeliverySchedule implements IRawRepresentable {
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants.BASAL_STEP_DURATION;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
|
||||
import static info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants.BASAL_STEP_DURATION;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class RateEntry implements IRawRepresentable {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class TempBasalDeliverySchedule extends DeliverySchedule implements IRawRepresentable {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class NotEnoughDataException extends OmnipodException {
|
||||
private final byte[] data;
|
||||
|
|
|
@ -15,20 +15,14 @@ import javax.inject.Singleton;
|
|||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.data.DetailedBolusInfo;
|
||||
import info.nightscout.interfaces.data.PumpEnactResult;
|
||||
import info.nightscout.androidaps.data.PumpEnactResultImpl;
|
||||
import info.nightscout.androidaps.extensions.PumpStateExtensionKt;
|
||||
import info.nightscout.interfaces.ActivityNames;
|
||||
import info.nightscout.androidaps.interfaces.Profile;
|
||||
import info.nightscout.androidaps.interfaces.PumpSync;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
|
||||
import info.nightscout.rx.events.EventOverviewBolusProgress;
|
||||
import info.nightscout.interfaces.notifications.Notification;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
|
||||
|
@ -75,14 +69,20 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil;
|
||||
import info.nightscout.shared.utils.T;
|
||||
import info.nightscout.interfaces.ActivityNames;
|
||||
import info.nightscout.interfaces.data.PumpEnactResult;
|
||||
import info.nightscout.interfaces.notifications.Notification;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
import info.nightscout.rx.AapsSchedulers;
|
||||
import info.nightscout.rx.bus.RxBus;
|
||||
import info.nightscout.rx.events.Event;
|
||||
import info.nightscout.rx.events.EventOverviewBolusProgress;
|
||||
import info.nightscout.rx.events.EventRefreshOverview;
|
||||
import info.nightscout.rx.logging.AAPSLogger;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.shared.sharedPreferences.SP;
|
||||
import info.nightscout.shared.utils.T;
|
||||
import io.reactivex.rxjava3.subjects.SingleSubject;
|
||||
|
||||
@Singleton
|
||||
|
|
|
@ -8,12 +8,10 @@ import java.util.List;
|
|||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.OmnipodAction;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.OmnipodMessage;
|
||||
|
@ -43,6 +41,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ril
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnexpectedException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnreachableException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType;
|
||||
|
@ -20,6 +19,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugi
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -7,15 +12,10 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BasalScheduleExtraCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BeepConfigCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class BolusExtraCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class CancelDeliveryCommandTest {
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertType;
|
||||
|
@ -14,8 +15,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Be
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.TimerAlertTrigger;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.UnitsRemainingAlertTrigger;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class ConfigureAlertsCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class GetStatusCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -7,12 +9,10 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BolusDeliverySchedule;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class SetInsulinScheduleCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class SetupPodCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class TempBasalExtraCommandTest {
|
||||
@Test
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class ErrorResponseTest {
|
||||
@Test
|
||||
public void testGetRawData() {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class StatusResponseTest {
|
||||
// TODO add /extend tests
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -12,6 +7,11 @@ import static org.junit.Assert.assertNotNull;
|
|||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class VersionResponseTest {
|
||||
@Test
|
||||
public void testRawDataAssignAddressVersionResponse() {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoActiveAlertsTest {
|
||||
@Test
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoDataLogTest {
|
||||
@Test
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
// From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift
|
||||
public class PodInfoDetailedStatusTest {
|
||||
@Test
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoFaultAndInitializationTimeTest {
|
||||
@Test
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoRecentPulseLogTest {
|
||||
@Test
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class PodInfoResponseTest {
|
||||
@Test
|
||||
public void testRawData() {
|
||||
|
|
|
@ -15,11 +15,9 @@ enum class PumpDriverState(var resourceId: Int) {
|
|||
Ready(R.string.pump_status_ready),
|
||||
Busy(R.string.pump_status_busy), //
|
||||
Suspended(R.string.pump_status_suspended), //
|
||||
Sleeping(R.string.pump_status_sleeping),
|
||||
ExecutingCommand(R.string.pump_status_executing_command),
|
||||
Disconnecting(R.string.disconnecting),
|
||||
Disconnected(R.string.disconnected),
|
||||
ErrorCommunicatingWithPump(R.string.pump_status_error_comm);
|
||||
Disconnected(R.string.disconnected);
|
||||
|
||||
fun isConnected(): Boolean = this == Connected || this == Initialized || this == Busy || this == Suspended
|
||||
fun isInitialized(): Boolean = this == Initialized || this == Busy || this == Suspended
|
||||
|
|
|
@ -11,14 +11,6 @@
|
|||
|
||||
|
||||
<!-- PumpCommon - Pump Status -->
|
||||
<string name="pump_status_never_contacted">Never contacted</string>
|
||||
<string name="pump_status_waking_up">Waking up</string>
|
||||
<string name="pump_status_error_comm">Error with communication</string>
|
||||
<string name="pump_status_timeout_comm">Timeout on communication</string>
|
||||
<string name="pump_status_pump_unreachable">Pump unreachable</string>
|
||||
<string name="pump_status_invalid_config">Invalid configuration</string>
|
||||
<string name="pump_status_active">Active</string>
|
||||
<string name="pump_status_sleeping">Sleeping</string>
|
||||
<string name="pump_status_not_initialized">Not initialized</string>
|
||||
<string name="pump_status_initialized">Initialized</string>
|
||||
<string name="pump_status_encrypt">Encrypting communication</string>
|
||||
|
|
1
pump/pump-core/.gitignore
vendored
Normal file
1
pump/pump-core/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/build
|
20
pump/pump-core/build.gradle
Normal file
20
pump/pump-core/build.gradle
Normal file
|
@ -0,0 +1,20 @@
|
|||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-allopen'
|
||||
id 'com.hiya.jacoco-android'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/jacoco_global.gradle"
|
||||
android {
|
||||
namespace 'info.nightscout.pump.core'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api "net.danlew:android.joda:$joda_version"
|
||||
}
|
0
pump/pump-core/consumer-rules.pro
Normal file
0
pump/pump-core/consumer-rules.pro
Normal file
21
pump/pump-core/proguard-rules.pro
vendored
Normal file
21
pump/pump-core/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
4
pump/pump-core/src/main/AndroidManifest.xml
Normal file
4
pump/pump-core/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest>
|
||||
|
||||
</manifest>
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.defs
|
||||
package info.nightscout.pump.core.defs
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.common.R
|
||||
import info.nightscout.pump.core.R
|
||||
|
||||
enum class PumpDeviceState(var resourceId: Int) {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.utils;
|
||||
package info.nightscout.pump.core.utils;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
|
@ -1,22 +1,19 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.utils;
|
||||
package info.nightscout.pump.core.utils;
|
||||
|
||||
import org.joda.time.LocalDateTime;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import info.nightscout.shared.utils.DateUtil;
|
||||
|
||||
/**
|
||||
* Created by geoff on 4/28/15.
|
||||
* modified by Andy
|
||||
*/
|
||||
public class StringUtil {
|
||||
|
||||
public static DecimalFormat[] DecimalFormaters = {
|
||||
public static DecimalFormat[] DecimalFormatters = {
|
||||
new DecimalFormat("#0"), new DecimalFormat("#0.0"), new DecimalFormat("#0.00"), new DecimalFormat("#0.000")};
|
||||
|
||||
|
||||
|
@ -44,7 +41,7 @@ public class StringUtil {
|
|||
|
||||
|
||||
public static String testJoin() {
|
||||
ArrayList<String> ra = new ArrayList<String>();
|
||||
ArrayList<String> ra = new ArrayList<>();
|
||||
ra.add("one");
|
||||
ra.add("two");
|
||||
ra.add("three");
|
||||
|
@ -69,8 +66,8 @@ public class StringUtil {
|
|||
}
|
||||
|
||||
|
||||
public static String getFormatedValueUS(Number value, int decimals) {
|
||||
return DecimalFormaters[decimals].format(value).replace(",", ".");
|
||||
public static String getFormattedValueUS(Number value, int decimals) {
|
||||
return DecimalFormatters[decimals].format(value).replace(",", ".");
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,9 +82,8 @@ public class StringUtil {
|
|||
}
|
||||
|
||||
|
||||
public static String toDateTimeString(DateUtil dateUtil, LocalDateTime localDateTime) {
|
||||
return dateUtil.dateAndTimeAndSecondsString(localDateTime.toDateTime().getMillis());
|
||||
//return localDateTime.toString("dd.MM.yyyy HH:mm:ss");
|
||||
public static String toDateTimeString(LocalDateTime localDateTime) {
|
||||
return localDateTime.toString("dd.MM.yyyy HH:mm:ss");
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.utils;
|
||||
package info.nightscout.pump.core.utils;
|
||||
|
||||
/**
|
||||
* Created by geoff on 5/27/16.
|
14
pump/pump-core/src/main/res/values/strings.xml
Normal file
14
pump/pump-core/src/main/res/values/strings.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- PumpDeviceState -->
|
||||
<string name="pump_status_never_contacted">Never contacted</string>
|
||||
<string name="pump_status_sleeping">Sleeping</string>
|
||||
<string name="pump_status_waking_up">Waking up</string>
|
||||
<string name="pump_status_active">Active</string>
|
||||
<string name="pump_status_error_comm">Error with communication</string>
|
||||
<string name="pump_status_timeout_comm">Timeout on communication</string>
|
||||
<string name="pump_status_pump_unreachable">Pump unreachable</string>
|
||||
<string name="pump_status_invalid_config">Invalid configuration</string>
|
||||
|
||||
</resources>
|
|
@ -20,5 +20,6 @@ dependencies {
|
|||
implementation project(':app-wear-shared:shared')
|
||||
implementation project(':core')
|
||||
implementation project(':pump:pump-common')
|
||||
implementation project(':pump:pump-core')
|
||||
implementation project(':interfaces')
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.androidaps.plugins.pump.common.events
|
||||
|
||||
import info.nightscout.androidaps.events.EventStatus
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
|
||||
open class EventRileyLinkDeviceStatusChange : EventStatus {
|
||||
|
|
|
@ -6,7 +6,6 @@ import javax.inject.Inject;
|
|||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin;
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.FrequencyScanResults;
|
||||
|
@ -21,8 +20,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.interfaces.utils.Round;
|
||||
import info.nightscout.pump.core.defs.PumpDeviceState;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
import info.nightscout.rx.logging.AAPSLogger;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
import info.nightscout.shared.sharedPreferences.SP;
|
||||
|
|
|
@ -12,7 +12,6 @@ import javax.inject.Inject;
|
|||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
|
||||
|
@ -32,13 +31,14 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
import info.nightscout.pump.core.utils.StringUtil;
|
||||
import info.nightscout.pump.core.utils.ThreadUtil;
|
||||
import info.nightscout.rx.bus.RxBus;
|
||||
import info.nightscout.rx.events.EventRefreshOverview;
|
||||
import info.nightscout.rx.logging.AAPSLogger;
|
||||
import info.nightscout.rx.logging.LTag;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import info.nightscout.shared.sharedPreferences.SP;
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,8 +4,8 @@ import android.os.SystemClock
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.ThreadUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import java.util.UUID
|
||||
|
|
|
@ -15,7 +15,6 @@ import android.content.pm.PackageManager
|
|||
import android.os.Build
|
||||
import android.os.SystemClock
|
||||
import androidx.core.content.ContextCompat
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes
|
||||
|
@ -28,8 +27,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operation
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.pump.core.utils.ByteUtil
|
||||
import info.nightscout.pump.core.utils.ThreadUtil
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
|
|
|
@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.Radi
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkCommandType;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion;
|
||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData;
|
||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||
import info.nightscout.pump.core.utils.ByteUtil;
|
||||
|
||||
public class SendAndListen extends RileyLinkCommand {
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue