Address review comments:

- move think dependency to core_dependencies and make it's version
   configurable: https://github.com/0pen-dash/AndroidAPS/pull/10#discussion_r584329468
 - add message string to exceptions. Renames
This commit is contained in:
Andrei Vereha 2021-02-28 19:11:42 +01:00
parent b1f099c506
commit 57c2d2d9a1
6 changed files with 8 additions and 6 deletions

View file

@ -23,6 +23,7 @@ buildscript {
commonscodec_version = '1.15' commonscodec_version = '1.15'
jodatime_version = '2.10.10' jodatime_version = '2.10.10'
work_version = '2.5.0' work_version = '2.5.0'
tink_version = '1.5.0'
junit_version = '4.13.2' junit_version = '4.13.2'
mockitoVersion = '3.7.7' mockitoVersion = '3.7.7'

View file

@ -46,7 +46,7 @@ dependencies {
//CryptoUtil //CryptoUtil
api 'com.madgag.spongycastle:core:1.58.0.0' api 'com.madgag.spongycastle:core:1.58.0.0'
api "com.google.crypto.tink:tink-android:$tink_version"
// Graphview cannot be upgraded // Graphview cannot be upgraded
api "com.jjoe64:graphview:4.0.1" api "com.jjoe64:graphview:4.0.1"

View file

@ -22,5 +22,4 @@ dependencies {
implementation "androidx.room:room-rxjava2:$room_version" implementation "androidx.room:room-rxjava2:$room_version"
kapt "androidx.room:room-compiler:$room_version" kapt "androidx.room:room-compiler:$room_version"
implementation 'com.github.guepardoapps:kulid:1.1.2.0' implementation 'com.github.guepardoapps:kulid:1.1.2.0'
implementation 'com.google.crypto.tink:tink-android:1.5.0'
} }

View file

@ -2,5 +2,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.excepti
class MessageIOException : Exception { class MessageIOException : Exception {
constructor(msg: String) : super(msg) constructor(msg: String) : super(msg)
constructor(cause: Throwable) : super(cause) constructor(cause: Throwable) : super("Caught Exception during Message I/O", cause)
} }

View file

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

View file

@ -1,7 +1,9 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair
import info.nightscout.androidaps.utils.extensions.toHex
data class PairResult(val ltk: ByteArray) { data class PairResult(val ltk: ByteArray) {
init { init {
require(ltk.size == 16) require(ltk.size == 16) {"LTK length must be 16 bytes. Received LTK: ${ltk.toHex()}"}
} }
} }