123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- #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 <linux/can.h>
- #include <linux/can/raw.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 <math.h>
- #include "../../define.h"
- #include <stdbool.h>
- typedef unsigned char byte;
- typedef unsigned short word;
- typedef unsigned int unit;
- #define PREPARE_STEP_NONE 0
- #define PREPARE_STEP_CABLE_CHECK 1
- #define PREPARE_STEP_GFD_DONE 2
- #define PREPARE_STEP_PRECHARGE 3
- #define PREPARE_STEP_CHARGING 4
- struct ChargingInfoData *chargingInfo[CONNECTOR_QUANTITY];
- bool isStartOutputSwitch[CONNECTOR_QUANTITY];
- bool isCharging = false;
- bool isWaitingAver = false;
- bool isReadToCharging = false;
- bool CanAverageCharging = false;
- int preChargingTarget;
- int preChargingCur;
- float toAverVolPoint;
- byte toAverVolCount;
- int connector_1[12];
- int connector_2[12];
- byte conn_1_count = 0;
- byte conn_2_count = 0;
- enum _PSU_ON_OFF_CMD
- {
- _PSU_OFF = 0,
- _PSU_ON = 1,
- };
- enum _PSU_TEMP_TYPE
- {
- _PSU_TMP_DCDC = 0,
- _PSU_TMP_PFC = 1,
- };
- enum _PSU_CMD_SEQ
- {
- _PSU_CMD_STATUS = 1,
- _PSU_CMD_VERSION = 2,
- _PSU_CMD_CAP = 10,
- _PSU_CMD_OUTPUT = 11,
- _PSU_CMD_IVAILIABLE = 12,
- _PSU_CMD_TEMP = 13
- };
- enum _CURRENT_CONFIG_MODE
- {
- _CURRENT_MODE_NONE = 0,
- _CURRENT_MODE_BALANCE = 1,
- _CURRENT_MODE_INCREASE = 2,
- _CURRENT_MODE_DECREASE = 3,
- _CURRENT_MODE_DERATING = 4,
- };
- enum _EXTEND_TYPE
- {
- _EXTEND_TYPE_NONE = 0,
- _EXTEND_TYPE_QUANTITY = 1,
- _EXTEND_TYPE_POWER = 2,
- };
- #define STR_EXTEND_CONFLICT_NONE "No Conflict"
- #define STR_EXTEND_CONFLICT_AVAILABLE "Available Conflict"
- #define STR_EXTEND_CONFLICT_AVERAGE "Average Conflict"
- #define STR_EXTEND_CONFLICT_PRIORITY "Priority Conflict"
- #define STR_EXTEND_CONFLICT_UNKNOWN "Unknown Conflict"
- enum _EXTEND_CONFLICT
- {
- _CONFLICT_NONE = 0,
- _CONFLICT_AVAILABLE = 1,
- _CONFLICT_AVERAGE = 2,
- _CONFLICT_PRIORITY = 3,
- _CONFLICT_UNKNOWN = 4,
- };
|