diff --git a/app/build.gradle b/app/build.gradle index 45ae641bf4..3c04647ee4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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') diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index 337bb98cbf..ade2787122 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -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') } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index ecf2d789d5..57d90464c3 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt index 537bd763da..0838bcda9d 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index 24d5a97115..acfe57893f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -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) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt index 25da4499e1..55912956ee 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt @@ -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(var aapsLogger: AAPSLogger, var medtronicUtil: MedtronicUtil, - var bitUtils: ByteUtil) : MedtronicHistoryDecoderInterface { + var bitUtils: ByteUtil +) : MedtronicHistoryDecoderInterface { // STATISTICS (remove at later time or not) protected var statisticsEnabled = true @@ -112,7 +113,7 @@ abstract class MedtronicHistoryDecoder(var aapsLogge } fun getFormattedFloat(value: Float, decimals: Int): String { - return StringUtil.getFormatedValueUS(value, decimals) + return StringUtil.getFormattedValueUS(value, decimals) } } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt index 7a70667d51..d36cc0f031 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt index 330ce83f70..7e0d44aca2 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt index 82beed1655..43dbbaabd0 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt index 146c4ed6d5..00f3b89b89 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt index e8babfcbe1..2e7166e986 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt @@ -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) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt index 2c7481fd73..777745b9d9 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt index 574bbacc9f..f68b2cef57 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt @@ -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 /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt index 45bfdcf5de..a3f8c72aef 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt @@ -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. diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt index 9445ecda75..8f72780450 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt @@ -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)) } } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt index 348d6acbf0..95dd6aadc0 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt @@ -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()) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 48909583e5..6dae0651c7 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt index dc22e76484..ccfb09aadb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt index 2b738c34f0..2d051326b6 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt index a295c76aff..68a5e14b89 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt @@ -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)) } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt index 1f5cf7db0a..b62a5771fb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt @@ -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) } } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt index 902e4f410e..5c96e90983 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt index 0eebc3bd81..be41dacc47 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt @@ -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") diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 02de0e041f..8f0e046829 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt index 3e8b7024ba..121585fbff 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt @@ -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 diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt index 140de43b9f..fd6fea5981 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt @@ -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 diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt index eb308c26f6..914b874bd9 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -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 diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt index 9a3975647a..1e624a3cbc 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt @@ -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 diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt index dea31405f6..b71a165e9d 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt @@ -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 diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index 7b36bb3f18..46fba25214 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -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') diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java index d8437851b3..e8993c6611 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java index 4d4d6d7d77..2dd6d61ac3 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java @@ -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. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java index 9661957f6d..927401de21 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java index dd6f1f965a..9dc2b574ba 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java index fd94fad4fc..d77d9d4801 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java index 18fcd7b740..394b943d5e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java index 82066bf4b7..4991083fbd 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java index 82daa20180..27284a11a4 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java @@ -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 configurations; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java index c811970321..1c6427fd49 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java index dc8fcec55a..0cf2c6bde3 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java index 68195c839e..44b8f46609 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java index 689e7be301..43a82f4a2f 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java index 0a25712e56..c493100607 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java index ebdab8f912..823646ec34 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java index a844b52862..e922ef45b4 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java index 374f69d0cb..08ca3e393e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java index 8ac03aa1a9..f2dac2d9a7 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java index aa2353df6f..2650b4bdf7 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java index 3a9dea9178..2fb56f6044 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java index b104fbc69d..84e632e0d9 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java index 8ca80ffe22..a5036c7d4c 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java index 20c2155477..1480d43f9a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java index c9518b0608..5451a18fd0 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java index 2e4c4f9957..dd54d1b090 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java index 56ee29c546..5103f8858e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java index 5fbb5a20b1..4b9ef1588d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java index a4c98cae00..e5bbf29634 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java index 150e32470d..24798e229b 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java index 5fbf4b43b1..ca699991a2 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java @@ -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 { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java index f656c706bc..bb3cb6ea8d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java @@ -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; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index f9e9c28bd0..27f947f3ac 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -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 diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java index 676a9626bc..3e53b9da90 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java @@ -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; /** diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java index 8f7f9d3183..ccc51ca0fb 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java @@ -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; diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java index 947df39bde..60733e458f 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java index a777c5d082..995301fe6c 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java index f37f6f09c7..7faacf7797 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java index c97a199340..1d00d152df 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java @@ -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 { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java index 8937911a03..7ad4116172 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java index 2a92300f1a..b1074bc967 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java index 03a0e3175e..c24f6822b2 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java index 07f91df881..439c7c2384 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java index 69da4a64fc..6cc543ec9b 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java index c61e7fded3..94eed25065 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java @@ -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() { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java index bbbc4d0a12..ac78f56da4 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java index 0114d14fd6..d0bcb5b833 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java @@ -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() { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java index 21468200e1..617824448f 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java index b3b0dec638..91656418d6 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java index fc451eda07..17f9f8c3aa 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java index 3cd87634f7..fe8a8a7c77 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java index d499a4b4b0..b782385dea 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java @@ -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 diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java index df85b00d83..c420084fdb 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java @@ -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() { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt index 6f6124005d..02cdfe1d32 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt @@ -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 diff --git a/pump/pump-common/src/main/res/values/strings.xml b/pump/pump-common/src/main/res/values/strings.xml index d51c9755f6..e705e33005 100644 --- a/pump/pump-common/src/main/res/values/strings.xml +++ b/pump/pump-common/src/main/res/values/strings.xml @@ -11,14 +11,6 @@ - Never contacted - Waking up - Error with communication - Timeout on communication - Pump unreachable - Invalid configuration - Active - Sleeping Not initialized Initialized Encrypting communication diff --git a/pump/pump-core/.gitignore b/pump/pump-core/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/pump/pump-core/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/pump/pump-core/build.gradle b/pump/pump-core/build.gradle new file mode 100644 index 0000000000..eb744c9963 --- /dev/null +++ b/pump/pump-core/build.gradle @@ -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" +} diff --git a/pump/pump-core/consumer-rules.pro b/pump/pump-core/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pump/pump-core/proguard-rules.pro b/pump/pump-core/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/pump/pump-core/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/pump/pump-core/src/main/AndroidManifest.xml b/pump/pump-core/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..44008a4332 --- /dev/null +++ b/pump/pump-core/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt b/pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt similarity index 83% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt rename to pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt index 803d1a8902..9ebe3463e3 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt @@ -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) { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java similarity index 99% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java index ac4f6d24af..fef889df2e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java @@ -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; diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java similarity index 79% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java index a2050a7273..73e12d8d17 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java @@ -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 ra = new ArrayList(); + ArrayList 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"); } diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java similarity index 86% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java index d1781da72a..66484701a9 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java @@ -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. diff --git a/pump/pump-core/src/main/res/values/strings.xml b/pump/pump-core/src/main/res/values/strings.xml new file mode 100644 index 0000000000..d1ffb7471e --- /dev/null +++ b/pump/pump-core/src/main/res/values/strings.xml @@ -0,0 +1,14 @@ + + + + + Never contacted + Sleeping + Waking up + Active + Error with communication + Timeout on communication + Pump unreachable + Invalid configuration + + diff --git a/pump/rileylink/build.gradle b/pump/rileylink/build.gradle index eb5621dc5a..5d7e629096 100644 --- a/pump/rileylink/build.gradle +++ b/pump/rileylink/build.gradle @@ -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') } diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt index 1e6cf11a25..efabc75863 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt @@ -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 { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 6bcc3dd689..341348d971 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -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; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index 1350d03aab..388378d254 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -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; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt index c064653472..b56774e985 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt @@ -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 diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt index 5e1103458f..d56184dc6a 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt @@ -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 diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java index d0e4e6de74..159b792c0e 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java @@ -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 { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java index ab7b5d6400..6486dd85ba 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java @@ -6,8 +6,8 @@ import javax.inject.Inject; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.CRC; +import info.nightscout.pump.core.utils.ByteUtil; /** * Created by geoff on 5/22/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java index c04163dcec..1fbbc319cb 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java @@ -12,8 +12,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile 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.androidaps.plugins.pump.common.utils.CRC; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java index ddde11e6b5..199120c9a3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java index 0b89d85a34..2def87cc09 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java @@ -6,7 +6,7 @@ import java.util.Locale; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt index fd4aa416cb..25d9f91c78 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes 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.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java index 74defd7a00..d916723cdf 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java @@ -2,10 +2,10 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data; import org.joda.time.LocalDateTime; -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; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt index e82d3cec56..beebdeed8f 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt @@ -6,16 +6,16 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.interfaces.ActivePlugin -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.databinding.RileylinkStatusGeneralBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil -import info.nightscout.shared.utils.DateUtil +import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.joda.time.LocalDateTime import javax.inject.Inject @@ -85,7 +85,7 @@ class RileyLinkStatusGeneralFragment : DaggerFragment() { } val lastConnectionTimeMillis = rileyLinkPumpDevice.lastConnectionTimeMillis if (lastConnectionTimeMillis == 0L) binding.lastDeviceContact.text = rh.gs(R.string.riley_link_ble_config_connected_never) - else binding.lastDeviceContact.text = StringUtil.toDateTimeString(dateUtil, LocalDateTime(lastConnectionTimeMillis)) + else binding.lastDeviceContact.text = StringUtil.toDateTimeString(LocalDateTime(lastConnectionTimeMillis)) } companion object { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt index 6925a1783c..8e66321068 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt @@ -7,14 +7,14 @@ import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryItemBinding -import info.nightscout.shared.utils.DateUtil +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class RileyLinkStatusHistoryFragment : DaggerFragment() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt index 88293787e1..758b1686a3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt @@ -7,8 +7,6 @@ import android.content.Intent import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper -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.RileyLinkUtil @@ -17,9 +15,11 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType 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.pump.core.defs.PumpDeviceState 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 java.util.Locale import javax.inject.Inject diff --git a/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java b/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java index 42ed577d43..5f7393d6bd 100644 --- a/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java +++ b/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java @@ -11,7 +11,7 @@ import java.util.Arrays; import java.util.Collection; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding.Encoding4b6bGeoff; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; /** * Created by andy on 11/21/18. diff --git a/settings.gradle b/settings.gradle index df262404ac..3ab7a61408 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,6 +24,7 @@ include ':pump:omnipod-common' include ':pump:omnipod-eros' include ':pump:omnipod-dash' include ':pump:pump-common' +include ':pump:pump-core' include ':pump:rileylink' include ':openhumans' include ':automation'