From dcf7672a24c05d783a9fcc48cdd798f9ff725abe Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sat, 27 Feb 2021 00:39:55 +0100 Subject: [PATCH] More cleanup after conversion --- .../dash/driver/OmnipodDashManagerImpl.kt | 28 ++-- .../omnipod/dash/driver/event/PodEvent.kt | 18 ++- .../omnipod/dash/driver/event/PodEventType.kt | 12 -- .../pod/command/ProgramAlertsCommand.kt | 5 +- .../driver/pod/command/ProgramBasalCommand.kt | 1 + .../driver/pod/command/ProgramBolusCommand.kt | 2 + .../pod/command/ProgramInsulinCommand.kt | 8 -- .../pod/command/ProgramTempBasalCommand.kt | 3 + .../driver/pod/command/SetUniqueIdCommand.kt | 1 + .../pod/command/SilenceAlertsCommand.kt | 1 + .../driver/pod/command/StopDeliveryCommand.kt | 2 + .../builder/HeaderEnabledCommandBuilder.kt | 1 + .../driver/pod/definition/BasalProgram.kt | 2 +- .../dash/driver/pod/definition/BeepType.kt | 8 +- .../pod/response/SetUniqueIdResponse.kt | 135 +++--------------- .../driver/pod/response/VersionResponse.kt | 90 ++---------- .../state/OmnipodDashPodStateManagerImpl.kt | 117 +++++++++------ .../pod/response/SetUniqueIdResponseTest.kt | 39 +++-- .../pod/response/VersionResponseTest.kt | 31 ++-- 19 files changed, 185 insertions(+), 319 deletions(-) delete mode 100644 omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEventType.kt diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt index 335ee0f372..3b3447003b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.OmnipodDashBleManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEvent -import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEventType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.GetVersionCommand import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.GetVersionCommand.Companion.DEFAULT_UNIQUE_ID import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.ActivationProgress @@ -31,25 +30,26 @@ class OmnipodDashManagerImpl @Inject constructor( return Observable.error(IllegalStateException("Pod is in an incorrect state")) } - private val observeConnectToPod: Observable = Observable.defer { - // TODO - // send CONNECTING event here - bleManager.connect() - Observable.just(PodEvent(PodEventType.CONNECTED, null)) - } + private val observeConnectToPod: Observable + get() { + return Observable.defer { + bleManager.connect() + Observable.just(PodEvent.Connected(0)) // TODO should be returned in BleManager + } + } override fun activatePodPart1(): Observable { - // TODO + val command = GetVersionCommand.Builder() // + .setSequenceNumber(podStateManager.messageSequenceNumber) // + .setUniqueId(DEFAULT_UNIQUE_ID) // + .build() + return Observable.concat( observePodReadyForActivationPart1, observeConnectToPod, Observable.defer { - bleManager.sendCommand(GetVersionCommand.Builder() // - .setSequenceNumber(podStateManager.messageSequenceNumber) // - .setUniqueId(DEFAULT_UNIQUE_ID) // - .build() - ) - Observable.just(PodEvent(PodEventType.COMMAND_SENT, null)) + bleManager.sendCommand(command) + Observable.just(PodEvent.CommandSent(command)) // TODO should be returned in BleManager } // ... Send more commands ) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt index c1fe5ace52..e5fe44fb00 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt @@ -1,8 +1,16 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event -import java.io.Serializable +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response + +sealed class PodEvent { + + object Scanning : PodEvent() + object Pairing : PodEvent() + object Connecting : PodEvent() + class Connected(val uniqueId: Int) : PodEvent() + class CommandSending(val command: Command) : PodEvent() + class CommandSent(val command: Command) : PodEvent() + class ResponseReceived(val response: Response) : PodEvent() +} -class PodEvent( - val type: PodEventType, - val data: Serializable? -) \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEventType.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEventType.kt deleted file mode 100644 index 15397610ee..0000000000 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEventType.kt +++ /dev/null @@ -1,12 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event - -enum class PodEventType { - SCANNING, - PAIRING, - CONNECTING, - CONNECTED, - COMMAND_SENDING, - COMMAND_SENT, - RESPONSE_RECEIVED, - // ... -} \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramAlertsCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramAlertsCommand.kt index 3ba15675f8..4f0424988b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramAlertsCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramAlertsCommand.kt @@ -11,7 +11,7 @@ class ProgramAlertsCommand private constructor( uniqueId: Int, sequenceNumber: Short, multiCommandFlag: Boolean, - alertConfigurations: List?, + alertConfigurations: List, nonce: Int ) : NonceEnabledCommand(CommandType.PROGRAM_ALERTS, uniqueId, sequenceNumber, multiCommandFlag, nonce) { @@ -52,6 +52,7 @@ class ProgramAlertsCommand private constructor( class Builder : NonceEnabledCommandBuilder() { private var alertConfigurations: List? = null + fun setAlertConfigurations(alertConfigurations: List?): Builder { this.alertConfigurations = alertConfigurations return this @@ -59,7 +60,7 @@ class ProgramAlertsCommand private constructor( override fun buildCommand(): ProgramAlertsCommand { requireNotNull(alertConfigurations) { "alertConfigurations can not be null" } // !!? - return ProgramAlertsCommand(uniqueId!!, sequenceNumber!!, multiCommandFlag, alertConfigurations, nonce!!) // TODO this might crash if not all are set + return ProgramAlertsCommand(uniqueId!!, sequenceNumber!!, multiCommandFlag, alertConfigurations!!, nonce!!) // TODO this might crash if not all are set } } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBasalCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBasalCommand.kt index 3495f94566..5758fe9377 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBasalCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBasalCommand.kt @@ -76,6 +76,7 @@ class ProgramBasalCommand private constructor( private var basalProgram: BasalProgram? = null private var programReminder: ProgramReminder? = null private var currentTime: Date? = null + fun setBasalProgram(basalProgram: BasalProgram?): Builder { this.basalProgram = basalProgram return this diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBolusCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBolusCommand.kt index 79d57534a0..c6bbfcfb72 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBolusCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramBolusCommand.kt @@ -57,6 +57,7 @@ class ProgramBolusCommand private constructor( private var numberOfUnits: Double? = null private var delayBetweenPulsesInEighthSeconds: Byte? = null private var programReminder: ProgramReminder? = null + fun setNumberOfUnits(numberOfUnits: Double): Builder { require(numberOfUnits > 0.0) { "Number of units should be greater than zero" } require((numberOfUnits * 1000).toInt() % 50 == 0) { "Number of units must be dividable by 0.05" } @@ -78,6 +79,7 @@ class ProgramBolusCommand private constructor( requireNotNull(numberOfUnits) { "numberOfUnits can not be null" } requireNotNull(delayBetweenPulsesInEighthSeconds) { "delayBetweenPulsesInEighthSeconds can not be null" } requireNotNull(programReminder) { "programReminder can not be null" } + val numberOfPulses = Math.round(numberOfUnits!! * 20).toShort() val byte10And11 = (numberOfPulses * delayBetweenPulsesInEighthSeconds!!).toShort() val interlockCommand = ProgramInsulinCommand(uniqueId!!, sequenceNumber!!, multiCommandFlag, nonce!!, listOf(BolusShortInsulinProgramElement(numberOfPulses)), calculateChecksum(0x01.toByte(), byte10And11, numberOfPulses), diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramInsulinCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramInsulinCommand.kt index eb41e68bda..0020407056 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramInsulinCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramInsulinCommand.kt @@ -34,14 +34,6 @@ class ProgramInsulinCommand internal constructor( } } - fun calculateChecksum(bytes: ByteArray): Short { - var sum: Short = 0 - for (b in bytes) { - sum = ((b.toInt() and 0xff) + sum).toShort() - } - return sum - } - override val encoded: ByteArray get() { val buffer = ByteBuffer.allocate(getLength().toInt()) // diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramTempBasalCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramTempBasalCommand.kt index 37c4597ae9..229138dd2d 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramTempBasalCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/ProgramTempBasalCommand.kt @@ -31,6 +31,7 @@ class ProgramTempBasalCommand private constructor( private var programReminder: ProgramReminder? = null private var rateInUnitsPerHour: Double? = null private var durationInMinutes: Short? = null + fun setProgramReminder(programReminder: ProgramReminder?): Builder { this.programReminder = programReminder return this @@ -43,6 +44,7 @@ class ProgramTempBasalCommand private constructor( fun setDurationInMinutes(durationInMinutes: Short): Builder { require(durationInMinutes % 30 == 0) { "durationInMinutes must be dividable by 30" } + this.durationInMinutes = durationInMinutes return this } @@ -51,6 +53,7 @@ class ProgramTempBasalCommand private constructor( requireNotNull(programReminder) { "programReminder can not be null" } requireNotNull(rateInUnitsPerHour) { "rateInUnitsPerHour can not be null" } requireNotNull(durationInMinutes) { "durationInMinutes can not be null" } + val durationInSlots = (durationInMinutes!! / 30).toByte() val pulsesPerSlot = ProgramTempBasalUtil.mapTempBasalToPulsesPerSlot(durationInSlots, rateInUnitsPerHour!!) val tenthPulsesPerSlot = ProgramTempBasalUtil.mapTempBasalToTenthPulsesPerSlot(durationInSlots.toInt(), rateInUnitsPerHour!!) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SetUniqueIdCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SetUniqueIdCommand.kt index 83c0fbc6f4..965f9a3de3 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SetUniqueIdCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SetUniqueIdCommand.kt @@ -45,6 +45,7 @@ class SetUniqueIdCommand private constructor( private var lotNumber: Int? = null private var podSequenceNumber: Int? = null private var initializationTime: Date? = null + fun setLotNumber(lotNumber: Int): Builder { this.lotNumber = lotNumber return this diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommand.kt index d9c32e8f7a..e838c89395 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommand.kt @@ -63,6 +63,7 @@ class SilenceAlertsCommand private constructor( private var silenceSuspendInProgressAlert = false private var silenceSuspendEndedAlert = false private var silencePodExpirationAlert = false + fun setSilenceAutoOffAlert(silenceAutoOffAlert: Boolean): Builder { this.silenceAutoOffAlert = silenceAutoOffAlert return this diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/StopDeliveryCommand.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/StopDeliveryCommand.kt index e941909a66..254fd8edf3 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/StopDeliveryCommand.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/StopDeliveryCommand.kt @@ -57,6 +57,7 @@ class StopDeliveryCommand private constructor( private var deliveryType: DeliveryType? = null private var beepType: BeepType? = BeepType.LONG_SINGLE_BEEP + fun setDeliveryType(deliveryType: DeliveryType?): Builder { this.deliveryType = deliveryType return this @@ -70,6 +71,7 @@ class StopDeliveryCommand private constructor( override fun buildCommand(): StopDeliveryCommand { requireNotNull(deliveryType) { "deliveryType can not be null" } requireNotNull(beepType) { "beepType can not be null" } + return StopDeliveryCommand(uniqueId!!, sequenceNumber!!, multiCommandFlag, deliveryType!!, beepType!!, nonce!!) } } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/base/builder/HeaderEnabledCommandBuilder.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/base/builder/HeaderEnabledCommandBuilder.kt index 27dcf630e4..f6fc7151b8 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/base/builder/HeaderEnabledCommandBuilder.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/base/builder/HeaderEnabledCommandBuilder.kt @@ -8,6 +8,7 @@ abstract class HeaderEnabledCommandBuilder protected var uniqueId: Int? = null protected var sequenceNumber: Short? = null protected var multiCommandFlag = false + override fun build(): R { requireNotNull(uniqueId) { "uniqueId can not be null" } requireNotNull(sequenceNumber) { "sequenceNumber can not be null" } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt index 45bbc93b3d..ef8f764f91 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt @@ -7,7 +7,7 @@ class BasalProgram( ) { val segments: MutableList = segments.toMutableList() - get() = Collections.unmodifiableList(field) // TODO Adrian: moved method here + get() = Collections.unmodifiableList(field) fun addSegment(segment: Segment) { segments.add(segment) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt index adcf4a9a5b..d997663b6f 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt @@ -1,10 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition -enum class BeepType( // Used in stop delivery command - val value: Byte -) { +enum class BeepType(val value: Byte) { SILENT(0x00.toByte()), - FOUR_TIMES_BIP_BEEP(0x02.toByte()), // Used in low reservoir alert, user expiration alert, expiration alert, imminent expiration alert, lump of coal alert - LONG_SINGLE_BEEP(0x06.toByte()); + FOUR_TIMES_BIP_BEEP(0x02.toByte()), // Used in low reservoir alert, user expiration alert, expiration alert, imminent expiration alert, lump of coal alert + LONG_SINGLE_BEEP(0x06.toByte()); // Used in stop delivery command } \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponse.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponse.kt index 0321f8b912..e91b750a6a 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponse.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponse.kt @@ -9,101 +9,25 @@ class SetUniqueIdResponse( encoded: ByteArray ) : ActivationResponseBase(ActivationResponseType.SET_UNIQUE_ID_RESPONSE, encoded) { - private val messageType: Byte // TODO directly assign here - private val messageLength: Short - private val pulseVolumeInTenThousandthMicroLiter: Short - private val pumpRate: Short - private val primePumpRate: Short - private val numberOfEngagingClutchDrivePulses: Short - private val numberOfPrimePulses: Short - private val podExpirationTimeInHours: Short - private val firmwareVersionMajor: Short - private val firmwareVersionMinor: Short - private val firmwareVersionInterim: Short - private val bleVersionMajor: Short - private val bleVersionMinor: Short - private val bleVersionInterim: Short - private val productId: Short - private val podStatus: PodStatus - private val lotNumber: Long - private val podSequenceNumber: Long - private val uniqueIdReceivedInCommand: Long - - fun getMessageType(): Byte { - return messageType - } - - fun getMessageLength(): Short { // TODO value getters - return messageLength - } - - fun getPulseVolumeInTenThousandthMicroLiter(): Short { - return pulseVolumeInTenThousandthMicroLiter - } - - fun getDeliveryRate(): Short { - return pumpRate - } - - fun getPrimeRate(): Short { - return primePumpRate - } - - fun getNumberOfEngagingClutchDrivePulses(): Short { - return numberOfEngagingClutchDrivePulses - } - - fun getNumberOfPrimePulses(): Short { - return numberOfPrimePulses - } - - fun getPodExpirationTimeInHours(): Short { - return podExpirationTimeInHours - } - - fun getFirmwareVersionMajor(): Short { - return firmwareVersionMajor - } - - fun getFirmwareVersionMinor(): Short { - return firmwareVersionMinor - } - - fun getFirmwareVersionInterim(): Short { - return firmwareVersionInterim - } - - fun getBleVersionMajor(): Short { - return bleVersionMajor - } - - fun getBleVersionMinor(): Short { - return bleVersionMinor - } - - fun getBleVersionInterim(): Short { - return bleVersionInterim - } - - fun getProductId(): Short { - return productId - } - - fun getPodStatus(): PodStatus { - return podStatus - } - - fun getLotNumber(): Long { - return lotNumber - } - - fun getPodSequenceNumber(): Long { - return podSequenceNumber - } - - fun getUniqueIdReceivedInCommand(): Long { - return uniqueIdReceivedInCommand - } + val messageType: Byte = encoded[0] + val messageLength: Short = (encoded[1].toInt() and 0xff).toShort() + val pulseVolumeInTenThousandthMicroLiter: Short = ByteBuffer.wrap(byteArrayOf(encoded[2], encoded[3])).short + val pumpRate: Short = (encoded[4].toInt() and 0xff).toShort() + val primePumpRate: Short = (encoded[5].toInt() and 0xff).toShort() + val numberOfEngagingClutchDrivePulses: Short = (encoded[6].toInt() and 0xff).toShort() + val numberOfPrimePulses: Short = (encoded[7].toInt() and 0xff).toShort() + val podExpirationTimeInHours: Short = (encoded[8].toInt() and 0xff).toShort() + val firmwareVersionMajor: Short = (encoded[9].toInt() and 0xff).toShort() + val firmwareVersionMinor: Short = (encoded[10].toInt() and 0xff).toShort() + val firmwareVersionInterim: Short = (encoded[11].toInt() and 0xff).toShort() + val bleVersionMajor: Short = (encoded[12].toInt() and 0xff).toShort() + val bleVersionMinor: Short = (encoded[13].toInt() and 0xff).toShort() + val bleVersionInterim: Short = (encoded[14].toInt() and 0xff).toShort() + val productId: Short = (encoded[15].toInt() and 0xff).toShort() + val podStatus: PodStatus = byValue(encoded[16], PodStatus.UNKNOWN) + val lotNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[17], encoded[18], encoded[19], encoded[20])).long + val podSequenceNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[21], encoded[22], encoded[23], encoded[24])).long + val uniqueIdReceivedInCommand: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[25], encoded[26], encoded[27], encoded[28])).long override fun toString(): String { return "SetUniqueIdResponse{" + @@ -132,25 +56,4 @@ class SetUniqueIdResponse( '}' } - init { - messageType = encoded[0] - messageLength = (encoded[1].toInt() and 0xff).toShort() - pulseVolumeInTenThousandthMicroLiter = ByteBuffer.wrap(byteArrayOf(encoded[2], encoded[3])).short - pumpRate = (encoded[4].toInt() and 0xff).toShort() - primePumpRate = (encoded[5].toInt() and 0xff).toShort() - numberOfEngagingClutchDrivePulses = (encoded[6].toInt() and 0xff).toShort() - numberOfPrimePulses = (encoded[7].toInt() and 0xff).toShort() - podExpirationTimeInHours = (encoded[8].toInt() and 0xff).toShort() - firmwareVersionMajor = (encoded[9].toInt() and 0xff).toShort() - firmwareVersionMinor = (encoded[10].toInt() and 0xff).toShort() - firmwareVersionInterim = (encoded[11].toInt() and 0xff).toShort() - bleVersionMajor = (encoded[12].toInt() and 0xff).toShort() - bleVersionMinor = (encoded[13].toInt() and 0xff).toShort() - bleVersionInterim = (encoded[14].toInt() and 0xff).toShort() - productId = (encoded[15].toInt() and 0xff).toShort() - podStatus = byValue(encoded[16], PodStatus.UNKNOWN) - lotNumber = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[17], encoded[18], encoded[19], encoded[20])).long - podSequenceNumber = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[21], encoded[22], encoded[23], encoded[24])).long - uniqueIdReceivedInCommand = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[25], encoded[26], encoded[27], encoded[28])).long - } } \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponse.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponse.kt index 8b06c96c4b..243c191efb 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponse.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponse.kt @@ -11,81 +11,21 @@ class VersionResponse( encoded: ByteArray ) : ActivationResponseBase(ActivationResponseType.GET_VERSION_RESPONSE, encoded) { - private val messageType: Byte = encoded[0] - private val messageLength: Short = (encoded[1].toInt() and 0xff).toShort() - private val firmwareVersionMajor: Short = (encoded[2].toInt() and 0xff).toShort() - private val firmwareVersionMinor: Short = (encoded[3].toInt() and 0xff).toShort() - private val firmwareVersionInterim: Short = (encoded[4].toInt() and 0xff).toShort() - private val bleVersionMajor: Short = (encoded[5].toInt() and 0xff).toShort() - private val bleVersionMinor: Short = (encoded[6].toInt() and 0xff).toShort() - private val bleVersionInterim: Short = (encoded[7].toInt() and 0xff).toShort() - private val productId: Short = (encoded[8].toInt() and 0xff).toShort() - private val podStatus: PodStatus = byValue((encoded[9] and 0xf), PodStatus.UNKNOWN) - private val lotNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[10], encoded[11], encoded[12], encoded[13])).long - private val podSequenceNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[14], encoded[15], encoded[16], encoded[17])).long - private val rssi: Byte = (encoded[18] and 0x3f) - private val receiverLowerGain: Byte = ((encoded[18].toInt() shr 6 and 0x03).toByte()) - private val uniqueIdReceivedInCommand: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[19], encoded[20], encoded[21], encoded[22])).long - - fun getMessageType(): Byte { - return messageType - } - - fun getMessageLength(): Short { - return messageLength - } - - fun getFirmwareVersionMajor(): Short { - return firmwareVersionMajor - } - - fun getFirmwareVersionMinor(): Short { - return firmwareVersionMinor - } - - fun getFirmwareVersionInterim(): Short { - return firmwareVersionInterim - } - - fun getBleVersionMajor(): Short { - return bleVersionMajor - } - - fun getBleVersionMinor(): Short { - return bleVersionMinor - } - - fun getBleVersionInterim(): Short { - return bleVersionInterim - } - - fun getProductId(): Short { - return productId - } - - fun getPodStatus(): PodStatus { - return podStatus - } - - fun getLotNumber(): Long { - return lotNumber - } - - fun getPodSequenceNumber(): Long { - return podSequenceNumber - } - - fun getRssi(): Byte { - return rssi - } - - fun getReceiverLowerGain(): Byte { - return receiverLowerGain - } - - fun getUniqueIdReceivedInCommand(): Long { - return uniqueIdReceivedInCommand - } + val messageType: Byte = encoded[0] + val messageLength: Short = (encoded[1].toInt() and 0xff).toShort() + val firmwareVersionMajor: Short = (encoded[2].toInt() and 0xff).toShort() + val firmwareVersionMinor: Short = (encoded[3].toInt() and 0xff).toShort() + val firmwareVersionInterim: Short = (encoded[4].toInt() and 0xff).toShort() + val bleVersionMajor: Short = (encoded[5].toInt() and 0xff).toShort() + val bleVersionMinor: Short = (encoded[6].toInt() and 0xff).toShort() + val bleVersionInterim: Short = (encoded[7].toInt() and 0xff).toShort() + val productId: Short = (encoded[8].toInt() and 0xff).toShort() + val podStatus: PodStatus = byValue((encoded[9] and 0xf), PodStatus.UNKNOWN) + val lotNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[10], encoded[11], encoded[12], encoded[13])).long + val podSequenceNumber: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[14], encoded[15], encoded[16], encoded[17])).long + val rssi: Byte = (encoded[18] and 0x3f) + val receiverLowerGain: Byte = ((encoded[18].toInt() shr 6 and 0x03).toByte()) + val uniqueIdReceivedInCommand: Long = ByteBuffer.wrap(byteArrayOf(0, 0, 0, 0, encoded[19], encoded[20], encoded[21], encoded[22])).long override fun toString(): String { return "VersionResponse{" + diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index a223b7099a..5fd48d82b4 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -36,14 +36,18 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( // TODO: dynamic get() fun instead of assignment - override val isUniqueIdSet: Boolean = activationProgress.isAtLeast(ActivationProgress.SET_UNIQUE_ID) + override val isUniqueIdSet: Boolean + get() = activationProgress.isAtLeast(ActivationProgress.SET_UNIQUE_ID) - override val isActivationCompleted: Boolean = activationProgress == ActivationProgress.COMPLETED + override val isActivationCompleted: Boolean + get() = activationProgress == ActivationProgress.COMPLETED - override val isSuspended: Boolean = podState.deliveryStatus?.equals(DeliveryStatus.SUSPENDED) - ?: true + override val isSuspended: Boolean + get() = podState.deliveryStatus?.equals(DeliveryStatus.SUSPENDED) + ?: true - override val isPodRunning: Boolean = podState.podStatus?.isRunning() ?: false + override val isPodRunning: Boolean + get() = podState.podStatus?.isRunning() ?: false override var lastConnection: Long get() = podState.lastConnection @@ -52,54 +56,77 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( store() } - override val lastUpdated: Long = podState.lastUpdated + override val lastUpdated: Long + get() = podState.lastUpdated - override val messageSequenceNumber: Short = podState.messageSequenceNumber + override val messageSequenceNumber: Short + get() = podState.messageSequenceNumber - override val sequenceNumberOfLastProgrammingCommand: Short? = podState.sequenceNumberOfLastProgrammingCommand + override val sequenceNumberOfLastProgrammingCommand: Short? + get() = podState.sequenceNumberOfLastProgrammingCommand - override val activationTime: Long? = podState.activationTime + override val activationTime: Long? + get() = podState.activationTime - override val uniqueId: Long? = podState.uniqueId + override val uniqueId: Long? + get() = podState.uniqueId - override val bluetoothAddress: String? = podState.bluetoothAddress + override val bluetoothAddress: String? + get() = podState.bluetoothAddress - override val bluetoothVersion: SoftwareVersion? = podState.bleVersion + override val bluetoothVersion: SoftwareVersion? + get() = podState.bleVersion - override val firmwareVersion: SoftwareVersion? = podState.firmwareVersion + override val firmwareVersion: SoftwareVersion? + get() = podState.firmwareVersion - override val lotNumber: Long? = podState.lotNumber + override val lotNumber: Long? + get() = podState.lotNumber - override val podSequenceNumber: Long? = podState.podSequenceNumber + override val podSequenceNumber: Long? + get() = podState.podSequenceNumber - override val pulseRate: Short? = podState.pulseRate + override val pulseRate: Short? + get() = podState.pulseRate - override val primePulseRate: Short? = podState.primePulseRate + override val primePulseRate: Short? + get() = podState.primePulseRate - override val podLifeInHours: Short? = podState.podLifeInHours + override val podLifeInHours: Short? + get() = podState.podLifeInHours - override val firstPrimeBolusVolume: Short? = podState.firstPrimeBolusVolume + override val firstPrimeBolusVolume: Short? + get() = podState.firstPrimeBolusVolume - override val secondPrimeBolusVolume: Short? = podState.secondPrimeBolusVolume + override val secondPrimeBolusVolume: Short? + get() = podState.secondPrimeBolusVolume - override val pulsesDelivered: Short? = podState.pulsesDelivered + override val pulsesDelivered: Short? + get() = podState.pulsesDelivered - override val pulsesRemaining: Short? = podState.pulsesRemaining + override val pulsesRemaining: Short? + get() = podState.pulsesRemaining - override val podStatus: PodStatus? = podState.podStatus + override val podStatus: PodStatus? + get() = podState.podStatus - override val deliveryStatus: DeliveryStatus? = podState.deliveryStatus + override val deliveryStatus: DeliveryStatus? + get() = podState.deliveryStatus - override val minutesSinceActivation: Short? = podState.minutesSinceActivation + override val minutesSinceActivation: Short? + get() = podState.minutesSinceActivation - override val activeAlerts: EnumSet? = podState.activeAlerts + override val activeAlerts: EnumSet? + get() = podState.activeAlerts - override val tempBasal: OmnipodDashPodStateManager.TempBasal? = podState.tempBasal + override val tempBasal: OmnipodDashPodStateManager.TempBasal? + get() = podState.tempBasal override val tempBasalActive: Boolean - get() = tempBasal != null && tempBasal.startTime + tempBasal.durationInMinutes * 60 * 1000 > System.currentTimeMillis() + get() = tempBasal != null && tempBasal!!.startTime + tempBasal!!.durationInMinutes * 60 * 1000 > System.currentTimeMillis() - override val basalProgram: BasalProgram? = podState.basalProgram + override val basalProgram: BasalProgram? + get() = podState.basalProgram override fun increaseMessageSequenceNumber() { podState.messageSequenceNumber = ((podState.messageSequenceNumber.toInt() + 1) and 0x0f).toShort() @@ -121,28 +148,28 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( } override fun updateFromVersionResponse(response: VersionResponse) { - podState.bleVersion = SoftwareVersion(response.getBleVersionMajor(), response.getBleVersionMinor(), response.getBleVersionInterim()) - podState.firmwareVersion = SoftwareVersion(response.getFirmwareVersionMajor(), response.getFirmwareVersionMinor(), response.getFirmwareVersionInterim()) - podState.podStatus = response.getPodStatus() - podState.lotNumber = response.getLotNumber() - podState.podSequenceNumber = response.getPodSequenceNumber() + podState.bleVersion = SoftwareVersion(response.bleVersionMajor, response.bleVersionMinor, response.bleVersionInterim) + podState.firmwareVersion = SoftwareVersion(response.firmwareVersionMajor, response.firmwareVersionMinor, response.firmwareVersionInterim) + podState.podStatus = response.podStatus + podState.lotNumber = response.lotNumber + podState.podSequenceNumber = response.podSequenceNumber podState.lastUpdated = System.currentTimeMillis() store() } override fun updateFromSetUniqueIdResponse(response: SetUniqueIdResponse) { - podState.pulseRate = response.getDeliveryRate() - podState.primePulseRate = response.getPrimeRate() - podState.firstPrimeBolusVolume = response.getNumberOfPrimePulses() - podState.secondPrimeBolusVolume = response.getNumberOfEngagingClutchDrivePulses() - podState.podLifeInHours = response.getPodExpirationTimeInHours() - podState.bleVersion = SoftwareVersion(response.getBleVersionMajor(), response.getBleVersionMinor(), response.getBleVersionInterim()) - podState.firmwareVersion = SoftwareVersion(response.getFirmwareVersionMajor(), response.getFirmwareVersionMinor(), response.getFirmwareVersionInterim()) - podState.podStatus = response.getPodStatus() - podState.lotNumber = response.getLotNumber() - podState.podSequenceNumber = response.getPodSequenceNumber() - podState.uniqueId = response.getUniqueIdReceivedInCommand() + podState.pulseRate = response.pumpRate + podState.primePulseRate = response.primePumpRate + podState.firstPrimeBolusVolume = response.numberOfPrimePulses + podState.secondPrimeBolusVolume = response.numberOfEngagingClutchDrivePulses + podState.podLifeInHours = response.podExpirationTimeInHours + podState.bleVersion = SoftwareVersion(response.bleVersionMajor, response.bleVersionMinor, response.bleVersionInterim) + podState.firmwareVersion = SoftwareVersion(response.firmwareVersionMajor, response.firmwareVersionMinor, response.firmwareVersionInterim) + podState.podStatus = response.podStatus + podState.lotNumber = response.lotNumber + podState.podSequenceNumber = response.podSequenceNumber + podState.uniqueId = response.uniqueIdReceivedInCommand podState.lastUpdated = System.currentTimeMillis() store() diff --git a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponseTest.kt b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponseTest.kt index fa0d1dac73..6f627c5d80 100644 --- a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponseTest.kt +++ b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/SetUniqueIdResponseTest.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodStatus -import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.ResponseType import org.apache.commons.codec.DecoderException import org.apache.commons.codec.binary.Hex import org.junit.Assert @@ -17,24 +16,24 @@ class SetUniqueIdResponseTest { Assert.assertNotSame(encoded, response.encoded) Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE, response.responseType) Assert.assertEquals(ResponseType.ActivationResponseType.SET_UNIQUE_ID_RESPONSE, response.activationResponseType) - Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE.value, response.getMessageType()) - Assert.assertEquals(27.toShort(), response.getMessageLength()) - Assert.assertEquals(5000.toShort(), response.getPulseVolumeInTenThousandthMicroLiter()) - Assert.assertEquals(16.toShort(), response.getDeliveryRate()) - Assert.assertEquals(8.toShort(), response.getPrimeRate()) - Assert.assertEquals(52.toShort(), response.getNumberOfEngagingClutchDrivePulses()) - Assert.assertEquals(10.toShort(), response.getNumberOfPrimePulses()) - Assert.assertEquals(80.toShort(), response.getPodExpirationTimeInHours()) - Assert.assertEquals(4.toShort(), response.getFirmwareVersionMajor()) - Assert.assertEquals(10.toShort(), response.getFirmwareVersionMinor()) - Assert.assertEquals(0.toShort(), response.getFirmwareVersionInterim()) - Assert.assertEquals(1.toShort(), response.getBleVersionMajor()) - Assert.assertEquals(3.toShort(), response.getBleVersionMinor()) - Assert.assertEquals(0.toShort(), response.getBleVersionInterim()) - Assert.assertEquals(4.toShort(), response.getProductId()) - Assert.assertEquals(PodStatus.UID_SET, response.getPodStatus()) - Assert.assertEquals(135556289L, response.getLotNumber()) - Assert.assertEquals(611540L, response.getPodSequenceNumber()) - Assert.assertEquals(37879809L, response.getUniqueIdReceivedInCommand()) + Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE.value, response.messageType) + Assert.assertEquals(27.toShort(), response.messageLength) + Assert.assertEquals(5000.toShort(), response.pulseVolumeInTenThousandthMicroLiter) + Assert.assertEquals(16.toShort(), response.pumpRate) + Assert.assertEquals(8.toShort(), response.primePumpRate) + Assert.assertEquals(52.toShort(), response.numberOfEngagingClutchDrivePulses) + Assert.assertEquals(10.toShort(), response.numberOfPrimePulses) + Assert.assertEquals(80.toShort(), response.podExpirationTimeInHours) + Assert.assertEquals(4.toShort(), response.firmwareVersionMajor) + Assert.assertEquals(10.toShort(), response.firmwareVersionMinor) + Assert.assertEquals(0.toShort(), response.firmwareVersionInterim) + Assert.assertEquals(1.toShort(), response.bleVersionMajor) + Assert.assertEquals(3.toShort(), response.bleVersionMinor) + Assert.assertEquals(0.toShort(), response.bleVersionInterim) + Assert.assertEquals(4.toShort(), response.productId) + Assert.assertEquals(PodStatus.UID_SET, response.podStatus) + Assert.assertEquals(135556289L, response.lotNumber) + Assert.assertEquals(611540L, response.podSequenceNumber) + Assert.assertEquals(37879809L, response.uniqueIdReceivedInCommand) } } \ No newline at end of file diff --git a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponseTest.kt b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponseTest.kt index 32612070fd..2ae37834d1 100644 --- a/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponseTest.kt +++ b/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/response/VersionResponseTest.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodStatus -import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.ResponseType import org.apache.commons.codec.DecoderException import org.apache.commons.codec.binary.Hex import org.junit.Assert @@ -17,20 +16,20 @@ class VersionResponseTest { Assert.assertNotSame(encoded, response.encoded) Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE, response.responseType) Assert.assertEquals(ResponseType.ActivationResponseType.GET_VERSION_RESPONSE, response.activationResponseType) - Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE.value, response.getMessageType()) - Assert.assertEquals(21.toShort(), response.getMessageLength()) - Assert.assertEquals(4.toShort(), response.getFirmwareVersionMajor()) - Assert.assertEquals(10.toShort(), response.getFirmwareVersionMinor()) - Assert.assertEquals(0.toShort(), response.getFirmwareVersionInterim()) - Assert.assertEquals(1.toShort(), response.getBleVersionMajor()) - Assert.assertEquals(3.toShort(), response.getBleVersionMinor()) - Assert.assertEquals(0.toShort(), response.getBleVersionInterim()) - Assert.assertEquals(4.toShort(), response.getProductId()) - Assert.assertEquals(PodStatus.FILLED, response.getPodStatus()) - Assert.assertEquals(135556289L, response.getLotNumber()) - Assert.assertEquals(611540L, response.getPodSequenceNumber()) - Assert.assertEquals(0.toByte(), response.getRssi()) - Assert.assertEquals(0.toByte(), response.getReceiverLowerGain()) - Assert.assertEquals(4294967295L, response.getUniqueIdReceivedInCommand()) + Assert.assertEquals(ResponseType.ACTIVATION_RESPONSE.value, response.messageType) + Assert.assertEquals(21.toShort(), response.messageLength) + Assert.assertEquals(4.toShort(), response.firmwareVersionMajor) + Assert.assertEquals(10.toShort(), response.firmwareVersionMinor) + Assert.assertEquals(0.toShort(), response.firmwareVersionInterim) + Assert.assertEquals(1.toShort(), response.bleVersionMajor) + Assert.assertEquals(3.toShort(), response.bleVersionMinor) + Assert.assertEquals(0.toShort(), response.bleVersionInterim) + Assert.assertEquals(4.toShort(), response.productId) + Assert.assertEquals(PodStatus.FILLED, response.podStatus) + Assert.assertEquals(135556289L, response.lotNumber) + Assert.assertEquals(611540L, response.podSequenceNumber) + Assert.assertEquals(0.toByte(), response.rssi) + Assert.assertEquals(0.toByte(), response.receiverLowerGain) + Assert.assertEquals(4294967295L, response.uniqueIdReceivedInCommand) } } \ No newline at end of file