|
@@ -39,8 +39,14 @@ class DeviceKeySlot(frame: Frame) : Device(frame) {
|
|
|
*/
|
|
*/
|
|
|
override fun ctrlReadSlotRFID(): List<Frame> {
|
|
override fun ctrlReadSlotRFID(): List<Frame> {
|
|
|
val frames = ArrayList<Frame>()
|
|
val frames = ArrayList<Frame>()
|
|
|
- frames.add(frame.newFrame().apply { cmd = frame.cmd }.buildReadSlotRFID(CAN_KEY_RFID_LEFT, 0x00))
|
|
|
|
|
- frames.add(frame.newFrame().apply { cmd = frame.cmd }.buildReadSlotRFID(CAN_KEY_RFID_RIGHT, 0x00))
|
|
|
|
|
|
|
+ val slots = (deviceStatus as DeviceStatusKeySlot).slotList.filter { it.isUsed && it.rfid.isEmpty() }
|
|
|
|
|
+ for (i in slots) {
|
|
|
|
|
+ if (i.ch == 0) {
|
|
|
|
|
+ frames.add(frame.newFrame().apply { cmd = frame.cmd }.buildReadSlotRFID(CAN_KEY_RFID_LEFT, 0x00))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ frames.add(frame.newFrame().apply { cmd = frame.cmd }.buildReadSlotRFID(CAN_KEY_RFID_RIGHT, 0x00))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return frames
|
|
return frames
|
|
|
}
|
|
}
|
|
|
|
|
|