YDCommStruct.h 1002 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #define CMD_HEAD_LEN 24
  3. #define CMD_PARAM_LEN 10000
  4. #define UDP_PARAM_LEN 1020
  5. #define UDP_PARAM_LEN_4K 4092 //4k
  6. #define UDP_PARAM_LEN_8K 8188 //8k
  7. #pragma pack(push)
  8. #pragma pack(1)
  9. typedef struct Command
  10. {
  11. short cmd; //类型
  12. short subType; //子类型
  13. int sFrom; //发送源
  14. int sTo; //目的地
  15. int flags; //标识
  16. int nParamLen; //参数长度Bytes
  17. int reserve1; //保留
  18. char cParam[CMD_PARAM_LEN];
  19. int GetInfoLen() {return 24;}; //固定长度,cmd的头信息
  20. int GetParamLen() {return nParamLen;}; //参数长度
  21. int GetBufLen() {return (GetInfoLen()+GetParamLen());} //有效数据长度
  22. }COMMAND,*LPCOMMAND;
  23. //typedef struct tagUdpPack
  24. //{
  25. // int dType;
  26. // char data[UDP_PARAM_LEN];
  27. //}UDPPACK,*LPUDPPACK;
  28. typedef struct tagUdpPack_4k
  29. {
  30. int dType;
  31. char data[UDP_PARAM_LEN_4K];
  32. }UDPPACK_4K, * LPUDPPACK_4K;
  33. typedef struct tagUdpPack_8k
  34. {
  35. int dType;
  36. char data[UDP_PARAM_LEN_8K];
  37. }UDPPACK_8K, * LPUDPPACK_8K;
  38. #pragma pack(pop)