diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet.java b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet.java index eacdfc1ffa..cf10a2d95c 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet.java +++ b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet.java @@ -174,8 +174,6 @@ public class DanaRS_Packet { public String asciiStringFromBuff(byte[] buff, int offset, int length) { byte[] strbuff = new byte[length]; System.arraycopy(buff, offset, strbuff, 0, length); - for (int pos = 0; pos < length; pos++) - strbuff[pos] += 65; // "A" return new String(strbuff, StandardCharsets.UTF_8); } diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Get_Shipping_Information.kt b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Get_Shipping_Information.kt index c280f5f126..edcb565f6c 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Get_Shipping_Information.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Get_Shipping_Information.kt @@ -22,15 +22,9 @@ class DanaRS_Packet_General_Get_Shipping_Information( failed = true return } else failed = false - var dataIndex = DATA_START - var dataSize = 10 - danaPump.serialNumber = stringFromBuff(data, dataIndex, dataSize) - dataIndex += dataSize - dataSize = 3 - danaPump.shippingDate = dateFromBuff(data, dataIndex) - dataIndex += dataSize - dataSize = 3 - danaPump.shippingCountry = asciiStringFromBuff(data, dataIndex, dataSize) + danaPump.serialNumber = stringFromBuff(data, DATA_START, 10) + danaPump.shippingCountry = asciiStringFromBuff(data, DATA_START + 10, 3) + danaPump.shippingDate = dateFromBuff(data, DATA_START + 13) aapsLogger.debug(LTag.PUMPCOMM, "Serial number: " + danaPump.serialNumber) aapsLogger.debug(LTag.PUMPCOMM, "Shipping date: " + dateUtil.dateAndTimeString(danaPump.shippingDate)) aapsLogger.debug(LTag.PUMPCOMM, "Shipping country: " + danaPump.shippingCountry)