Professional Documents
Culture Documents
CEP 3.A
NO: HZ_Protocol_CEP
2016-02-18
Version
1. Translate to English.
3.A.1 2014/12/07 Seth
2. Remove segment labels.
1.1.Communitation Structure
1.2.Protocol Structure
The base station open 9999 UDP port to receive the initialization command,
and also send ACK to 9999 UDP port of the Server.
2.1.1.Search Command
2.1.2.Response Message
Fixed content(2Bytes) 00 01
6个 0(6Bytes) 00 00 00 00 00 00
Fixed content(2Bytes) 5A 5A
Fixed content(1Byte) 5A
MAC Address(6Bytes) 00 23 20 EE 0C BB
MAC Ending(1Byte) A5
IP Address(4Bytes) C0 A8 0B 64 192.168.11.100
Subnet mask(4Bytes) FF FF FF 00 255.255.255.0
Gateway(4Bytes) C0 A8 0B 01 192.168.11.1
IP of Server(4Bytes) C0 A8 0B 16 192.168.11.22
Server UDP port(2Bytes) 04 D2 1234
Local UDP port(2Bytes) 04 01 1025
Fixed content 0A 06 00
Module Name(33Bytes) 43 45 4E 54 55 52 59 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Ending(1Byte) 3C
Configure the network parameters, such as IP address, server UDP port, local UDP
port, module name, subnet mask, and gateway. When the Base station receive the
message, it will restart itself.
Content / sample remark
Fixed content(2Bytes) 00 03
MAC Address(6Bytes) 00 23 14 EE 0C BB
MAC Ending(2Bytes) A5 A5
8个 0(8Bytes) 00 00 00 00 00 00 00 00
IP Address(4Bytes) C0 A8 0A 6F 192.168.10.111
Subnet mask(4Bytes) FF FF FF 00 255.255.255.0
Gateway(4Bytes) C0 A8 0A 01 192.168.10.1
IP of Server(4Bytes) C0 A8 0A 66 192.168.10.102
Server UDP Port(2Bytes) 04 D2 1234
Local UDP Port(2Bytes) 04 01 1025
Fixed content(3Bytes) 06 06 00
Module Name(33Bytes) 43 45 4E 54 55 52 59 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00
Ending(1Byte) 3C
3.1.Overview
There are 2 type general command frame format, short frame and long frame.
Short frame:
The short frame is less than 255 bytes, the format is:
Head Length Reader ID Message Sequence Payload Check Sum
Type
2Bytes 1Byte 2Bytes 1Byte 2Bytes x Bytes 1Byte
Long frame is used to transmit long message which is long than 255 and less 长
than 65535 bytes, and the frame format is:
Head Length Reader ID Message Sequence Payload Check Sum
Type
2Bytes 2Bytes 2Bytes 1Byte 2Bytes x Bytes 1Byte
The long frame is used in transmitting E-paper dot-matrix information.
The following table explains every segment.
Segment
Head Always be [0x0A 0x0A]
Length The length of the message, not including the ‘Head’and ‘Length’ segment. 2 bytes.
Reader ID Always be [0xFF 0xFF]
Message The type of message.
Type
Sequence The Server will generate unique sequence for every message. For ***_ACK
message, it is response message. So, its sequence is same as request message. For
example, Server send READER_SEARCH message with a sequence 0x60, correlated,
the Base Station will response a READER_SEARCH_ACK message with a sequence
0x60.
Payload The content of message. It can be empty.
Check XOR check sum of the total message (not including “Check Sum” segment).
Sum
3.2.Message Type
The following table shows all types of the general message. (PC: software, AP: Base
station).
Message Name Type Value Data flow
READER_SEARCH 0x00 PC->AP
READER_SEARCH_ACK 0x01 AP->PC
TAG_STATE_UPLOAD_NEW 0x3B AP->PC
WRITE_PRICEBUF_NEW 0x40 PC->AP
WRITE_PRICEBUF_NEW_ACK 0x41 AP->PC
BIND_TAG&BARCODE_NEW 0x45 AP->PC
UN_BINDING_NEW 0x47 AP->PC
QUERY_GOODS_PROPERTY 0x2D AP->PC
QUERY_GOODS_PROPERTY_ACK 0x2E PC->AP
WRITE_IMAGE_DATA_INFO_NEW 0x48 PC->AP
WRITE_IMAGE_DATA_INFO_NEW_ACK 0x49 AP->PC
WRITE_IMAGE_DATA_NEW 0x4A PC->AP
WRITE_IMAGE_DATA _NEW_ACK 0x4B AP->PC
UPLOAD_TAG_STATE&VALUE_NEW 0x4F AP->PC
…… …… ……
READER_SEARCH
Query the status and the version of the Base Station.
Segment Payload
Value <empty>
Length of bytes 0Bytes
READER_SEARCH_ACK
The Base Station response the “READER_SEARCH” command by this message
type.
Segment Payload
Value ReaderStatus VersionInfo
Length of bytes 1Bytes 3Bytes
Segment Explanation
ReaderStatus Reader status, 0 indicates normal, 1 indicates unnormal.
VersionInfo Version information of the base station, 3 bytes.
Protocol version Hardware version Firmware version
1 byte 1 byte 1 byte
3.3.2.Collect Tag’s Heart beat
The base station will collect the tag’s heart beat, and when the cache is full (41
items) or time is up to 2 minutes, base station will upload the information. For
software, Server can analyse the information to dispatch a best base station for
every tag. Meanwhile, the Server can analyse which tag is offline, low-battery, and
reset.
UPLOAD_TAG_STATE&VALUE_NEW
Payload
Tag 1 Tag 2 Tag 3 Tag … Tag N
BIND_TAG&BARCODE_NEW
When the handheld-terminal scan the tag ID and the barcode of the product, it will
upload the information to the base station, and the base station will upload to the
Server by this message.
Payload
TagID BarCode
4Bytes xByte
The Barcode segment is encoded by BCD code. If the length of barcode is odd, use
‘A’ to represent the last half byte.
For example,
1234567890123 0x12,0x34,0x56,0x78,0x90,0x12,0x3A
12345678 0x12, 0x34, 0x56, 0x78
When the tag does not use, the operator will use Handheld-terminal to tell Server.
Meanwhile, the tag will switch to the initial page.
UN_BINDING_NEW
Payload
TagID Reserved ID
4Bytes 4Bytes
The handheld-terminal can query any property of the product. When the handheld
submit a query request to base station, the base station will forward the
“QUERY_GOODS_PROPERTY”command to the server, and the Server should
response a “QUERY_GOODS_PROPERTY_ACK”.
QUERY_GOODS_PROPERTY
The command specifies 2 parameters, barcode of the product and the property ID.
Payload
Barcode AttributeID
xBytes 1Byte
“Barcode”is a BCD code.
QUERY_GOODS_PROPERTY_ACK
负载
Attribute Contents
xBytes
The “Attribute Contents” is less than 28 bytes.
3.5.Tag Process
This section define the messages that used to interactive between tag and the
Server. There are 2 case. One is small data message, and the other is big data
message.
Small data message: used to send short message that can be transmitted in
one frame, such as:
Update the cotent of segment labels.
Send command to control the labels (switch cache pages, query some
information of tag, and so on).
Big data message: used to send big data, such as updating dot-matrix tag.
This process is used in transmitting small data, such as segment data of segment
tag and controlling command data of all kinds of tag.
Base
Server Tag
Station
Send "WRITE_PRICEBUF_NEW"
Cache Task
Send "WRITE_PRICEBUF_NEW_ACK"
Transmit by 2.4Ghz
WRITE_PRICEBUF_NEW
Payloads
TagID <Fixed Content> PriceInfo
4Bytes 1 byte, 0x03 xBytes
This message is used in 2 case, and the <PriceInfo> definition is depend on the case:
Update the screen of Segment tag.
The lower four bits of the first byte is 0. The content of <PriceInfo> field is
different by the tag model. There are 2 segment tag models in use. They are
TS823L and TS825N.
TS823L:
1. Segment definition
2. True table
3. Explain
The “Segment definition” name every segment in the display for referring
to the “True table”. The “Ture table” dispatch every segment to a bit in
the <PriceInfo> field. If the value of the bit is 0, it means the segment in the
display if OFF, and 1 is ON.
The Low 4-bit of Byte0 in the table is special. If it‘s 0b0000, means this
message is a segment updating message. If it’s 0b0001, means this
message is a controlling command message. Byte21 is 0x00 always.
TS825N:
1. Segment definition
2. True table
3. Explain
The “Segment definition” name every segment in the display for referring
to the “True table”. The “Ture table” dispatch every segment to a bit in
the <PriceInfo> field. If the value of the bit is 0, it means the segment in the
display if OFF, and 1 is ON.
The value of Byte0 in the table is special. If it‘s 0x00, means this message
is a segment updating message. If it’s 0x01, means this message is a
controlling command message.
Send some controlling command data.
The structure of <PriceInfo> is a little different between Dot Matrix tag and
Segment tag.
Segment tag:
The length is depend on the model. The lower four bits of the first byte is
0x01 (refer to the last section above).
Dot Matrix tag:
The length is 12 bytes. The content is depend on the type of tag command
and refer to the following table.
The definition of the tag command for dot-matrix tag.
Tag Value of <PriceInfo> Description
command
WRITE_PRICEBUF_NEW_ACK
When Base Station received the “WRITE_PRICEBUF_NEW”message, it will cache
the task, and response the “WRITE_PRICEBUF_NEW_ACK”to Server. The server
use it to check if the message is sent to the Base station and cached successfully.
Payload
TagID State
4Bytes 1Byte
For State, 0x00 is succeeded, 0x01 is failed when the memory is full. The memory
of the base station is 32 MB.
This process is used in transmitting big data, such as pixels data of Dot-Matrix tag
and NFC content for some special tag.
Base
Server Tag
Station
Send "WRITE_IMAGE_DATA_INFO_NEW"
Send "WRITE_IMAGE_DATA_INFO_NEW_ACK"
Send "WRITE_IMAGE_DATA_NEW"
Cache Task
Send "WRITE_IMAGE_DATA_NEW_ACK"
Transmit by 2.4Ghz
Send "TAG_STATE_UPLOAD_NEW"
WRITE_IMAGE_DATA_INFO_NEW
Before send big data, Server should send an Info-Packet to describe the content of
the big data. The format is as follow:
Payload
TagID TotalFrame StorePosition FinallyFrameBytes L_Position R_Position
4Bytes 2Bytes 1Byte 1Byte 4Bytes 4Bytes
WRITE_IMAGE_DATA_INFO_NEW_ACK
When Base Station received the “WRITE_IMAGE_DATA_INFO_NEW”message, it
will cache the task, and response the “WRITE_IMAGE_DATA_INFO_NEW_ACK”to
Server. The server use it to check if the message is sent to the Base station and
cached successfully.
Payload
TagID State
4Bytes 1Byte
WRITE_IMAGE_DATA_NEW
It use long frame. The structure of the payload is:
Payload
TagID PackageTotal PackageNum ImageData
4Bytes 2Bytes 2Bytes xBytes
Field Description
PackageTotal The total numbers of data packet, consisting of 2 bytes. 65535
packets is the max value. For the reliability of UDP communication
between Server and Base station, the IMAGE DATA can not be too
big. So, the IMAGE data should be splitted, and the biggest
ImageData is 1428 bytes.
PackageNum The series number of current packets, consisting of 2 bytes. The
number starts from zero. When the value +1=PackageTotal”, it
means the last data packet.
ImageData Image data, the longest length of each packet is 1428 bytes.
The image data is simplized 1-bit (2-bit for 3 color labels) bitmap
format of an image. The following table show the map of color to
value of each dot.
Value of dot Black-white label Black-white-red label
Black 0 00
White 1 11
Red / 01
WRITE_IMAGE_DATA_NEW_ACK
Payload
TagID PackageTotal PackageNum State
4Bytes 2Bytes 2Bytes 1Byte
Field Description
PackageTotal The valud of the field in related WRITE_IMAGE_DATA_NEW
message.
PackageNum The value of the field in related WRITE_IMAGE_DATA_NEW
message, and started as 0, and the PackageNum of the last
package is [PackageTotal – 1].
State 0x00- successful to cache, 0x01- lack of buffering.
As the diagram, the above message just complete to cache the information on the
base station. This section will show the message that is uploaded when the tag is
updated successed by base station.
TAG_STATE_UPLOAD_NEW
Payload
TagID TagState StateValue
4Bytes 1Byte xBytes
Segment Explanation
TagID Tag ID, 4 bytes
TagState State of the Tag, refer to the table below
StateValue State’value of the Tag, refer to the table below
0x12 Update failed Not all of the data transmitted from Base 0Byte
station to the Tag successfully.
0x22 Time out If the tag doesn’t update succeeded 0Byte
after a [Task keeplive] interval, the base
station will return this value. The value of
[Task keeplive] is 30 seconds before FW
version 0x18 of base station. And it’s 45
seconds after 0x19 version.
0x01 Battery Percentage 1Byte
0x02 Temperature 1Byte Temperature+1Byte Humidity 2Byte
&Humidity