2016-06-14 23:45:55 +02:00
|
|
|
package info.nightscout.androidaps.interfaces;
|
2016-06-05 01:40:35 +02:00
|
|
|
|
2016-08-04 09:17:26 +02:00
|
|
|
import android.content.Context;
|
|
|
|
|
2016-06-11 20:45:40 +02:00
|
|
|
import org.json.JSONObject;
|
|
|
|
|
2016-07-12 17:56:01 +02:00
|
|
|
import java.util.Date;
|
|
|
|
|
2016-06-24 17:16:17 +02:00
|
|
|
import info.nightscout.androidaps.data.PumpEnactResult;
|
2016-06-19 20:06:00 +02:00
|
|
|
import info.nightscout.androidaps.db.TempBasal;
|
2017-02-17 13:18:36 +01:00
|
|
|
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
|
2016-06-11 20:45:40 +02:00
|
|
|
|
2016-06-05 01:40:35 +02:00
|
|
|
/**
|
|
|
|
* Created by mike on 04.06.2016.
|
|
|
|
*/
|
2016-06-14 23:45:55 +02:00
|
|
|
public interface PumpInterface {
|
2016-06-11 20:45:40 +02:00
|
|
|
|
2016-11-10 23:32:58 +01:00
|
|
|
boolean isInitialized();
|
2017-02-12 19:51:13 +01:00
|
|
|
boolean isSuspended();
|
|
|
|
boolean isBusy();
|
2016-11-10 23:32:58 +01:00
|
|
|
|
2016-06-11 20:45:40 +02:00
|
|
|
boolean isTempBasalInProgress();
|
|
|
|
boolean isExtendedBoluslInProgress();
|
2016-06-05 01:40:35 +02:00
|
|
|
|
2016-06-13 22:53:41 +02:00
|
|
|
// Upload to pump new basal profile
|
2016-12-25 14:26:41 +01:00
|
|
|
int SUCCESS = 0;
|
|
|
|
int FAILED = 1;
|
|
|
|
int NOT_NEEDED = 2;
|
|
|
|
int setNewBasalProfile(NSProfile profile);
|
2016-12-24 23:53:17 +01:00
|
|
|
boolean isThisProfileSet(NSProfile profile);
|
2016-06-11 20:45:40 +02:00
|
|
|
|
2017-01-29 11:11:07 +01:00
|
|
|
Date lastStatusTime();
|
|
|
|
void updateStatus(String reason);
|
|
|
|
|
2016-06-11 20:45:40 +02:00
|
|
|
double getBaseBasalRate(); // base basal rate, not temp basal
|
|
|
|
double getTempBasalAbsoluteRate();
|
|
|
|
double getTempBasalRemainingMinutes();
|
2016-07-12 17:56:01 +02:00
|
|
|
TempBasal getTempBasal(Date time);
|
2016-06-19 20:06:00 +02:00
|
|
|
TempBasal getTempBasal();
|
2016-06-24 17:16:17 +02:00
|
|
|
TempBasal getExtendedBolus();
|
2016-06-11 20:45:40 +02:00
|
|
|
|
2016-08-04 09:17:26 +02:00
|
|
|
PumpEnactResult deliverTreatment(Double insulin, Integer carbs, Context context);
|
|
|
|
void stopBolusDelivering();
|
2016-06-24 17:16:17 +02:00
|
|
|
PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes);
|
|
|
|
PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes);
|
|
|
|
PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes);
|
|
|
|
PumpEnactResult cancelTempBasal();
|
|
|
|
PumpEnactResult cancelExtendedBolus();
|
2016-06-10 18:50:46 +02:00
|
|
|
|
2016-06-14 23:45:55 +02:00
|
|
|
// Status to be passed to NS
|
2016-06-11 20:45:40 +02:00
|
|
|
JSONObject getJSONStatus();
|
2016-06-24 17:16:17 +02:00
|
|
|
String deviceID();
|
2016-12-08 15:21:16 +01:00
|
|
|
|
|
|
|
PumpDescription getPumpDescription();
|
2017-02-13 00:15:02 +01:00
|
|
|
|
|
|
|
public String shortStatus(boolean veryShort);
|
2016-06-05 01:40:35 +02:00
|
|
|
}
|