
#define MSG_RECEIVE_CHECK    _T("WOOSIM_PRT_OK")

/****************************************************************************
	CONST DEFINE
****************************************************************************/
//Message used in Protocol mode
#define FRAME_START			0xc0			// Frame Start
#define FRAME_END           0xc1			// Frame End
#define ACK					0x06			// 
#define NACK				0x15			//
#define ENQ					0x05			//
#define DATA				0x44			// 
#define STATUS_REQUEST		0x51			//Inquiry of printer status
#define STATUS_ANSWER		0x53			//Response of printer status
#define EOT					0x04			//
#define ETX					0x03			//
#define CAN					0x18			// 
#define MSR_FAIL			0x4d			// 

#define INSERT_BYTE			0x7d			// 0xc0,0xc1,0x7d case 0x7d insert.
#define XOR_BYTE            0x20			// after XOR


//Set buffer size
#define BUFF_SIZE				0x19000		// Buffer size
#define TEMP_BUFF_SIZE			0x19000		// Temporary buffer size
#define MSR_BUFF_SIZE			0x400		// MSR buffer size
#define DATA_FRAME_BUFF_SIZE    0x19000 
#define R_BUFF_SIZE				0x19000	


// Return Message
//serial, Bluetooth 
#define SUCCESS									1
#define ALREADY_OPENED							-1
#define UNABLE_TO_OPEN_THE_PORT					-2
#define UNABLE_TO_CONFIGURE_THE_SERIAL_PORT		-3 
#define UNABLE_TO_SET_THE_TIMEOUT_PARAMETERS	-4
#define NO_RESPONSE_FROM_PRINTER				-5

// WLAN
#undef SOCKET_OPEN_ERROR
#define SOCKET_OPEN_ERROR						-1
#define CONNECT_FAIL							-2
#define ALREADY_CONNECTED						-3


#define NOT_OPEN_THE_PORT						-11
#define BUFFER_OVERFLOW                         -12
#define OPERATOR_ERROR							-13

//barcode type
#define UPCA									65
#define UPCE									66
#define EAN13									67
#define EAN8									68
#define CODE39									69
#define ITF										70
#define CODABAR									71
#define CODE93									72
#define CODE128									73

//printer width
#define _2INCH									384
#define _3INCH									576
#define _4INCH									832

/****************************************************************************
	END 
****************************************************************************/



/******************************************************************************************
	IMPORT
******************************************************************************************/

class CWoosimPrinter
{
	public:
		static int InitPrinter(char *sPortName, int iBaudRate=57600,BOOL bProtocol=TRUE);
		static int InitWlanPrinter(char *sIP_ADDR, int iPortNum, int iTimeout,BOOL bProtcol);
		static BOOL ClosePrinter();	
		static int ControlCommand(BYTE *Cmds, int iLength); 
		static int SaveSpool(char *sData, int iFontValue=0, BOOL bEmphasis = FALSE);					
		static int PrintSpool(BOOL bDelete_Spool = TRUE);
		static void ClearSpool();
		static void CardRead(BOOL bTrack2 = TRUE);
		static void CardCancel();
		static int BmpSaveSpool(char* sBmpFilePath,int iXPosition, int iYPosition);
		static int BarcodeSaveSpool(BYTE ucBarcodeType, BYTE ucBarWidth, BYTE ucBarHeight, BOOL HRI_On, char* BarcodeData, int iPrtWidth,int iPrtHeight,int iXPos);
};

