- changed PumpMessage to be get correct frame from 523 and 554
This commit is contained in:
parent
f0ccf57e69
commit
d50d6087ea
|
@ -7,6 +7,7 @@ import info.nightscout.androidaps.logging.L;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType;
|
import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by geoff on 5/29/16.
|
* Created by geoff on 5/29/16.
|
||||||
|
@ -132,7 +133,11 @@ public class PumpMessage implements RLMessage {
|
||||||
|
|
||||||
public byte[] getRawContentOfFrame() {
|
public byte[] getRawContentOfFrame() {
|
||||||
byte[] raw = messageBody.getTxData();
|
byte[] raw = messageBody.getTxData();
|
||||||
return ByteUtil.substring(raw, 1);
|
|
||||||
|
if (MedtronicUtil.getMedtronicPumpModel().isMedtronic_523orHigher())
|
||||||
|
return ByteUtil.substring(raw, 1, raw.length - 2);
|
||||||
|
else
|
||||||
|
return ByteUtil.substring(raw, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -105,9 +105,9 @@ public enum MedtronicDeviceType {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean isLargerFormat(MedtronicDeviceType model) {
|
// public static boolean isLargerFormat(MedtronicDeviceType model) {
|
||||||
return isSameDevice(model, Medtronic_523andHigher);
|
// return isSameDevice(model, Medtronic_523andHigher);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
public boolean isFamily() {
|
public boolean isFamily() {
|
||||||
|
@ -120,13 +120,17 @@ public enum MedtronicDeviceType {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isLargerFormat() {
|
// public boolean isLargerFormat() {
|
||||||
|
// return isSameDevice(this, Medtronic_523andHigher);
|
||||||
|
// }
|
||||||
|
|
||||||
|
public boolean isMedtronic_523orHigher() {
|
||||||
return isSameDevice(this, Medtronic_523andHigher);
|
return isSameDevice(this, Medtronic_523andHigher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getBolusStrokes() {
|
public int getBolusStrokes() {
|
||||||
return (isLargerFormat(this)) ? 40 : 10;
|
return (isMedtronic_523orHigher()) ? 40 : 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue