system_communicator.cpp 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // Created by huli on 2020/6/28.
  3. //
  4. #include "system_communicator.h"
  5. System_communicator::System_communicator()
  6. {
  7. }
  8. System_communicator::~System_communicator()
  9. {
  10. }
  11. //定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
  12. Error_manager System_communicator::encapsulate_send_data()
  13. {
  14. return Error_code::SUCCESS;
  15. }
  16. /*
  17. * 发送消息函数
  18. */
  19. Error_manager System_communicator::encapsulate_msg(Communication_message* message)
  20. {
  21. switch(message->get_message_type())
  22. {
  23. default:break;
  24. }
  25. }
  26. /*
  27. * 检测消息是否合法
  28. */
  29. Error_manager System_communicator::check_msg(Communication_message* p_msg)
  30. {
  31. return SUCCESS;
  32. }
  33. //检查消息是否可以被处理, 需要重载
  34. Error_manager System_communicator::check_executer(Communication_message* p_msg)
  35. {
  36. return SUCCESS;
  37. }
  38. /*
  39. * 处理接收到的消息
  40. */
  41. Error_manager System_communicator::execute_msg(Communication_message* p_msg)
  42. {
  43. /*
  44. * 接收终端指令, 生成流程
  45. */
  46. }