|
|
@@ -1074,6 +1074,11 @@ object ModBusController {
|
|
|
if (keyList.isEmpty()) {
|
|
|
return null
|
|
|
}
|
|
|
+ val sendConnectingAndConnected = BleSendDispatcher.getConnectedAndConnecting()
|
|
|
+ //如果已连接和连接中的设备不在钥匙列表中,直接断开连接让路
|
|
|
+ sendConnectingAndConnected.filter { it !in keyList.map { it.mac } }.forEach {
|
|
|
+ BleSendDispatcher.scheduleDisconnect(it)
|
|
|
+ }
|
|
|
keyList = keyList.sortedWith(
|
|
|
compareByDescending<DockBean.KeyBean> {
|
|
|
BleSendDispatcher.isConnected(it.mac ?: "") || BleSendDispatcher.isConnecting(
|