xinbiao.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef _XINBIAO_H_
  2. #define _XINBIAO_H_
  3. #define XINBIAO_NUM 100
  4. #define XINBIAO_FILE "/ext/prepack/xinbiao"
  5. #define LEADER_FILE "/ext/prepack/leader"
  6. /*
  7. 信标协议 cmd 00 通用
  8. 0a 摇晕 只收不发
  9. a0 解除摇晕
  10. 0b 摇毙 不收不发
  11. b0 解除摇毙
  12. 0c 强制打开GPS
  13. */
  14. #define NULLCMD 0x00
  15. #define YAOYUN 0xa0
  16. #define UNYAOYUN 0x0a
  17. #define YAOBI 0x0b
  18. #define UNYAOBI 0xb0
  19. #define GPSALLON 0x0c
  20. #define MAX_USER 100
  21. typedef struct{
  22. unsigned int xb_id;// 结构体index 也做作为mark
  23. unsigned int xb_CallID;
  24. unsigned char xb_CallName[26];
  25. unsigned int xb_longitue;//经度
  26. unsigned int xb_latitue;//纬度
  27. unsigned int xb_heading;//航向
  28. unsigned int xb_headerSpeed;
  29. unsigned short xb_elevation;//海拔
  30. unsigned short xb_dir;//相对方向
  31. unsigned short xb_distance; //相对距离
  32. }SUT_XINBIAO_PAGE;
  33. extern SUT_XINBIAO_PAGE sut_xinbiaopage[XINBIAO_NUM];
  34. extern SUT_XINBIAO_PAGE New_xinbiaopage;
  35. typedef struct{
  36. unsigned char Max_id;//最大值
  37. }SUT_XINBIAO_INFO;
  38. typedef struct{
  39. int id;
  40. char UserName[26];
  41. }USERARR;
  42. typedef struct{
  43. char status;
  44. int id;
  45. }LEADER;
  46. extern SUT_XINBIAO_INFO sut_xinbiao_info;
  47. extern USERARR UserArr[MAX_USER];
  48. extern LEADER leader[XINBIAO_NUM];
  49. void Recv_PackNewxinbiaopage(char*msg);
  50. void XinbiaoPackSend(char cmd);
  51. void Xinbiao_handler(unsigned int interval);
  52. /*
  53. 首长功能
  54. */
  55. signed char Record_Leader_CurIndex();
  56. char Record_Leader_Scanf(int id);
  57. void Record_Leader_Status(char type);
  58. void LeaderPackSend(char cmd);
  59. void LeaderRecv_handler(char*msg,char type);
  60. void ReadLeaderFile();
  61. void WriteLeaderFile();
  62. #endif