You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
851 B
C++
25 lines
851 B
C++
#pragma once
|
|
|
|
#include "CommPortClass.h"
|
|
//¶ÔµÚÈý·½com ÔÙ·â×°Ò»´Î
|
|
class CCommPortMgr
|
|
{
|
|
public:
|
|
CCommPortMgr(bool fAutoBeginThread = true, DWORD dwIOMode = FILE_FLAG_OVERLAPPED);
|
|
~CCommPortMgr(void);
|
|
bool Open(DWORD dwPort, DWORD dwBaudRate = 9600);
|
|
bool Open(DWORD dwPort, char *szSetStr);
|
|
void Close();
|
|
void SetWnd(HWND hWnd);
|
|
void Write(const char *szBuffer);
|
|
void WriteBuf(LPVOID Buffer, DWORD dwBufferLength);
|
|
CString ReadStr();
|
|
CString ReadBuf(char *szBuffer,DWORD dwBufferLength);
|
|
int Read(LPVOID Buffer, DWORD dwBufferLength);
|
|
bool IsOpen(){return m_ComObject.IsOpen();};
|
|
void SetBufferSize(DWORD dwInputSize, DWORD dwOutputSize);
|
|
bool WaitCommRev(int WaitTime,int DateLen,char *szBuffer,DWORD dwBufferLength);
|
|
void ClearComBuf();
|
|
private:
|
|
cnComm m_ComObject;
|
|
}; |