Module_Payment_Bazel8.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 DEBUG_INFO(format, args...) printf("[Info] "format, ##args)
  53. //#define DEBUG_WARN(format, args...) printf("[Warn] "format, ##args)
  54. //#define DEBUG_ERROR(format, args...) printf("[Error] "format, ##args)
  55. #define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000L)
  56. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  57. #define PASS 1
  58. #define FAIL -1
  59. #define ON 1
  60. #define OFF 0
  61. #define YES 1
  62. #define NO 0
  63. #define RAW_DATA_LENGTH 32
  64. #define SPEC_REQUEST_RETRY 3
  65. #define TIMEOUT_REQUEST 30
  66. struct SysConfigAndInfo *ShmSysConfigAndInfo;
  67. struct StatusCodeData *ShmStatusCodeData;
  68. struct OCPP16Data *ShmOCPP16Data;
  69. enum TIMER
  70. {
  71. TIMER_READ_RESPONSE,
  72. TIMER_INDEX_1,
  73. TIMER_CNT
  74. };
  75. enum Boolean
  76. {
  77. false=0,
  78. true
  79. };
  80. enum MESSAGE_HEADER
  81. {
  82. STX=0xC2
  83. };
  84. enum
  85. {
  86. s_NONE = 0,
  87. s_INFO,
  88. s_INFO_WAIT_RESPONE,
  89. s_IDLE,
  90. s_SEND_AUTH_ONLY,
  91. s_WAIT_RESPONE,
  92. s_DONE,
  93. };
  94. struct COMMAND
  95. {
  96. uint8_t requestData[1024];
  97. uint8_t responseData[1024];
  98. };
  99. char ISO_4217_Currency_Code[54][4]=
  100. {
  101. "784", // - Emirati Dirham
  102. "032", // - Argentine Peso
  103. "036", // - Australian Dollar
  104. "975", // - Bulgarian Lev
  105. "048", // - Bahraini Dinar
  106. "096", // - Bruneian Dollar
  107. "986", // - Brazilian Real
  108. "072", // - Botswana Pula
  109. "124", // - Canadian Dollar
  110. "756", // - Swiss Franc
  111. "152", // - Chilean Peso
  112. "156", // - Chinese Yuan Renminbi
  113. "170", // - Colombian Peso
  114. "203", // - Czech Koruna
  115. "208", // - Danish Krone
  116. "978", // - Euro
  117. "826", // - British Pound
  118. "344", // - Hong Kong Dollar
  119. "191", // - Croatian Kuna
  120. "348", // - Hungarian Forint
  121. "360", // - Indonesian Rupiah
  122. "376", // - Israeli Shekel
  123. "356", // - Indian Rupee
  124. "364", // - Iranian Rial
  125. "352", // - Icelandic Krona
  126. "392", // - Japanese Yen
  127. "410", // - South Korean Won
  128. "414", // - Kuwaiti Dinar
  129. "398", // - Kazakhstani Tenge
  130. "144", // - Sri Lankan Rupee
  131. "434", // - Libyan Dinar
  132. "480", // - Mauritian Rupee
  133. "484", // - Mexican Peso
  134. "458", // - Malaysian Ringgit
  135. "578", // - Norwegian Krone
  136. "524", // - Nepalese Rupee
  137. "554", // - New Zealand Dollar
  138. "512", // - Omani Rial
  139. "608", // - Philippine Peso
  140. "586", // - Pakistani Rupee
  141. "985", // - Polish Zloty
  142. "634", // - Qatari Riyal
  143. "946", // - Romanian New Leu
  144. "643", // - Russian Ruble
  145. "682", // - Saudi Arabian Riyal
  146. "752", // - Swedish Krona
  147. "702", // - Singapore Dollar
  148. "764", // - Thai Baht
  149. "946", // - Turkish Lira
  150. "780", // - Trinidadian Dollar
  151. "901", // - Taiwan New Dollar
  152. "840", // - US Dollar
  153. "928", // - Venezuelan Bolivar
  154. "710" // - South African Rand
  155. };
  156. #endif /* MODULE_PAYMENT_BAZEL8_H_ */