Module_Payment_Bazel8.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Module_Payment_Omnixpay.h
  3. *
  4. * Created on: 2022/01/24
  5. * Author: folus
  6. */
  7. #ifndef MODULE_PAYMENT_BAZEL8_H_
  8. #define MODULE_PAYMENT_BAZEL8_H_
  9. //#define X86
  10. #include <sys/time.h>
  11. #include <sys/timeb.h>
  12. #include <sys/types.h>
  13. #include <sys/stat.h>
  14. #include <sys/types.h>
  15. #include <sys/ioctl.h>
  16. #include <sys/socket.h>
  17. #include <sys/ipc.h>
  18. #include <sys/shm.h>
  19. #include <sys/shm.h>
  20. #include <sys/mman.h>
  21. #include <linux/wireless.h>
  22. #include <arpa/inet.h>
  23. #include <netinet/in.h>
  24. #include <unistd.h>
  25. #include <stdarg.h>
  26. #include <stdio.h>
  27. #include <stdlib.h>
  28. #include <unistd.h>
  29. #include <fcntl.h>
  30. #include <termios.h>
  31. #include <errno.h>
  32. #include <errno.h>
  33. #include <string.h>
  34. #include <time.h>
  35. #include <ctype.h>
  36. #include <ifaddrs.h>
  37. #include <math.h>
  38. #include <limits.h>
  39. #include <stdint.h>
  40. #include <libxml/parser.h>
  41. #include <libxml/tree.h>
  42. #ifndef X86
  43. #include "define.h"
  44. #define TTY_PORT "/dev/ttyS2"
  45. #else
  46. #define ConsloePrintLog
  47. #define TTY_PORT "/dev/ttyUSB0"
  48. #endif
  49. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  50. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  51. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
  52. #define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000L)
  53. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  54. #define PASS 1
  55. #define FAIL -1
  56. #define ON 1
  57. #define OFF 0
  58. #define YES 1
  59. #define NO 0
  60. #define RAW_DATA_LENGTH 32
  61. #define SPEC_REQUEST_RETRY 3
  62. #define TIMEOUT_REQUEST 40
  63. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  64. struct StatusCodeData *ShmStatusCodeData;
  65. struct OCPP16Data *ShmOCPP16Data;
  66. enum TIMER
  67. {
  68. TIMER_READ_RESPONSE,
  69. TIMER_INDEX_1,
  70. TIMER_CNT
  71. };
  72. enum Boolean
  73. {
  74. false=0,
  75. true
  76. };
  77. enum MESSAGE_HEADER
  78. {
  79. STX=0xC2
  80. };
  81. struct COMMAND
  82. {
  83. uint8_t requestData[1024];
  84. uint8_t responseData[1024];
  85. };
  86. #endif /* MODULE_PAYMENT_BAZEL8_H_ */