Convert Server User Manual
Jinan USR IOT Technology Limited
17 / 41
5.2.2.
5.2.2.
5.2.2.
5.2.2. Serial
Serial
Serial
Serial command
command
command
command mode
mode
mode
mode
In this mode, the user can send the serial data to a different server address, this pattern can be use UDP or
TCP client sends data to the server.
Customer MCU send packets according to the following format, parsing Convert Server is finished, only the n
bytes of data sent to the destination address.When data is returned, not analytical data from serial port output
directly.
Table
Table
Table
Table 6
6
6
6 Protocol
Protocol
Protocol
Protocol table
table
table
table of
of
of
of Serial
Serial
Serial
Serial command
command
command
command mode
mode
mode
mode
frame
header
length
functio
n
byte
Backup
data area
Destinati
on port
Target
address
Data
Sum
check
2
2
(n+m+5)
1
2
2
m
n
1
frame
frame
frame
frame header
header
header
header
:
0x55 0xAA
(
Constant
)
Length
Length
Length
Length
:
Starting from the function byte, to Sum check (does not contain the sum check) all bytes.
High byte at
the front
Function
Function
Function
Function byte
byte
byte
byte
:
Bit0:
(
UDP:0 ;TCP:1
)
Bit1:
(
Short connection:0;Long connection:1
)
Bit2:
(
IP:0;Domain name:1
)
Bit7:
(
cut protocol:0;full protocol:1
)
Note: currently only supports cut protocol
Notes:
�
Bit1:If it is a short connection, it sends data, and then will be disconnected; if it is long connection, it
sends data, connection will remain, until the re changing the target address.
�
Bit2:Indicates that the target address is IP or domain name. If it is IP, the target address is 4 bytes; if the
domain name, the target address length for the entire domain name string length (the last byte address is
‘\0’, that is the end of the string).
�
Bit7:Under the cut protocol, reply frame contains only data; Under the full protocol, reply frame has
"failed to send", "waiting for", "UDP radio response equipment IP" frame data.
Backup
Backup
Backup
Backup data
data
data
data area
area
area
area::::
�
First byte:If it is a short connection, this position is TCP waits for the timeout time (1-255), if the send
command is completed, did not receive a response, then wait a few seconds and the corresponding, if 5,
said to wait for the 5S to disconnect; if the sending command, immediately receive the returned data,
then immediately disconnected; if it is long connection, this position is 0x00.
�
Second byte:Reserve
Destination
Destination
Destination
Destination port
port
port
port::::
Little endian, low byte in the former,such as port 23, here are 0x17 0x00
Target
Target
Target
Target address:
address:
address:
address:
If it is IP, is 4 bytes, for example, 192.168.0.7 said 0x07 0x00 0xA8 0xC0; if it is a domain name, then the
address of
indefinite length,ending with the’\0'.