AndroidAPS/app/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.java

106 lines
3.1 KiB
Java
Raw Normal View History

2016-06-14 23:45:55 +02:00
package info.nightscout.androidaps.interfaces;
2016-06-05 01:40:35 +02:00
2016-06-11 20:45:40 +02:00
import org.json.JSONObject;
import java.util.List;
2019-12-30 00:53:44 +01:00
import javax.annotation.Nullable;
2017-05-29 21:45:59 +02:00
import info.nightscout.androidaps.data.DetailedBolusInfo;
2017-06-02 10:25:49 +02:00
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
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
boolean isInitialized(); // true if pump status has been read and is ready to accept commands
2019-07-27 19:56:07 +02:00
boolean isSuspended(); // true if suspended (not delivering insulin)
2019-07-27 19:56:07 +02:00
boolean isBusy(); // if true pump is not ready to accept commands right now
2019-07-27 19:56:07 +02:00
boolean isConnected(); // true if BT connection is established
2019-07-27 19:56:07 +02:00
boolean isConnecting(); // true if BT connection is in progress
2019-07-27 19:56:07 +02:00
boolean isHandshakeInProgress(); // true if BT is connected but initial handshake is still in progress
2019-07-27 19:56:07 +02:00
void finishHandshaking(); // set initial handshake completed
2017-11-10 00:27:18 +01:00
void connect(String reason);
2019-07-27 19:56:07 +02:00
2017-11-10 00:27:18 +01:00
void disconnect(String reason);
2019-07-27 19:56:07 +02:00
2017-11-11 14:05:29 +01:00
void stopConnecting();
void getPumpStatus();
2016-06-13 22:53:41 +02:00
// Upload to pump new basal profile
2017-11-10 00:27:18 +01:00
PumpEnactResult setNewBasalProfile(Profile profile);
2019-07-27 19:56:07 +02:00
2017-06-02 10:25:49 +02:00
boolean isThisProfileSet(Profile profile);
2016-06-11 20:45:40 +02:00
2018-08-17 15:11:43 +02:00
long lastDataTime();
2017-01-29 11:11:07 +01:00
2016-06-11 20:45:40 +02:00
double getBaseBasalRate(); // base basal rate, not temp basal
2018-06-12 23:28:11 +02:00
double getReservoirLevel();
int getBatteryLevel(); // in percent as integer
2017-05-29 21:45:59 +02:00
PumpEnactResult deliverTreatment(DetailedBolusInfo detailedBolusInfo);
2019-07-27 19:56:07 +02:00
2016-08-04 09:17:26 +02:00
void stopBolusDelivering();
2019-07-27 19:56:07 +02:00
2018-03-20 22:09:22 +01:00
PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes, Profile profile, boolean enforceNew);
2019-07-27 19:56:07 +02:00
PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes, Profile profile, boolean enforceNew);
2019-07-27 19:56:07 +02:00
PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes);
2019-07-27 19:56:07 +02:00
//some pumps might set a very short temp close to 100% as cancelling a temp can be noisy
//when the cancel request is requested by the user (forced), the pump should always do a real cancel
2017-11-08 22:22:51 +01:00
PumpEnactResult cancelTempBasal(boolean enforceNew);
2019-07-27 19:56:07 +02:00
PumpEnactResult cancelExtendedBolus();
2016-06-10 18:50:46 +02:00
2016-06-14 23:45:55 +02:00
// Status to be passed to NS
JSONObject getJSONStatus(Profile profile, String profileName);
2019-07-27 19:56:07 +02:00
ManufacturerType manufacturer();
2019-07-27 19:56:07 +02:00
PumpType model();
2019-07-27 19:56:07 +02:00
2019-06-08 23:39:14 +02:00
String serialNumber();
2016-12-08 15:21:16 +01:00
2017-02-19 19:15:14 +01:00
// Pump capabilities
2016-12-08 15:21:16 +01:00
PumpDescription getPumpDescription();
2017-02-13 00:15:02 +01:00
2017-02-19 19:15:14 +01:00
// Short info for SMS, Wear etc
String shortStatus(boolean veryShort);
2017-05-12 17:30:52 +02:00
boolean isFakingTempsByExtendedBoluses();
2018-03-14 00:57:48 +01:00
PumpEnactResult loadTDDs();
2019-07-27 19:56:07 +02:00
boolean canHandleDST();
2019-12-30 00:53:44 +01:00
@Nullable
List<CustomAction> getCustomActions();
2019-02-20 23:57:31 +01:00
void executeCustomAction(CustomActionType customActionType);
/**
* This method will be called when time or Timezone changes, and pump driver can then do a specific action (for
* example update clock on pump).
*/
void timeDateOrTimeZoneChanged();
2016-06-05 01:40:35 +02:00
}