RS232Packet.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // // ******************************************************************
  2. // // /\ /| @File RS232Packet.h
  3. // // \ V/ @Brief
  4. // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
  5. // // / | @Creation 2024-05-16
  6. // // / \\ @Modified 2024-05-16
  7. // // *(__\_\
  8. // // ******************************************************************
  9. #pragma once
  10. #include <cstdint>
  11. #include "ProtocolRS232Enums.h"
  12. namespace Protocol
  13. {
  14. //内部使用数据结构 数据帧
  15. struct RS232Packet
  16. {
  17. bool StartBit; //起始位
  18. bool ParityBit; //校验位数据 High or Low
  19. bool ParityFind; //是否存在校验位
  20. bool ParityResult; //校验结果 有效 or 无效
  21. uint8_t Data; //解码数据
  22. int32_t DataIndex; //数据开始帧序号
  23. int32_t ParityIndex; //校准开始帧序号
  24. int32_t StartIndex; //数据开始序号
  25. double PerBitLenght; //单字节数据时域占比长度
  26. //virtual Enums::RS232DecodePacketType GetPacketType();
  27. //virtual ~RS232Packet() = default;
  28. };
  29. }