fix parsing RS password

This commit is contained in:
Milos Kozak 2020-07-20 15:09:01 +02:00
parent 05eee2ebb9
commit 38e2ae90d8

View file

@ -554,7 +554,7 @@ class BLEComm @Inject internal constructor(
val size = decryptedBuffer.size
var pass: Int = (decryptedBuffer[size - 1].toInt() and 0x000000FF shl 8) + (decryptedBuffer[size - 2].toInt() and 0x000000FF)
pass = pass xor 3463
danaPump.rsPassword = Integer.toHexString(pass)
danaPump.rsPassword = String.format("%04X", pass)
aapsLogger.debug(LTag.PUMPBTCOMM, "Pump user password: " + danaPump.rsPassword)
if (!danaPump.isRSPasswordOK) {
aapsLogger.error(LTag.PUMPBTCOMM, "Wrong pump password")