Module_Payment_Bazel8.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/ttyS3"
  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_IDLE = 0,
  87. s_SEND_AUTH_ONLY,
  88. s_WAIT_RESPONE,
  89. s_DONE,
  90. };
  91. struct COMMAND
  92. {
  93. uint8_t requestData[1024];
  94. uint8_t responseData[1024];
  95. };
  96. char ISO_4217_Currency_Code[54][4]=
  97. {
  98. "784", // - Emirati Dirham
  99. "032", // - Argentine Peso
  100. "036", // - Australian Dollar
  101. "975", // - Bulgarian Lev
  102. "048", // - Bahraini Dinar
  103. "096", // - Bruneian Dollar
  104. "986", // - Brazilian Real
  105. "072", // - Botswana Pula
  106. "124", // - Canadian Dollar
  107. "756", // - Swiss Franc
  108. "152", // - Chilean Peso
  109. "156", // - Chinese Yuan Renminbi
  110. "170", // - Colombian Peso
  111. "203", // - Czech Koruna
  112. "208", // - Danish Krone
  113. "978", // - Euro
  114. "826", // - British Pound
  115. "344", // - Hong Kong Dollar
  116. "191", // - Croatian Kuna
  117. "348", // - Hungarian Forint
  118. "360", // - Indonesian Rupiah
  119. "376", // - Israeli Shekel
  120. "356", // - Indian Rupee
  121. "364", // - Iranian Rial
  122. "352", // - Icelandic Krona
  123. "392", // - Japanese Yen
  124. "410", // - South Korean Won
  125. "414", // - Kuwaiti Dinar
  126. "398", // - Kazakhstani Tenge
  127. "144", // - Sri Lankan Rupee
  128. "434", // - Libyan Dinar
  129. "480", // - Mauritian Rupee
  130. "484", // - Mexican Peso
  131. "458", // - Malaysian Ringgit
  132. "578", // - Norwegian Krone
  133. "524", // - Nepalese Rupee
  134. "554", // - New Zealand Dollar
  135. "512", // - Omani Rial
  136. "608", // - Philippine Peso
  137. "586", // - Pakistani Rupee
  138. "985", // - Polish Zloty
  139. "634", // - Qatari Riyal
  140. "946", // - Romanian New Leu
  141. "643", // - Russian Ruble
  142. "682", // - Saudi Arabian Riyal
  143. "752", // - Swedish Krona
  144. "702", // - Singapore Dollar
  145. "764", // - Thai Baht
  146. "946", // - Turkish Lira
  147. "780", // - Trinidadian Dollar
  148. "901", // - Taiwan New Dollar
  149. "840", // - US Dollar
  150. "928", // - Venezuelan Bolivar
  151. "710" // - South African Rand
  152. };
  153. #endif /* MODULE_PAYMENT_BAZEL8_H_ */