|
@@ -479,12 +479,17 @@ object ModBusController {
|
|
|
|
|
|
|
|
val key = keyList.find { it.isExist && it.rfid != null && it.mac != null &&
|
|
val key = keyList.find { it.isExist && it.rfid != null && it.mac != null &&
|
|
|
BleManager.getInstance().isConnected(BusinessManager.getBleDeviceByMac(it.mac!!)?.bleDevice) }
|
|
BleManager.getInstance().isConnected(BusinessManager.getBleDeviceByMac(it.mac!!)?.bleDevice) }
|
|
|
- val addr = keyDockList.find { it.getKeyList().any { it.rfid == key?.rfid } }?.addr
|
|
|
|
|
|
|
+ if (key == null) {
|
|
|
|
|
+ LogUtil.e("getOneKey : no key match")
|
|
|
|
|
+ return null
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (key == null || addr == null) {
|
|
|
|
|
|
|
+ val address = keyDockList.find { it.getKeyList().any { it.rfid == key.rfid } }?.addr
|
|
|
|
|
+ if (address == null) {
|
|
|
|
|
+ LogUtil.e("getOneKey : no dock match")
|
|
|
return null
|
|
return null
|
|
|
}
|
|
}
|
|
|
- return Pair(addr, key)
|
|
|
|
|
|
|
+ return Pair(address, key)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|