comboctl-base: Handle ext/multiwave bolus in PumpIO.deliverCMDStandardBolus
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
This commit is contained in:
parent
05674ba552
commit
83dce8bee3
1 changed files with 20 additions and 2 deletions
|
@ -1012,11 +1012,29 @@ class PumpIO(
|
|||
* of a packet's payload does not match the expected size.
|
||||
* @throws ComboIOException if IO with the pump fails.
|
||||
*/
|
||||
suspend fun deliverCMDStandardBolus(bolusAmount: Int): Boolean =
|
||||
suspend fun deliverCMDStandardBolus(totalBolusAmount: Int): Boolean =
|
||||
deliverCMDStandardBolus(
|
||||
totalBolusAmount,
|
||||
immediateBolusAmount = 0,
|
||||
durationInMinutes = 0,
|
||||
bolusType = ApplicationLayer.CMDDeliverBolusType.STANDARD_BOLUS
|
||||
)
|
||||
|
||||
suspend fun deliverCMDStandardBolus(
|
||||
totalBolusAmount: Int,
|
||||
immediateBolusAmount: Int,
|
||||
durationInMinutes: Int,
|
||||
bolusType: ApplicationLayer.CMDDeliverBolusType
|
||||
): Boolean =
|
||||
runPumpIOCall("deliver standard bolus", Mode.COMMAND) {
|
||||
|
||||
val packet = sendPacketWithResponse(
|
||||
ApplicationLayer.createCMDDeliverBolusPacket(bolusAmount),
|
||||
ApplicationLayer.createCMDDeliverBolusPacket(
|
||||
totalBolusAmount,
|
||||
immediateBolusAmount,
|
||||
durationInMinutes,
|
||||
bolusType
|
||||
),
|
||||
ApplicationLayer.Command.CMD_DELIVER_BOLUS_RESPONSE
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue