From 33297ae4cf7c7a0bdac5bdfa7abbfd7788db4d75 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Fri, 25 Dec 2020 02:17:43 +0100 Subject: [PATCH] Remove redundant code and improve comment --- .../pump/common/dialog/RileyLinkBLEScanActivity.java | 2 +- .../plugins/pump/common/hw/rileylink/ble/RFSpy.java | 12 ------------ .../service/RileyLinkBroadcastReceiver.java | 3 --- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java index 00fdefea36..364e0e19c3 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java @@ -108,7 +108,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress); RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePlugin.getActivePump(); - rileyLinkPump.getRileyLinkService().verifyConfiguration(true); // force reloading of address + rileyLinkPump.getRileyLinkService().verifyConfiguration(true); // force reloading of address to assure that the RL gets reconnected (even if the address didn't change) rileyLinkPump.triggerPumpConfigurationChangedEvent(); finish(); diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index 4df1a22389..bf06acad02 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -112,18 +112,6 @@ public class RFSpy { reader.newDataIsAvailable(); } - public String getBleDeviceName() { - BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(UUID.fromString(GattAttributes.SERVICE_GAP), UUID.fromString(GattAttributes.CHARA_GAP_NAME)); - if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) { - String value = new String(result.value); - aapsLogger.debug(LTag.PUMPBTCOMM, "BLE device name: {}", value); - return value; - } else { - aapsLogger.error(LTag.PUMPBTCOMM, "getBleDeviceName failed with code: " + result.resultCode); - return null; - } - } - public Integer getBatteryLevel() { BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(batteryServiceUUID, batteryLevelUUID); if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) { diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java index 3a80dff4fd..dbe2731e89 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.java @@ -152,9 +152,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver { String bleVersion = rileyLinkService.rfspy.getBLEVersionCached(); RileyLinkFirmwareVersion rlVersion = rileyLinkServiceData.firmwareVersion; - rileyLinkServiceData.rileyLinkName = rileyLinkService.rfspy.getBleDeviceName(); - aapsLogger.debug(LTag.PUMPBTCOMM, "BLE device name: {}", rileyLinkServiceData.rileyLinkName); - aapsLogger.debug(LTag.PUMPBTCOMM, "RfSpy version (BLE113): " + bleVersion); rileyLinkService.rileyLinkServiceData.versionBLE113 = bleVersion;