tracker.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. package tracker;
  2. message GPS {
  3. optional sint32 longitude = 1;
  4. optional sint32 latitude = 2;
  5. optional int32 degree = 3;
  6. optional int32 speed = 4;
  7. optional int32 viewed_sates = 5;
  8. }
  9. message LacAndCell {
  10. message Cells {
  11. message Cell {
  12. required int32 mcc = 1;
  13. required int32 mnc = 2;
  14. required int32 cell_id = 3;
  15. required int32 cell_rssi = 4;
  16. }
  17. required int32 lac_id = 1;
  18. repeated Cell cells = 2;
  19. }
  20. repeated Cells cells = 1;
  21. optional int32 ta = 2;
  22. }
  23. message Status {
  24. optional bool shake = 1;
  25. optional bool charger = 2;
  26. optional bool acc = 3;
  27. optional bool gps = 4;
  28. optional int32 rssi = 5;
  29. optional int32 vbat = 6;
  30. enum ChargeStatus {
  31. NOT_CHARGE = 0;
  32. CHARGING = 1;
  33. CHARGE_COMPLETE = 2;
  34. }
  35. optional ChargeStatus charge_status = 7;
  36. }
  37. message LogIn {
  38. optional int32 project_id = 1;
  39. optional string project_name = 2;
  40. optional string script_version = 3;
  41. optional string iccid = 4;
  42. optional string imsi = 5;
  43. optional int32 heart_interval = 6;
  44. }
  45. message Location {
  46. enum LocationType {
  47. DEV_TIMER_REPORT = 0;
  48. SVR_QUERY_RSP = 1;
  49. DEV_SOS_REPORT = 2;
  50. DEV_KEY_REPORT = 3;
  51. }
  52. required LocationType type = 1;
  53. optional bool gps_exist = 2;
  54. optional GPS gps_info = 3;
  55. optional bool cell_exist = 4;
  56. optional LacAndCell cell_info = 5;
  57. optional Status status = 6;
  58. }
  59. message Heart {
  60. required Status status = 1;
  61. }
  62. enum ParaType {
  63. GUARD = 0;
  64. LOCATION_INTERVAL = 1;
  65. }
  66. message DevParaReport {
  67. required ParaType type = 1;
  68. optional bool guard = 2;
  69. optional int32 location_interval = 3;
  70. }
  71. message DevSvrSetParaRsp {
  72. required ParaType type = 1;
  73. required bool result = 2;
  74. }
  75. message DevSvrEventRsp {
  76. required SvrMessageType type = 1;
  77. optional bool result = 2;
  78. }
  79. message Client {
  80. enum ClientMessageID {
  81. DEV_LOGIN = 0;
  82. DEV_LOCATION = 1;
  83. DEV_HEART = 2;
  84. DEV_PARA_REPORT = 3;
  85. DEV_SVRSETPARA_RSP = 4;
  86. DEV_SVREVENT_RSP = 5;
  87. }
  88. required ClientMessageID message_id = 1;
  89. optional LogIn log_in = 2;
  90. optional Location location = 3;
  91. optional Heart heart = 4;
  92. optional DevParaReport para_report = 5;
  93. optional DevSvrSetParaRsp set_para_rsp = 6;
  94. optional DevSvrEventRsp event_rsp = 7;
  95. }
  96. message SvrSetPara {
  97. required ParaType type = 1;
  98. optional bool guard = 2;
  99. optional int32 location_interval = 3;
  100. }
  101. enum SvrMessageType {
  102. SVR_SET_PARA = 0;
  103. SVR_QUERY_LOCATION = 1;
  104. SVR_RESET = 2;
  105. SVR_POWEROFF = 3;
  106. SVR_RESTORE = 4;
  107. }
  108. message Server {
  109. required SvrMessageType message_id = 1;
  110. optional SvrSetPara svr_set_para = 2;
  111. }