Module_PsuComm.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. typedef unsigned short word;
  35. typedef unsigned int unit;
  36. unsigned char _gunCount;
  37. struct ChargingInfoData *chargingInfo[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  38. bool isStartOutputSwitch[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
  39. struct timeval _cmdSubPriority_time;
  40. struct timeval _derating_time;
  41. struct timeval _max_time;
  42. struct timeval _log_time;
  43. bool isCharging = false;
  44. bool isWaitingAver = false;
  45. bool isReadToCharging = false;
  46. bool CanAverageCharging = false;
  47. int preChargingTarget;
  48. int preChargingCur;
  49. float toAverVolPoint;
  50. byte toAverVolCount;
  51. int connector_1[12];
  52. int connector_2[12];
  53. byte conn_1_count = 0;
  54. byte conn_2_count = 0;
  55. enum _PSU_CMD_SEQ
  56. {
  57. _PSU_CMD_STATUS = 1,
  58. _PSU_CMD_VERSION = 2,
  59. _PSU_CMD_CAP = 10,
  60. _PSU_CMD_OUTPUT = 11,
  61. _PSU_CMD_IVAILIABLE = 12,
  62. _PSU_CMD_TEMP = 13
  63. };
  64. enum _CHARGING_LOG_INDEX
  65. {
  66. _CHARGING_LOG_NEED_VOL = 0,
  67. _CHARGING_LOG_NEED_CUR = 1,
  68. _CHARGING_LOG_OUTPUT_VOL = 2,
  69. _CHARGING_LOG_OUTPUT_CUR = 3
  70. };