123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- #include <sys/time.h>
- #include <sys/timeb.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <sys/ioctl.h>
- #include <sys/socket.h>
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <sys/shm.h>
- #include <sys/mman.h>
- #include <linux/wireless.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
- #include <unistd.h>
- #include <stdarg.h>
- #include <stdio.h> /*標準輸入輸出定義*/
- #include <stdlib.h> /*標準函數庫定義*/
- #include <unistd.h> /*Unix 標準函數定義*/
- #include <fcntl.h> /*檔控制定義*/
- #include <termios.h> /*PPSIX 終端控制定義*/
- #include <errno.h> /*錯誤號定義*/
- #include <errno.h>
- #include <string.h>
- #include <time.h>
- #include <ctype.h>
- #include <ifaddrs.h>
- #include <stdbool.h>
- #include "../../define.h"
- #include "Config.h"
- #define Debug
- #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
- #define PASS 1
- #define FAIL -1
- typedef unsigned char byte;
- struct SysConfigAndInfo *ShmSysConfigAndInfo;
- struct StatusCodeData *ShmStatusCodeData;
- struct FanModuleData *ShmFanModuleData;
- #define CMD_TITLE_1 0x5A
- #define CMD_TITLE_2 0xA5
- #define CMD_READ 0x80
- #define CMD_WRITE 0x81
- #define CMD_MULTI_WRITE 0x82
- #define CMD_MULTI_READ 0x83
- #define CMD_BACKLIGHT 0x01
- #define CMD_REGISTER 0x03
- int _port;
- //char* pPortName = "/dev/ttyO2";
- char* pPortName = "/dev/ttyS3";
- char* moduleName = "DMT80480T070_09WT";
- byte _totalCount = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
- struct ChargingInfoData *_chargingInfoData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
- bool isAbnormalStopFlag = false;
- struct timeval _ani_time;
- // 當前選擇的槍號
- short _currentPage = _LCM_NONE;
- byte _gunIndex = 0;
- byte _idlePageRotate = 1;
- bool _backend_conn_status = false;
- bool _wifi_conn_status = false;
- bool _net_conn_status = false;
- // LCM - HW
- //byte _everyPageRollChange = 0;
- short __conn_status = 0x0030;
- short __ethernet_status = 0x0036;
- short __wifi_status = 0x003C;
- short __sel_gun_btn = 0x0040;
- short __ret_home_btn = 0x0042;
- short __stop_charging_btn = 0x0044;
- short __qr_code = 0x0050;
- short __plug_in_arrow = 0x0060;
- short __conn_line = 0x0066;
- short __gun_type_index = 0x0070;
- short __qr_code_pre = 0x0080;
- short __side_top = 0x0090;
- short __side_down = 0x0092;
- short __conn_line_chag = 0x0096;
- short __batt_map = 0x0100;
- short __soc_value_charging = 0x0102;
- short __remain_time_map = 0x0106;
- short __power_map = 0x0108;
- short __energy_map = 0x010A;
- short __remain_time_tx = 0x0110;
- short __output_eng_tx = 0x0120;
- short __total_out_eng_tx = 0x0130;
- short __conn_line_comp = 0x0140;
- short __charging_proc_stop_tx = 0x0196;
- // ICON ID
- byte _disappear = 0;
- byte _disconnect = 1;
- byte _connect = 2;
- byte _warning = 3;
- byte _arrow_dark = 4;
- byte _arrow_light = 5;
- byte _ethernet_disconnect = 6;
- byte _ethernet_connect = 7;
- byte _wifi_disconnect = 8;
- byte _wifi_connect = 9;
- byte _logo = 10;
- byte _conn_map1 = 11;
- byte _conn_map2 = 12;
- byte _sel_gun_btn = 13;
- byte _back_home_btn = 14;
- byte _stop_charging_btn = 15;
- byte _stop_charging_rfid_btn = 16;
- byte _chademo_dark = 17;
- byte _ccs_dark = 18;
- byte _actype_dark = 19;
- byte _chademo_light = 20;
- byte _ccs_light = 21;
- byte _actype_light = 22;
- byte _side_rfid_1 = 23;
- byte _side_qr_1 = 24;
- byte _side_app_1 = 25;
- byte _side_rfid_2 = 26;
- byte _side_qr_2 = 27;
- byte _side_app_2 = 28;
- byte _charging_map1 = 29;
- byte _charging_map2 = 30;
- byte _battery_cap_20 = 31;
- byte _battery_cap_40 = 32;
- byte _battery_cap_60 = 33;
- byte _battery_cap_80 = 34;
- byte _battery_cap_100 = 35;
- byte _battery_map = 36;
- byte _power_map = 37;
- byte _time_map = 38;
- byte _complete_map = 39;
- byte _battery_soc_20 = 40;
- byte _battery_soc_40 = 41;
- byte _battery_soc_60 = 42;
- byte _battery_soc_80 = 43;
- byte _battery_soc_100 = 44;
- byte _battery_eng_map = 45;
- byte _money_map = 46;
- byte _elapse_time_map = 47;
- byte _black_bar_map = 48;
|