6 years ago (2015-08-05)  Software development |   First to comment  156 
post score 0 times, average 0.0

Regional Controller Serial Protocol

1. Communication format = [frame header] + [data length] + [instruction code] + [communication content] + [checksum] + [end of frame]. 2. The data length is the total number of bytes (including frame headers and frame trailers) from the beginning of the frame to the end of the frame. 3. The checksum is the exclusive OR of all the bytes in front of the check bits. 4. RS232 serial port communication, Porter Rate 9600, no parity, 8 data bits, 1 stop bit. 5, multi-byte data transmission, high in the front, low in the post C language reads serial data and prints in hexadecimal

Key code port.cpp



This article has been printed on copyright and is protected by copyright laws. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/c-language-read-serial-data-hexadecimal-printing-2.html

Post comment


No Comment


Forget password?