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.medtronic.MedtronicPumpPlugin
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.sensitivity.SensitivityAAPSPlugin
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
@ -155,12 +154,6 @@ abstract class PluginsModule {
@IntKey(150)
abstract fun bindMedtronicPumpPlugin(plugin: MedtronicPumpPlugin): PluginBase
@Binds
@PumpDriver
@IntoMap
@IntKey(155)
abstract fun bindOmnipodErosPumpPlugin(plugin: OmnipodErosPumpPlugin): PluginBase
@Binds
@PumpDriver
@IntoMap

View file

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

View file

@ -69,7 +69,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
emitter.tryOnError(MessageIOException("XXX random failure to test unconfirmed commands"))
return@create
}*/
when (val readResult = session.readAndAckResponse(responseType)) {
when (val readResult = session.readAndAckResponse()) {
is CommandReceiveSuccess ->
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
fun parseAttributes(aapsLogger: AAPSLogger, payload: ByteArray): List<EapAkaAttribute> {
fun parseAttributes(payload: ByteArray): List<EapAkaAttribute> {
var tail = payload
val ret = LinkedList<EapAkaAttribute>()
while (tail.isNotEmpty()) {

View file

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

View file

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

View file

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

View file

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

View file

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