diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/dialog/RileyLinkBLEScanActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/dialog/RileyLinkBLEScanActivity.java index a8c7069a89..a14152a43e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/dialog/RileyLinkBLEScanActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/dialog/RileyLinkBLEScanActivity.java @@ -1,8 +1,12 @@ package info.nightscout.androidaps.plugins.PumpCommon.dialog; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,12 +20,11 @@ import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; +import android.os.ParcelUuid; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; @@ -41,15 +44,21 @@ import android.widget.Toast; import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkConst; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.GattAttributes; import info.nightscout.androidaps.plugins.PumpCommon.utils.LocationHelper; import info.nightscout.utils.SP; public class RileyLinkBLEScanActivity extends AppCompatActivity { private static final Logger LOG = LoggerFactory.getLogger(RileyLinkBLEScanActivity.class); + private static final int PERMISSION_REQUEST_COARSE_LOCATION = 30241; // arbitrary. private static final int REQUEST_ENABLE_BT = 30242; // arbitrary - // Stops scanning after 10 seconds. + + private static String TAG = "RileyLinkBLEScanActivity"; + + // Stops scanning after 30 seconds. private static final long SCAN_PERIOD = 30000; public boolean mScanning; public Snackbar snackbar; @@ -62,52 +71,6 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { private BluetoothLeScanner mLEScanner; private LeDeviceListAdapter mLeDeviceListAdapter; private Handler mHandler; - private ScanCallback mScanCallback = new ScanCallback() { - - @Override - public void onScanResult(int callbackType, ScanResult result) { - final BluetoothDevice device = result.getDevice(); - runOnUiThread(new Runnable() { - - @Override - public void run() { - if (device.getName() != null && device.getName().length() > 0) { - mLeDeviceListAdapter.addDevice(device); - mLeDeviceListAdapter.notifyDataSetChanged(); - LOG.debug("Found BLE" + device.getName()); - } - } - }); - } - - - @Override - public void onBatchScanResults(final List results) { - runOnUiThread(new Runnable() { - - @Override - public void run() { - for (ScanResult result : results) { - BluetoothDevice device = result.getDevice(); - if (device.getName() != null && device.getName().length() > 0) { - mLeDeviceListAdapter.addDevice(device); - LOG.debug("Found BLE" + result.toString()); - } else { - LOG.error("Found BLE, but name appears to be missing. Ignoring. " + device.getAddress()); - } - } - mLeDeviceListAdapter.notifyDataSetChanged(); - } - }); - } - - - @Override - public void onScanFailed(int errorCode) { - Log.e("Scan Failed", "Error Code: " + errorCode); - Toast.makeText(mContext, "Scan Failed " + errorCode, Toast.LENGTH_LONG).show(); - } - }; @Override @@ -131,6 +94,14 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { SP.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress); + // Context applicationContext = MainApp.instance().getApplicationContext(); + // applicationContext.get + + // RileyLinkBLEScanActivity.this.findPreference("pref_key"); + + // EditTextPreference viewById = + // (EditTextPreference)super.findPreference(R.id.rileylink_mac_address_mdt); + // //Notify that we have a new rileylinkAddressKey // RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.INTENT_NEW_rileylinkAddressKey); // @@ -159,14 +130,13 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { } - @Override - protected void onPause() { - super.onPause(); - scanLeDevice(false); - mLeDeviceListAdapter.clear(); - mLeDeviceListAdapter.notifyDataSetChanged(); - } - + // @Override + // protected void onPause() { + // super.onPause(); + // scanLeDevice(false); + // mLeDeviceListAdapter.clear(); + // mLeDeviceListAdapter.notifyDataSetChanged(); + // } @Override public boolean onCreateOptionsMenu(Menu menu) { @@ -179,7 +149,7 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.rileylink_miScan: - startScanBLE(); + scanLeDevice(true); return true; default: return super.onOptionsItemSelected(item); @@ -217,11 +187,14 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { mLEScanner = mBluetoothAdapter.getBluetoothLeScanner(); settings = new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build(); - filters = new ArrayList(); + filters = Arrays.asList(new ScanFilter.Builder().setServiceUuid( + ParcelUuid.fromString(GattAttributes.SERVICE_RADIO)).build()); scanLeDevice(true); } } + + RileyLinkUtil.sendBroadcastMessage(RileyLinkConst.Intents.RileyLinkDisconnect); } @@ -238,16 +211,111 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { } } + private ScanCallback mScanCallback2 = new ScanCallback() { + + @Override + public void onScanResult(int callbackType, final ScanResult scanRecord) { + + // final BleAdvertisedData badata = RileyLinkUtil.parseAdertisedData(scanRecord); + + Log.d(TAG, scanRecord.toString()); + + runOnUiThread(new Runnable() { + + @Override + public void run() { + if (addDevice(scanRecord)) + mLeDeviceListAdapter.notifyDataSetChanged(); + } + }); + } + + + @Override + public void onBatchScanResults(final List results) { + + runOnUiThread(new Runnable() { + + @Override + public void run() { + + boolean added = false; + + for (ScanResult result : results) { + + if (addDevice(result)) + added = true; + } + + if (added) + mLeDeviceListAdapter.notifyDataSetChanged(); + } + }); + } + + + private boolean addDevice(ScanResult result) { + + BluetoothDevice device = result.getDevice(); + + // BluetoothClass bluetoothClass = device.getBluetoothClass(); + // + // StringBuilder sb = new StringBuilder("Class: "); + // sb.append("MajorClass: " + bluetoothClass.getMajorDeviceClass()); + // sb.append("DeviceClass: " + bluetoothClass.getDeviceClass()); + // Log.d(TAG, sb.toString()); + // FIXME remove most of code + List serviceUuids = result.getScanRecord().getServiceUuids(); + + if (serviceUuids == null || serviceUuids.size() == 0) { + Log.v(TAG, "Device " + device.getAddress() + " has no serviceUuids (Not RileyLink)."); + } else if (serviceUuids.size() > 1) { + Log.v(TAG, "Device " + device.getAddress() + " has too many serviceUuids (Not RileyLink)."); + } else { + + String uuid = serviceUuids.get(0).getUuid().toString().toLowerCase(); + + if (uuid.equals(GattAttributes.SERVICE_RADIO)) { + Log.i(TAG, "Found RileyLink with address: " + device.getAddress()); + mLeDeviceListAdapter.addDevice(result); + return true; + } else { + Log.v(TAG, "Device " + device.getAddress() + " has incorrect uuid (Not RileyLink)."); + } + } + + return false; + } + + + private String getDeviceDebug(BluetoothDevice device) { + + return "BluetoothDevice [name=" + device.getName() + ", address=" + device.getAddress() + // + ", type=" + device.getType(); // + ", alias=" + device.getAlias(); + } + + // @Override + // public void onScanFailed(int errorCode) { + // + // Log.e("Scan Failed", "Error Code: " + errorCode); + // Toast.makeText(mContext, "Scan Failed " + errorCode, Toast.LENGTH_LONG).show(); + // } + }; + private void scanLeDevice(final boolean enable) { if (enable) { + + mLeDeviceListAdapter.clear(); + mLeDeviceListAdapter.notifyDataSetChanged(); + // Stops scanning after a pre-defined scan period. mHandler.postDelayed(new Runnable() { @Override public void run() { mScanning = false; - mLEScanner.stopScan(mScanCallback); + mLEScanner.stopScan(mScanCallback2); LOG.debug("scanLeDevice: Scanning Stop"); // Toast.makeText(mContext, "Scanning finished", Toast.LENGTH_SHORT).show(); snackbar.dismiss(); @@ -255,13 +323,13 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { }, SCAN_PERIOD); mScanning = true; - mLEScanner.startScan(mScanCallback); + mLEScanner.startScan(filters, settings, mScanCallback2); LOG.debug("scanLeDevice: Scanning Start"); // Toast.makeText(this, "Scanning", Toast.LENGTH_SHORT).show(); snackbar.show(); } else { mScanning = false; - mLEScanner.stopScan(mScanCallback); + mLEScanner.stopScan(mScanCallback2); LOG.debug("scanLeDevice: Scanning Stop"); // Toast.makeText(this, "Scanning finished", Toast.LENGTH_SHORT).show(); @@ -270,40 +338,49 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { } } - static class ViewHolder { - - TextView deviceName; - TextView deviceAddress; - } - private class LeDeviceListAdapter extends BaseAdapter { private ArrayList mLeDevices; + private Map rileyLinkDevices; private LayoutInflater mInflator; + String currentlySelectedAddress; public LeDeviceListAdapter() { super(); mLeDevices = new ArrayList<>(); + rileyLinkDevices = new HashMap<>(); mInflator = RileyLinkBLEScanActivity.this.getLayoutInflater(); + currentlySelectedAddress = SP.getString(RileyLinkConst.Prefs.RileyLinkAddress, ""); } - public void addDevice(BluetoothDevice device) { - if (!mLeDevices.contains(device)) { - mLeDevices.add(device); - notifyDataSetChanged(); + // public void addDevice(BluetoothDevice device) { + // + // if (!mLeDevices.contains(device)) { + // mLeDevices.add(device); + // notifyDataSetChanged(); + // } + // } + + public void addDevice(ScanResult result) { + + if (!mLeDevices.contains(result.getDevice())) { + mLeDevices.add(result.getDevice()); } + rileyLinkDevices.put(result.getDevice(), result.getRssi()); + notifyDataSetChanged(); } - public BluetoothDevice getDevice(int position) { - return mLeDevices.get(position); - } - + // public BluetoothDevice getDevice(int position) { + // + // return rileyLinkDevices.get(position); + // } public void clear() { mLeDevices.clear(); + rileyLinkDevices.clear(); notifyDataSetChanged(); } @@ -328,6 +405,7 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { @Override public View getView(int i, View view, ViewGroup viewGroup) { + ViewHolder viewHolder; // General ListView optimization code. if (view == null) { @@ -342,17 +420,46 @@ public class RileyLinkBLEScanActivity extends AppCompatActivity { BluetoothDevice device = mLeDevices.get(i); String deviceName = device.getName(); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - if (SP.getString(RileyLinkConst.Prefs.RileyLinkAddress, "").compareTo(device.getAddress()) == 0) { + + if (StringUtils.isBlank(deviceName)) { + deviceName = "RileyLink"; + } + + deviceName += " [" + rileyLinkDevices.get(device).intValue() + "]"; + + if (currentlySelectedAddress.equals(device.getAddress())) { // viewHolder.deviceName.setTextColor(getColor(R.color.secondary_text_light)); // viewHolder.deviceAddress.setTextColor(getColor(R.color.secondary_text_light)); deviceName += " (" + getResources().getString(R.string.rileylink_scanner_selected_device) + ")"; } + + // if (deviceName == null) { + // BleAdvertisedData bleAdvertisedData = mapDevices.get(device); + // + // deviceName = bleAdvertisedData.getName(); + // + // Log.d(TAG, "Old name was null so we replaced it with " + deviceName); + // } + viewHolder.deviceName.setText(deviceName); viewHolder.deviceAddress.setText(device.getAddress()); return view; } + + // public void addDevice(BluetoothDevice device, BleAdvertisedData bleAdvertisedData) { + // if (!mLeDevices.contains(device)) { + // mLeDevices.add(device); + // mapDevices.put(device, bleAdvertisedData); + // notifyDataSetChanged(); + // } + // } + } + + static class ViewHolder { + + TextView deviceName; + TextView deviceAddress; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkCommunicationManager.java index 11f6a85595..167dfe3b1a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkCommunicationManager.java @@ -31,6 +31,7 @@ import info.nightscout.utils.SP; public abstract class RileyLinkCommunicationManager { private static final Logger LOG = LoggerFactory.getLogger(RileyLinkCommunicationManager.class); + private static final int SCAN_TIMEOUT = 1500; protected final RFSpy rfspy; protected final Context context; @@ -40,12 +41,12 @@ public abstract class RileyLinkCommunicationManager { protected PumpStatus pumpStatus; protected RileyLinkServiceData rileyLinkServiceData; protected RileyLinkTargetFrequency targetFrequency; + private long nextWakeUpRequired = 0L; private double[] scanFrequencies; // internal flag private boolean showPumpMessages = true; private int timeoutCount = 0; - private long nextWakeUpRequired = 0L; public RileyLinkCommunicationManager(Context context, RFSpy rfspy, RileyLinkTargetFrequency targetFrequency) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkConst.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkConst.java index b29567d79b..c4ee63c820 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkConst.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkConst.java @@ -23,6 +23,7 @@ public class RileyLinkConst { public static final String INTENT_NEW_rileylinkAddressKey = Prefix + "INTENT_NEW_rileylinkAddressKey"; public static final String INTENT_NEW_pumpIDKey = Prefix + "INTENT_NEW_pumpIDKey"; + public static final String RileyLinkDisconnect = Prefix + "RileyLink_Disconnect"; } public class Prefs { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkUtil.java index af4b5dd621..95cc48af64 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/RileyLinkUtil.java @@ -1,7 +1,11 @@ package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; +import java.util.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,7 +16,9 @@ import android.support.v4.content.LocalBroadcastManager; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RileyLinkBLE; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkTargetFrequency; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.data.BleAdvertisedData; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkServiceState; @@ -44,12 +50,12 @@ public class RileyLinkUtil { private static RileyLinkService rileyLinkService; // private static RileyLinkIPCConnection rileyLinkIPCConnection; private static MedtronicDeviceType medtronicPumpModel; - // private static MedtronicPumpStatus pumpStatus; // BAD dependencies in Classes: RileyLinkService private static RileyLinkTargetFrequency rileyLinkTargetFrequency; // Broadcasts: RileyLinkBLE, RileyLinkService, private static RileyLinkTargetDevice targetDevice; + private static RileyLinkEncodingType encoding; public static void setContext(Context contextIn) { @@ -57,6 +63,17 @@ public class RileyLinkUtil { } + public static RileyLinkEncodingType getEncoding() { + return encoding; + + } + + + public static void setEncoding(RileyLinkEncodingType encoding) { + RileyLinkUtil.encoding = encoding; + } + + public static void sendBroadcastMessage(String message) { Intent intent = new Intent(message); LocalBroadcastManager.getInstance(RileyLinkUtil.context).sendBroadcast(intent); @@ -197,6 +214,56 @@ public class RileyLinkUtil { } + public static BleAdvertisedData parseAdertisedData(byte[] advertisedData) { + List uuids = new ArrayList(); + String name = null; + if (advertisedData == null) { + return new BleAdvertisedData(uuids, name); + } + + ByteBuffer buffer = ByteBuffer.wrap(advertisedData).order(ByteOrder.LITTLE_ENDIAN); + while (buffer.remaining() > 2) { + byte length = buffer.get(); + if (length == 0) + break; + + byte type = buffer.get(); + switch (type) { + case 0x02: // Partial list of 16-bit UUIDs + case 0x03: // Complete list of 16-bit UUIDs + while (length >= 2) { + uuids + .add(UUID.fromString(String.format("%08x-0000-1000-8000-00805f9b34fb", buffer.getShort()))); + length -= 2; + } + break; + case 0x06: // Partial list of 128-bit UUIDs + case 0x07: // Complete list of 128-bit UUIDs + while (length >= 16) { + long lsb = buffer.getLong(); + long msb = buffer.getLong(); + uuids.add(new UUID(msb, lsb)); + length -= 16; + } + break; + case 0x09: + byte[] nameBytes = new byte[length - 1]; + buffer.get(nameBytes); + try { + name = new String(nameBytes, "utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + break; + default: + buffer.position(buffer.position() + length - 1); + break; + } + } + return new BleAdvertisedData(uuids, name); + } + + public static List getRileyLinkHistory() { return historyRileyLink; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpy.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpy.java index 5d913e70b4..02166d918d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpy.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpy.java @@ -8,13 +8,19 @@ import org.slf4j.LoggerFactory; import android.os.SystemClock; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.RileyLinkCommand; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.SendAndListen; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.SetPreamble; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.SetSoftwareEncoding; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.UpdateRegister; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.GattAttributes; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.RFSpyResponse; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.RadioPacket; -import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.RadioResponse; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.CC111XRegister; -import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RFSpyCommand; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RXFilterMode; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkTargetFrequency; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.operations.BLECommOperationResult; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; @@ -38,6 +44,8 @@ public class RFSpy { private UUID radioDataUUID = UUID.fromString(GattAttributes.CHARA_RADIO_DATA); private UUID radioVersionUUID = UUID.fromString(GattAttributes.CHARA_RADIO_VERSION); private UUID responseCountUUID = UUID.fromString(GattAttributes.CHARA_RADIO_RESPONSE_COUNT); + private RileyLinkFirmwareVersion firmwareVersion; + private String bleVersion; // We don't use it so no need of sofisticated logic public RFSpy(RileyLinkBLE rileyLinkBle) { @@ -46,6 +54,16 @@ public class RFSpy { } + public RileyLinkFirmwareVersion getRLVersionCached() { + return firmwareVersion; + } + + + public String getBLEVersionCached() { + return bleVersion; + } + + // Call this after the RL services are discovered. // Starts an async task to read when data is available public void startReader() { @@ -60,6 +78,27 @@ public class RFSpy { } + // Here should go generic RL initialisation + protocol adjustments depending on + // firmware version + public void initializeRileyLink() { + // We have to call raw version of communication to get firmware version + // So that we can adjust other commands accordingly afterwords + byte[] getVersionRaw = getByteArray(RileyLinkCommandType.GetVersion.code); + byte[] response = writeToDataRaw(getVersionRaw, 5000); + if (response != null) { // && response[0] == (byte) 0xDD) { + + // This throws an exception if version not supported, we should treat exceptions somehow + // and show "Not supported firmware" message in UI + RileyLinkFirmwareVersion version = RileyLinkFirmwareVersion.getByVersionString(StringUtil + .fromBytes(response)); + + this.firmwareVersion = version; + + } + bleVersion = getVersion(); + } + + // Call this from the "response count" notification handler. public void newDataIsAvailable() { // pass the message to the reader (which should be internal to RFSpy) @@ -80,22 +119,7 @@ public class RFSpy { } - public String getRadioVersion() { - RFSpyResponse resp = writeToData(RFSpyCommand.GetVersion, null, EXPECTED_MAX_BLUETOOTH_LATENCY_MS); - if (resp == null) { - LOG.error("getRadioVersion returned null"); - return "(null)"; - } else { - return StringUtil.fromBytes(resp.getRadioResponse().decodedPayload); - } - } - - - // The caller has to know how long the RFSpy will be busy with what was sent to it. - private RFSpyResponse writeToData(RFSpyCommand command, byte[] body, int responseTimeout_ms) { - - byte[] bytes = getCommandArray(command, body); - + private byte[] writeToDataRaw(byte[] bytes, int responseTimeout_ms) { SystemClock.sleep(100); // FIXME drain read queue? byte[] junkInBuffer = reader.poll(0); @@ -109,17 +133,28 @@ public class RFSpy { // prepend length, and send it. byte[] prepended = ByteUtil.concat(new byte[] { (byte)(bytes.length) }, bytes); - //LOG.debug("writeToData (command={},raw={})", command.name(), HexDump.toHexStringDisplayable(prepended)); + LOG.debug("writeToData (raw={})", HexDump.toHexStringDisplayable(prepended)); BLECommOperationResult writeCheck = rileyLinkBle.writeCharacteristic_blocking(radioServiceUUID, radioDataUUID, prepended); if (writeCheck.resultCode != BLECommOperationResult.RESULT_SUCCESS) { LOG.error("BLE Write operation failed, code=" + writeCheck.resultCode); - return new RFSpyResponse(); // will be a null (invalid) response + return null; // will be a null (invalid) response } SystemClock.sleep(100); // Log.i(TAG,ThreadUtil.sig()+String.format(" writeToData:(timeout %d) %s",(responseTimeout_ms),ByteUtil.shortHexString(prepended))); byte[] rawResponse = reader.poll(responseTimeout_ms); + return rawResponse; + + } + + + // The caller has to know how long the RFSpy will be busy with what was sent to it. + private RFSpyResponse writeToData(RileyLinkCommand command, int responseTimeout_ms) { + + byte[] bytes = command.getRaw(); + byte[] rawResponse = writeToDataRaw(bytes, responseTimeout_ms); + RFSpyResponse resp = new RFSpyResponse(command, rawResponse); if (rawResponse == null) { LOG.error("writeToData: No response from RileyLink"); @@ -135,9 +170,9 @@ public class RFSpy { resetNotConnectedCount(); } else { if (resp.looksLikeRadioPacket()) { - RadioResponse radioResp = resp.getRadioResponse(); - byte[] responsePayload = radioResp.getPayload(); - LOG.info("writeToData: decoded radio response is " + ByteUtil.shortHexString(responsePayload)); + // RadioResponse radioResp = resp.getRadioResponse(); + // byte[] responsePayload = radioResp.getPayload(); + LOG.info("writeToData: received radio response. Will decode at upper level"); resetNotConnectedCount(); } // Log.i(TAG, "writeToData: raw response is " + ByteUtil.shortHexString(rawResponse)); @@ -157,7 +192,7 @@ public class RFSpy { } - private byte[] getCommandArray(RFSpyCommand command, byte[] body) { + private byte[] getCommandArray(RileyLinkCommandType command, byte[] body) { int bodyLength = body == null ? 0 : body.length; byte[] output = new byte[bodyLength + 1]; @@ -174,27 +209,38 @@ public class RFSpy { } - public RFSpyResponse transmit(RadioPacket radioPacket) { + // public RFSpyResponse transmit(RadioPacket radioPacket) { + // + // return transmit(radioPacket, (byte) 0, (byte) 0, (byte) 0xFF); + // } + // + // + // public RFSpyResponse transmit(RadioPacket radioPacket, byte sendChannel, byte repeatCount, byte delay_ms) { + // // append checksum, encode data, send it. + // byte[] fullPacket = ByteUtil.concat(getByteArray(sendChannel, repeatCount, delay_ms), radioPacket.getEncoded()); + // RFSpyResponse response = writeToData(RileyLinkCommandType.Send, fullPacket, delay_ms + + // EXPECTED_MAX_BLUETOOTH_LATENCY_MS); + // return response; + // } - return transmit(radioPacket, (byte)0, (byte)0, (byte)0xFF); - } + // public RFSpyResponse receive(byte listenChannel, int timeout_ms, byte retryCount) { + // int receiveDelay = timeout_ms * (retryCount + 1); + // byte[] listen = getByteArray(listenChannel, (byte) ((timeout_ms >> 24) & 0x0FF), (byte) ((timeout_ms >> 16) & + // 0x0FF), (byte) ((timeout_ms >> 8) & 0x0FF), (byte) (timeout_ms & 0x0FF), retryCount); + // return writeToData(RileyLinkCommandType.GetPacket, listen, receiveDelay); + // } + // public RFSpyResponse transmitThenReceive(RadioPacket pkt, int timeout_ms) { + // return transmitThenReceive(pkt, (byte) 0, (byte) 0, (byte) 0, (byte) 0, timeout_ms, (byte) 0); + // } + // public RFSpyResponse transmitThenReceive(RadioPacket pkt, int timeout_ms, int repeatCount, int extendPreamble_ms) + // { + // return transmitThenReceive(pkt, (byte) 0, (byte) repeatCount, (byte) 0, (byte) 0, timeout_ms, (byte) 0); + // } - public RFSpyResponse transmit(RadioPacket radioPacket, byte sendChannel, byte repeatCount, byte delay_ms) { - // append checksum, encode data, send it. - byte[] fullPacket = ByteUtil.concat(getByteArray(sendChannel, repeatCount, delay_ms), radioPacket.getEncoded()); - RFSpyResponse response = writeToData(RFSpyCommand.Send, fullPacket, delay_ms - + EXPECTED_MAX_BLUETOOTH_LATENCY_MS); - return response; - } - - - public RFSpyResponse receive(byte listenChannel, int timeout_ms, byte retryCount) { - int receiveDelay = timeout_ms * (retryCount + 1); - byte[] listen = getByteArray(listenChannel, (byte)((timeout_ms >> 24) & 0x0FF), - (byte)((timeout_ms >> 16) & 0x0FF), (byte)((timeout_ms >> 8) & 0x0FF), (byte)(timeout_ms & 0x0FF), - retryCount); - return writeToData(RFSpyCommand.GetPacket, listen, receiveDelay); + public RFSpyResponse transmitThenReceive(RadioPacket pkt, byte sendChannel, byte repeatCount, byte delay_ms, + byte listenChannel, int timeout_ms, byte retryCount) { + return transmitThenReceive(pkt, sendChannel, repeatCount, delay_ms, listenChannel, timeout_ms, retryCount, null); } @@ -203,23 +249,24 @@ public class RFSpy { } + // FIXME: to be able to work with Omnipod we need to support preamble extensions so we should create a class for the + // SnedAndListen RL command + // To avoid snedAndListen command assembly magic public RFSpyResponse transmitThenReceive(RadioPacket pkt, byte sendChannel, byte repeatCount, byte delay_ms, - byte listenChannel, int timeout_ms, byte retryCount) { + byte listenChannel, int timeout_ms, byte retryCount, Integer extendPreamble_ms) { int sendDelay = repeatCount * delay_ms; int receiveDelay = timeout_ms * (retryCount + 1); - byte[] sendAndListen = getByteArray(sendChannel, repeatCount, delay_ms, listenChannel, - (byte)((timeout_ms >> 24) & 0x0FF), (byte)((timeout_ms >> 16) & 0x0FF), (byte)((timeout_ms >> 8) & 0x0FF), - (byte)(timeout_ms & 0x0FF), (byte)retryCount); - byte[] fullPacket = ByteUtil.concat(sendAndListen, pkt.getEncoded()); - return writeToData(RFSpyCommand.SendAndListen, fullPacket, sendDelay + receiveDelay - + EXPECTED_MAX_BLUETOOTH_LATENCY_MS); + + SendAndListen command = new SendAndListen(firmwareVersion, sendChannel, repeatCount, delay_ms, listenChannel, + timeout_ms, retryCount, extendPreamble_ms, pkt); + + return writeToData(command, sendDelay + receiveDelay + EXPECTED_MAX_BLUETOOTH_LATENCY_MS); } public RFSpyResponse updateRegister(CC111XRegister reg, int val) { - byte[] updateRegisterPkt = getByteArray(reg.value, (byte)val); - RFSpyResponse resp = writeToData(RFSpyCommand.UpdateRegister, updateRegisterPkt, + RFSpyResponse resp = writeToData(new UpdateRegister(firmwareVersion, reg, (byte)val), EXPECTED_MAX_BLUETOOTH_LATENCY_MS); return resp; } @@ -244,32 +291,64 @@ public class RFSpy { switch (frequency) { case Medtronic_WorldWide: { + // updateRegister(CC111X_MDMCFG4, (byte) 0x59); setRXFilterMode(RXFilterMode.Wide); // updateRegister(CC111X_MDMCFG3, (byte) 0x66); // updateRegister(CC111X_MDMCFG2, (byte) 0x33); updateRegister(CC111XRegister.mdmcfg1, 0x62); updateRegister(CC111XRegister.mdmcfg0, 0x1A); updateRegister(CC111XRegister.deviatn, 0x13); + // RileyLinkUtil.setEncoding(RileyLinkEncodingType.FourByteSixByte); } break; case Medtronic_US: { + // updateRegister(CC111X_MDMCFG4, (byte) 0x99); setRXFilterMode(RXFilterMode.Narrow); // updateRegister(CC111X_MDMCFG3, (byte) 0x66); // updateRegister(CC111X_MDMCFG2, (byte) 0x33); updateRegister(CC111XRegister.mdmcfg1, 0x61); updateRegister(CC111XRegister.mdmcfg0, 0x7E); updateRegister(CC111XRegister.deviatn, 0x15); + // RileyLinkUtil.setEncoding(RileyLinkEncodingType.FourByteSixByte); } break; - case Omnipod: { - LOG.debug("No region configuration for RfSpy and {}", frequency.name()); - } + RFSpyResponse r = null; + // RL initialization for Omnipod is a copy/paste from OmniKit implementation. + // Last commit from original repository: 5c3beb4144 + // so if something is terribly wrong, please check git diff PodCommsSession.swift since that commit + r = updateRegister(CC111XRegister.pktctrl1, 0x20); + r = updateRegister(CC111XRegister.agcctrl0, 0x00); + r = updateRegister(CC111XRegister.fsctrl1, 0x06); + r = updateRegister(CC111XRegister.mdmcfg4, 0xCA); + r = updateRegister(CC111XRegister.mdmcfg3, 0xBC); + r = updateRegister(CC111XRegister.mdmcfg2, 0x06); + r = updateRegister(CC111XRegister.mdmcfg1, 0x70); + r = updateRegister(CC111XRegister.mdmcfg0, 0x11); + r = updateRegister(CC111XRegister.deviatn, 0x44); + r = updateRegister(CC111XRegister.mcsm0, 0x18); + r = updateRegister(CC111XRegister.foccfg, 0x17); + r = updateRegister(CC111XRegister.fscal3, 0xE9); + r = updateRegister(CC111XRegister.fscal2, 0x2A); + r = updateRegister(CC111XRegister.fscal1, 0x00); + r = updateRegister(CC111XRegister.fscal0, 0x1F); + r = updateRegister(CC111XRegister.test1, 0x31); + r = updateRegister(CC111XRegister.test0, 0x09); + r = updateRegister(CC111XRegister.paTable0, 0x84); + r = updateRegister(CC111XRegister.sync1, 0xA5); + r = updateRegister(CC111XRegister.sync0, 0x5A); + + r = setSoftwareEncoding(RileyLinkEncodingType.Manchester); + // RileyLinkUtil.setEncoding(RileyLinkEncodingType.Manchester); + r = setPreamble(0x6665); + + } + break; default: - // no configuration + LOG.debug("No region configuration for RfSpy and {}", frequency.name()); break; } @@ -278,6 +357,24 @@ public class RFSpy { } + private RFSpyResponse setPreamble(int preamble) { + RFSpyResponse resp = null; + try { + resp = writeToData(new SetPreamble(firmwareVersion, preamble), EXPECTED_MAX_BLUETOOTH_LATENCY_MS); + } catch (Exception e) { + e.toString(); + } + return resp; + } + + + private RFSpyResponse setSoftwareEncoding(RileyLinkEncodingType encoding) { + RFSpyResponse resp = writeToData(new SetSoftwareEncoding(firmwareVersion, encoding), + EXPECTED_MAX_BLUETOOTH_LATENCY_MS); + return resp; + } + + private void setRXFilterMode(RXFilterMode mode) { byte drate_e = (byte)0x9; // exponent of symbol rate (16kbps) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpyReader.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpyReader.java index 97b04c8f55..14cf5d885c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpyReader.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RFSpyReader.java @@ -11,7 +11,9 @@ import org.slf4j.LoggerFactory; import android.os.AsyncTask; import android.os.SystemClock; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.GattAttributes; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.operations.BLECommOperationResult; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; import info.nightscout.androidaps.plugins.PumpCommon.utils.ThreadUtil; @@ -22,7 +24,7 @@ import info.nightscout.androidaps.plugins.PumpCommon.utils.ThreadUtil; public class RFSpyReader { private static final Logger LOG = LoggerFactory.getLogger(RFSpyReader.class); - AsyncTask readerTask; + private static AsyncTask readerTask; // private Context context; private RileyLinkBLE rileyLinkBle; private Semaphore waitForRadioData = new Semaphore(0, true); @@ -92,6 +94,9 @@ public class RFSpyReader { UUID serviceUUID = UUID.fromString(GattAttributes.SERVICE_RADIO); UUID radioDataUUID = UUID.fromString(GattAttributes.CHARA_RADIO_DATA); BLECommOperationResult result; + boolean stopAtNull = true; + if (RileyLinkUtil.getEncoding() == RileyLinkEncodingType.Manchester) + stopAtNull = false; while (true) { try { acquireCount++; @@ -104,11 +109,13 @@ public class RFSpyReader { SystemClock.sleep(100); if (result.resultCode == BLECommOperationResult.RESULT_SUCCESS) { - // only data up to the first null is valid - for (int i = 0; i < result.value.length; i++) { - if (result.value[i] == 0) { - result.value = ByteUtil.substring(result.value, 0, i); - break; + if (stopAtNull) { + // only data up to the first null is valid + for (int i = 0; i < result.value.length; i++) { + if (result.value[i] == 0) { + result.value = ByteUtil.substring(result.value, 0, i); + break; + } } } mDataQueue.add(result.value); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RileyLinkBLE.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RileyLinkBLE.java index 8991d3b505..380cd8b073 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RileyLinkBLE.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/RileyLinkBLE.java @@ -115,6 +115,7 @@ public class RileyLinkBLE { if (status == 133) { LOG.error("Got the status 133 bug, closing gatt"); disconnect(); + SystemClock.sleep(500); return; } @@ -363,6 +364,7 @@ public class RileyLinkBLE { // This function must be run on UI thread. public void connectGatt() { bluetoothConnectionGatt = rileyLinkDevice.connectGatt(context, true, bluetoothGattCallback); + // , BluetoothDevice.TRANSPORT_LE if (bluetoothConnectionGatt == null) { LOG.error("Failed to connect to Bluetooth Low Energy device at " + bluetoothAdapter.getAddress()); Toast.makeText(context, "No Rileylink at " + bluetoothAdapter.getAddress(), Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/GetVersion.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/GetVersion.java new file mode 100644 index 0000000000..0416af4737 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/GetVersion.java @@ -0,0 +1,23 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; + +public class GetVersion extends RileyLinkCommand { + + public GetVersion(RileyLinkFirmwareVersion version) { + super(version); + } + + + @Override + public RileyLinkCommandType getCommandType() { + return RileyLinkCommandType.GetVersion; + } + + + @Override + public byte[] getRaw() { + return super.getRawSimple(); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/RileyLinkCommand.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/RileyLinkCommand.java new file mode 100644 index 0000000000..b8c2853de1 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/RileyLinkCommand.java @@ -0,0 +1,32 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; + +public abstract class RileyLinkCommand { + + protected RileyLinkFirmwareVersion version; + + + public RileyLinkCommand(RileyLinkFirmwareVersion version) { + this.version = version; + } + + + public abstract RileyLinkCommandType getCommandType(); + + + public abstract byte[] getRaw(); + + + protected byte[] getRawSimple() { + return getByteArray(getCommandType().code); + + } + + + protected byte[] getByteArray(byte... input) { + return input; + } + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SendAndListen.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SendAndListen.java new file mode 100644 index 0000000000..2ff79f43c7 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SendAndListen.java @@ -0,0 +1,93 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import java.nio.ByteBuffer; +import java.util.ArrayList; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data.RadioPacket; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; +import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; + +public class SendAndListen extends RileyLinkCommand { + + private byte sendChannel; + private byte repeatCount; + private int delayBetweenPackets_ms; + private byte listenChannel; + private int timeout_ms; + private byte retryCount; + private Integer preambleExtension_ms; + private RadioPacket packetToSend; + + + public SendAndListen(RileyLinkFirmwareVersion version, byte sendChannel, byte repeatCount, + byte delayBetweenPackets_ms, byte listenChannel, int timeout_ms, byte retryCount, RadioPacket packetToSend + + ) { + this(version, sendChannel, repeatCount, delayBetweenPackets_ms, listenChannel, timeout_ms, retryCount, null, + packetToSend); + } + + + public SendAndListen(RileyLinkFirmwareVersion version, byte sendChannel, byte repeatCount, + int delayBetweenPackets_ms, byte listenChannel, int timeout_ms, byte retryCount, + Integer preambleExtension_ms, RadioPacket packetToSend + + ) { + super(version); + this.sendChannel = sendChannel; + this.repeatCount = repeatCount; + this.delayBetweenPackets_ms = delayBetweenPackets_ms; + this.listenChannel = listenChannel; + this.timeout_ms = timeout_ms; + this.retryCount = retryCount; + this.preambleExtension_ms = preambleExtension_ms == null ? 0 : preambleExtension_ms; + this.packetToSend = packetToSend; + } + + + @Override + public RileyLinkCommandType getCommandType() { + return RileyLinkCommandType.SendAndListen; + } + + + @Override + public byte[] getRaw() { + + boolean isPacketV2 = this.version.isSameVersion(RileyLinkFirmwareVersion.Version2AndHigher); + + ArrayList bytes = new ArrayList(); + bytes.add(this.getCommandType().code); + bytes.add(this.sendChannel); + bytes.add(this.repeatCount); + + if (isPacketV2) { // delay is unsigned 16-bit integer + byte[] delayBuff = ByteBuffer.allocate(4).putInt(delayBetweenPackets_ms).array(); + bytes.add(delayBuff[2]); + bytes.add(delayBuff[3]); + } else { + bytes.add((byte)delayBetweenPackets_ms); + } + + bytes.add(this.listenChannel); + + byte[] timeoutBuff = ByteBuffer.allocate(4).putInt(timeout_ms).array(); + + bytes.add(timeoutBuff[0]); + bytes.add(timeoutBuff[1]); + bytes.add(timeoutBuff[2]); + bytes.add(timeoutBuff[3]); + + bytes.add(retryCount); + + if (isPacketV2) { // 2.x (and probably higher versions) support preamble extension + byte[] preambleBuf = ByteBuffer.allocate(4).putInt(preambleExtension_ms).array(); + bytes.add(preambleBuf[2]); + bytes.add(preambleBuf[3]); + } + + return ByteUtil.concat(ByteUtil.fromByteArray(bytes), packetToSend.getEncoded()); + + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetPreamble.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetPreamble.java new file mode 100644 index 0000000000..d3bcde6bd6 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetPreamble.java @@ -0,0 +1,40 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import java.nio.ByteBuffer; + +import org.apache.commons.lang3.NotImplementedException; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; + +public class SetPreamble extends RileyLinkCommand { + + private int preamble; + + + public SetPreamble(RileyLinkFirmwareVersion version, int preamble) throws Exception { + super(version); + if (!this.version.isSameVersion(RileyLinkFirmwareVersion.Version2AndHigher)) { // this command was not supported + // before 2.0 + throw new NotImplementedException("Old firmware does not support SetPreamble command"); + } + + if (preamble < 0 || preamble > 0xFFFF) { + throw new Exception("preamble value is out of range"); + } + this.preamble = preamble; + } + + + @Override + public RileyLinkCommandType getCommandType() { + return RileyLinkCommandType.SetPreamble; + } + + + @Override + public byte[] getRaw() { + byte[] bytes = ByteBuffer.allocate(4).putInt(preamble).array(); + return getByteArray(this.getCommandType().code, bytes[2], bytes[3]); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetSoftwareEncoding.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetSoftwareEncoding.java new file mode 100644 index 0000000000..718d00b1cc --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/SetSoftwareEncoding.java @@ -0,0 +1,28 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; + +public class SetSoftwareEncoding extends RileyLinkCommand { + + private final RileyLinkEncodingType encoding; + + + public SetSoftwareEncoding(RileyLinkFirmwareVersion version, RileyLinkEncodingType encoding) { + super(version); + this.encoding = encoding; + } + + + @Override + public RileyLinkCommandType getCommandType() { + return RileyLinkCommandType.SetSWEncoding; + } + + + @Override + public byte[] getRaw() { + return getByteArray(getCommandType().code, encoding.value); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/UpdateRegister.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/UpdateRegister.java new file mode 100644 index 0000000000..4817e79a08 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/command/UpdateRegister.java @@ -0,0 +1,30 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.CC111XRegister; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; + +public class UpdateRegister extends RileyLinkCommand { + + CC111XRegister register; + byte registerValue; + + + public UpdateRegister(RileyLinkFirmwareVersion version, CC111XRegister register, byte registerValue) { + super(version); + this.register = register; + this.registerValue = registerValue; + } + + + @Override + public RileyLinkCommandType getCommandType() { + return RileyLinkCommandType.UpdateRegister; + } + + + @Override + public byte[] getRaw() { + return getByteArray(getCommandType().code, register.value, registerValue); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RFSpyResponse.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RFSpyResponse.java index a7e1f186ad..e86f70fad1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RFSpyResponse.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RFSpyResponse.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data; -import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RFSpyCommand; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.RileyLinkCommand; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RFSpyRLResponse; /** * Created by geoff on 5/26/16. @@ -10,9 +11,13 @@ public class RFSpyResponse { // 0xaa == timeout // 0xbb == interrupted // 0xcc == zero-data + // 0xdd == success + // 0x11 == invalidParam + // 0x22 == unknownCommand + protected byte[] raw; protected RadioResponse radioResponse; - private RFSpyCommand command; + private RileyLinkCommand command; public RFSpyResponse() { @@ -25,7 +30,7 @@ public class RFSpyResponse { } - public RFSpyResponse(RFSpyCommand command, byte[] rawResponse) { + public RFSpyResponse(RileyLinkCommand command, byte[] rawResponse) { this.command = command; init(rawResponse); @@ -39,15 +44,15 @@ public class RFSpyResponse { raw = bytes; } + } + + + public RadioResponse getRadioResponse() { if (looksLikeRadioPacket()) { radioResponse = new RadioResponse(command, raw); } else { radioResponse = new RadioResponse(); } - } - - - public RadioResponse getRadioResponse() { return radioResponse; } @@ -72,9 +77,29 @@ public class RFSpyResponse { } + public boolean isInvalidParam() { + if ((raw.length == 1) || (raw.length == 2)) { + if (raw[0] == (byte)0x11) { + return true; + } + } + return false; + } + + + public boolean isUnknownCommand() { + if ((raw.length == 1) || (raw.length == 2)) { + if (raw[0] == (byte)0x22) { + return true; + } + } + return false; + } + + public boolean isOK() { if ((raw.length == 1) || (raw.length == 2)) { - if (raw[0] == (byte)0x01) { + if (raw[0] == (byte)0x01 || raw[0] == (byte)0xDD) { return true; } } @@ -90,6 +115,17 @@ public class RFSpyResponse { } + @Override + public String toString() { + if (raw.length > 2) { + return "Radio packet"; + } else { + RFSpyRLResponse r = RFSpyRLResponse.fromByte(raw[0]); + return r.toString(); + } + } + + public byte[] getRaw() { return raw; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioPacket.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioPacket.java index e09f7d7bad..fab3171b68 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioPacket.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioPacket.java @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data; +import org.apache.commons.lang3.NotImplementedException; + +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RFTools; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; import info.nightscout.androidaps.plugins.PumpCommon.utils.CRC; @@ -30,10 +33,22 @@ public class RadioPacket { public byte[] getEncoded() { - byte[] withCRC = ByteUtil.concat(pkt, CRC.crc8(pkt)); - byte[] encoded = RFTools.encode4b6b(withCRC); - byte[] withNullTerm = ByteUtil.concat(encoded, (byte)0); - return withNullTerm; + + switch (RileyLinkUtil.getEncoding()) { + case Manchester: { // We have this encoding in RL firmware + return pkt; + } + + case FourByteSixByte: { + byte[] withCRC = getWithCRC(); + + byte[] encoded = RFTools.encode4b6b(withCRC); + return ByteUtil.concat(encoded, (byte)0); + } + + default: + throw new NotImplementedException(("Encoding not supported: " + RileyLinkUtil.getEncoding().toString())); + } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioResponse.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioResponse.java index fa4d3a011b..5c4fb6b793 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioResponse.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/data/RadioResponse.java @@ -1,10 +1,14 @@ package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.data; +import org.apache.commons.lang3.NotImplementedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RFTools; -import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RFSpyCommand; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.command.RileyLinkCommand; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkCommandType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; import info.nightscout.androidaps.plugins.PumpCommon.utils.CRC; @@ -20,10 +24,11 @@ public class RadioResponse { public int responseNumber; public byte[] decodedPayload = new byte[0]; public byte receivedCRC; - private RFSpyCommand command; + private RileyLinkCommand command; public RadioResponse() { + } @@ -32,8 +37,7 @@ public class RadioResponse { } - public RadioResponse(RFSpyCommand command, byte[] raw) { - + public RadioResponse(RileyLinkCommand command, byte[] raw) { this.command = command; init(raw); } @@ -41,7 +45,8 @@ public class RadioResponse { public boolean isValid() { - if (command != null && !command.isEncoded()) { + // We should check for all listening commands, but only one is actually used + if (command != null && command.getCommandType() != RileyLinkCommandType.SendAndListen) { return true; } @@ -58,6 +63,7 @@ public class RadioResponse { public void init(byte[] rxData) { + if (rxData == null) { return; } @@ -67,28 +73,48 @@ public class RadioResponse { } rssi = rxData[0]; responseNumber = rxData[1]; - byte[] encodedPayload = ByteUtil.substring(rxData, 2, rxData.length - 2); + byte[] encodedPayload; + + if (RileyLinkFirmwareVersion.isSameVersion(RileyLinkUtil.getRileyLinkServiceData().versionCC110, + RileyLinkFirmwareVersion.Version2)) { + encodedPayload = ByteUtil.substring(rxData, 3, rxData.length - 3); + } else { + encodedPayload = ByteUtil.substring(rxData, 2, rxData.length - 2); + } + try { - boolean isEncoded = command == null || command.isEncoded(); - - if (isEncoded) { - byte[] decodeThis = RFTools.decode4b6b(encodedPayload); - decodedOK = true; - decodedPayload = ByteUtil.substring(decodeThis, 0, decodeThis.length - 1); - byte calculatedCRC = CRC.crc8(decodedPayload); - receivedCRC = decodeThis[decodeThis.length - 1]; - if (receivedCRC != calculatedCRC) { - LOG.error(String.format("RadioResponse: CRC mismatch, calculated 0x%02x, received 0x%02x", - calculatedCRC, receivedCRC)); - } - } else { + // for non-radio commands we just return the raw response + // well, for non-radio commands we shouldn't even reach this point + // but getVersion is kind of exception + if (command != null && // + command.getCommandType() != RileyLinkCommandType.SendAndListen) { decodedOK = true; decodedPayload = encodedPayload; + return; } - // byte[] decodeThis = RFTools.decode4b6b(encodedPayload); - } catch (NumberFormatException e) { + switch (RileyLinkUtil.getEncoding()) { + case Manchester: + decodedOK = true; + decodedPayload = encodedPayload; + break; + case FourByteSixByte: + byte[] decodeThis = RFTools.decode4b6b(encodedPayload); + decodedOK = true; + decodedPayload = ByteUtil.substring(decodeThis, 0, decodeThis.length - 1); + receivedCRC = decodeThis[decodeThis.length - 1]; + byte calculatedCRC = CRC.crc8(decodedPayload); + if (receivedCRC != calculatedCRC) { + LOG.error(String.format("RadioResponse: CRC mismatch, calculated 0x%02x, received 0x%02x", + calculatedCRC, receivedCRC)); + } + break; + default: + throw new NotImplementedException("this {" + RileyLinkUtil.getEncoding().toString() + + "} encoding is not supported"); + } + } catch (NumberFormatException e) { decodedOK = false; LOG.error("Failed to decode radio data: " + ByteUtil.shortHexString(encodedPayload)); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RFSpyRLResponse.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RFSpyRLResponse.java new file mode 100644 index 0000000000..feaf9f5b1e --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RFSpyRLResponse.java @@ -0,0 +1,37 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs; + +public enum RFSpyRLResponse { + // 0xaa == timeout + // 0xbb == interrupted + // 0xcc == zero-data + // 0xdd == success + // 0x11 == invalidParam + // 0x22 == unknownCommand + + Invalid(0), // default, just fail + Timeout(0xAA), + Interrupted(0xBB), + ZeroData(0xCC), + Success(0xDD), + OldSuccess(0x01), + InvalidParam(0x11), + UnknownCommand(0x22), ; + + byte value; + + + RFSpyRLResponse(int value) { + this.value = (byte)value; + } + + + public static RFSpyRLResponse fromByte(byte input) { + for (RFSpyRLResponse type : values()) { + if (type.value == input) { + return type; + } + } + return null; + } + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkCommandType.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkCommandType.java new file mode 100644 index 0000000000..4dc45a40aa --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkCommandType.java @@ -0,0 +1,30 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs; + +/** + * Created by andy on 22/05/2018. + */ + +public enum RileyLinkCommandType { + + GetState(1), // + GetVersion(2), // + GetPacket(3), // aka Listen, receive + Send(4), // + SendAndListen(5), // + UpdateRegister(6), // + Reset(7), // + Led(8), + ReadRegister(8), + SetModeRegisters(10), + SetSWEncoding(11), + SetPreamble(12), + ResetRadioConfig(13), + GetStatistics(14), ; + + public byte code; + + + RileyLinkCommandType(int code) { + this.code = (byte)code; + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkEncodingType.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkEncodingType.java new file mode 100644 index 0000000000..47b65cbd13 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkEncodingType.java @@ -0,0 +1,15 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs; + +public enum RileyLinkEncodingType { + None(0x00), // + Manchester(0x01), // + FourByteSixByte(0x02), // + ; + + public byte value; + + + RileyLinkEncodingType(int value) { + this.value = (byte)value; + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java new file mode 100644 index 0000000000..c89e6f8fa8 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkFirmwareVersion.java @@ -0,0 +1,104 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public enum RileyLinkFirmwareVersion { + + Version_0_0(0, 0, "0.0"), // just for defaulting + Version_0_9(0, 9, "0.9"), // + Version_1_0(1, 0, "1.0"), // + Version_2_0(2, 0, "2.0"), // + Version_2_2(2, 2, "2.2"), // + Version_3_0(3, 0, "3.0"), // + UnknownVersion(0, 0, "???"), // + Version1(Version_0_0, Version_0_9, Version_1_0), // + Version2(Version_2_0, Version_2_2), // + Version2AndHigher(Version_2_0, Version_2_2, Version_3_0), // + ; + + private static final String FIRMWARE_IDENTIFICATION_PREFIX = "subg_rfspy "; + private static final Pattern _version_pattern = Pattern.compile(FIRMWARE_IDENTIFICATION_PREFIX + + "([0-9]+)\\.([0-9]+)"); + static Map mapByVersion; + + static { + mapByVersion = new HashMap<>(); + for (RileyLinkFirmwareVersion version : values()) { + if (version.familyMembers == null) { + mapByVersion.put(version.versionKey, version); + } + } + } + + protected RileyLinkFirmwareVersion[] familyMembers; + private int major; + private int minor; + private String versionKey = ""; + + + RileyLinkFirmwareVersion(int major, int minor, String versionKey) { + this.major = major; + this.minor = minor; + this.versionKey = versionKey; + } + + + RileyLinkFirmwareVersion(RileyLinkFirmwareVersion... familyMembers) { + this.familyMembers = familyMembers; + } + + + public static boolean isSameVersion(RileyLinkFirmwareVersion versionWeCheck, RileyLinkFirmwareVersion versionSources) { + if (versionSources.familyMembers != null) { + for (RileyLinkFirmwareVersion vrs : versionSources.familyMembers) { + if (vrs == versionWeCheck) + return true; + } + } else { + return (versionWeCheck == versionSources); + } + return false; + } + + + public static RileyLinkFirmwareVersion getByVersionString(String versionString) { + if (versionString != null) { + Matcher m = _version_pattern.matcher(versionString); + if (m.find()) { + int major = Integer.parseInt(m.group(1)); + int minor = Integer.parseInt(m.group(2)); + String versionKey = major + "." + minor; + if (mapByVersion.containsKey(versionKey)) { + return mapByVersion.get(versionKey); + } else { + return defaultToLowestMajorVersion(major); // just in case there is new release that we don't cover + // example: 2.3 etc + } + } + } + + return RileyLinkFirmwareVersion.UnknownVersion; + } + + + private static RileyLinkFirmwareVersion defaultToLowestMajorVersion(int major) { + if (mapByVersion.containsKey(major + ".0")) { + return mapByVersion.get(major + ".0"); + } + return UnknownVersion; + } + + + public boolean isSameVersion(RileyLinkFirmwareVersion versionSources) { + return isSameVersion(this, versionSources); + } + + + @Override + public String toString() { + return FIRMWARE_IDENTIFICATION_PREFIX + versionKey; + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkTargetDevice.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkTargetDevice.java new file mode 100644 index 0000000000..3a0ac72dd0 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/ble/defs/RileyLinkTargetDevice.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs; + +/** + * Created by andy on 5/19/18. + */ + +public enum RileyLinkTargetDevice { + MedtronicPump, // + Omnipod, // + ; +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/data/BleAdvertisedData.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/data/BleAdvertisedData.java new file mode 100644 index 0000000000..ca5e56664a --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/data/BleAdvertisedData.java @@ -0,0 +1,35 @@ +package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.data; + +import java.util.List; +import java.util.UUID; + +/** + * Created by andy on 9/10/18. + */ + +public class BleAdvertisedData { + + private List mUuids; + private String mName; + + + public BleAdvertisedData(List uuids, String name) { + mUuids = uuids; + mName = name; + } + + + public List getUuids() { + return mUuids; + } + + + public String getName() { + return mName; + } + + + public String toString() { + return "BleAdvertisedData [name=" + mName + ", UUIDs=" + mUuids + "]"; + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkService.java index 05cbee89ee..90eb2486df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkService.java @@ -19,6 +19,8 @@ import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RileyLinkBLE; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkTargetFrequency; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkServiceState; @@ -61,10 +63,14 @@ public abstract class RileyLinkService extends Service { determineRileyLinkTargetFrequency(); RileyLinkUtil.setRileyLinkService(this); RileyLinkUtil.setRileyLinkTargetFrequency(rileyLinkTargetFrequency); + RileyLinkUtil.setEncoding(getEncoding()); initRileyLinkServiceData(); } + public abstract RileyLinkEncodingType getEncoding(); + + /** * You need to determine which frequencies RileyLink will use, and set rileyLinkTargetFrequency */ @@ -148,13 +154,15 @@ public abstract class RileyLinkService extends Service { rileyLinkBLE.enableNotifications(); rfspy.startReader(); // call startReader from outside? - String data = rfspy.getVersion(); - LOG.debug("RfSpy version (BLE113): " + data); - rileyLinkServiceData.versionBLE113 = data; + rfspy.initializeRileyLink(); + String bleVersion = rfspy.getBLEVersionCached(); + RileyLinkFirmwareVersion rlVersion = rfspy.getRLVersionCached(); - data = rfspy.getRadioVersion(); - LOG.debug("RfSpy Radio version (CC110): " + data); - rileyLinkServiceData.versionCC110 = data; + LOG.debug("RfSpy version (BLE113): " + bleVersion); + rileyLinkServiceData.versionBLE113 = bleVersion; + + LOG.debug("RfSpy Radio version (CC110): " + rlVersion.name()); + rileyLinkServiceData.versionCC110 = rlVersion; ServiceTask task = new InitializePumpManagerTask(); ServiceTaskExecutor.startTask(task); @@ -187,6 +195,8 @@ public abstract class RileyLinkService extends Service { reconfigureRileyLink(RileylinkBLEAddress); // MainApp.getServiceClientConnection().setThisRileylink(RileylinkBLEAddress); } + } else if (action.equals(RileyLinkConst.Intents.RileyLinkDisconnect)) { + disconnectRileyLink(); } /* @@ -248,6 +258,7 @@ public abstract class RileyLinkService extends Service { intentFilter.addAction(RileyLinkConst.Intents.RileyLinkDisconnected); intentFilter.addAction(RileyLinkConst.Intents.BluetoothReconnected); intentFilter.addAction(RileyLinkConst.Intents.RileyLinkNewAddressSet); + intentFilter.addAction(RileyLinkConst.Intents.RileyLinkDisconnect); // intentFilter.addAction(RT2Const.serviceLocal.ipcBound); // intentFilter.addAction(RT2Const.IPC.MSG_BLE_accessGranted); // intentFilter.addAction(RT2Const.IPC.MSG_BLE_accessDenied); @@ -460,7 +471,11 @@ public abstract class RileyLinkService extends Service { public void disconnectRileyLink() { - this.rileyLinkBLE.disconnect(); + + if (this.rileyLinkBLE.isConnected()) { + this.rileyLinkBLE.disconnect(); + rileyLinkServiceData.rileylinkAddress = null; + } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkServiceData.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkServiceData.java index b54316d583..5b7f8177c8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkServiceData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/RileyLinkServiceData.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.service; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkTargetDevice; @@ -20,7 +21,7 @@ public class RileyLinkServiceData { // bt version public String versionBLE113; // radio version - public String versionCC110; + public RileyLinkFirmwareVersion versionCC110; public RileyLinkTargetDevice targetDevice; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/InitializePumpManagerTask.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/InitializePumpManagerTask.java index e824eb0548..5d1968190d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/InitializePumpManagerTask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/InitializePumpManagerTask.java @@ -34,6 +34,7 @@ public class InitializePumpManagerTask extends ServiceTask { // FIXME double lastGoodFrequency = SP.getDouble(RileyLinkConst.Prefs.LastGoodDeviceFrequency, 0.0d); + lastGoodFrequency = Math.round(lastGoodFrequency * 1000d) / 1000d; RileyLinkUtil.getRileyLinkServiceData().lastGoodFrequency = lastGoodFrequency; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/WakeAndTuneTask.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/WakeAndTuneTask.java index 58dd7e712a..d47de20461 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/WakeAndTuneTask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/hw/rileylink/service/tasks/WakeAndTuneTask.java @@ -8,6 +8,9 @@ import info.nightscout.androidaps.plugins.PumpMedtronic.service.RileyLinkMedtron */ public class WakeAndTuneTask extends PumpTask { + private static final String TAG = "WakeAndTuneTask"; + + public WakeAndTuneTask() { } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/utils/CRC.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/utils/CRC.java index ba2c7ac77b..226b65f6f1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/utils/CRC.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCommon/utils/CRC.java @@ -71,6 +71,27 @@ public class CRC { 203, 80, 190, 37, 19, 136, 127, 228, 210, 73, 149, 14, 56, 163, 84, 207, 249, 98, 140, 23, 33, 186, 77, 214, 224, 123 }; + static final int[] crc16lookup = new int[] { + 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011, 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, + 0x8027, 0x0022, 0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072, 0x0050, 0x8055, 0x805f, 0x005a, + 0x804b, 0x004e, 0x0044, 0x8041, 0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2, 0x00f0, 0x80f5, + 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1, 0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1, + 0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082, 0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, + 0x8197, 0x0192, 0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1, 0x01e0, 0x81e5, 0x81ef, 0x01ea, + 0x81fb, 0x01fe, 0x01f4, 0x81f1, 0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2, 0x0140, 0x8145, + 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151, 0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162, + 0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132, 0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, + 0x0104, 0x8101, 0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312, 0x0330, 0x8335, 0x833f, 0x033a, + 0x832b, 0x032e, 0x0324, 0x8321, 0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371, 0x8353, 0x0356, + 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342, 0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1, + 0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2, 0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, + 0x83b7, 0x03b2, 0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381, 0x0280, 0x8285, 0x828f, 0x028a, + 0x829b, 0x029e, 0x0294, 0x8291, 0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2, 0x82e3, 0x02e6, + 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2, 0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1, + 0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252, 0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, + 0x0264, 0x8261, 0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231, 0x8213, 0x0216, 0x021c, 0x8219, + 0x0208, 0x820d, 0x8207, 0x0202 }; + public static byte crc8(byte[] data, int len) { byte result = 0; @@ -120,4 +141,13 @@ public class CRC { crc &= 0xffff; return new byte[] { (byte)((crc & 0xFF00) >> 8), (byte)(crc & 0xFF) }; } + + + public static int crc16(byte[] bytes) { + int crc = 0x0000; + for (byte b : bytes) { + crc = (crc >>> 8) ^ crc16lookup[(crc ^ b) & 0xff]; + } + return crc; + } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/MedtronicCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/MedtronicCommunicationManager.java index 4477647cc1..7d41f40c8b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/MedtronicCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/MedtronicCommunicationManager.java @@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.Riley import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; import info.nightscout.androidaps.plugins.PumpCommon.utils.HexDump; import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.Page; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.Record; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.Record; import info.nightscout.androidaps.plugins.PumpMedtronic.comm.history.RawHistoryPage; import info.nightscout.androidaps.plugins.PumpMedtronic.comm.message.ButtonPressCarelinkMessageBody; import info.nightscout.androidaps.plugins.PumpMedtronic.comm.message.CarelinkLongMessageBody; @@ -689,6 +689,10 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager return false; } + if (responseRaw.length == 1) { + return false; + } + return !(responseRaw[last] == 0x00 && responseRaw[last - 1] == 0x00 && responseRaw[last - 2] == 0x00); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/Page.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/Page.java index 73b1e12a2d..abb28db2df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/Page.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/Page.java @@ -40,11 +40,11 @@ import android.util.Log; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; import info.nightscout.androidaps.plugins.PumpCommon.utils.CRC; import info.nightscout.androidaps.plugins.PumpCommon.utils.HexDump; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.PumpTimeStamp; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.Record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.RecordTypeEnum; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeFormat; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.IgnoredHistoryEntry; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.PumpTimeStamp; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.Record; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.RecordTypeEnum; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeFormat; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.IgnoredHistoryEntry; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; @Deprecated diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/PumpTimeStamp.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/PumpTimeStamp.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/PumpTimeStamp.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/PumpTimeStamp.java index d83dcff8c2..7c7517f72b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/PumpTimeStamp.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/PumpTimeStamp.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/Record.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/Record.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/Record.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/Record.java index 24f2f6a55c..f6f831789a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/Record.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/Record.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old; import android.os.Bundle; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/RecordTypeEnum.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/RecordTypeEnum.java similarity index 82% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/RecordTypeEnum.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/RecordTypeEnum.java index c7a2ce8625..3474d4779b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/RecordTypeEnum.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/RecordTypeEnum.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -6,60 +6,60 @@ import java.util.Map; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.AlarmClockReminderPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.AlarmSensorPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.BGReceivedPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.BasalProfileStart; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.BatteryPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.BolusNormalPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.BolusWizardBolusEstimatePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.CalBgForPhPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeAlarmClockEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeAlarmNotifyModePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeAudioBolusPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBGReminderEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBasalProfilePatternPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBasalProfilePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBolusReminderEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBolusReminderTimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBolusScrollStepSizePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeBolusWizardSetupPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeCaptureEventEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeCarbUnitsPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeChildBlockEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeMaxBolusPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeOtherDeviceIDPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeReservoirWarningTimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeSensorRateOfChangeAlertSetupPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeSensorSetup2PumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeTempBasalTypePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeTimeFormatPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeTimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeVariableBolusPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeWatchdogEnablePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ChangeWatchdogMarriageProfilePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ClearAlarmPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.DeleteAlarmClockTimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.DeleteBolusReminderTimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.DeleteOtherDeviceIDPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.EnableDisableRemotePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.IgnoredHistoryEntry; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.InsulinMarkerEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.JournalEntryExerciseMarkerPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.JournalEntryPumpLowBatteryPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.JournalEntryPumpLowReservoirPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.Model522ResultTotalsPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.NewTimeSet; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.PrimePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.PumpAlarmPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ResultDailyTotalPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.ResumePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.RewindPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.SuspendPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.TempBasalDurationPumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.TempBasalRatePumpEvent; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.UnabsorbedInsulin; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record.Unknown7ByteEvent1; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.AlarmClockReminderPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.AlarmSensorPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.BGReceivedPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.BasalProfileStart; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.BatteryPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.BolusNormalPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.BolusWizardBolusEstimatePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.CalBgForPhPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeAlarmClockEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeAlarmNotifyModePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeAudioBolusPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBGReminderEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBasalProfilePatternPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBasalProfilePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBolusReminderEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBolusReminderTimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBolusScrollStepSizePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeBolusWizardSetupPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeCaptureEventEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeCarbUnitsPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeChildBlockEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeMaxBolusPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeOtherDeviceIDPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeReservoirWarningTimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeSensorRateOfChangeAlertSetupPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeSensorSetup2PumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeTempBasalTypePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeTimeFormatPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeTimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeVariableBolusPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeWatchdogEnablePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ChangeWatchdogMarriageProfilePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ClearAlarmPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.DeleteAlarmClockTimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.DeleteBolusReminderTimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.DeleteOtherDeviceIDPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.EnableDisableRemotePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.IgnoredHistoryEntry; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.InsulinMarkerEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.JournalEntryExerciseMarkerPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.JournalEntryPumpLowBatteryPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.JournalEntryPumpLowReservoirPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.Model522ResultTotalsPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.NewTimeSet; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.PrimePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.PumpAlarmPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ResultDailyTotalPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.ResumePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.RewindPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.SuspendPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.TempBasalDurationPumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.TempBasalRatePumpEvent; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.UnabsorbedInsulin; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record.Unknown7ByteEvent1; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeFormat.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeFormat.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeFormat.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeFormat.java index ce3fe25070..6c43b08512 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeFormat.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeFormat.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeStampedRecord.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeStampedRecord.java similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeStampedRecord.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeStampedRecord.java index d8059c1ea9..4cbae2a4fc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/TimeStampedRecord.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/TimeStampedRecord.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old; import android.os.Bundle; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmClockReminderPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmClockReminderPumpEvent.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmClockReminderPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmClockReminderPumpEvent.java index 915bcf570a..5d848bd806 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmClockReminderPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmClockReminderPumpEvent.java @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/11/16. */ +@Deprecated public class AlarmClockReminderPumpEvent extends TimeStampedRecord { public AlarmClockReminderPumpEvent() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmSensorPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmSensorPumpEvent.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmSensorPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmSensorPumpEvent.java index abb57be3da..963a3f3332 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/AlarmSensorPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/AlarmSensorPumpEvent.java @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. */ +@Deprecated public class AlarmSensorPumpEvent extends TimeStampedRecord { public AlarmSensorPumpEvent() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BGReceivedPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BGReceivedPumpEvent.java similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BGReceivedPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BGReceivedPumpEvent.java index 1538eba683..5fec4ac47b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BGReceivedPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BGReceivedPumpEvent.java @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class BGReceivedPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BasalProfileStart.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BasalProfileStart.java similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BasalProfileStart.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BasalProfileStart.java index 3ee75888e7..25a42e29ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BasalProfileStart.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BasalProfileStart.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class BasalProfileStart extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BatteryPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BatteryPumpEvent.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BatteryPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BatteryPumpEvent.java index 6fb9324287..21cd9cafbe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BatteryPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BatteryPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class BatteryPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusNormalPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusNormalPumpEvent.java similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusNormalPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusNormalPumpEvent.java index 1021895840..06a9866562 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusNormalPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusNormalPumpEvent.java @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.PumpTimeStamp; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeFormat; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.PumpTimeStamp; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeFormat; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class BolusNormalPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusWizardBolusEstimatePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusWizardBolusEstimatePumpEvent.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusWizardBolusEstimatePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusWizardBolusEstimatePumpEvent.java index 5dc4d4c0de..910b0932be 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/BolusWizardBolusEstimatePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/BolusWizardBolusEstimatePumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class BolusWizardBolusEstimatePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/CalBgForPhPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/CalBgForPhPumpEvent.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/CalBgForPhPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/CalBgForPhPumpEvent.java index 970ee66367..d7cc1d8535 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/CalBgForPhPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/CalBgForPhPumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class CalBgForPhPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmClockEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmClockEnablePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmClockEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmClockEnablePumpEvent.java index a0cf5722d0..9664077dba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmClockEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmClockEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmNotifyModePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmNotifyModePumpEvent.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmNotifyModePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmNotifyModePumpEvent.java index 9962132550..ad36104038 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAlarmNotifyModePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAlarmNotifyModePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeAlarmNotifyModePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAudioBolusPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAudioBolusPumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAudioBolusPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAudioBolusPumpEvent.java index fddf57b5d5..2607b991f4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeAudioBolusPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeAudioBolusPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBGReminderEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBGReminderEnablePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBGReminderEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBGReminderEnablePumpEvent.java index 79ec26f5df..809f9ba8db 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBGReminderEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBGReminderEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePatternPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePatternPumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePatternPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePatternPumpEvent.java index 1f1f9ec05a..253ca8632f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePatternPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePatternPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePumpEvent.java index a32a1f3681..58ffd70b71 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBasalProfilePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBasalProfilePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeBasalProfilePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderEnablePumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderEnablePumpEvent.java index e1959eba02..39966b2925 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderTimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderTimePumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderTimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderTimePumpEvent.java index dca6b3be04..c2fe31a798 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusReminderTimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusReminderTimePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusScrollStepSizePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusScrollStepSizePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusScrollStepSizePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusScrollStepSizePumpEvent.java index 1be80a3029..225c702877 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusScrollStepSizePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusScrollStepSizePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusWizardSetupPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusWizardSetupPumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusWizardSetupPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusWizardSetupPumpEvent.java index 1d2b8e6d28..10128c3b7f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeBolusWizardSetupPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeBolusWizardSetupPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeBolusWizardSetupPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCaptureEventEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCaptureEventEnablePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCaptureEventEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCaptureEventEnablePumpEvent.java index 0624df5d54..2dfb7e71b8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCaptureEventEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCaptureEventEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCarbUnitsPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCarbUnitsPumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCarbUnitsPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCarbUnitsPumpEvent.java index 97e11fb805..58f88cffd3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeCarbUnitsPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeCarbUnitsPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeChildBlockEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeChildBlockEnablePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeChildBlockEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeChildBlockEnablePumpEvent.java index 1e88972777..530145f25b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeChildBlockEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeChildBlockEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeMaxBolusPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeMaxBolusPumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeMaxBolusPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeMaxBolusPumpEvent.java index 15645abed4..7392ace954 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeMaxBolusPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeMaxBolusPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeOtherDeviceIDPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeOtherDeviceIDPumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeOtherDeviceIDPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeOtherDeviceIDPumpEvent.java index c2732106f5..7d6b573bf8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeOtherDeviceIDPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeOtherDeviceIDPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeOtherDeviceIDPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeReservoirWarningTimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeReservoirWarningTimePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeReservoirWarningTimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeReservoirWarningTimePumpEvent.java index d17f6e47d8..4aa0d03cf7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeReservoirWarningTimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeReservoirWarningTimePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java index 0432f9044c..e6c318b4a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorRateOfChangeAlertSetupPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorSetup2PumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorSetup2PumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorSetup2PumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorSetup2PumpEvent.java index edd9b0152c..510c53d800 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeSensorSetup2PumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeSensorSetup2PumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTempBasalTypePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTempBasalTypePumpEvent.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTempBasalTypePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTempBasalTypePumpEvent.java index 72edcd8794..3bdb37e713 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTempBasalTypePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTempBasalTypePumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimeFormatPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimeFormatPumpEvent.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimeFormatPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimeFormatPumpEvent.java index cb5f38cc77..8524d7733a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimeFormatPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimeFormatPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeTimeFormatPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimePumpEvent.java index c18913c0f0..a7fd315f38 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeTimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeTimePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ChangeTimePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeVariableBolusPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeVariableBolusPumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeVariableBolusPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeVariableBolusPumpEvent.java index 008d9fa48c..402e15e36e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeVariableBolusPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeVariableBolusPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogEnablePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogEnablePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogEnablePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogEnablePumpEvent.java index d0123e42ab..f9bae2d401 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogEnablePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogEnablePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogMarriageProfilePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogMarriageProfilePumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogMarriageProfilePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogMarriageProfilePumpEvent.java index a75e860f3c..c2a19fce00 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ChangeWatchdogMarriageProfilePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ChangeWatchdogMarriageProfilePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ClearAlarmPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ClearAlarmPumpEvent.java similarity index 85% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ClearAlarmPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ClearAlarmPumpEvent.java index 2f5deea19d..c270445c63 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ClearAlarmPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ClearAlarmPumpEvent.java @@ -1,7 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; +@Deprecated public class ClearAlarmPumpEvent extends TimeStampedRecord { public ClearAlarmPumpEvent() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteAlarmClockTimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteAlarmClockTimePumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteAlarmClockTimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteAlarmClockTimePumpEvent.java index d318167fc1..eacb76819b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteAlarmClockTimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteAlarmClockTimePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteBolusReminderTimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteBolusReminderTimePumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteBolusReminderTimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteBolusReminderTimePumpEvent.java index 816500bbb6..1e4d8367e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteBolusReminderTimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteBolusReminderTimePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteOtherDeviceIDPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteOtherDeviceIDPumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteOtherDeviceIDPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteOtherDeviceIDPumpEvent.java index c30e85eae3..7a278a476d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/DeleteOtherDeviceIDPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/DeleteOtherDeviceIDPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/EnableDisableRemotePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/EnableDisableRemotePumpEvent.java similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/EnableDisableRemotePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/EnableDisableRemotePumpEvent.java index 0ca04b02f9..3d45c8da86 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/EnableDisableRemotePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/EnableDisableRemotePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class EnableDisableRemotePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/IgnoredHistoryEntry.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/IgnoredHistoryEntry.java similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/IgnoredHistoryEntry.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/IgnoredHistoryEntry.java index b2228aa05f..be7f0d268a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/IgnoredHistoryEntry.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/IgnoredHistoryEntry.java @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.Record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.RecordTypeEnum; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.Record; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.RecordTypeEnum; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/InsulinMarkerEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/InsulinMarkerEvent.java similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/InsulinMarkerEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/InsulinMarkerEvent.java index 97b7ac5855..cf8d1591e5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/InsulinMarkerEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/InsulinMarkerEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 7/16/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryExerciseMarkerPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryExerciseMarkerPumpEvent.java similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryExerciseMarkerPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryExerciseMarkerPumpEvent.java index 1a76a4843e..6010ec9eff 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryExerciseMarkerPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryExerciseMarkerPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 6/5/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowBatteryPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowBatteryPumpEvent.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowBatteryPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowBatteryPumpEvent.java index 4a3ee07ec9..c334f187b3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowBatteryPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowBatteryPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class JournalEntryPumpLowBatteryPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowReservoirPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowReservoirPumpEvent.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowReservoirPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowReservoirPumpEvent.java index c2d347aa3e..7e011b84ad 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/JournalEntryPumpLowReservoirPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/JournalEntryPumpLowReservoirPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class JournalEntryPumpLowReservoirPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Model522ResultTotalsPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Model522ResultTotalsPumpEvent.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Model522ResultTotalsPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Model522ResultTotalsPumpEvent.java index 86d344335d..945f6421e9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Model522ResultTotalsPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Model522ResultTotalsPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class Model522ResultTotalsPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/NewTimeSet.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/NewTimeSet.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/NewTimeSet.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/NewTimeSet.java index 071dc6615a..827f9d2fcc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/NewTimeSet.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/NewTimeSet.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; // This event existed as 0x18 in Roundtrip and early Decocare, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PrimePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PrimePumpEvent.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PrimePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PrimePumpEvent.java index 50d5cdd590..eff76d71c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PrimePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PrimePumpEvent.java @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; +@Deprecated public class PrimePumpEvent extends TimeStampedRecord { private double amount = 0.0; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PumpAlarmPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PumpAlarmPumpEvent.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PumpAlarmPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PumpAlarmPumpEvent.java index fd962cd445..90b0b45db3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/PumpAlarmPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/PumpAlarmPumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class PumpAlarmPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResultDailyTotalPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResultDailyTotalPumpEvent.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResultDailyTotalPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResultDailyTotalPumpEvent.java index 0ec39d4be6..e9c5da3089 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResultDailyTotalPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResultDailyTotalPumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.PumpTimeStamp; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeFormat; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.PumpTimeStamp; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeFormat; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ResultDailyTotalPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResumePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResumePumpEvent.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResumePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResumePumpEvent.java index 5646e2c829..6d5c493931 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/ResumePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/ResumePumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class ResumePumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/RewindPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/RewindPumpEvent.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/RewindPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/RewindPumpEvent.java index 759105c24f..5da14ee47c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/RewindPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/RewindPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class RewindPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Sara6EPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Sara6EPumpEvent.java similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Sara6EPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Sara6EPumpEvent.java index 3465acd8ef..61ea370a76 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Sara6EPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Sara6EPumpEvent.java @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.PumpTimeStamp; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeFormat; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.PumpTimeStamp; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeFormat; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; public class Sara6EPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/SuspendPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/SuspendPumpEvent.java similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/SuspendPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/SuspendPumpEvent.java index bdd9eace7b..c38e90bf5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/SuspendPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/SuspendPumpEvent.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; public class SuspendPumpEvent extends TimeStampedRecord { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalDurationPumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalDurationPumpEvent.java similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalDurationPumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalDurationPumpEvent.java index 4625d40bfe..8bea03d912 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalDurationPumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalDurationPumpEvent.java @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; +@Deprecated public class TempBasalDurationPumpEvent extends TimeStampedRecord { private int durationMinutes = 0; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalRatePumpEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalRatePumpEvent.java similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalRatePumpEvent.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalRatePumpEvent.java index fa65c77e12..24cae1102c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/TempBasalRatePumpEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/TempBasalRatePumpEvent.java @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import android.os.Bundle; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; +@Deprecated public class TempBasalRatePumpEvent extends TimeStampedRecord { private double basalRate = 0.0; // rate in Units/hr diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/UnabsorbedInsulin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/UnabsorbedInsulin.java similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/UnabsorbedInsulin.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/UnabsorbedInsulin.java index d6b2f7a405..27ac346a16 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/UnabsorbedInsulin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/UnabsorbedInsulin.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; import java.util.ArrayList; @@ -6,9 +6,10 @@ import android.os.Bundle; import android.util.Log; import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.Record; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.Record; import info.nightscout.androidaps.plugins.PumpMedtronic.defs.MedtronicDeviceType; +@Deprecated public class UnabsorbedInsulin extends Record { private static final String TAG = "UnabsorbedInsulin"; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Unknown7ByteEvent1.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Unknown7ByteEvent1.java similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Unknown7ByteEvent1.java rename to app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Unknown7ByteEvent1.java index 6afd675313..c1e5277c83 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history/record/Unknown7ByteEvent1.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/data/history_old/record/Unknown7ByteEvent1.java @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.record; +package info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.record; -import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history.TimeStampedRecord; +import info.nightscout.androidaps.plugins.PumpMedtronic.comm.data.history_old.TimeStampedRecord; /** * Created by geoff on 7/16/16. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/message/MessageBody.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/message/MessageBody.java index da50ceee5b..c6526e3fce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/message/MessageBody.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/comm/message/MessageBody.java @@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.PumpCommon.utils.HexDump; // Andy (4.6.2018): We probably need rewrite of this message body code. If there is no data sent, body is 00, which // denotes, -// no parameters. If we have 3 parameters sent (1 2 3), the body would actually be length of 4, first byte beeing the +// no parameters. If we have 3 parameters sent (1 2 3), the body would actually be length of 4, first byte being the // length // of the message, so the body would be 3 1 2 3. This is not done that way now. public class MessageBody { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/data/dto/BasalProfile.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/data/dto/BasalProfile.java index 7a5670ea14..35b7c34c86 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/data/dto/BasalProfile.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/data/dto/BasalProfile.java @@ -63,6 +63,11 @@ public class BasalProfile { LOG.error("setRawData: buffer is null!"); return false; } + + if (data.length == 1) { + data = MedtronicUtil.createByteArray(data[0], (byte)0, (byte)0); + } + // int len = Math.min(MAX_RAW_DATA_SIZE, data.length); mRawData = data; // System.arraycopy(data, 0, mRawData, 0, len); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/defs/MedtronicCommandType.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/defs/MedtronicCommandType.java index f9d71fdd70..a687905d68 100755 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/defs/MedtronicCommandType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/defs/MedtronicCommandType.java @@ -109,8 +109,7 @@ public enum MedtronicCommandType implements Serializable // , MinimedCommandType GetHistoryData(128, "History data", MinimedTargetType.PumpData, MedtronicDeviceType.Medtronic_512andHigher, MinimedCommandParameterType.SubCommands, 1024, 36, 0), // 0x80 // new MinimedCommandHistoryData(36) - GetBasalProfileSTD(146, "Get Profile Standard", MinimedTargetType.PumpConfiguration, MedtronicDeviceType.Medtronic_512andHigher, MinimedCommandParameterType.NoParameters, 192, 1, 8, 7), // 146 - // FIXME + GetBasalProfileSTD(146, "Get Profile Standard", MinimedTargetType.PumpConfiguration, MedtronicDeviceType.Medtronic_512andHigher, MinimedCommandParameterType.NoParameters, 192, 1, 8, 1), // 146 GetBasalProfileA(147, "Get Profile A", MinimedTargetType.PumpConfiguration, MedtronicDeviceType.Medtronic_512andHigher, MinimedCommandParameterType.NoParameters, 192, 1, 9), // 147 // FIXME diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/service/RileyLinkMedtronicService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/service/RileyLinkMedtronicService.java index 7c890d0ea6..e886b9b3ea 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/service/RileyLinkMedtronicService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMedtronic/service/RileyLinkMedtronicService.java @@ -24,6 +24,7 @@ import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.RileyLinkBLE; +import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkEncodingType; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.ble.defs.RileyLinkTargetFrequency; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.PumpCommon.hw.rileylink.defs.RileyLinkTargetDevice; @@ -208,6 +209,12 @@ public class RileyLinkMedtronicService extends RileyLinkService { } + @Override + public RileyLinkEncodingType getEncoding() { + return RileyLinkEncodingType.FourByteSixByte; + } + + @Override protected void determineRileyLinkTargetFrequency() { boolean hasUSFrequency = SP.getString(MedtronicConst.Prefs.PumpFrequency, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 001f41b653..a0d16c3be9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1230,7 +1230,7 @@ RileyLink MAC Address Selected Scan - RileyLink BLE Scan + RileyLink Scan Scan for RileyLink @@ -1309,7 +1309,6 @@ Remote cancel of Bolus is not supported. If you wish to cancel bolus, go to pump put it in suspend and then resume. This will cancel the bolus. - %1$d day %1$d days diff --git a/app/src/main/res/xml/pref_medtronic.xml b/app/src/main/res/xml/pref_medtronic.xml index 0a356a15f0..c91da65e7e 100644 --- a/app/src/main/res/xml/pref_medtronic.xml +++ b/app/src/main/res/xml/pref_medtronic.xml @@ -52,6 +52,7 @@