M1 card Protocol definition

Source: Internet
Author: User

1. The format of the command communication package sent by the host

STX Package Length Command Parameters Data Etx BCC
0x01 2 byte 1 byte 1 byte N byte 0x03 1 byte

 

Description: A. The data segment length is n Bytes, n <= 290;

B. The package length is two bytes. The package length is pre-embedded and the lower byte is post-embedded. It refers to the length of commands, parameters, and data.

C. The package length is decimal. Other fields are transmitted in ASCII code;

D. BCC is the difference or check value of STX, package length, command, parameter, data, and etx.

 

2. The card reader returns normally.

STX Package Length Command Parameters Data Etx BCC
0x01 2 byte 1 byte 1 byte N byte 0x03 1 byte

 

Description: The same format as the communication package for sending commands

 

3. The card reader returns an exception.

 

STX Package Length 'N' Command Error Message Etx BCC
0x01 2 byte 1 byte 1 byte 1 byte 0x03 1 byte

Note: 0x00 undefined commands

0x01 parameter error

0x02 command cannot be executed

0x04 command data error

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.