/*
 * Module_Payment_Omnixpay.h
 *
 *  Created on: 2022/01/24
 *      Author: folus
 */

#ifndef MODULE_PAYMENT_BAZEL8_H_
#define MODULE_PAYMENT_BAZEL8_H_
//#define	X86

#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>
#include 	<libxml/parser.h>
#include 	<libxml/tree.h>

#ifndef X86
	#include	"define.h"
	#define TTY_PORT		"/dev/ttyS2"
#else
	#define ConsloePrintLog
	#define TTY_PORT		"/dev/ttyUSB0"
#endif

#define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
#define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
#define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)

//#define DEBUG_INFO(format, args...) printf("[Info] "format, ##args)
//#define DEBUG_WARN(format, args...) printf("[Warn] "format, ##args)
//#define DEBUG_ERROR(format, args...) printf("[Error] "format, ##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

#define RAW_DATA_LENGTH				32
#define SPEC_REQUEST_RETRY			3
#define TIMEOUT_REQUEST				30

struct SysConfigAndInfo				*ShmSysConfigAndInfo;
struct StatusCodeData 				*ShmStatusCodeData;
struct OCPP16Data 					*ShmOCPP16Data;

enum TIMER
{
	TIMER_READ_RESPONSE,
	TIMER_INDEX_1,
	TIMER_CNT
};

enum Boolean
{
	false=0,
	true
};

enum MESSAGE_HEADER
{
	STX=0xC2
};

enum 
{
    s_NONE = 0,
    s_INFO,
    s_INFO_WAIT_RESPONE,
	s_IDLE,
	s_SEND_AUTH_ONLY,
	s_WAIT_RESPONE,
	s_DONE,
};

struct COMMAND
{
	uint8_t requestData[1024];
	uint8_t responseData[1024];
};

char ISO_4217_Currency_Code[54][4]=
{
	"784",	// - Emirati Dirham
	"032",	// - Argentine Peso
	"036",	// - Australian Dollar
	"975",	// - Bulgarian Lev
	"048",	// - Bahraini Dinar
	"096",	// - Bruneian Dollar
	"986",	// - Brazilian Real
	"072",	// - Botswana Pula
	"124",	// - Canadian Dollar
	"756",	// - Swiss Franc
	"152",	// - Chilean Peso
	"156",	// - Chinese Yuan Renminbi
	"170",	// - Colombian Peso
	"203",	// - Czech Koruna
	"208",	// - Danish Krone
	"978",	// - Euro
	"826",	// - British Pound
	"344",	// - Hong Kong Dollar
	"191",	// - Croatian Kuna
	"348",	// - Hungarian Forint
	"360",	// - Indonesian Rupiah
	"376",	// - Israeli Shekel
	"356",	// - Indian Rupee
	"364",	// - Iranian Rial
	"352",	// - Icelandic Krona
	"392",	// - Japanese Yen
	"410",	// - South Korean Won
	"414",	// - Kuwaiti Dinar
	"398",	// - Kazakhstani Tenge
	"144",	// - Sri Lankan Rupee
	"434",	// - Libyan Dinar
	"480",	// - Mauritian Rupee
	"484",	// - Mexican Peso
	"458",	// - Malaysian Ringgit
	"578",	// - Norwegian Krone
	"524",	// - Nepalese Rupee
	"554",	// - New Zealand Dollar
	"512",	// - Omani Rial
	"608",	// - Philippine Peso
	"586",	// - Pakistani Rupee
	"985",	// - Polish Zloty
	"634",	// - Qatari Riyal
	"946",	// - Romanian New Leu
	"643",	// - Russian Ruble
	"682",	// - Saudi Arabian Riyal
	"752",	// - Swedish Krona
	"702",	// - Singapore Dollar
	"764",	// - Thai Baht
	"946",	// - Turkish Lira
	"780",	// - Trinidadian Dollar
	"901",	// - Taiwan New Dollar
	"840",	// - US Dollar
	"928",	// - Venezuelan Bolivar
	"710"	// - South African Rand
};

#endif /* MODULE_PAYMENT_BAZEL8_H_ */