123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- /*
- * Module_Payment_Enegate.h
- *
- * Created on: 2022/5/4
- * Author: folus
- */
- #ifndef MODULE_PAYMENT_ENEGATE_H_
- #define MODULE_PAYMENT_ENEGATE_H_
- #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>
- #include <fcntl.h>
- #include <termios.h>
- #include <errno.h>
- #include <errno.h>
- #include <string.h>
- #include <time.h>
- #include <ctype.h>
- #include <ifaddrs.h>
- #include <math.h>
- #include <limits.h>
- #include <stdint.h>
- //#define DEBUG
- #include "define.h"
- #define TTY_PORT "/dev/ttyS2"
- #define ID_OFFSET 2
- #define FIRMWARE_VERSION "D0.01.P0"
- #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)), __LINE__, __FUNCTION__, ##args)
- #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)), __LINE__, __FUNCTION__, ##args)
- #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)), __LINE__, __FUNCTION__, ##args)
- #define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000L)
- #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
- #define PASS 1
- #define FAIL -1
- #define ON 1
- #define OFF 0
- #define YES 1
- #define NO 0
- struct SysConfigAndInfo *ShmSysConfigAndInfo;
- struct StatusCodeData *ShmStatusCodeData;
- struct OCPP16Data *ShmOCPP16Data;
- enum TIMER
- {
- TIMER_COMM_TIMEOUT,
- TIMER_UPDATE_RTC,
- TIMER_CNT
- };
- enum GUN_TYPE
- {
- GUN_TYPE_UNKNOWN=0,
- GUN_TYPE_CHAdeMO,
- GUN_TYPE_CCS,
- GUN_TYPE_GBT,
- GUN_TYPE_DO,
- GUN_TYPE_AC
- };
- typedef struct MESSAGE
- {
- int size;
- uint8_t buffer[64];
- }Message;
- enum MESSAGE_HEADER
- {
- SOH=0x01,
- LF=0x0a,
- CR=0x0d,
- STX=0x1b,
- ACK=0x06,
- NAK=0x15
- };
- enum HOST_COMMAND
- {
- HOST_CMD_GET_STATUS=1000,
- HOST_CMD_AUTH_PASS=3000,
- HOST_CMD_AUTH_FAIL=3001,
- HOST_CMD_SESSION_STOP=4000,
- HOST_CMD_PAUSE_ENABLE=100,
- HOST_CMD_PAUSE_DISABLE=111,
- HOST_CMD_AUTO_START_ENABLE=200,
- HOST_CMD_AUTOSTART_DIABLE=222,
- HOST_CMD_AUTH_CHECKING=9000,
- HOST_CMD_AUTH_CANCEL=9001,
- HOST_CMD_GET_SELECTED_ID=9301,
- HOST_CMD_SET_SERVICE_TIME=9200
- };
- #endif /* MODULE_PAYMENT_ENEGATE_H_ */
|