|
|
@@ -147,7 +147,7 @@ object BusinessManager {
|
|
|
sendLoadingEventMsg(MyApplication.instance?.applicationContext?.getString(R.string.take_out_key_tip))
|
|
|
val dock = ModBusController.getDockByKeyMac(it.data.bleBean.bleDevice.mac)
|
|
|
ModBusController.controlKeyBuckle(true, keyBean.isLeft, dock?.addr)
|
|
|
- keyBean.isReady = false
|
|
|
+ ModBusController.updateKeyReadyStatus(it.data.bleBean.bleDevice.mac, false)
|
|
|
ToastUtils.tip(R.string.take_out_key)
|
|
|
}
|
|
|
} else {
|
|
|
@@ -160,7 +160,7 @@ object BusinessManager {
|
|
|
// 待机模式
|
|
|
2 -> {
|
|
|
if (it.data.res == 1) {
|
|
|
- ModBusController.getKeyByMac(it.data.bleBean.bleDevice.mac)?.isReady = true
|
|
|
+ ModBusController.updateKeyReadyStatus(it.data.bleBean.bleDevice.mac, true)
|
|
|
// 延时再次获取当前状态,触发handleCurrentMode里工作票下发状态检查
|
|
|
Executor.delayOnMain(500) {
|
|
|
getCurrentStatus(1, it.data.bleBean.bleDevice)
|
|
|
@@ -709,7 +709,7 @@ object BusinessManager {
|
|
|
bleDevice.mac?.let { itMac ->
|
|
|
unregisterConnectListener(itMac)
|
|
|
}
|
|
|
- ModBusController.getKeyByMac(bleDevice.mac)?.isReady = false
|
|
|
+ ModBusController.updateKeyReadyStatus(bleDevice.mac, false)
|
|
|
if (!isActiveDisConnected) {
|
|
|
// 测试模式下不重连
|
|
|
if (isTestMode) {
|
|
|
@@ -1317,7 +1317,8 @@ object BusinessManager {
|
|
|
}
|
|
|
}
|
|
|
} ?: let {
|
|
|
- key.isReady = true
|
|
|
+ ModBusController.updateKeyReadyStatus(currentModeMsg.bleBean.bleDevice.mac, true)
|
|
|
+ sendLoadingEventMsg(null, false)
|
|
|
}
|
|
|
}
|
|
|
}
|