EHUOYAN
YHY521X
Manual
Page 28 of 36
Description
AA BB
33
2A
01
00 .. 00
18
Head
Length
Status
Sector 01
48 Bytes Data of Sector 01
BCC
Receive(Failure)
AA BB 02 D5 D7
Description
AA BB
02
D5
D7
Head
Length
Error
BCC
14.2.26
Sector_Write
This command writes 48/240 bytes data to the appointed sector.
One sector has 3 blocks(48 bytes, sector 0 to 31) .This command can
not write the tailor block and sector 0, sector 0 include block 0 which is
read only.
Table 83. Command--:Host
Æ
YHY521X
Send
Header
Length
Command
Data
XOR Checksum
0xAA
0xBB
Len
0x2B
Write Info:
48 bytes
BCC
Len:-----
0x3A (58)—if sector is 0-31
Write Info: Key type +Sector Key + SData
Key type: 1 byte, 0x00—Key A, 0x01—Key B.
Sector number: 1 byte, 0x01..0x1F (1..31)
Key: 6 bytes, default “FFFFFFFFFFFF” (*)
SData: 48 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 84. Response--: YHY521X
Æ
Host
Receive
Head
Length
Status
Data
XOR Checksum
Success 0xAA
0xBB 0x02
0x2B
0x29
Failure 0xAA
0xBB 0x02
0xD4
0xD6
Table 85. Example
Send
AA BB 3A 2B
00 01
FF FF FF FF FF FF
11 11 11 11 11 11 11 11
11 11 11 11 11 11 11 11 22 22 22 22 11 22 22 22 22 11 22 22
22 22 11 22 22 22 22 33 33 33 33 33 33 33 33 33 33 33 33 33
33 33 33
10
Description
AA BB
3A
2B
00
01
FF FF FF FF FF FF
Head
Length
COMMAND
Key type A
Write Sector 01
Authenticate with Key A