rs232_packet.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. // // ******************************************************************
  2. // // /\ /| @File rs232_packet.h
  3. // // \ V/ @Brief
  4. // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
  5. // // / | @Creation 2024-06-26
  6. // // / \\ @Modified 2024-07-16
  7. // // *(__\_\
  8. // // ******************************************************************
  9. #pragma once
  10. #include <cstdint>
  11. #include "protocol_rs232_enums.h"
  12. namespace Protocol
  13. {
  14. //内部使用数据结构 数据帧
  15. struct Rs232Packet
  16. {
  17. bool start_bit; //起始位
  18. bool parity_bit; //校验位数据 High or Low
  19. bool parity_find; //是否存在校验位
  20. bool parity_result; //校验结果 有效 or 无效
  21. uint8_t data; //解码数据
  22. int32_t data_index; //数据开始帧序号
  23. int32_t parity_index; //校准开始帧序号
  24. int32_t start_index; //数据开始序号
  25. double per_bit_length; //单字节数据时域占比长度
  26. };
  27. }