Files missed on previous checkin.

This commit is contained in:
Andy Rozman 2018-11-06 17:39:16 +00:00
parent b4ce95902b
commit 3fdbc0400e
3 changed files with 90 additions and 0 deletions

View file

@ -9,6 +9,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/action_buttons_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">

View file

@ -1238,6 +1238,7 @@
<string name="rileylink_scanner_scan">Scan</string> <string name="rileylink_scanner_scan">Scan</string>
<string name="rileylink_scanner_title">RileyLink Scan</string> <string name="rileylink_scanner_title">RileyLink Scan</string>
<string name="rileylink_scanner_scan_menu">Scan for RileyLink</string> <string name="rileylink_scanner_scan_menu">Scan for RileyLink</string>
<string name="medtronic_custom_action_wake_and_tune">Wake and Tune Up</string>
<!-- RL Status Page --> <!-- RL Status Page -->
<string name="rileylink_settings_tab1">Settings</string> <string name="rileylink_settings_tab1">Settings</string>

View file

@ -0,0 +1,88 @@
package info.nightscout.androidaps.plugins.PumpMedtronic.comm.history.pump;
import org.junit.Before;
import info.nightscout.androidaps.plugins.PumpCommon.utils.ByteUtil;
/**
* Created by andy on 11/1/18.
*/
public class MedtronicPumpHistoryDecoderUTest {
MedtronicPumpHistoryDecoder decoder = new MedtronicPumpHistoryDecoder();
@Before
public void setup() {
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "trace");
// final TestAppender appender = new TestAppender();
// final Logger logger = Logger.getRootLogger();
// logger.addAppender(appender);
// try {
// Logger.getLogger(MyTest.class).info("Test");
// } finally {
// logger.removeAppender(appender);
// }
}
// @Test
public void decodeRecord() throws Exception {
byte[] data = new byte[] { 0x07, 0x00, 0x00, 0x05, (byte)0xFA, (byte)0xBF, 0x12 };
PumpHistoryEntryType entryType = PumpHistoryEntryType.getByCode(0x07);
PumpHistoryEntry phe = new PumpHistoryEntry();
phe.setEntryType(entryType);
phe.setData(ByteUtil.getListFromByteArray(data), false);
decoder.decodeRecord(phe);
System.out.println("Record: " + phe);
}
// @Test
public void decodeDailyTotals522() {
// PumpHistoryRecord [type=DailyTotals522 [109, 0x6D], DT: 01.11.2018 00:00:00, length=1,2,41(44), data={Raw
// Data=0x6D 0xA1 0x92 0x05 0x0C 0x00 0xE8 0x00 0x00 0x00 0x00 0x04 0x0A 0x04 0x0A 0x64 0x00 0x00 0x00 0x00 0x00
// 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0C 0x00 0xE8 0x00 0x00
// 0x00}]
byte[] data4443 = new byte[] {
0x6D, (byte)0xA1, (byte)0x92, 0x05, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0A, 0x04, 0x0A,
0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00 };
byte[] data = new byte[] {
0x6D, (byte)0xA2, (byte)0x92, 0x05, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00, 0x00, 0x03, 0x18, 0x02,
(byte)0xD4, 0x5B, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x44, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x44, 0x64, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x00, (byte)0xE8, 0x00, 0x00, 0x00 };
// basal 18.1, bolus 1.7 manual = 1.7
// All (bg low hi, number Bgs, Sen Lo/Hi, Sens Cal/Data, Basal, Bolus, Carbs, Fodd, Corr, Manual=1.7, food/corr,
// Food+corr, manual bolus=1
testRecord(data);
}
private void testRecord(byte[] data) {
// byte[] data = new byte[] { 0x07, 0x00, 0x00, 0x05, (byte)0xFA, (byte)0xBF, 0x12 };
PumpHistoryEntryType entryType = PumpHistoryEntryType.getByCode(data[0]);
PumpHistoryEntry phe = new PumpHistoryEntry();
phe.setEntryType(entryType);
phe.setData(ByteUtil.getListFromByteArray(data), false);
decoder.decodeRecord(phe);
System.out.println("Record: " + phe);
}
}