dash/ble: remove retries for connect for now

It's easier to debug for now if we stop on the first issue/error
This commit is contained in:
Andrei Vereha 2021-03-06 10:58:43 +01:00
parent 9c586c4942
commit 5647007190
3 changed files with 34 additions and 1 deletions

View file

@ -49,7 +49,8 @@ class OmnipodDashManagerImpl @Inject constructor(
private val observeConnectToPod: Observable<PodEvent>
get() = Observable.defer {
bleManager.connect().retryWithBackoff(retries = 2, delay = 3, timeUnit = TimeUnit.SECONDS)
bleManager.connect()
} // TODO are these reasonable values?
private fun observeSendProgramBolusCommand(

View file

@ -0,0 +1,28 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
import java.nio.ByteBuffer
class CryptSequence(var sqn: Long) {
fun incrementForEapAka():ByteArray {
sqn++
return ByteBuffer.allocate(8)
.putLong(sqn)
.array()
.copyOfRange(2, 8)
}
fun incrementForEnDecrypt(podReceiving: Boolean):ByteArray{
sqn++
val ret = ByteBuffer.allocate(8)
.putLong(sqn)
.array()
.copyOfRange(3, 8)
if (podReceiving) {
ret[0] = (ret[0].toInt() and 127).toByte()
} else {
ret[0] = (ret[0].toInt() or 128).toByte()
}
return ret
}
}

View file

@ -0,0 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session
class EapSqn {
}