UART Fingerprint Sensor (C)
V1.0
5
/
18
COMMANDS
COMMANDS FORMAT
This module works as slaver device, and you should control Master device to send commands to
control it. Communicating interface is UART: 19200 8N1.
The format commands and responses should be:
1)
=8 bytes
Byte
1
2
3
4
5
6
7
8
CMD
0xF5
CMD
P1
P2
P3
0
CHK
0xF5
ACK
0xF5
CMD
Q1
Q2
Q3
0
CHK
0xF5
Notes:
CMD: Type of command/response
P1, P2, P3: Parameters of command
Q1, Q2, Q3: Parameters of response
Q3: Generally Q3 is valid/invalid information of the operation, it should be:
#define ACK_SUCCESS 0x00 //
操作成功
#define ACK_FAIL 0x01 //
操作失败
#define ACK_FULL 0x04 //
指纹数据库已满
#define ACK_NOUSER 0x05 //
无此用户
#define ACK_USER_OCCUPIED 0x06 //
用户已存在
#define ACK_FINGER_OCCUPIED 0x07 //
指纹已存在
#define ACK_TIMEOUT 0x08 //
采集超时
CHK: Checksum, it is XOR result of bytes from Byte 1 to Byte 6
2)
>8 bytes. This data contains two parts: data head and data packet
data head:
Byte
1
2
3
4
5
6
7
8
CMD
0xF5
CMD
Hi(Len) Low(Len) 0
0
CHK
0xF5
ACK
0xF5
CMD
Hi(Len) Low(Len) Q3
0
CHK
0xF5
Note:
CMD, Q3: same as 1)
Len: Length of valid data in data packet, 16bits (two bytes)
Hi(Len): High 8 bits of Len
Low(Len): Low 8 bits of Len
CHK: Checksum, it is XOR result of bytes from Byte 1 to Byte 6
data packet:
Byte
1
2
…
Len+1
Len+2
Len+3
CMD
0xF5
Data
CHK
0xF5
ACK
0xF5
Data
CHK
0xF5
Note: