From f32d6055677c693b1f3351713fff20a1d3270f76 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Fri, 26 Feb 2021 02:34:30 +0100 Subject: [PATCH] Add OmnipodDashManager interface --- .../omnipod/dash/driver/OmnipodDashManager.kt | 27 ++++++++++++++++++- .../omnipod/dash/driver/pod/event/PodEvent.kt | 6 +++++ .../dash/driver/pod/event/PodEventType.kt | 9 +++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEvent.kt create mode 100644 omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEventType.kt diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt index d0c15d5107..1c4e63ea99 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt @@ -1,3 +1,28 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver -interface OmnipodDashManager \ No newline at end of file +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.event.PodEvent +import io.reactivex.Observable + +interface OmnipodDashManager { + + fun activatePodPart1(): Observable + + fun activatePodPart2(): Observable + + fun getStatus(): Observable + + fun setBasalProgram(program: BasalProgram): Observable + + fun suspendDelivery(): Observable + + fun setTime(): Observable + + fun setTempBasal(rate: Double, durationInMinutes: Short): Observable + + fun cancelTempBasal(): Observable + + fun bolus(amount: Double): Observable + + fun cancelBolus(): Observable +} \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEvent.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEvent.kt new file mode 100644 index 0000000000..db22203b11 --- /dev/null +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEvent.kt @@ -0,0 +1,6 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.event + +class PodEvent( + val type: PodEventType, + val data: Any? +) \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEventType.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEventType.kt new file mode 100644 index 0000000000..d8e564b72a --- /dev/null +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/event/PodEventType.kt @@ -0,0 +1,9 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.event + +enum class PodEventType { + CONNECTED, + COMMAND_SENDING, + COMMAND_SENT, + RESPONSE_RECEIVED, + // ... +} \ No newline at end of file