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