ble api update
This commit is contained in:
parent
ab27faa832
commit
a2cc797320
|
|
@ -19,8 +19,8 @@ android {
|
|||
applicationId "llc.arma.ble"
|
||||
minSdk 26
|
||||
targetSdk 34
|
||||
versionCode 41
|
||||
versionName "1.4.13"
|
||||
versionCode 44
|
||||
versionName "1.4.16"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
|
@ -30,11 +30,11 @@ android {
|
|||
|
||||
buildTypes {
|
||||
debug {
|
||||
minifyEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
release {
|
||||
minifyEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
-keeppackagenames org.apache.poi.ss.formula.function
|
||||
|
||||
-keep class org.apache.**
|
||||
|
||||
-keep class com.fasterxml.aalto.stax.InputFactoryImpl
|
||||
-keep class com.fasterxml.aalto.stax.OutputFactoryImpl
|
||||
-keep class com.fasterxml.aalto.stax.EventFactoryImpl
|
||||
|
|
|
|||
|
|
@ -39,12 +39,19 @@ suspend fun readTable(
|
|||
|
||||
do {
|
||||
|
||||
val nextPackageDataCount = value.get2byteUIntAt(2)
|
||||
val nextPackageDataCount = if(value.size > 3)
|
||||
value.get2byteUIntAt(2)
|
||||
else
|
||||
UInt.MIN_VALUE
|
||||
|
||||
tableResult.addAll(value.asList().subList(4, value.size))
|
||||
if(value.size > 4) {
|
||||
|
||||
characteristic.write(DataByteArray(nextRequestPayload))
|
||||
value = characteristic.read().value
|
||||
tableResult.addAll(value.asList().subList(4, value.size))
|
||||
|
||||
characteristic.write(DataByteArray(nextRequestPayload))
|
||||
value = characteristic.read().value
|
||||
|
||||
}
|
||||
|
||||
} while (nextPackageDataCount.toInt() != 0)
|
||||
|
||||
|
|
@ -91,7 +98,7 @@ fun readHostHistory(
|
|||
readTable(
|
||||
characteristic,
|
||||
//Чтение без удаления
|
||||
byteArrayOf(1, 0, 0, -2, -1),
|
||||
byteArrayOf(1, 0, 0, -1, -1),
|
||||
byteArrayOf(5)
|
||||
)
|
||||
)
|
||||
|
|
@ -192,7 +199,6 @@ fun readHostHistory(
|
|||
periodBle = mutableListOf()
|
||||
|
||||
continue
|
||||
|
||||
}
|
||||
|
||||
if (bleIdTableCell.contentEquals(intervalEndAndHit.hexToByteArray())) {
|
||||
|
|
@ -202,7 +208,6 @@ fun readHostHistory(
|
|||
periodBle = mutableListOf()
|
||||
|
||||
continue
|
||||
|
||||
}
|
||||
|
||||
val innerIndex = getInnerIndex(bleIdTableCell[1])
|
||||
|
|
|
|||
Loading…
Reference in New Issue