EHUOYAN
YHY522R
RFID module
Page 23 of 36
Receive(Success)
AA BB 12 21
00 11 22 33 44 55 66 77 88 99 AA
00
BB CC DD EE
FF
23 (*)
Description
AA BB
12
21
00 .. FF
23
Head
Length
Status
16 Bytes Data of Block 08
BCC
Receive(Failure)
AA BB 02 DE DC
Description
AA BB
02
DE
DC
Head
Length
Error
BCC
*If receive one block data include ‘AA’,then the ‘00’ will be added behind ‘AA’, but the length does
not add 1.
14.2.19
Block_Write
This command writes 16 bytes data to the appointed card’s block.
Table 63. Command--:Host
Æ
YHY522R
Send
Header
Length
Command
Data
XOR Checksum
0xAA
0xBB
0x1A
0x22
Block Info:
24 bytes
BCC
Block Info: Key type +Block Key + BData
Key type: 1 byte, 0x00—Key A, 0x01—Key B.
Block number: 1 byte, 0x01..0xff (1..255)
Key: 6 bytes, default “FFFFFFFFFFFF” (*)
BData: 16 bytes data to be write into card
(*)Note: If auth mode is “1”, then this key is not active, it can be any 6 data bytes.
Table 64. Response--: YHY522R
Æ
Host
Receive
Head
Length
Status
Data
XOR Checksum
Success 0xAA
0xBB 0x02 0x22
0x20
Failure 0xAA
0xBB 0x02
0xDD
0xDF
Table 65. Example
Send
AA BB 1A 22
00 08
FF FF FF FF FF FF
00 11 22 33 44 55 66 77
88 99 AA
00
BB CC DD EE FF
30
(*)
Description
AA BB
1A
22
00
08
FF FF FF FF FF FF
00 ..FF
30
Head
Length
COMMAND
Key type A
Write Block 08(Sector 02,1
st
block )
Authenticate with Key A
16 bytes data
BCC
Receive(Success)
AA BB 02 22 20