To read attendance records, you must first disable the device, request the data using CMD_DATA_WRRQ with a specific 11-byte payload, and then re-enable the device.
Workflow:
- Send
CMD_DISABLEDEVICE and wait for CMD_ACK_OK. - Send
CMD_DATA_WRRQ with payload 010d000000000000000000. - Receive data via
CMD_DATA. For small structures, the data is sent immediately. For larger structures, follow the Exchange of Data specification. - Send
CMD_ENABLEDEVICE and wait for CMD_ACK_OK to return the device to normal operation.
Attendance Record Structure (att rec):
att_size (4 bytes, offset 0): Total size of user attendance entries (Little Endian).attN entry (40 bytes each): Individual log entries starting at offset 4.
Attendance Entry Fields (40 bytes):
user sn (2 bytes, offset 0): Internal serial number (Little Endian).user id (9 bytes, offset 2): User ID as a string.Fixed (15 bytes, offset 11): Constant 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00.verify type (1 byte, offset 26): 0=Password, 1=Fingerprint, 2=RF card.record time (4 bytes, offset 27): Event time (Little Endian).verify state (1 byte, offset 31): 0=Check in, 1=Check out, 2=Break out, 3=Break in, 4=OT in, 5=OT out.Fixed (8 bytes, offset 32): Constant 00 00 00 00 FF 00 00 00.
// 1. Disable device
packet(id=CMD_DISABLEDEVICE)
packet(id=CMD_ACK_OK)
// 2. Request attendance data
packet(id=CMD_DATA_WRRQ, data=010d000000000000000000)
// 3. Receive data (example for small structure)
packet(id=CMD_DATA, data=<att rec>)
// 4. Enable device
packet(id=CMD_ENABLEDEVICE)
packet(id=CMD_ACK_OK)