Professional Documents
Culture Documents
WBSR-1000
Date 2018/12/18
WB R-1000 Ver. V21
Page 2
W ommunication protocol
BCC is XOR checksum, like BCC= STX ^ Command packet ^ ETX ( ^ is XOR operator)
e.g.:Reset command
A N E E
C A N O
K K Q T
6. Communication procedure
6.1 Normal communication process(command operation)
HOST send command, device(READER) receive the command and check the BCC checksum, if the check
is right, response ACK, then HOST send ENQ, device(READER) will do the operation according to the
command, and last response the relevant operation data to HOST.
If device(READER ) receive an command which the BCC checksum is Incorrect, then response NAK to
HOST which mean the BCC checksum of command is not correct. Host should check the BCC checksum of
the request command. When device(Reader) receive the correct command which with right BCC
checksum, then response ACK to HOST.
length
Calculation range of communication packet
Note:
a. The “n bytes” of data packet : the max is 264 byte, the min is 0 byte.
b. Communication packet length is the length of “Command code” + “Command parameter” +
“Data packet” and has two bytes, the first is high byte, second is low byte.
eg: length: 257(dec) eg: length: 255(dec)
length: 0x01 0x01(hex) length: 0x00 0xFF(hex)
a. The “n bytes” of Data Packet :the max is 264 byte, the min is 0 byte.
b. Command word and Command parameter are HOST to READER that need to do
operation.
Negative response :
8. Command list
9. Device operation
9.1 Reset
Host send:
0x02 0x00 0x02 0x30 0x30 / 0x31 0x03 BCC
Reader response:
0x02 0x00 0x12 0x30 0x30 / 0x31 Device version info SV 0x03 BCC
Reader version info: SV=“WBSR-1000 V1.0”
Reader response:
0x02 0x00 0x03 0x33 0x30/ 0x31 Operation status code P 0x03 BCC
P=‘Y’(0X59) Operation ok
P=‘N’(0X4E) Operation fail
Reader response:
0x02 0x00 0x12 0xDC 0x31 Version info code SV 0x03 BCC
Firmware version info: SV=“WBSR-1000 V1.0 ”
Reader response:
0x02 0x00 0x03 0x34 Code N Operation status code P 0x03 BCC
Reader response:
S=‘N’(0X4E)set fail
S=‘Y’(0X59)set ok
Mode=0x30 EMV mode(If there have not the mode parameter, still use according to the EMV reset mode.)
Mode=0x31 ISO7816 mode
0x02 Communication 0x37 0x30 Operate status Reset data packet Reset data 0x03 BCC
packet length code P length 2 byte n byte
2 byte
Negative response:
0x02 0x00 0x04 0x37 0x30 Operate status code P 0x03 BCC
0x02 Communication 0x37 0x2F Operate status Reset data packet Reset data 0x03 BCC
packet length code P length 2 byte n byte
2 byte
0x02 Communication 0x37 0x2F Operate status Reset data packet Reset data 0x03 BCC
packet length code P length 2 byte n byte
2 byte
Negative response:
0x02 0x00 0x03 0x37 0x2F Operate status code P 0x03 BCC
0x02 Communication packet 0x37 0x31 C-APDU packet C-APDU packet data 0x03 BCC
length 2 byte length 2 byte n byte
Communication packet length=4+ C-APDU packet length n (The max is 262byte)
0x02 Communication 0x37 0x31 Operate status C-APDU response C-APDU response 0x03 BCC
packet length 2 code P packet length 2 byte packet n byte
byte
Communication packet length=5+ C-APDU response packet length n (the max is 257byte)
Negative response:
0x02 0x00 0x03 0x37 0x31 Operate response code P 0x03 BCC
0x02 Communication 0x37 0x32 C-APDU packet C-APDU packet n 0x03 BCC
packet length 2 byte length 2 byte byte
Negative response:
0x02 0x00 0x03 0x37 0x32 Operate status code P 0x03 BCC
Positive response:
T=0 SIM card :Operate status code P=‘Y’(0x59)
0x02 communication 0x3 Pm SIM card Operate Reset data packet Reset data 0x03 BCC
packet length D No status code P length 2 byte n byte
2 byte
communication packet length=6+ reset data n
Positive response:
0x02 communication 0x3D Pm SIM card Operate Reset data Reset data 0x03 BCC
packet length No status code P packet length n byte
2 byte 2 byte
Negative response:
0x02 communication 0x3D 0x31 SIM card No C-APDU packet length C-APDU packet 0x03 BCC
packet length 2 byte n byte
2 byte
0x02 communication 0x3D 0x31 SIM card Operate C-APDU response C-APDU 0x03 BCC
packet length No status code P packet length 2 byte response
2 byte packet n byte
Negative response:
0x02 0x00 0x04 0x3D 0x31 SIM card No Operate 0x03 BCC
status code P
0x02 communication 0x3D 0x32 SIM card C-APDU packet length C-APDU packet 0x03 BCC
packet length 2 byte No 2 byte n byte
0x02 communication 0x3D 0x32 SIM card Operate C-APDU C-APDU 0x03 BCC
packet length 2 No status code P response response
byte packet length packet n byte
2 byte
Negative response:
0x02 0x00 0x04 0x3D 0x32 SIM card No Operate 0x03 BCC
status code P
Reader response:
0x02 0x00 0x04 0x36 0X30 Card type N Operate 0x03 BCC
status code P
Operate status code P=‘N’(0x4E) Set card fail
P=‘Y’(0x59) Set card success
P=‘E’(0x45) No card
0x02 0x00 0x06 0x36 0x31 Card type Operate start address Operate length 0x03 BCC
N 2byte L
Operate length L=0X01—0X80 ,the min length is 1 BYTE,the max is 128 BYTE ,start address 2BYTE:
The valid address is decided by the card capacity.
Negative response:
0x02 0x00 0x04 0x36 0x31 Card type N Operate status code P 0x03 BCC
Operate status code P=‘N’(0x4E) read fail
P=‘E’(0x45) No card
0x02 communication 0x36 0x32 Card type Operate start Operate Write data 0x03 BCC
packet length (2 N address 2byte length L n byte
byte)
communication packet length = 6 + operate length L
operate length L=0X01—0X80,the min is 1 BYTE,the max is 128 BYTE
Reader response:
0x02 0x00 0x04 0x36 0x32 Card type N Operate status code P 0x03 BCC
Operate status code P=‘Y’(0x59) write success
P=‘N’(0x4E) write fail
P=‘E’(0x45) No card
1.3.2 write card with checking
HOST send:
0x02 communication 0x36 0x33 Card type Operate start Operate Write data 0x03 BCC
packet length (2 N address 2byte length L n byte
byte)
Note:communication packet length = 6 + Operate length L
operate length L=0X01—0X80,the min is 1 BYTE,the max is 128 BYTE
Positive response:
0x02 communication 0x36 0x33 Card Operate Operate start Operate Read the Written 0x03 BCC
packet length type N status address 2byte length L data n byte
(2 byte) code P
2. SLE4442 card
2.1 SLE4442 CARD reset
HOST send:
Negative response:
0x02 0x00 0x04 0x38 0X31 Read start 1 byte Read 1 byte 0x03 BCC
address ADR length L
ADR=0X00-0XFF
L=0x01—0x80
Operate length L=0X01--0X80 ,the min 1 BYTE,the max is 128 BYTE ,4442 will be used only in 256 bytes.
0x02 Communication 0x38 0x31 Operate Read start Read length Read data L byte 0x03 BCC
packet length 2 status code P address ADR L
Communication packet length =5+ Read length L
Negative response:
0x02 0x00 0x05 0x38 0x31 Operate status Read start Read length L 0x0 BCC
code P address ADR 3
P=‘N’(0x4E) read fail
P=‘E’(0x45) No card
0x02 0x00 0x23 0x38 0x32 Operate status protection status bit 32 byte 0x03 BCC
code P
Every protection status bit is corresponding to every unit write protection status in one main storage
area, the address is from low to high.
protection status bit = 0x00 means this bit can’t be written since it has been protected valid.
= 0x01 means the protection bit is invalid ,you can write it.
Read 4442 protection bit, read the 32bytes in one time.
Negative response:
0x02 0x00 0x03 0x38 0x32 Operate status 0x BCC
code P 03
Operate status code P=‘N’(0x4E) read fail
0x02 0x00 0x07 0x38 0x33 Operate Safety area data 4 0x03 BCC
status code P byte
The first byte of safety are: the wrong password counter data
The second byte of safety are: password 1
The third byte of safety are: password 2
The fourth byte of safety are: password 3
wrong password counter data=0X07(verify wrong counter data is 0),0X06(counter data is 1), 0X04(
counter data is 2),0X00(counter data is 1,the card scraped)
Negative response:
0x02 0x00 0x03 0x38 0x33 Operate status 0x03 BCC
code P
Operate status code P=‘N’(0x4E) read fail
P=‘E’(0x45) No card
0x02 0x00 0x05 0x38 0x34 Password data 3 byte 0x03 BCC
Reader response:
0x02 0x00 0x03 0x38 0x34 Operate status code 0x03 BCC
P
0x02 Communication 0x38 0x35 Write start address Write length Write data L 0x03 BCC
packet length 2 byte ADR(1byte) L byte
Communication packet length= 4+ Write length L
Operate length L=0x01—0x80 ,the min is 1 Byte,the max is 128 Byte.
Reader response:
0x02 0x00 0x05 0x38 0x35 Operate Write start address Write length 0x03 BCC
status code ADR L
2.7 Write protection bit:(ADR:0x00-0x1f total 32 bytes have the write protection function,)
HOST send:
0x02 communication 0x38 0x36 Adr Len Len byte write protection 0x03 BCC
packet length L data
Note: communication packet length L= 4 + Len
Adr : The start address of the write protection bit Adr:0x00---0x1F
Len : The length of the write protection bit 0x01---0x20
S byte : The unit status byte packet of write protection bit
Len byte write protection data:the data need to be written protection. When the data is same as the
previous storage unit ,the write protection will be success, otherwise the write protection will be fail.
Modify write protection area: Only can modify in 00H-31H storage unit, the write protection will be
valid forever and can’t be canceled if it write protection success. you need to sure the Adr, Len in the
range. you can operate write protection to single byte.
Reader response:
0x02 0x00 0x03 0x38 0x36 Operate status code 0x03 BCC
P
Operate status code P=‘Y’(0x59) write success
P=‘N’(0x4E) write fail
P=‘E’(0x45) No card
0x02 0x00 0x05 0x38 0x37 Password data 3 byte 0x03 BCC
Reader response:
0x02 0x00 0x03 0x38 0x37 Operate status code P 0x03 BCC
3. SLE4428 card
3.1 reset
HOST send:
Negative response:
0x02 0x00 0x03 0x39 0x30 Operate status code P 0x03 BCC
Operate status code P=‘N’(0x4E) reset fail
P=‘E’(0x45) No card
0x02 0x00 0x05 0x39 0X31 Read start 2 byte Read length 1 byte 0x03 BCC
address ADR L
ADR=0000-03FF
L =0x01—0x80
Operate length L=0X01—0X80 ,the min is 1 BYTE,the max is 128 BYTE ,
4428 storage only 1k byte, pls note the address and length are in the range.
0x02 Communication 0x39 0x31 Operate Read start Read length Read data 0x03 BCC
length 2 byte status code P address 2byte L 1bye L byte
Communication length=6+ read length L
Negative response:
0x02 0x00 0x06 0x39 0x31 Operate Read start address Read length L 0x03 BCC
status code P 2byte 1bye
Operate status code P=‘N’(0x4E) read fail
P=‘E’(0x45) No card
0x02 0x00 0x05 0x39 0X32 Read start 2 byte Read length 1 byte 0x03 BCC
address ADR L
ADR=0000-03FF
L =0x01—0x80
Operate length L=0X01—0X80 ,the min is 1 BYTE,the max is 128 BYTE ,
4428 storage only 1K byte, pls note the address and length are in the range.
Every protection status bit is corresponding to every unit write protection status in one main storage area, the
address is from low to high.
protection status bit = 0x00 means this bit can’t be written since it has been protected valid.
= 0x01 means the protection bit is invalid ,you can write it.
0x02 Communication 0x39 0x32 Operate Read start Read length Protection bit 0x03 BCC
length 2 byte status code address 2byte L 1bye data L byte
P
Communication length=6+ Read length L
Negative response:
0x02 0x00 0x06 0x39 0x32 Operate Read start Read length L 0x03 BCC
status code P address 2byte 1bye
Operate status code P=‘N’(0x4E) read fail
P=‘E’(0x45) No card.
0x02 0x00 0x04 0x39 0x33 Password data 2 byte 0x03 BCC
Reader response:
0x02 0x00 0x03 0x39 0x33 Operate status code P 0x03 BCC
0x02 Communication 0x39 0x34 Write start address Write length L Write data L 0x03 BCC
length 2 byte ADR 2byte 1byte byte
Reader response:
0x02 0x00 0x06 0x39 0x34 Operate status Write start Write length 0x03 BC C
code P address ADR L1byte
0x02 Communication 0x39 0x35 Write start address Write length L Write data 0x03 BCC
length 2 byte ADR 2byte 1byte L byte
Reader response:
0x02 0x00 0x06 0x39 0x35 Operate Write start address ADR Write length 0x03 BCC
status code P 2byte L 1byte
Operate status code P=‘Y’(0x59) write success
P=‘N’(0x4E) write fail
P=‘E’(0x45) No card
3.7 Modify password
HOST send:
0x02 0x00 0x06 0x39 0x36 Old password 2 byte New password 2 byte 0x03 BCC
Reader response:
0x02 0x00 0x03 0x39 0x36 Operate status code P 0x03 BCC
0x02 communication packet 0x35 0x60 Operate status code P ATR data packet 0x03 BCC
length 2 byte
Negative response:
P=‘N’(0X4E) search fail;
P=‘E’(0X45) No card
0x02 0x00 0x02 0x35 0x60 Operate status code P 0x03 BCC
0x02 communication 0x35 0x61 Operate status code P ATR data packet 0x03 BCC
packet length 2 byte
0x02 0x00 0x02 0x35 0x61 Operate status code P 0x03 BCC
2.C-APDU command
HOST send:
0x02 communication 0x35 0x65 C-APDU packet C-APDU packet 0x03 BCC
packet length 2 byte length 2 byte n byte
communication packet length=4+ C-APDU packet ;length n (n=4--262byte)
Negative response:
0x02 0x00 0x04 0x35 0x65 Operate status code P 0x03 BCC
3. DESELECT command
HOST send:
0x02 0x00 0x03 0x35 0x68 Operate status code P 0x03 BCC
Negative response:
0x02 0x00 0x03 0x35 0x68 Operate status code P 0x03 BCC
0x02 0x00 0x03 0x35 0x69 Operate status Four byte or seven byte card 0x03 BCC
code P serial no
Negative response:
0x02 0x00 0x03 0x35 0x69 Operate status code P 0x03 BCC
READER response:
READER response:
0x02 0x00 0x06 0x35 0x31 Operate status P 4 byte hex card serial no 0x03 BCC
P=‘Y’(0X59) Get the card serial no success, and response to the serial no
P=‘N’(0X4E)Get the card serial no fail,and response to empty serial no(0X00,0X00,0X00,0X00)
P=‘E’(0X45) No card
3.Verify sector password command A type: Verify the password of specified sector
The operate password of the sector: Verify the Key A or Key B of specified sector to verify the operate
password.
A. Verify Key A :
HOST send:
0x02 0x00 0x09 0x35 0x32 Sector no 6 byte hex password 0x03 bcc
If S50 card, Sector no= 0x00 0x1 0x02 ……0x0F ,If the card is S70,Sector no= 0x00 0x1 0x02 ……0x27
READER response:
0x02 0x00 0x03 0x35 0x32 Sector no Operate status code P 0x03 bcc
B. verify Key B :
HOST send:
0x02 0x00 0x09 0x35 0x39 Sector no 6 byte hex password 0x03 bcc
If S50 card, Sector no= 0x00 0x1 0x02 ……0x0F ,If S70 card, Sector no= 0x00 0x1 0x02 ……0x27
READER response:
0x02 0x00 0x03 0x35 0x39 Sector no Operate status code P 0x03 bcc
Positive response:
0x02 0x00 0x15 0x35 0x33 Sector no Block no P=0x59 16 byte hex data 0x03 BCC
P=‘Y’(0X59) Read block data success, and upload the data read from16 byte
Negative response:
0x02 0x00 0x05 0x35 0x33 Sector no Block no Operate status code P 0x03 BCC
0x02 0x00 0x14 0x35 0x34 Sector no Block no 16 byte hex data 0x03 BCC
If S50 card, Sector no= 0x00 0x1 0x02 ……0x0F, if S70 card, Sector no= 0x00 0x1 0x02 ……0x27
Sector no <32,Block no= 0x00 0x01 0x02 0x03 ,Sector no ≥32, Block no= 0x00 0x1 0x02 …0x0F
Positive response:
0x02 0x00 0x15 0x35 0x34 Sector no Block no P 16 byte hex data 0x03 BCC
Negative response:
0x02 0x00 0x05 0x35 0x33 Sector no Block no Operate status code P 0x03 BCC
6. Modify password:Only can be modified in KEY A, and change the KEY B in :”0xFF, 0xFF,
0xFF,0xFF,0xFF,0xFF”,the control bit write in:”0xFF, 0x07, 0x80, 0x69”
HOST send:
0x02 0x00 0x09 0x35 0x35 Sector no 6 byte hex password 0x03 bcc
READER response:
0x02 0x00 0x04 0x35 0x35 Sector no Operate status code P 0x03 bcc
If you need to modify complete of the sector operate password(Key A or Key B) and control bit, pls use the write
block data command in every sector 3 after you verify the password success.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
6 byte Key A bit 4 byte control bit 6 byte Key B bit
0x02 0x00 0x08 0x35 0x37 Sector no Block no 4 byte hex data 0x03 BCC
If S50 card, Sector no= 0x00 0x1 0x02 ……0x0F, If S70 card, Sector no= 0x00 0x1 0x02 ……0x27
Sector no <32,block no= 0x00 0x01 0x02 0x03 ,Sector no ≥32,block no= 0x00 0x1 0x02 ……0x0F
Note: When do the value operation, password control block(0X03 or 0X0F ) and hardware information block
can’t be operated. 4 byte hex data is the increment value of the specified sector block data,(low byte is after
high byte), unallowed in 0,otherwise will be fail. for example, if the block 0 of fifth sector need to increase
0x10,the value should be of 4byte is “0x10, 0x00, 0x00, 0x00”
READER response:
0x02 0x00 0x05 0x35 0x37 Sector no Block no Operate status code P 0x03 BCC
HOST send:
0x02 0x00 0x08 0x35 0x38 Sector no Block no 4 byte hex data 0x03 BCC
If S50 card, Sector no= 0x00 0x1 0x02 ……0x0F ,If S70 card, Sector no= 0x1 0x02 ……0x27
Sector no <32,block no= 0x00 0x01 0x02 ,Sector no ≥32,block no= 0x00 0x1 0x02 ……0x0E
Note: When do the value operation, password control block(0X03 or 0X0F ) and hardware information block
can’t be operated.4 byte hex data is the decrement value of the specified sector block data,(low byte is after
high byte), unallowed in 0,otherwise will be fail.
READER response:
0x02 0x00 0x05 0x35 0x38 Sector no Block no Operate status code P 0x03 BCC
8. initialization value
Use the write block data command to operate, write the 16byte data according to MIFARE value data
format, as follows:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Value /Value Value Adr /Adr Adr /Adr
Value: initialize 4 byte value , low byte first, high byte follows.
/Value: initialize 4 byte value, and invert it.
Adr: the block address of initialization value Adr= sector x4 + block no
/Adr: Invert the block address of initialization value
e.g.:initialize block 0 value of sector 5 to 10,the 16byte block data should be written into is:
“ 0x0A, 0x00, 0x00, 0x00, 0xF0, 0xFF,0xFF ,0xFF , 0x0A, 0x00, 0x00, 0x00, 0x14, 0xEB, 0x14, 0xEB ”
Read value:operate by reading block data command, regarding the response 16 byte value ,it should be
verified whether it is MIFARE card data format, it can read out if it is MIFARE data format, otherwise the
value is error(data format is error.)
Note:When do the value operation, the block 3 of every sector can’t storage value data. the sector
block address should be noted when operate initialization value, increase value, decrease value ,read
value
READER response:
0x02 0x00 0x04 0x35 0x40 Operate status code P 0x03 BCC
READER response:
0x02 0x00 0x0A 0x35 0x42 Operate status 7 byte hex card serial no 0x03 BCC
code P
0x02 0x00 0x08 0x35 0x43 Page no Operate status code P 4 byte hex data 0x03 BCC
Read page data success, and upload 4byte,it is the data of one page.
Negative response:
0x02 0x00 0x04 0x35 0x43 Page no Operate status code 0x03 BCC
P
Operate status code P=‘N‘(0X4E) search RF card fail
0x02 0x00 0x08 0x35 0x44 Page no Operate status code P 4 byte hex data 0x03 BCC
Operate status code:P=‘Y’(0x59)Write page data success, and upload the 4byte read data which
has been written success.
Negative response:
0x02 0x00 0x04 0x35 0x44 Page no Operate status code P 0x03 BCC
Operate status code P=‘N‘(0X4E) search RF card fail