M1 RF Card Reader notes

Source: Internet
Author: User

Operation Command:

1. Reset the card host

Host sending:

0x02 0x00 0x02 0x30 0x30/0x31 0x03 BCC

The reader returns:

0x02 0x00 012 0x30 0x30/0x31 card reader version 0x03 BCC

Card Reader version "xxx VX. X"

 

 

2. Check the card host status

Host sending:

0x02 0x00 0x02 0x31 0x30 0x03 BCC

Card Reader return:

0x02 0x00 0x03 0x31 0x30 card host status word s 0x03 BCC

S = 'n' (0x4e) No card on the host

S = 'y' (0x59) with a card in place

 

Mefare 1 card operation command

1. Seek cards

Host sending:

0x02 0x00 0x02 0x35 0x30 0x03 BCC

Card Reader return:

0x02 0x00 0x03 0x35 0x30 status word P 0x03 BCC

P = 'y' (0x59) card retrieval successful

P = 'n' (0x4e) failed to find the card

P = 'E' (0x45) No card in the host

 

2. Read the mefare1 card serial number:

Host sending:

0x02 0x00 0x02 0x35 0x31 0x03 BCC

Card Reader return:

0x02 0x00 0x03 0x35 0x31 status word P 4byte Sn 0x03 BCC

P = 'y' (0x59) reads successfully and returns the serial number of the card.

P = 'n' (0x4e) failed to read and return NULL 0x00 0x00 0x00 0x00

P = 'E' (0x45) No card in the card, no card in the card

 

3. Verify the password of the mefare1 card:

Host sending:

0x02 0x00 0x02 0x35 0x32/39 fan No. 4byte password 0x03 BCC

Password type: 0x32 indicates Password.

0x39 is password B

Fan ID: The S50 card is 0 ~ 63

 

Card Reader return:

0x02 0x00 0x03 0x35 0x31 status word P 0x03 BCC

P = 'y' (0x59) Verification Successful

P = 'n' (0x4e) Verification Failed

P = 'E' (0x45) No card in the card, no card in the card

 

4. Verify the password of the mefare1 card:

Host sending:

0x02 0x00 0x02 0x35 0x32/39 fan No. 4byte password 0x03 BCC

Password type: 0x32 indicates Password.

0x39 is password B

Fan ID: The S50 card is 0 ~ 63

 

Card Reader return:

0x02 0x00 0x03 0x35 0x31 status word P 0x03 BCC

P = 'y' (0x59) Verification Successful

P = 'n' (0x4e) Verification Failed

P = 'E' (0x45) No card in the card, no card in the card

 

5. Read the block data of the specified slice of the mefare1 card

Host sending:

0x02 0x00 0x04 0x35 0x33 fan No. 0x03 BCC

Fan ID: The S50 card is 0 ~ 63

Block number: 0 ~ 3

 

Card Reader return:

0x02 0x00 0x03 0x35 0x33 sector code block number 'y' 16byte DATA 0x03 BCC

P = 'y' (0x59) read successfully, followed by 16 bytes of block data

0x02 0x00 0x03 0x35 0x33 status word P 0x03 BCC

P = 'n' (0x4e) failed to read

P = 'E' (0x45) No card in the card, no card in the card

 

6. Write the block data of the specified slice of the mefare1 card.

Host sending:

0x02 0x00 0x04 0x35 0x34 fan No. 0x03 BCC

Fan ID: The S50 card is 0 ~ 63

Block number: 0 ~ 3

 

Card Reader return:

0x02 0x00 0x03 0x35 0x34 fan block number 'y' 16byte DATA 0x03 BCC

P = 'y' (0x59) is successfully written, followed by 16 bytes of data read back.

0x02 0x00 0x03 0x35 0x34 status word P 0x03 BCC

P = 'n' (0x4e) Write failed

P = 'E' (0x45) No card in the card, no card in the card

 

7. Change Password A of the specified slice on the mefare1 card (password B and control word remain unchanged)

WRITE password B as 0xff 0xff 0xff 0xff 0xff and control word as 0xff 0x07 0x08 0x069

Host sending:

0x02 0x00 0x09 0x35 0x35 fan ID 6byte password 0x03 BCC

Fan ID: The S50 card is 0 ~ 63

 

Card Reader return:

0x02 0x00 0x04 0x35 0x35 status word P 0x03 BCC

P = 'y' (0x59) changed successfully

P = 'n' (0x4e) failed to change

P = 'E' (0x45) No card in the card, no card in the card

Exercise caution when writing the third block. The M1 card will be locked if the control word is entered randomly. For more information, see the M1 card manual;

 

8. mefare1 card value-added operations

Note: You should initialize the wallet for this block before performing this operation. The third block of each slice cannot perform this base operation.

Host sending:

0x02 0x00 0x08 0x35 0x37 Partition Number 4byte DATA 0x03 BCC

Fan ID: The S50 card is 0 ~ 63

Block number: The S50 card is 0 ~ 3

 

Card Reader return:

0x02 0x00 0x03 0x35 0x37 status word P 0x03 BCC

P = 'y' (0x59) Written successfully

P = 'n' (0x4e) Write failed

P = 'E' (0x45) No card in the host

 

8. mefare1 card impairment operation

Note: You should initialize the wallet for this block before performing this operation. The third block of each slice cannot perform this base operation.

Host sending:

0x02 0x00 0x08 0x35 0x38 Partition Number 4byte DATA 0x03 BCC

Fan ID: The S50 card is 0 ~ 63

Block number: The S50 card is 0 ~ 3

 

Card Reader return:

0x02 0x00 0x03 0x35 0x38 status word P 0x03 BCC

P = 'y' (0x59) Written successfully

P = 'n' (0x4e) Write failed

P = 'E' (0x45) No card in the host

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.