|
|
@@ -1,7 +1,5 @@
|
|
|
package com.grkj.ui_base.business
|
|
|
|
|
|
-import androidx.lifecycle.LiveData
|
|
|
-import androidx.lifecycle.liveData
|
|
|
import com.clj.fastble.BleManager
|
|
|
import com.grkj.data.data.MainDomainData
|
|
|
import com.grkj.data.di.LogicManager
|
|
|
@@ -13,7 +11,6 @@ import com.grkj.data.model.res.KeyPageRes
|
|
|
import com.grkj.data.model.res.LockPageRes
|
|
|
import com.grkj.ui_base.business.BleBusinessManager.connectExistsKey
|
|
|
import com.grkj.ui_base.utils.ble.BleConnectionManager
|
|
|
-import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
|
|
import kotlin.coroutines.resume
|
|
|
|
|
|
@@ -79,10 +76,14 @@ object DataBusiness {
|
|
|
if (maxPowerMac != mac) {
|
|
|
connectExistsKey(listOf(mac ?: ""))
|
|
|
BleConnectionManager.launchDisconnectJob(mac ?: "")
|
|
|
+ } else {
|
|
|
+ connectExistsKey()
|
|
|
}
|
|
|
} else {
|
|
|
mac?.let {
|
|
|
BleConnectionManager.launchDisconnectJob(it)
|
|
|
+ } ?: let {
|
|
|
+ BleConnectionManager.launchDisconnectAllJob()
|
|
|
}
|
|
|
}
|
|
|
return true
|