[+] Ability to close a ble

This commit is contained in:
Azalea Gui
2023-01-24 13:12:36 -05:00
parent 5b5a691b59
commit 34bd187e14
2 changed files with 6 additions and 0 deletions
@@ -86,6 +86,7 @@ class ActivityScan : AppCompatActivity() {
{
view.snack("✅ Connected.")
prefs.chosenDevice = address
ble.close()
finish()
}
}
@@ -78,6 +78,11 @@ internal class BluetoothHandler private constructor(context: Context) {
}
}
fun close() {
central.close()
instance = null
}
companion object {
val decoders = listOf(BatteryDecoder(), BloodPressureDecoder(), GlucoseDecoder(), HeartRateDecoder(),
PLXSpotDecoder(), PLXContinuousDecoder(), TemperatureDecoder(), WeightDecoder())