compile. fix build warnings

This commit is contained in:
Andrei Vereha 2021-06-26 15:58:40 +02:00
parent fc7c1bd957
commit 7b0702b8eb
9 changed files with 9 additions and 18 deletions

View file

@ -42,7 +42,6 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
@ -155,12 +154,6 @@ abstract class PluginsModule {
@IntKey(150) @IntKey(150)
abstract fun bindMedtronicPumpPlugin(plugin: MedtronicPumpPlugin): PluginBase abstract fun bindMedtronicPumpPlugin(plugin: MedtronicPumpPlugin): PluginBase
@Binds
@PumpDriver
@IntoMap
@IntKey(155)
abstract fun bindOmnipodErosPumpPlugin(plugin: OmnipodErosPumpPlugin): PluginBase
@Binds @Binds
@PumpDriver @PumpDriver
@IntoMap @IntoMap

View file

@ -500,7 +500,6 @@ class OmnipodDashPumpPlugin @Inject constructor(
private fun updateBolusProgressDialog(msg: String, percent: Int) { private fun updateBolusProgressDialog(msg: String, percent: Int) {
val progressUpdateEvent = EventOverviewBolusProgress val progressUpdateEvent = EventOverviewBolusProgress
val percent = percent
progressUpdateEvent.status = msg progressUpdateEvent.status = msg
progressUpdateEvent.percent = percent progressUpdateEvent.percent = percent
rxBus.send(progressUpdateEvent) rxBus.send(progressUpdateEvent)

View file

@ -69,7 +69,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
emitter.tryOnError(MessageIOException("XXX random failure to test unconfirmed commands")) emitter.tryOnError(MessageIOException("XXX random failure to test unconfirmed commands"))
return@create return@create
}*/ }*/
when (val readResult = session.readAndAckResponse(responseType)) { when (val readResult = session.readAndAckResponse()) {
is CommandReceiveSuccess -> is CommandReceiveSuccess ->
emitter.onNext(PodEvent.ResponseReceived(cmd, readResult.result)) emitter.onNext(PodEvent.ResponseReceived(cmd, readResult.result))

View file

@ -29,7 +29,7 @@ sealed class EapAkaAttribute {
const val SIZE_MULTIPLIER = 4 // The length for EAP-AKA attributes is a multiple of 4 const val SIZE_MULTIPLIER = 4 // The length for EAP-AKA attributes is a multiple of 4
fun parseAttributes(aapsLogger: AAPSLogger, payload: ByteArray): List<EapAkaAttribute> { fun parseAttributes(payload: ByteArray): List<EapAkaAttribute> {
var tail = payload var tail = payload
val ret = LinkedList<EapAkaAttribute>() val ret = LinkedList<EapAkaAttribute>()
while (tail.isNotEmpty()) { while (tail.isNotEmpty()) {

View file

@ -64,7 +64,7 @@ class Session(
} }
@Suppress("ReturnCount") @Suppress("ReturnCount")
fun readAndAckResponse(responseType: KClass<out Response>): CommandReceiveResult { fun readAndAckResponse(): CommandReceiveResult {
var responseMsgPacket: MessagePacket? = null var responseMsgPacket: MessagePacket? = null
for (i in 0..MAX_TRIES) { for (i in 0..MAX_TRIES) {
val responseMsg = msgIO.receiveMessage() val responseMsg = msgIO.receiveMessage()
@ -113,10 +113,10 @@ class Session(
// TODO verify length // TODO verify length
val uniqueId = data.copyOfRange(0, 4) //val uniqueId = data.copyOfRange(0, 4)
val lenghtAndSequenceNumber = data.copyOfRange(4, 6) //val lenghtAndSequenceNumber = data.copyOfRange(4, 6)
val payload = data.copyOfRange(6, data.size - 2) val payload = data.copyOfRange(6, data.size - 2)
val crc = data.copyOfRange(data.size - 2, data.size) //val crc = data.copyOfRange(data.size - 2, data.size)
// TODO validate uniqueId, sequenceNumber and crc // TODO validate uniqueId, sequenceNumber and crc

View file

@ -24,7 +24,7 @@ object ProgramTempBasalUtil {
val tenthPulsesPerSlot = ShortArray(durationInSlots) val tenthPulsesPerSlot = ShortArray(durationInSlots)
var i = 0 var i = 0
while (durationInSlots > i) { while (durationInSlots > i) {
tenthPulsesPerSlot[i] = (roundToHalf(pulsesPerHour / 2.0) * 10).toShort() tenthPulsesPerSlot[i] = (roundToHalf(pulsesPerHour / 2.0) * 10).toInt().toShort()
i++ i++
} }
return tenthPulsesPerSlot return tenthPulsesPerSlot

View file

@ -91,7 +91,7 @@ interface OmnipodDashPodStateManager {
requestedBolus: Double? = null requestedBolus: Double? = null
): Single<ActiveCommand> ): Single<ActiveCommand>
fun updateActiveCommand(): Maybe<CommandConfirmed> fun updateActiveCommand(): Maybe<CommandConfirmed>
fun observeNoActiveCommand(b: Boolean): Observable<PodEvent> fun observeNoActiveCommand(check: Boolean): Observable<PodEvent>
fun getCommandConfirmationFromState(): CommandConfirmationFromState fun getCommandConfirmationFromState(): CommandConfirmationFromState
fun createLastBolus(requestedUnits: Double, historyId: String, bolusType: DetailedBolusInfo.BolusType) fun createLastBolus(requestedUnits: Double, historyId: String, bolusType: DetailedBolusInfo.BolusType)

View file

@ -443,6 +443,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
createdRealtime = now, createdRealtime = now,
sentRealtime = now + 1 sentRealtime = now + 1
) )
podState.activeCommand = newCommand
podState.lastStatusResponseReceived = 0 podState.lastStatusResponseReceived = 0
} }

View file

@ -35,8 +35,6 @@ public class RileyLinkOmnipodService extends RileyLinkService {
@Inject OmnipodErosPumpPlugin omnipodErosPumpPlugin; @Inject OmnipodErosPumpPlugin omnipodErosPumpPlugin;
@Inject AapsOmnipodUtil aapsOmnipodUtil; @Inject AapsOmnipodUtil aapsOmnipodUtil;
@Inject PodStateManager podStateManager;
@Inject AapsOmnipodErosManager aapsOmnipodErosManager;
@Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager; @Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager;
private final IBinder mBinder = new LocalBinder(); private final IBinder mBinder = new LocalBinder();