s/utils.extensions/extensions/

This commit is contained in:
Andrei Vereha 2021-05-02 10:31:47 +02:00
parent f197141cd5
commit 2ae9f399aa
23 changed files with 24 additions and 24 deletions

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.nio.ByteBuffer

View file

@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEven
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
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import io.reactivex.Observable
import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject

View file

@ -10,7 +10,7 @@ import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.CharacteristicType.Companion.byValue
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.IncomingPackets
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.DisconnectHandler
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.util.*
import java.util.concurrent.BlockingQueue
import java.util.concurrent.CountDownLatch

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.nio.ByteBuffer
object BleCommandRTS : BleCommand(BleCommandType.RTS)

View file

@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecry
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import org.spongycastle.crypto.engines.AESEngine
import org.spongycastle.crypto.modes.CCMBlockCipher
import org.spongycastle.crypto.params.AEADParameters

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
class CouldNotParseMessageException(val payload: ByteArray) :
Exception("Could not parse message payload: ${payload.toHex()}")

View file

@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callback
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.WriteConfirmationError
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.WriteConfirmationSuccess
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.*
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.util.concurrent.BlockingQueue
import java.util.concurrent.TimeUnit

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
class CrcMismatchException(val expected: Long, val actual: Long, val payload: ByteArray) :
Exception("CRC mismatch. Actual: $actual. Expected: $expected. Payload: ${payload.toHex()}")

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
class IncorrectPacketException(
val payload: ByteArray,

View file

@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.*
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.BlePacket
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
sealed class MessageSendResult
object MessageSendSuccess : MessageSendResult()

View file

@ -1,7 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.nio.ByteBuffer
/***

View file

@ -6,7 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.BuildConfig
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import org.spongycastle.crypto.engines.AESEngine
import org.spongycastle.crypto.macs.CMac
import org.spongycastle.crypto.params.KeyParameter

View file

@ -14,8 +14,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.StringLengthPrefixEncoding.Companion.parseKeys
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator
import info.nightscout.androidaps.utils.extensions.hexStringToByteArray
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.hexStringToByteArray
import info.nightscout.androidaps.extensions.toHex
internal class LTKExchanger(
private val aapsLogger: AAPSLogger,

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
data class PairResult(val ltk: ByteArray, val msgSeq: Byte) {
init {

View file

@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.CmdBl
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.DataBleIO
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.IncomingPackets
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageIO
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
sealed class ConnectionState

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.util.*
enum class EapAkaAttributeType(val type: Byte) {

View file

@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.nio.ByteBuffer
enum class EapCode(val code: Byte) {

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import org.spongycastle.util.encoders.Hex
import java.security.SecureRandom
import javax.crypto.Cipher

View file

@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.b
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.AlarmStatusResponse
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.NakResponse
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import kotlin.reflect.KClass
sealed class CommandSendResult

View file

@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageSendSuccess
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageType
import info.nightscout.androidaps.utils.extensions.toHex
import info.nightscout.androidaps.extensions.toHex
import java.security.SecureRandom
import java.util.*

View file

@ -20,7 +20,7 @@ import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.queue.events.EventQueueChanged
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.extensions.toVisibility
import info.nightscout.androidaps.extensions.toVisibility
import info.nightscout.androidaps.utils.rx.AapsSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign

View file

@ -37,7 +37,7 @@ class DashInitializePodViewModel @Inject constructor(
},
onError = { throwable ->
logger.error(LTag.PUMP, "Error in Pod activation part 1", throwable)
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.message))
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.toString()))
},
onComplete = {
logger.debug("Pod activation part 1 completed")

View file

@ -48,7 +48,7 @@ class DashInsertCannulaViewModel @Inject constructor(
},
onError = { throwable ->
logger.error(LTag.PUMP, "Error in Pod activation part 2", throwable)
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.message))
source.onSuccess(PumpEnactResult(injector).success(false).comment(throwable.toString()))
},
onComplete = {
logger.debug("Pod activation part 2 completed")