Module_LcmContro.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #include <sys/time.h>
  2. #include <sys/timeb.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <sys/types.h>
  6. #include <sys/ioctl.h>
  7. #include <sys/socket.h>
  8. #include <sys/ipc.h>
  9. #include <sys/shm.h>
  10. #include <sys/shm.h>
  11. #include <sys/mman.h>
  12. #include <linux/wireless.h>
  13. #include <arpa/inet.h>
  14. #include <netinet/in.h>
  15. #include <unistd.h>
  16. #include <stdarg.h>
  17. #include <stdio.h> /*標準輸入輸出定義*/
  18. #include <stdlib.h> /*標準函數庫定義*/
  19. #include <unistd.h> /*Unix 標準函數定義*/
  20. #include <fcntl.h> /*檔控制定義*/
  21. #include <termios.h> /*PPSIX 終端控制定義*/
  22. #include <errno.h> /*錯誤號定義*/
  23. #include <errno.h>
  24. #include <string.h>
  25. #include <time.h>
  26. #include <ctype.h>
  27. #include <ifaddrs.h>
  28. #include <stdbool.h>
  29. #include "../../define.h"
  30. #include "Config.h"
  31. #define Debug
  32. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  33. #define PASS 1
  34. #define FAIL -1
  35. typedef unsigned char byte;
  36. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  37. struct StatusCodeData *ShmStatusCodeData;
  38. struct FanModuleData *ShmFanModuleData;
  39. #define CMD_TITLE_1 0x5A
  40. #define CMD_TITLE_2 0xA5
  41. #define CMD_READ 0x80
  42. #define CMD_WRITE 0x81
  43. #define CMD_MULTI_WRITE 0x82
  44. #define CMD_MULTI_READ 0x83
  45. #define CMD_BACKLIGHT 0x01
  46. #define CMD_REGISTER 0x03
  47. int _port;
  48. //char* pPortName = "/dev/ttyO2";
  49. char* pPortName = "/dev/ttyS3";
  50. char* moduleName = "DMT80480T070_09WT";
  51. byte _totalCount = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
  52. struct ChargingInfoData *_chargingInfoData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  53. bool isAbnormalStopFlag = false;
  54. struct timeval _ani_time;
  55. // 當前選擇的槍號
  56. short _currentPage = _LCM_NONE;
  57. byte _gunIndex = 0;
  58. byte _idlePageRotate = 1;
  59. bool _backend_conn_status = false;
  60. bool _wifi_conn_status = false;
  61. bool _net_conn_status = false;
  62. // LCM - HW
  63. //byte _everyPageRollChange = 0;
  64. short __conn_status = 0x0030;
  65. short __ethernet_status = 0x0036;
  66. short __wifi_status = 0x003C;
  67. short __sel_gun_btn = 0x0040;
  68. short __ret_home_btn = 0x0042;
  69. short __stop_charging_btn = 0x0044;
  70. short __qr_code = 0x0050;
  71. short __plug_in_arrow = 0x0060;
  72. short __conn_line = 0x0066;
  73. short __gun_type_index = 0x0070;
  74. short __qr_code_pre = 0x0080;
  75. short __side_top = 0x0090;
  76. short __side_down = 0x0092;
  77. short __conn_line_chag = 0x0096;
  78. short __batt_map = 0x0100;
  79. short __soc_value_charging = 0x0102;
  80. short __remain_time_map = 0x0106;
  81. short __power_map = 0x0108;
  82. short __energy_map = 0x010A;
  83. short __remain_time_tx = 0x0110;
  84. short __output_eng_tx = 0x0120;
  85. short __total_out_eng_tx = 0x0130;
  86. short __conn_line_comp = 0x0140;
  87. short __charging_proc_stop_tx = 0x0196;
  88. // ICON ID
  89. byte _disappear = 0;
  90. byte _disconnect = 1;
  91. byte _connect = 2;
  92. byte _warning = 3;
  93. byte _arrow_dark = 4;
  94. byte _arrow_light = 5;
  95. byte _ethernet_disconnect = 6;
  96. byte _ethernet_connect = 7;
  97. byte _wifi_disconnect = 8;
  98. byte _wifi_connect = 9;
  99. byte _logo = 10;
  100. byte _conn_map1 = 11;
  101. byte _conn_map2 = 12;
  102. byte _sel_gun_btn = 13;
  103. byte _back_home_btn = 14;
  104. byte _stop_charging_btn = 15;
  105. byte _stop_charging_rfid_btn = 16;
  106. byte _chademo_dark = 17;
  107. byte _ccs_dark = 18;
  108. byte _actype_dark = 19;
  109. byte _chademo_light = 20;
  110. byte _ccs_light = 21;
  111. byte _actype_light = 22;
  112. byte _side_rfid_1 = 23;
  113. byte _side_qr_1 = 24;
  114. byte _side_app_1 = 25;
  115. byte _side_rfid_2 = 26;
  116. byte _side_qr_2 = 27;
  117. byte _side_app_2 = 28;
  118. byte _charging_map1 = 29;
  119. byte _charging_map2 = 30;
  120. byte _battery_cap_20 = 31;
  121. byte _battery_cap_40 = 32;
  122. byte _battery_cap_60 = 33;
  123. byte _battery_cap_80 = 34;
  124. byte _battery_cap_100 = 35;
  125. byte _battery_map = 36;
  126. byte _power_map = 37;
  127. byte _time_map = 38;
  128. byte _complete_map = 39;
  129. byte _battery_soc_20 = 40;
  130. byte _battery_soc_40 = 41;
  131. byte _battery_soc_60 = 42;
  132. byte _battery_soc_80 = 43;
  133. byte _battery_soc_100 = 44;
  134. byte _battery_eng_map = 45;
  135. byte _money_map = 46;
  136. byte _elapse_time_map = 47;
  137. byte _black_bar_map = 48;