/*
 * 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 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				40

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
};

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


#endif /* MODULE_PAYMENT_BAZEL8_H_ */