Merge pull request #141 from AAPS-Omnipod/omnipod_eros_dev_upstream_merge
Bugfixes and improvements in RileyLink selection, code cleanup in RileyLinkStatusFragmentGeneral
This commit is contained in:
commit
d035e13203
|
@ -180,7 +180,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean verifyConfiguration() {
|
public boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal) {
|
||||||
try {
|
try {
|
||||||
String regexSN = "[0-9]{6}";
|
String regexSN = "[0-9]{6}";
|
||||||
String regexMac = "([\\da-fA-F]{1,2}(?:\\:|$)){6}";
|
String regexMac = "([\\da-fA-F]{1,2}(?:\\:|$)){6}";
|
||||||
|
@ -316,7 +316,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
|
||||||
//boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on));
|
//boolean bolusDebug = bolusDebugEnabled != null && bolusDebugEnabled.equals(resourceHelper.gs(R.string.common_on));
|
||||||
//MedtronicHistoryData.doubleBolusDebug = bolusDebug;
|
//MedtronicHistoryData.doubleBolusDebug = bolusDebug;
|
||||||
|
|
||||||
reconfigureService();
|
reconfigureService(forceRileyLinkAddressRenewal);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean reconfigureService() {
|
private boolean reconfigureService(boolean forceRileyLinkAddressRenewal) {
|
||||||
|
|
||||||
if (!inPreInit) {
|
if (!inPreInit) {
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ public class RileyLinkMedtronicService extends RileyLinkService {
|
||||||
serialChanged = false;
|
serialChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rileyLinkAddressChanged) {
|
if (rileyLinkAddressChanged || forceRileyLinkAddressRenewal) {
|
||||||
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
|
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
|
||||||
rileyLinkAddressChanged = false;
|
rileyLinkAddressChanged = false;
|
||||||
}
|
}
|
||||||
|
@ -380,6 +380,6 @@ public class RileyLinkMedtronicService extends RileyLinkService {
|
||||||
public boolean setNotInPreInit() {
|
public boolean setNotInPreInit() {
|
||||||
this.inPreInit = false;
|
this.inPreInit = false;
|
||||||
|
|
||||||
return reconfigureService();
|
return reconfigureService(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean verifyConfiguration() {
|
public boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal) {
|
||||||
try {
|
try {
|
||||||
errorDescription = null;
|
errorDescription = null;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
|
||||||
|
|
||||||
rileyLinkServiceData.rileyLinkTargetFrequency = RileyLinkTargetFrequency.Omnipod;
|
rileyLinkServiceData.rileyLinkTargetFrequency = RileyLinkTargetFrequency.Omnipod;
|
||||||
|
|
||||||
reconfigureService();
|
reconfigureService(forceRileyLinkAddressRenewal);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -144,9 +144,9 @@ public class RileyLinkOmnipodService extends RileyLinkService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean reconfigureService() {
|
private boolean reconfigureService(boolean forceRileyLinkAddressRenewal) {
|
||||||
if (!inPreInit) {
|
if (!inPreInit) {
|
||||||
if (rileyLinkAddressChanged) {
|
if (rileyLinkAddressChanged || forceRileyLinkAddressRenewal) {
|
||||||
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
|
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
|
||||||
rileyLinkAddressChanged = false;
|
rileyLinkAddressChanged = false;
|
||||||
}
|
}
|
||||||
|
@ -158,6 +158,6 @@ public class RileyLinkOmnipodService extends RileyLinkService {
|
||||||
public boolean setNotInPreInit() {
|
public boolean setNotInPreInit() {
|
||||||
this.inPreInit = false;
|
this.inPreInit = false;
|
||||||
|
|
||||||
return reconfigureService();
|
return reconfigureService(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,8 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
private String actionTitleStart, actionTitleStop;
|
private String actionTitleStart, actionTitleStop;
|
||||||
private MenuItem menuItem;
|
private MenuItem menuItem;
|
||||||
|
|
||||||
|
private boolean rlDisconnected;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -106,7 +108,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress);
|
sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress);
|
||||||
|
|
||||||
RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePlugin.getActivePump();
|
RileyLinkPumpDevice rileyLinkPump = (RileyLinkPumpDevice) activePlugin.getActivePump();
|
||||||
rileyLinkPump.getRileyLinkService().verifyConfiguration(); // 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();
|
rileyLinkPump.triggerPumpConfigurationChangedEvent();
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
@ -115,10 +117,12 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
toolbarBTScan = findViewById(R.id.rileylink_toolbarBTScan);
|
toolbarBTScan = findViewById(R.id.rileylink_toolbarBTScan);
|
||||||
toolbarBTScan.setTitle(R.string.rileylink_scanner_title);
|
toolbarBTScan.setTitle(R.string.rileylink_scanner_title);
|
||||||
setSupportActionBar(toolbarBTScan);
|
setSupportActionBar(toolbarBTScan);
|
||||||
|
|
||||||
prepareForScanning();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
prepareForScanning();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
@ -138,6 +142,10 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getTitle().equals(actionTitleStart)) {
|
if (item.getTitle().equals(actionTitleStart)) {
|
||||||
|
// disable currently selected RL, so that we can discover it
|
||||||
|
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnect, this);
|
||||||
|
rlDisconnected = true;
|
||||||
|
|
||||||
scanLeDevice(true);
|
scanLeDevice(true);
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getTitle().equals(actionTitleStop)) {
|
} else if (item.getTitle().equals(actionTitleStop)) {
|
||||||
|
@ -148,8 +156,21 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
if (rlDisconnected) {
|
||||||
|
// Reconnect RL if it was disconnected for the scan
|
||||||
|
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkNewAddressSet, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void prepareForScanning() {
|
@Override protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
mScanning = false;
|
||||||
|
mLEScanner.stopScan(mScanCallback2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void prepareForScanning() {
|
||||||
boolean checkOK = blePrecheck.prerequisitesCheck(this);
|
boolean checkOK = blePrecheck.prerequisitesCheck(this);
|
||||||
|
|
||||||
if (checkOK) {
|
if (checkOK) {
|
||||||
|
@ -158,9 +179,6 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
|
||||||
filters = Collections.singletonList(new ScanFilter.Builder().setServiceUuid(
|
filters = Collections.singletonList(new ScanFilter.Builder().setServiceUuid(
|
||||||
ParcelUuid.fromString(GattAttributes.SERVICE_RADIO)).build());
|
ParcelUuid.fromString(GattAttributes.SERVICE_RADIO)).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable currently selected RL, so that we can discover it
|
|
||||||
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnect, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -112,18 +112,6 @@ public class RFSpy {
|
||||||
reader.newDataIsAvailable();
|
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() {
|
public Integer getBatteryLevel() {
|
||||||
BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(batteryServiceUUID, batteryLevelUUID);
|
BLECommOperationResult result = rileyLinkBle.readCharacteristic_blocking(batteryServiceUUID, batteryLevelUUID);
|
||||||
if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) {
|
if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) {
|
||||||
|
|
|
@ -151,8 +151,8 @@ public class RileyLinkBLE {
|
||||||
|
|
||||||
} else if ((newState == BluetoothProfile.STATE_CONNECTING) || //
|
} else if ((newState == BluetoothProfile.STATE_CONNECTING) || //
|
||||||
(newState == BluetoothProfile.STATE_DISCONNECTING)) {
|
(newState == BluetoothProfile.STATE_DISCONNECTING)) {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM,"We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" :
|
aapsLogger.debug(LTag.PUMPBTCOMM, "We are in {} state.", status == BluetoothProfile.STATE_CONNECTING ? "Connecting" :
|
||||||
"Disconnecting");
|
"Disconnecting");
|
||||||
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
|
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
|
||||||
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context);
|
rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnected, context);
|
||||||
if (manualDisconnect)
|
if (manualDisconnect)
|
||||||
|
@ -392,6 +392,9 @@ public class RileyLinkBLE {
|
||||||
if (gattDebugEnabled) {
|
if (gattDebugEnabled) {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "Gatt Connected.");
|
aapsLogger.debug(LTag.PUMPBTCOMM, "Gatt Connected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rileyLinkServiceData.rileylinkAddress = bluetoothConnectionGatt.getDevice().getAddress();
|
||||||
|
rileyLinkServiceData.rileyLinkName = bluetoothConnectionGatt.getDevice().getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity;
|
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.R;
|
import info.nightscout.androidaps.plugins.pump.common.R;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface;
|
import info.nightscout.androidaps.plugins.pump.common.dialog.RefreshableInterface;
|
||||||
|
@ -66,50 +65,14 @@ public class RileyLinkStatusActivity extends NoSplashAppCompatActivity {
|
||||||
RefreshableInterface selectableInterface = (RefreshableInterface) mSectionsPagerAdapter
|
RefreshableInterface selectableInterface = (RefreshableInterface) mSectionsPagerAdapter
|
||||||
.getItem(tabLayout.getSelectedTabPosition());
|
.getItem(tabLayout.getSelectedTabPosition());
|
||||||
selectableInterface.refreshData();
|
selectableInterface.refreshData();
|
||||||
|
|
||||||
// refreshData(tabLayout.getSelectedTabPosition());
|
|
||||||
|
|
||||||
// Toast.makeText(getApplicationContext(), "Test pos: " + tabLayout.getSelectedTabPosition(),
|
|
||||||
// Toast.LENGTH_LONG);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.connectionStatus = findViewById(R.id.rls_t1_connection_status);
|
this.connectionStatus = findViewById(R.id.rls_t1_connection_status);
|
||||||
this.configuredAddress = findViewById(R.id.rls_t1_configured_address);
|
this.configuredAddress = findViewById(R.id.rls_t1_configured_address);
|
||||||
this.connectedDevice = findViewById(R.id.rls_t1_connected_device);
|
this.connectedDevice = findViewById(R.id.rls_t1_connected_device);
|
||||||
this.connectionError = findViewById(R.id.rls_t1_connection_error);
|
this.connectionError = findViewById(R.id.rls_t1_connection_error);
|
||||||
|
|
||||||
// // 7-12
|
|
||||||
// int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, //
|
|
||||||
// R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12};
|
|
||||||
//
|
|
||||||
// for (int id : ids) {
|
|
||||||
//
|
|
||||||
// TextView tv = (TextView) findViewById(id);
|
|
||||||
// tv.setText(tv.getText() + ":");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// refreshData(0);
|
|
||||||
// refreshData(1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void refreshData(int position) {
|
|
||||||
if (position == 0) {
|
|
||||||
// FIXME i18n
|
|
||||||
this.connectionStatus.setText(rileyLinkServiceData.rileyLinkServiceState.name());
|
|
||||||
this.configuredAddress.setText(rileyLinkServiceData.rileylinkAddress);
|
|
||||||
// FIXME
|
|
||||||
this.connectedDevice.setText("???");
|
|
||||||
// FIXME i18n
|
|
||||||
this.connectionError.setText(rileyLinkServiceData.rileyLinkError.name());
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setupViewPager(ViewPager pager) {
|
public void setupViewPager(ViewPager pager) {
|
||||||
|
|
||||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||||
|
|
|
@ -40,29 +40,24 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
|
||||||
@Inject RileyLinkServiceData rileyLinkServiceData;
|
@Inject RileyLinkServiceData rileyLinkServiceData;
|
||||||
@Inject DateUtil dateUtil;
|
@Inject DateUtil dateUtil;
|
||||||
|
|
||||||
TextView connectionStatus;
|
private TextView connectionStatus;
|
||||||
TextView configuredAddress;
|
private TextView configuredAddress;
|
||||||
TextView connectedRileyLinkName;
|
private TextView connectedRileyLinkName;
|
||||||
TextView connectedDevice;
|
private TextView connectedDevice;
|
||||||
TextView connectionError;
|
private TextView connectionError;
|
||||||
TextView deviceType;
|
private TextView deviceType;
|
||||||
TextView deviceModel;
|
private TextView deviceModel;
|
||||||
TextView serialNumber;
|
private TextView serialNumber;
|
||||||
TextView pumpFrequency;
|
private TextView pumpFrequency;
|
||||||
TextView lastUsedFrequency;
|
private TextView lastUsedFrequency;
|
||||||
TextView lastDeviceContact;
|
private TextView lastDeviceContact;
|
||||||
TextView firmwareVersion;
|
private TextView firmwareVersion;
|
||||||
|
|
||||||
boolean first = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View rootView = inflater.inflate(R.layout.rileylink_status_general, container, false);
|
return inflater.inflate(R.layout.rileylink_status_general, container, false);
|
||||||
|
|
||||||
return rootView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
@ -80,28 +75,10 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
|
||||||
this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact);
|
this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact);
|
||||||
this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version);
|
this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version);
|
||||||
|
|
||||||
// BS: FIXME Remove
|
|
||||||
if (!first) {
|
|
||||||
|
|
||||||
// 7-14
|
|
||||||
int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv14, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, //
|
|
||||||
R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12, R.id.rls_t1_tv13};
|
|
||||||
|
|
||||||
for (int id : ids) {
|
|
||||||
|
|
||||||
TextView tv = getActivity().findViewById(id);
|
|
||||||
tv.setText(tv.getText() + ":");
|
|
||||||
}
|
|
||||||
|
|
||||||
first = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshData();
|
refreshData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void refreshData() {
|
public void refreshData() {
|
||||||
|
|
||||||
RileyLinkTargetDevice targetDevice = rileyLinkServiceData.targetDevice;
|
RileyLinkTargetDevice targetDevice = rileyLinkServiceData.targetDevice;
|
||||||
|
|
||||||
this.connectionStatus.setText(resourceHelper.gs(rileyLinkServiceData.rileyLinkServiceState.getResourceId()));
|
this.connectionStatus.setText(resourceHelper.gs(rileyLinkServiceData.rileyLinkServiceState.getResourceId()));
|
||||||
|
|
|
@ -139,7 +139,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
|
||||||
} else {
|
} else {
|
||||||
rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.BluetoothDisabled);
|
rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.BluetoothDisabled);
|
||||||
}
|
}
|
||||||
rileyLinkServiceData.rileyLinkName = null;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (action.equals(RileyLinkConst.Intents.RileyLinkReady)) {
|
} else if (action.equals(RileyLinkConst.Intents.RileyLinkReady)) {
|
||||||
|
@ -153,9 +152,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
|
||||||
String bleVersion = rileyLinkService.rfspy.getBLEVersionCached();
|
String bleVersion = rileyLinkService.rfspy.getBLEVersionCached();
|
||||||
RileyLinkFirmwareVersion rlVersion = rileyLinkServiceData.firmwareVersion;
|
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);
|
aapsLogger.debug(LTag.PUMPBTCOMM, "RfSpy version (BLE113): " + bleVersion);
|
||||||
rileyLinkService.rileyLinkServiceData.versionBLE113 = bleVersion;
|
rileyLinkService.rileyLinkServiceData.versionBLE113 = bleVersion;
|
||||||
|
|
||||||
|
@ -170,7 +166,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
|
||||||
return true;
|
return true;
|
||||||
} else if (action.equals(RileyLinkConst.Intents.RileyLinkNewAddressSet)) {
|
} else if (action.equals(RileyLinkConst.Intents.RileyLinkNewAddressSet)) {
|
||||||
String RileylinkBLEAddress = sp.getString(RileyLinkConst.Prefs.RileyLinkAddress, "");
|
String RileylinkBLEAddress = sp.getString(RileyLinkConst.Prefs.RileyLinkAddress, "");
|
||||||
rileyLinkServiceData.rileyLinkName = null;
|
|
||||||
if (RileylinkBLEAddress.equals("")) {
|
if (RileylinkBLEAddress.equals("")) {
|
||||||
aapsLogger.error("No Rileylink BLE Address saved in app");
|
aapsLogger.error("No Rileylink BLE Address saved in app");
|
||||||
} else {
|
} else {
|
||||||
|
@ -183,8 +178,6 @@ public class RileyLinkBroadcastReceiver extends DaggerBroadcastReceiver {
|
||||||
return true;
|
return true;
|
||||||
} else if (action.equals(RileyLinkConst.Intents.RileyLinkDisconnect)) {
|
} else if (action.equals(RileyLinkConst.Intents.RileyLinkDisconnect)) {
|
||||||
rileyLinkService.disconnectRileyLink();
|
rileyLinkService.disconnectRileyLink();
|
||||||
rileyLinkServiceData.rileyLinkName = null;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -230,6 +230,7 @@ public abstract class RileyLinkService extends DaggerService {
|
||||||
if (rileyLinkBLE.isConnected()) {
|
if (rileyLinkBLE.isConnected()) {
|
||||||
rileyLinkBLE.disconnect();
|
rileyLinkBLE.disconnect();
|
||||||
rileyLinkServiceData.rileylinkAddress = null;
|
rileyLinkServiceData.rileylinkAddress = null;
|
||||||
|
rileyLinkServiceData.rileyLinkName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady);
|
rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady);
|
||||||
|
@ -260,5 +261,9 @@ public abstract class RileyLinkService extends DaggerService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract boolean verifyConfiguration();
|
public boolean verifyConfiguration() {
|
||||||
|
return verifyConfiguration(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract boolean verifyConfiguration(boolean forceRileyLinkAddressRenewal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv02"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -65,7 +64,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv14"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -93,7 +91,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv03"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -122,7 +119,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv04"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -151,7 +147,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv05"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -179,7 +174,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv13"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -222,7 +216,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv07"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -251,7 +244,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv08"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -280,13 +272,12 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv09"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_weight="35"
|
android:layout_weight="35"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/medtronic_serial_number" />
|
android:text="@string/rileylink_pump_serial_number" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_serial_number"
|
android:id="@+id/rls_t1_serial_number"
|
||||||
|
@ -309,13 +300,12 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv10"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_weight="35"
|
android:layout_weight="35"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/medtronic_pump_frequency" />
|
android:text="@string/rileylink_pump_frequency" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_pump_frequency"
|
android:id="@+id/rls_t1_pump_frequency"
|
||||||
|
@ -337,7 +327,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv11"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
@ -366,7 +355,6 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rls_t1_tv12"
|
|
||||||
android:layout_width="58dp"
|
android:layout_width="58dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
|
|
|
@ -20,16 +20,19 @@
|
||||||
<string name="medtronic_pump_status">Pump Status</string>
|
<string name="medtronic_pump_status">Pump Status</string>
|
||||||
<string name="title_activity_rileylink_settings">RileyLink Settings</string>
|
<string name="title_activity_rileylink_settings">RileyLink Settings</string>
|
||||||
<string name="rileylink_title">RileyLink</string>
|
<string name="rileylink_title">RileyLink</string>
|
||||||
<string name="rileylink_configured_address">Configured Address</string>
|
<string name="rileylink_configured_address">Configured Address:</string>
|
||||||
<string name="rileylink_connected_device">Connected Device</string>
|
<string name="rileylink_connected_device">Connected Device:</string>
|
||||||
<string name="rileylink_connection_status">Connection Status</string>
|
<string name="rileylink_connection_status">Connection Status:</string>
|
||||||
<string name="rileylink_connection_error">Connection Error</string>
|
<string name="rileylink_connection_error">Connection Error:</string>
|
||||||
<string name="rileylink_device">Device</string>
|
<string name="rileylink_device">Device</string>
|
||||||
<string name="rileylink_device_type">Device Type</string>
|
<string name="rileylink_device_type">Device Type:</string>
|
||||||
<string name="rileylink_device_model">Device Model</string>
|
<string name="rileylink_device_model">Device Model:</string>
|
||||||
<string name="rileylink_last_used_frequency">Last used frequency</string>
|
<string name="rileylink_last_used_frequency">Last Used Frequency:</string>
|
||||||
<string name="rileylink_last_device_contact">Last device contact</string>
|
<string name="rileylink_last_device_contact">Last Device Contact:</string>
|
||||||
<string name="rileylink_firmware_version">Firmware</string>
|
<string name="rileylink_firmware_version">Firmware Version:</string>
|
||||||
|
<string name="rileylink_connected_riley_link_name">Connected RileyLink Name:</string>
|
||||||
|
<string name="rileylink_pump_serial_number">Pump Serial Number:</string>
|
||||||
|
<string name="rileylink_pump_frequency">Pump Frequency:</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- RL State -->
|
<!-- RL State -->
|
||||||
|
@ -64,7 +67,6 @@
|
||||||
<string name="key_medtronic_encoding" translatable="false">pref_medtronic_encoding</string>
|
<string name="key_medtronic_encoding" translatable="false">pref_medtronic_encoding</string>
|
||||||
|
|
||||||
<string name="mdt_last_bolus" translatable="false">%1$.1f %2$s (%3$s)</string>
|
<string name="mdt_last_bolus" translatable="false">%1$.1f %2$s (%3$s)</string>
|
||||||
<string name="rileylink_connected_riley_link_name">Connected RileyLink name</string>
|
|
||||||
|
|
||||||
<plurals name="duration_days">
|
<plurals name="duration_days">
|
||||||
<item quantity="one">%1$d day</item>
|
<item quantity="one">%1$d day</item>
|
||||||
|
|
Loading…
Reference in a new issue