comm.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #pragma once
  2. #include<string>
  3. #include <unordered_map>
  4. #include <vector>
  5. #define WM_NOTIFY_REP WM_APP+1
  6. #define WM_NOTIFY_ANSWER WM_APP+2
  7. #define WM_NOTIFY_REQ WM_APP+3
  8. //#define WM_NOTIFY_LEAVE WM_APP+3
  9. #define WM_NOTIFY_CANDIDATE WM_APP+4
  10. #define WM_NOTIFY_OFFER WM_APP+5
  11. #define WM_NOTIFY_LEAVE WM_APP+6
  12. #define WM_ASK_VIDEOREQ WM_APP+8
  13. template<typename T>
  14. struct FVector3
  15. {
  16. T X;
  17. T Y;
  18. T Z;
  19. };
  20. typedef FVector3<double> FVector3d;
  21. enum RadarPosition :int32_t
  22. {
  23. RADAR_LEFT,
  24. RADAR_RIGHT,
  25. RADAR_REAR,
  26. RADAR_ALL
  27. };
  28. enum RenderPosition :int32_t
  29. {
  30. FRONT,
  31. BACK,
  32. LEFT,
  33. RIGHT,
  34. LANCHOR,
  35. RANCHOR,
  36. ALL
  37. };
  38. enum EgoType :int32_t
  39. {
  40. None,
  41. User,
  42. Car,
  43. Monitor
  44. };
  45. enum CarType
  46. {
  47. ZJ,
  48. KRESS,
  49. };
  50. enum ChannelType:int32_t
  51. {
  52. CHANNEL_CAR,
  53. CHANNEL_RADAR,
  54. CHANNEL_ENCODE,
  55. CHANNEL_ALL,
  56. };
  57. enum WorkArea
  58. {
  59. Area_A,
  60. Area_B,
  61. Area_C,
  62. Area_D,
  63. Area_E,
  64. Area_F,
  65. Area_G,
  66. Area_H,
  67. Area_I,
  68. Area_J,
  69. Area_ALL
  70. };
  71. enum Metal_Area
  72. {
  73. Put_Wait =0,
  74. Put_1=1,
  75. Put_2=2,
  76. Put_3=3,
  77. Get_Wait=10,
  78. Get_1=11,
  79. Get_2=12,
  80. Get_3=13,
  81. Out_Area=100
  82. };
  83. enum UserState
  84. {
  85. Offline=0,
  86. Idle = 1,
  87. Remote = 2,
  88. Automotive = 3,
  89. AskRemote = 4
  90. };
  91. enum MoveDesc
  92. {
  93. Move_OK = 0,
  94. Move_Encode_Fail = 1,
  95. Move_Unknow_Fail = 2
  96. };
  97. enum Lock_Status
  98. {
  99. Lock_Open,
  100. Lock_Closed,
  101. Lock_CloseInvalid,
  102. };
  103. struct UserCamera
  104. {
  105. int32_t uid;
  106. EgoType type;
  107. UserState state;
  108. CarType carType;
  109. std::string name;
  110. std::string viewurl;
  111. };
  112. struct UserDriver
  113. {
  114. int32_t uid;
  115. EgoType type;
  116. UserState state;
  117. std::string name;
  118. };
  119. struct OfferDesc
  120. {
  121. char type[16];
  122. char sdp[4096 * 3-16];
  123. };
  124. struct AnswerDesc
  125. {
  126. char type[16];
  127. char sdp[4096 * 3 - 16];
  128. };
  129. struct CandidateDesc
  130. {
  131. char candidate[4096];
  132. char sdp_mid[4096];
  133. int32_t sdp_mline_index;
  134. };
  135. #pragma pack(1)
  136. #define CAN_MSG_LEN 13
  137. struct cannet_frame
  138. {
  139. int8_t dlc;
  140. int32_t canid;
  141. int8_t data[8];
  142. };
  143. #pragma pack()
  144. enum RobotStatus
  145. {
  146. OK,
  147. Fail,
  148. };
  149. class IRender
  150. {
  151. public:
  152. virtual void OnRender(std::unique_ptr<uint8_t>& pBuffer, int32_t width, int32_t height) = 0;
  153. virtual void Empty() = 0;
  154. };
  155. struct FeedData
  156. {
  157. int32_t work_pressure;//����ϵͳѹ��
  158. int32_t brake_pressure; //�ƶ�ϵͳѹ��
  159. int32_t gearbox_oil_temp;//����������
  160. int32_t gearbox_oil_pressure; //��������ѹ
  161. int32_t engine_rpm;//������ת��
  162. int32_t engine_pressure;
  163. int32_t speed;
  164. // int32_t gear;
  165. int32_t cold_water;
  166. int32_t steer_angle;
  167. int32_t left_lock_status;
  168. int32_t right_lock_status;
  169. int32_t left_angle;
  170. int32_t right_angle;
  171. };