message_base.proto 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. syntax = "proto2";
  2. package message;
  3. //消息类型定义,每个在网络上传输的消息必须含有这个属性
  4. enum Message_type
  5. {
  6. eBase_msg=0x00;
  7. eCommand_msg=0x01; //指令消息
  8. eLocate_status_msg=0x11; //定位模块状态消息
  9. eLocate_request_msg=0x12; //定位请求消息
  10. eLocate_response_msg=0x13; //定位反馈消息
  11. eHarware_statu_msg=0x21; //调度模块硬件状态消息
  12. eExecute_request_msg=0x22; //请求调度消息
  13. eExecute_response_msg=0x23; //调度结果反馈消息
  14. }
  15. //通讯单元
  16. enum Communicator
  17. {
  18. eEmpty=0x0000;
  19. eMain=0x0001; //主流程
  20. eTerminor=0x0100;
  21. //数据表
  22. eTable=0x0200;
  23. //测量单元
  24. eMeasurer=0x0300;
  25. //调度机构
  26. eProcess=0x0400;
  27. //...
  28. }
  29. ////base message 用于解析未知类型的消息
  30. message Base_msg
  31. {
  32. required Message_type msg_type=1;
  33. optional int32 timeout_ms=2;
  34. required Communicator sender=3; //发送者
  35. required Communicator receiver=4; //接收者
  36. }
  37. //测量结果结构体
  38. message Locate_data
  39. {
  40. required int32 error_code=1;
  41. optional string error_description=2;
  42. optional float length=3;
  43. optional float width=4;
  44. optional float height=5;
  45. optional float wheel_base=6;
  46. optional float x=7;
  47. optional float y=8;
  48. optional float theta=9;
  49. }