|
@@ -105,6 +105,10 @@ object BusinessManager {
|
|
|
ModBusController.readKeyRfid(dockBean.addr.toInt() - 1, if ((keyBean as DockBean.KeyBean).isLeft) 0 else 1) { isLeft, res ->
|
|
ModBusController.readKeyRfid(dockBean.addr.toInt() - 1, if ((keyBean as DockBean.KeyBean).isLeft) 0 else 1) { isLeft, res ->
|
|
|
val rfid = res.copyOfRange(3, 11).toHexStrings(false).removeLeadingZeros()
|
|
val rfid = res.copyOfRange(3, 11).toHexStrings(false).removeLeadingZeros()
|
|
|
ModBusController.updateKeyRfid(dockBean.addr.toInt(), keyBean.isLeft, rfid)
|
|
ModBusController.updateKeyRfid(dockBean.addr.toInt(), keyBean.isLeft, rfid)
|
|
|
|
|
+ if (PresentationManager.mConfigKeyList.any { it.rfid == rfid }) {
|
|
|
|
|
+ val mac = PresentationManager.mConfigKeyList.find { it.rfid == rfid }?.keyMac
|
|
|
|
|
+ ModBusController.updateKeyMac(dockBean.addr.toInt(), keyBean.isLeft, mac!!)
|
|
|
|
|
+ }
|
|
|
// NetApi.getKeyInfo(rfid) {
|
|
// NetApi.getKeyInfo(rfid) {
|
|
|
// if (it != null && !it.macAddress.isNullOrEmpty()) {
|
|
// if (it != null && !it.macAddress.isNullOrEmpty()) {
|
|
|
// ModBusController.updateKeyMac(dockBean.addr.toInt(), keyBean.isLeft, it.macAddress)
|
|
// ModBusController.updateKeyMac(dockBean.addr.toInt(), keyBean.isLeft, it.macAddress)
|