#if !defined(AFX_SERIALPORT_H__AF245E01_29F9_11D6_872A_00EEB1035D2D__INCLUDED_)
#define AFX_SERIALPORT_H__AF245E01_29F9_11D6_872A_00EEB1035D2D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SerialPort.h : header file
//
#include "SerialPortHead.h"
/////////////////////////////////////////////////////////////////////////////
// CSerialPort command target
class CSerialPort : public CObject
{
// Attributes
public:
// Operations
public:
CSerialPort();
virtual ~CSerialPort();
BOOL OpenPort(CWnd* pPortOwner, LPTTYSTRUCT lpTTY);
void ClosePort();
BOOL StartMonitoring();
BOOL RestartMonitoring();
BOOL StopMonitoring();
static UINT CommThread(LPVOID pParam);
DWORD ReadComm(BYTE *pBuff, DWORD nToRead);
void ProcessRcvData(CSerialPort* port, BYTE *byBuf, int nSize );
DWORD WriteComm(BYTE *pBuff , DWORD nToWrite);
// Overrides
public:
HANDLE m_hComm;
BOOL m_bThreadAlive; //¾²·¹µå on/of flag
CWinThread* m_Thread;
OVERLAPPED m_ovrWrite; //Åë½Å ¿À¹ö·¦ Áö¿ø
OVERLAPPED m_osRead;
CWnd* m_pOwner; //ÇÚµé
UINT m_nPortNr;
unsigned char m_strData[32];
CString m_strComErrMsg;
// Implementation
protected:
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SERIALPORT_H__AF245E01_29F9_11D6_872A_00EEB1035D2D__INCLUDED_)
|