Waveshare UART-WIFI232-B2 User Manual page 72

Table of Contents

Advertisement

UART-WIFI232-B2 User Manual
The length is variable, and the length of the whole data packet is not more than 4096 bytes.
Checksum:
Starting from the parameter area (including the parameter area), and counting up to the byte
before the checksum byte, calculate the sum and take the last byte as the checksum byte.
The following are specific application examples:
55FDAA00036100CC2D(Hex)
Among them,
Length byte 0003: length is 3.
Parameter byte: 6100: Send data to socketA connection.
Data area CC: The data sent is "0xCC".
Checksum calculation: 61+00+CC=2D.
(2) Data format from module to serial port device
When data (n bytes) is sent from the network, the module sends the data packet to the serial
device according to the following format; In addition, when the serial device sends data to the
module, if there is an error in sending, it will also reply to the serial device according to this format.
Header Length Parameter area Data
3
Header:
Always 0xAA0xFD0x55
Length:
The sum of all bytes from the parameter area (including the parameter area) to the sum check
(excluding the sum check). High byte first
Parameter area:
The first byte: common parameter area, which is the connection serial number (socket or socket
b); The data returned for SocketA is 0x61, and the data returned for SocketB is 0x62.
The second byte: spare parameter area, and the seventh bit indicates whether the reply frame is
data returned by the network or the module. (1: module returns data; 0: network returns data). Data:
If it is network data, copy the data directly to the location; The length is variable, and the length
of the whole data packet is not more than 4096 bytes.
If it is the data replied by the module, the corresponding operation reply code is returned. The
specific operation reply code is as follows:
No. Return code Description
1
0x00
2
0x01
3
0x02
4
0x04
5
0x10
Checksum:
Table Serial Port Sending Format
2(n+2) 2
Table Operation reply code
Header error
Data length error
Parameter error
Checksum error
Sending failed (parameters correct but sending failed)
Parity bit
n
1
72
Note
www.waveshare.com

Advertisement

Table of Contents
loading

Table of Contents