国产肉体XXXX裸体137大胆,国产成人久久精品流白浆,国产乱子伦视频在线观看,无码中文字幕免费一区二区三区 国产成人手机在线-午夜国产精品无套-swag国产精品-国产毛片久久国产

新聞中心

EEPW首頁(yè) > 手機(jī)與無(wú)線通信 > 設(shè)計(jì)應(yīng)用 > 基于Virtools 和串口通信的界面交互性的設(shè)計(jì)與實(shí)現(xiàn)

基于Virtools 和串口通信的界面交互性的設(shè)計(jì)與實(shí)現(xiàn)

作者: 時(shí)間:2010-07-08 來(lái)源:網(wǎng)絡(luò) 收藏

基類_base_com 的聲明如下。

class _base_com //虛基類基本串口接口

{

protected:

volatile int _PORT; //串口號(hào)

volatile HANDLE _com_handle;//串口句柄

DCB _dcb; //波特率,停止位,等

int _in_buf, _out_buf; // 緩沖區(qū)

COMMTIMEOUTS _co; // 超時(shí)時(shí)間

//虛函數(shù),用于不同方式的串口打開(kāi)

virtual bool open_PORT() = 0;

void init(); //初始化

public:

_base_com()

{

init();

}

virtual ~_base_com();

/*基本參數(shù)設(shè)置*/

//設(shè)置串口參數(shù):波特率,停止位,等

inline bool set_para();

//支持設(shè)置字符串 "9600, 8, n, 1"

bool set_dcb(char *set_str);

//設(shè)置內(nèi)置結(jié)構(gòu)串口參數(shù):波特率,停止位

bool set_dcb(int BaudRate, int ByteSize = 8, int Parity = NOPARITY, int StopBits =

ONESTOPBIT);

//設(shè)置緩沖區(qū)大小

inline bool set_buf(int in_buf, int out_buf);

//打開(kāi)串口缺省 9600, 8, n, 1

inline bool open(int PORT);

//打開(kāi)串口缺省 baud_rate, 8, n, 1

inline bool open(int PORT, int baud_rate);

//打開(kāi)串口

inline bool open(int PORT, char *set_str);

//關(guān)閉串口

inline virtual void close();

//判斷串口是或打開(kāi)

inline bool is_open();

//獲得串口句炳

HANDLE get_handle();

};

異步類_sync_com 的聲明如下。

class _sync_com : public _base_com

{

protected:

//打開(kāi)串口

virtual bool open_PORT();

public:

_sync_com();

//同步讀

int read(char *buf, int buf_len);

//同步寫(xiě)

int write(char *buf, int buf_len)

//同步寫(xiě)

inline int write(char *buf)

{

assert(buf);

return write(buf, strlen(buf));

}

};



關(guān)鍵詞: 串口通信

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉