At present, there are two main ways to send data: active continuous sending mode and passive command and answer sending mode.
To send data, serial communication, the first to set the communication parameters.
Serial communication first sets the communication parameters.
The first section sets the general parameters.
Mainly includes the serial number: E.G.:COM1
Communication parameters: Baud rate, parity check, data bit, stop bit.
The second part of the data processing according to the specific protocol.
After setting the first part of the parameters, you can receive the sending data normally.
However, the data received and sent will also need to be processed according to the agreed protocol.
Data processing needs to be processed in stages.
The serial communication also exists the packet adhesion in TCP communication.
The first step is to clearly define a complete packet of communication from the received data.
Then, for a complete packet, and then according to the agreed communication protocol, the data packet contains a set of information: containing the status identification and data information.
Serial communication protocol Data processing one