12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // // ******************************************************************
- // // /\ /| @File rs232_decode_event.h
- // // \ V/ @Brief
- // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
- // // / | @Creation 2024-06-26
- // // / \\ @Modified 2024-07-16
- // // *(__\_\
- // // ******************************************************************
- #pragma once
- #include <vector>
- #include "protocol_rs232_enums.h"
- #include "../decode_event.h"
- namespace Protocol
- {
- struct Rs232DecodeEventUnit
- {
- int64_t start_index; //开始帧
- int64_t length; //长度
- uint8_t data; //数据
- Rs232Enums::Rs232DecodeEventType event_type; //事件类型 None, Start, Data,Parity,
- // //事件相等判断
- // bool Equals(const RS232DecodeEventUint eventData) const
- // {
- // return Data == eventData.Data;
- // }
- };
- struct Rs232DecodeEvent : DecodeBaseEvent
- {
- int8_t parity_result; //校验结果
-
- Rs232DecodeEventUnit* event_data; //事件数据指针
- int64_t event_data_count; //事件数据长度
- //事件相等判断
- // 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;
- // }
- };
- }
|