⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comm.h

📁 本源码主要是通过API函数实现串口打开
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef CommH
#define CommH
//---------------------------------------------------------------------------
#include <dstring.h>
#include <Classes.hpp>
#include <System.hpp>
//---------------------------------------------------------------------------


class TComm : public TObject
{
#define TxAbort 0
#define RxAbort 1
#define TxClear 2
#define RxClear 3

private:
        HANDLE ComHandle;
protected:
public:
    
    virtual __fastcall TComm();
    virtual __fastcall ~TComm();
    bool __fastcall openport(String port,String baud,int &result);
    bool __fastcall WriteCom(String str);
    unsigned long __fastcall ReadCom(char * array);
    void __fastcall purge_comm(int type);
    void __fastcall ClosePort();
	unsigned long __fastcall GetModemStatus();
	unsigned long __fastcall ClearError();
};
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -