diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.kt index 602acf6bba..43802833c5 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpInterface.kt @@ -12,6 +12,9 @@ import info.nightscout.androidaps.utils.TimeChangeType import org.json.JSONObject /** + * This interface defines the communication from AAPS-core to pump drivers. + * Pump drivers communicate data changes back to AAPS-core using {@link info.nightscout.androidaps.interfaces.PumpSync}. + * * Created by mike on 04.06.2016. */ interface PumpInterface { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt index a94d82ac28..c76312df87 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt @@ -3,6 +3,22 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +/** + * This interface allows pump drivers to push data changes (creation and update of treatments) back to AAPS-core. + * + * Intended use cases for handling bolus treatments: + * + * - for pumps that have a reliable history that can be read and which therefore issue a bolus on the pump, + * read the history back and add new bolus entries on the pump, the method [syncBolusWithPumpId] + * are used to inform AAPS-core of a new bolus. + * [VirtualPumpPlugin](info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin) is a pump driver that + * takes this approach. + * - for pumps that don't support history or take rather long to complete a bolus, the methods + * [addBolusWithTempId] and [syncBolusWithTempId] provide a mechanism to notify AAPS-core of a started + * bolus, so AAPS-core can operate under the assumption the bolus will be delivered and effect IOB until delivery + * completed. Upon completion, the pump driver will call the second method to turn a temporary bolus into a finished + * bolus. + */ interface PumpSync { /** * Create bolus with temporary id