123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- // // ******************************************************************
- // // /\ /| @File RS232DecodeEvent.h
- // // \ V/ @Brief
- // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
- // // / | @Creation 2024-5-7
- // // / \\ @Modified 2024-5-13
- // // *(__\_\
- // // ******************************************************************
- #pragma once
- #include <vector>
- #include "ProtocolRS232Enums.h"
- #include "../DecodeEvent.h"
- namespace Protocol::ProtocolRS232
- {
- struct RS232DecodeEventUnit
- {
- int64_t StartIndex; //开始帧
- int64_t Length; //长度
- uint8_t Data; //数据
- Enums::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;
- // }
- };
- }
|