// // ****************************************************************** // // /\ /| @File RS232Packet.h // // \ V/ @Brief // // | "") @Author lijinwen, ghz005@uni-trend.com.cn // // / | @Creation 2024-5-7 // // / \\ @Modified 2024-5-13 // // *(__\_\ // // ****************************************************************** #pragma once #include #include "ProtocolRS232Enums.h" namespace Protocol::ProtocolRS232 { //内部使用数据结构 数据帧 struct RS232Packet { bool StartBit; //起始位 bool ParityBit; //校验位数据 High or Low bool ParityFind; //是否存在校验位 bool ParityResult; //校验结果 有效 or 无效 uint8_t Data; //解码数据 int32_t DataIndex; //数据开始帧序号 int32_t ParityIndex; //校准开始帧序号 int32_t StartIndex; //数据开始序号 double PerBitLenght; //单字节数据时域占比长度 //virtual Enums::RS232DecodePacketType GetPacketType(); //virtual ~RS232Packet() = default; }; }