ble api update

This commit is contained in:
Vineyro 2024-11-02 16:31:58 +07:00
parent ab27faa832
commit a2cc797320
3 changed files with 18 additions and 11 deletions

View File

@ -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'
}
}

View File

@ -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

View File

@ -39,13 +39,20 @@ suspend fun readTable(
do {
val nextPackageDataCount = value.get2byteUIntAt(2)
val nextPackageDataCount = if(value.size > 3)
value.get2byteUIntAt(2)
else
UInt.MIN_VALUE
if(value.size > 4) {
tableResult.addAll(value.asList().subList(4, value.size))
characteristic.write(DataByteArray(nextRequestPayload))
value = characteristic.read().value
}
} while (nextPackageDataCount.toInt() != 0)
return tableResult
@ -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])