Module_PsuComm.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 <linux/can.h>
  14. #include <linux/can/raw.h>
  15. #include <arpa/inet.h>
  16. #include <netinet/in.h>
  17. #include <unistd.h>
  18. #include <stdarg.h>
  19. #include <stdio.h> /*標準輸入輸出定義*/
  20. #include <stdlib.h> /*標準函數庫定義*/
  21. #include <unistd.h> /*Unix 標準函數定義*/
  22. #include <fcntl.h> /*檔控制定義*/
  23. #include <termios.h> /*PPSIX 終端控制定義*/
  24. #include <errno.h> /*錯誤號定義*/
  25. #include <errno.h>
  26. #include <string.h>
  27. #include <time.h>
  28. #include <ctype.h>
  29. #include <ifaddrs.h>
  30. #include <math.h>
  31. #include "../../define.h"
  32. #include <stdbool.h>
  33. typedef unsigned char byte;
  34. #define SELF_TEST_VOL 1600
  35. #define SELF_TEST_CUR 10
  36. #define ZERO_VOL 0
  37. #define ZERO_CUR 0
  38. #define NONE_CARE_ADDRESS 0
  39. #define OUTPUT_POWER_SWITCH_ON 2
  40. #define OUTPUT_POWER_SWITCH_OFF 0
  41. enum _FIRMWARE_TYPE
  42. {
  43. _Fw_pri_app = 0,
  44. _Fw_sec_app,
  45. _Fw_pri_bootload,
  46. _Fw_sec_bootload
  47. };
  48. struct _RecordPsuData
  49. {
  50. byte _phy_addr;
  51. char _serial_num[32];
  52. byte _fire_index;
  53. };
  54. unsigned char _gunCount = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
  55. struct ChargingInfoData *chargingInfo[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  56. bool rework = false;
  57. struct timeval _id_assign_time;
  58. struct timeval _chk_output_time;
  59. bool isCheckOutputTimeStart = false;
  60. byte _curCheckPsuIndexForFireLine = 0x00;
  61. struct timeval _chk_cap_time;
  62. bool _chkTotalCapStart = false;
  63. bool isUpgradeFlag = false;
  64. struct timeval _workModePriority_time;
  65. struct timeval _derating_time;
  66. int deratingTime = 0;
  67. int connector_1[] = {1, 2};
  68. int connector_2[] = {3, 4};
  69. int conn_1_count = 0;
  70. int conn_2_count = 0;