// // ****************************************************************** // // /\ /| @File RS232DecodeEvent.h // // \ V/ @Brief // // | "") @Author lijinwen, ghz005@uni-trend.com.cn // // / | @Creation 2024-05-16 // // / \\ @Modified 2024-06-05 // // *(__\_\ // // ****************************************************************** #pragma once #include #include "ProtocolRS232Enums.h" #include "../DecodeEvent.h" namespace Protocol { struct RS232DecodeEventUnit { int64_t StartIndex; //开始帧 int64_t Length; //长度 uint8_t Data; //数据 RS232Enums::RS232DecodeEventType EventType; //事件类型 None, Start, Data,Parity, // //事件相等判断 // bool Equals(const RS232DecodeEventUint eventData) const // { // return Data == eventData.Data; // } }; struct RS232DecodeEvent : DecodeBaseEvent { int8_t ParityResult; //校验结果 RS232DecodeEventUnit* EventData; //事件数据指针 int64_t EventDataCount; //事件数据长度 //事件相等判断 // bool Equals(const RS232DecodeEvent decodeEvent) // { // if (decodeEvent.EventDataCount != EventDataCount) // { // return false; // } // const int64_t size = decodeEvent.EventDataCount; // for (int64_t i = 0; i < size; i++) // { // if (!decodeEvent.EventData[i].Equals(EventData[i])) // { // return false; // } // } // return true; // } }; }