#pragma once

class CRs232cUsb
{
private:
	HANDLE m_SerialPort;										// Serial port handle
	char m_TransferBuffer[65536];								// Transfer buffer
	char m_ReceiveBuffer[65536];								// Receive buffer

public:
	CString m_ReceiveData;										// Received data

public:
	CRs232cUsb();
	virtual ~CRs232cUsb();
	BOOL OpenInterface(CString PortName, DWORD BaudRate);
	BOOL CloseInterface();
	BOOL SendMsg(CString SendData);
	BOOL ReceiveMsg(DWORD Timeout);
	BOOL SendQueryMsg(CString SendData, DWORD Timeout);
	CString GetLastErrorMessage(DWORD MessageId);
};
