SAAT-520Wireless Communication Programming Development Protocol
SAAT-520Wireless Communication Programming Development Protocol
Wireless Communication
Programming Protocol Manual
Version: V2.0.0
1
Dear Customer
Thanks for your trust and support! We try best to provide you comprehensive service and
technical support.
This manual will introduce How to use API of SAAT-520 series wireless communication Reader, so
that your integrated software can communicate, configure reader parameter, control the
command of reader reading tags, and information of tags returned. Please consult our technical
support if you have problems of using products. Welcome to s contact us for any feedback and
suggestion.
2
This manual is suitable for the following readers:
The manual is supposed that the user already owns basic RFID and computer knowledge, so that
related terms such as RFID, RF and Ethernet is not described in details, the users can search and
inquire reference, or consult our technical department.
Warning
if violate the signed operation method or usage environment, which will do damage to health or
devices.
Advice:
3
Table of Contents
1. Overview 1
2. Data Structure 2
3. Command Instruction 8
This document is only suitable for our active reader devices, which describes the connection
and management of reader transmits data by GPRS\CDMA\WIFI model. For example, the
data received by SOCKET need further analysis to get the system required data, and the data
received need meet the following protocol format, including 10 commands about reading
tags, stopping reading, information query, carrier frequency point query and configuration;
the specific command is as follows:
1
2. Data Structure
All the data transmitted between reader and PC by RS-232, USB, and Ethernet interface, data
frame is as the basic unit, which is similar with the frame format of SLIP Ethernet protocol,
defined as the following diagram.
2.2Frame Structure
Struct CRfidFrame
{
unsigned char bFrame;
unsigned char bAddrInfo;
unsigned char bAddr;
unsigned char bLength;
2
unsigned char bCommand;
unsigned char bData [256];
};
Definition:
Control Field
Frame Control Length of Data Data Field Check Field
Bus-Address
Frame Field
Length Field
1 byte 1 byte 1 byte 1 byte 2 bytes
Value
1. "0x55" is the identifier of frame header, there is no identifier of frame ender in the
agreement, every frame length is decided by the frame field length after the frame
header identifier.
2. If the frame header identifier 0x55 appeared in the frame data, which requires to
transmit the two bytes "0x56" and "0x56" instead.
3. If the data 0x56 appeared in the frame data, which requires to transmit the two bytes
"0x56" and "0x57" instead.
4. The data field is the actual data content transmitted, including command, command
parameters and exchange data, length is the section length or defined value.
5. The check field is to achieve data test of the entire frame, including all other data except
the frame header and CRC check word, by the standard CRC-16 algorithm, demonstrate
the concrete realization of reference source, the length of 2 bytes.
6. about the connection of GPRS/CDMA/WIFI, the bus address is reserved unused, and
inquire device information through this value.
Without special instructions, all command and byte data in the domain follows the principle of
higher bit priority. That means higher byte priority on the data frame transmission, and higher
bit priority on the byte transmission.
3
2.4CRC Checkout
To ensure reliable data transmission, its reliable to use CRC to check the data transmission
between reader and PC, with the standard CRC-16 checkout algorithm (excluding frame
head).
Two ways to realize CRC-16 examining procedure: Numeration and Look-up Table
4
0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291,
0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2,
0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2,
0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1,
0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252,
0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261,
0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231,
0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202
};
When the reader fails to execute command from host, it will return error code to host and
indicates the reason of failure.
5
0x11 Reader Baseband Board Hardware Version Error
6
0x63 The running reader doesn't support the tag protocol
7
3. Command Instruction
The command is used to inquire the system setting information of RFID device, including
products series number and hardware configuration information. The command structure
is as follows:
Commands instructions:
RFID Device Name: Name of returned RFID device, is defined by the user and used to
separate the different RFID devices in the same integrated system.
Note:
Because this command is only used to inquire one parameter, so which can be used to
specify and distinguish different bus addresses, query device name, device serial number
and device number, software and hardware version information;
Command response:
8
a) Command operated successfully:
Calling Example:
CRfidFrame frame;
CString userid=13800138000;
int nLen;
// Data binding function, self-encapsulation, refer to DEMO source code
PackDeviceCmd(0x01,frame,nLen,0);
// SOC is the socket for the device to login
if ( send(soc,(char*)&frame, nLen, NULL) != SOCKET_ERROR )
return TRUE;
else
9
return FALSE;
Commands Structure:
Commands instructions:
The reader will start up reception circuit to receive ID code sent by the tag after receiving
the command, and send the receiving data to the host.
0xXX Reserve
10
Command response:
Time information includes (time data is BCD code, as 0x11 means 11 but not 17):
GetClock_Para[0]:seconds
GetClock_Para[1]:minutes
GetClock_Para[2]:hour
GetClock_Para[3]:day
GetClock_Para[4]:date
GetClock_Para[5]:month
GetClock_Para[6]:year
Commands Structure:
12
Command response:
13
3.4 Command of Antenna Port Parameter Configures
(0x11H)
Commands Structure:
Command Instruction:
About reader:
Port Enable :
the first byte: 0x03 allow to modify the receiving gain of amplifier (Reserve)
The second byte: 0x03 allow to modify transmission power of 2401 RF device
(Reserve)
The Third byte: 0x03 allow to modify the attenuator power of RF device
Output Power:
14
0x02: high gain;
0x00-18DB
0x01-12DB
0x02 -6DB
0x03 0DB
0-0DB
1-2DB
2-4DB
3-6DB
4-8DB
5-10DB
6-12DB
....
15-30Db
Polling Time:
This command is used to inquire parameter of reader antenna port, defined as the above
section.
Commands Structure:
16
Bus Address, Control word,
Control Field 3 0x00~0xFF
Data field length, etc
commands of The host point
Command Word 1 0x12
the RFID device to operate
Check Field 2 0x00~0xFF CRC checking data
Command Instruction:
Reader device returns the antenna port parameter in turn according to format defined in
above section.
Command response:
17
Return the error code and
Error Code 1 0x01~0xFF Clarify the operation failure
reason
Check Field 2 0x00~0xFF CRC Check data
Commands Structure:
Command Instruction:
Parameter Types is the carrier parameter types, 0x00 is frequency hopping format.value
is 0x00.
Parameter data is the carrier parameter data, when the type is 0x00, this is the frequency
point serial number list.
About reader:
Parameter data:
18
02405M
12410M
22415M
32420M
162515M
172520M
Command response:
19
Check Field 2 0x00~0xFF CRC Check data
Commands Structure:
Command Instruction:
Command response:
02405M
12410M
22415M
32420M
162515M
172520M
Commands Structure:
21
Bus Address, Control word,
Control Field 3 0x00~0xFF
Data field length, etc
commands of The host point
Command Word 1 0xBO
the RFID device to operate
Parameter Types 7 0x00~0x99 BCD code of sending time
Check Field 2 0x00~0xFF CRC checking data
Command Instruction:
GetClock_Para[0]:seconds
GetClock_Para[1]:minutes
GetClock_Para[2]:hour
GetClock_Para[3]:day
GetClock_Para[4]:date
GetClock_Para[5]:month
GetClock_Para[6]:year
Command response:
This command is used to reply the data length received on the reader working process, or
the reader will continuously upload the same data package; after over some data package,
reader will judge the communication with the server disconnected, then reboot and login;
Commands Structure:
Command response:
Commands Structure:
Command response:
24
Without GPS function, reader didnt support this command.
25