SerialCom.h
上传用户:sarrow1992
上传日期:2022-07-29
资源大小:2k
文件大小:0k
- #ifndef _SERIALCOM_H
- #define _SERIALCOM_H
- #include <string>
- using namespace std;
- class CSerial
- {
- public:
- HANDLE m_hComDev;
- OVERLAPPED m_OverlappedRead;
- OVERLAPPED m_OverlappedWrite;
- BOOL m_bOpened;
- char dataRx[100];
- public:
- CSerial();
- virtual ~CSerial();
- BOOL Open( int nPort, int nBaud );
- int InBufferCount( void );
- DWORD ReadData( void *buffer, DWORD dwBytesRead);
- DWORD SendData( const char *buffer, DWORD dwBytesWritten);
- BOOL Close();
- };
- #endif