rename LTK to Pair

This commit is contained in:
Andrei Vereha 2021-02-28 18:25:08 +01:00
parent ee0ac46c5a
commit b1f099c506
4 changed files with 7 additions and 7 deletions

View file

@ -13,7 +13,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.*
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.BleIO
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.CharacteristicType
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.ltk.LTKExchanger
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair.LTKExchanger
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageIO
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.scan.PodScanner
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.status.ConnectionStatus

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.ltk
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
import com.google.crypto.tink.subtle.X25519
import info.nightscout.androidaps.logging.AAPSLogger
@ -37,7 +37,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
random.nextBytes(pdmNonce)
}
fun negotiateLTK(): LTK {
fun negotiateLTK(): PairResult {
// send SP1, SP2
var sp1sp2 = sp1sp2(nodeId.address, sp2())
msgIO.sendMesssage(sp1sp2.messagePacket)
@ -74,7 +74,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
val p0 = msgIO.receiveMessage()
validateP0(p0)
return LTK(
return PairResult(
ltk = ltk,
)
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.ltk
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.ltk
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
data class LTK(val ltk: ByteArray) {
data class PairResult(val ltk: ByteArray) {
init {
require(ltk.size == 16)
}