diff --git a/app/build.gradle b/app/build.gradle index e3666c9961..fe1e65a617 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -139,8 +139,8 @@ android { // OMNIPOD: Keep track of what commit from the main repository we're on, these fields aren't actually used anywhere buildConfigField "String", "DEV_VERSION", '"2.6.5-dev"' - buildConfigField "String", "DEV_VERSION_COMMIT", '"b87155ead499167b3d42a73e3daf808494f10a2d"' - buildConfigField "String", "DEV_VERSION_COMMIT_DATE", '"24.4.2020"' // 24th April + buildConfigField "String", "DEV_VERSION_COMMIT", '"cf291b3adc2a8df06fd99220b59b500298c8e56f"' + buildConfigField "String", "DEV_VERSION_COMMIT_DATE", '"6.5.2020"' // 6th May ndk { moduleName "BleCommandUtil" diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java index bf71a19fe5..a68796dfea 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.java @@ -152,8 +152,8 @@ public class RileyLinkBLE { } else if ((newState == BluetoothProfile.STATE_CONNECTING) || // (newState == BluetoothProfile.STATE_DISCONNECTING)) { - // aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" : - // "Disconnecting"); + aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" : + "Disconnecting"); } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context); if (manualDisconnect) @@ -243,8 +243,6 @@ public class RileyLinkBLE { if (rileyLinkFound) { mIsConnected = true; rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkReady, context); - // RileyLinkUtil.sendNotification(new - // ServiceNotification(RileyLinkConst.Intents.RileyLinkReady), null); } else { mIsConnected = false; rileyLinkServiceData.setServiceState(RileyLinkServiceState.RileyLinkError, @@ -273,7 +271,6 @@ public class RileyLinkBLE { if (isAnyRileyLinkServiceFound(serviceI)) { return true; } - } } @@ -433,6 +430,7 @@ public class RileyLinkBLE { // Catch if the service is not supported by the BLE device rval.resultCode = BLECommOperationResult.RESULT_NONE; aapsLogger.error(LTag.PUMPBTCOMM, "BT Device not supported"); + rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.NoBluetoothAdapter); // TODO: 11/07/2016 UI update for user } else { BluetoothGattCharacteristic chara = bluetoothConnectionGatt.getService(serviceUUID) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java index 09273eb719..7ef3380a0d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.java @@ -114,21 +114,6 @@ public abstract class RileyLinkService extends DaggerService { } - /** - * Prefix for Device specific broadcast identifier prefix (for example MSG_PUMP_ for pump or - * MSG_POD_ for Omnipod) - * - * @return - */ - public abstract String getDeviceSpecificBroadcastsIdentifierPrefix(); - - - public abstract boolean handleDeviceSpecificBroadcasts(Intent intent); - - - public abstract void registerDeviceSpecificBroadcasts(IntentFilter intentFilter); - - public abstract RileyLinkCommunicationManager getDeviceCommunicationManager(); // Here is where the wake-lock begins: diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java index 7b5314ce33..cac30e6de1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.java @@ -34,7 +34,7 @@ public class RileyLinkServiceData { public RileyLinkError rileyLinkError; public RileyLinkServiceState rileyLinkServiceState = RileyLinkServiceState.NotStarted; public RileyLinkFirmwareVersion firmwareVersion; - public RileyLinkTargetFrequency rileyLinkTargetFrequency; + public RileyLinkTargetFrequency rileyLinkTargetFrequency; // TODO this might not be correct place public String rileylinkAddress; long lastTuneUpTime = 0L; @@ -45,7 +45,7 @@ public class RileyLinkServiceData { // radio version public RileyLinkFirmwareVersion versionCC110; - public RileyLinkTargetDevice targetDevice; + public RileyLinkTargetDevice targetDevice; // TODO this might not be correct place // Medtronic Pump public String pumpID; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java index ab9c085b71..d283b658da 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java @@ -115,12 +115,13 @@ public class RileyLinkOmnipodService extends RileyLinkService { PodSessionState podState = null; if (sp.contains(OmnipodConst.Prefs.PodState) && omnipodUtil.getPodSessionState() == null) { try { - Gson gson = omnipodUtil.getGsonInstance(); - String storedPodState = sp.getString(OmnipodConst.Prefs.PodState, ""); - aapsLogger.info(LTag.PUMPCOMM, "PodSessionState-SP: loaded from SharedPreferences: " + storedPodState); - podState = gson.fromJson(storedPodState, PodSessionState.class); - podState.injectDaggerClass(injector); - omnipodUtil.setPodSessionState(podState); + omnipodUtil.loadSessionState(); +// Gson gson = omnipodUtil.getGsonInstance(); +// String storedPodState = sp.getString(OmnipodConst.Prefs.PodState, ""); +// aapsLogger.info(LTag.PUMPCOMM, "PodSessionState-SP: loaded from SharedPreferences: " + storedPodState); +// podState = gson.fromJson(storedPodState, PodSessionState.class); +// podState.injectDaggerClass(injector); +// omnipodUtil.setPodSessionState(podState); } catch (Exception ex) { aapsLogger.error(LTag.PUMPCOMM, "Could not deserialize Pod state", ex); } @@ -178,22 +179,6 @@ public class RileyLinkOmnipodService extends RileyLinkService { } - @Override - public String getDeviceSpecificBroadcastsIdentifierPrefix() { - return null; - } - - - public boolean handleDeviceSpecificBroadcasts(Intent intent) { - return false; - } - - - @Override - public void registerDeviceSpecificBroadcasts(IntentFilter intentFilter) { - } - - public boolean verifyConfiguration() { try { omnipodPumpStatus.errorDescription = "-";