- 博客(0)
- 资源 (1)
- 收藏
- 关注
C++串口类封装
C++语言封装的串口,可以直接调用;
class CSerial : public iSerial
{
public:
CSerial();
~CSerial();
BOOL Open( int nPort , int nBaud ,int BAU ,int PAR , int STO);
BOOL Close( void );
int ReadData( void *, int );
int SendData( const char *, int );
int SendData( const unsigned char *, int );
int ReadDataWaiting( void );
//int Write(unsigned char[] WriteBytes);
BOOL IsOpened( void ){ return( m_bOpened ); }
protected:
BOOL WriteCommByte( unsigned char );
HANDLE m_hIDComDev;
OVERLAPPED m_OverlappedRead, m_OverlappedWrite;
BOOL m_bOpened;
// afx_msg void OnSerial(void);
// DECLARE_EVENTSINK_MAP();
};
2017-12-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人