communication_message.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // Created by huli on 2020/6/29.
  3. //
  4. #ifndef NNXX_TESTS_COMMUNICATION_MESSAGE_H
  5. #define NNXX_TESTS_COMMUNICATION_MESSAGE_H
  6. #include <time.h>
  7. #include <sys/time.h>
  8. #include <chrono>
  9. class Communication_message
  10. {
  11. //消息类型定义,每个在网络上传输的消息必须含有这个属性
  12. enum Message_type
  13. {
  14. COMMAND_MESSAGE = 0X01, //指令消息
  15. SENSING_STATUS_MESSAGE = 0X11, //定位模块状态消息
  16. SENSING_REQUEST_MESSAGE = 0X12, //定位请求消息
  17. SENSING_RESPONSE_MESSAGE = 0X13, //定位反馈消息
  18. HARWARE_STATU_MESSAGE = 0X21, //调度模块硬件状态消息
  19. EXECUTE_REQUEST_MESSAGE = 0X22, //请求调度消息
  20. EXECUTE_RESPONSE_MESSAGE = 0X23, //调度结果反馈消息
  21. };
  22. public:
  23. Communication_message();
  24. Communication_message(const Communication_message& other)= default;
  25. Communication_message& operator =(const Communication_message& other)= default;
  26. ~Communication_message();
  27. public://API functions
  28. public://get or set member variable
  29. protected://member variable
  30. Message_type m_message_type; //消息类型
  31. std::chrono::system_clock::time_point m_receive_time; //接收时间
  32. private:
  33. };
  34. #endif //NNXX_TESTS_COMMUNICATION_MESSAGE_H