亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qextserialbase.cpp

?? 一個很好的串口類
?? CPP
字號:
#include "qextserialbase.h"#include <qthread.h>/*!\class QextSerialBase\version 0.70 (pre-alpha)\author Wayne RothA common base class for Win_QextSerialBase, Posix_QextSerialBase and QextSerialPort.  */#ifdef QT_THREAD_SUPPORTQMutex* QextSerialBase::mutex=NULL;unsigned long QextSerialBase::refCount=0;#endif/*!\fn QextSerialBase::QextSerialBase()Default constructor.*/QextSerialBase::QextSerialBase():QIODevice() {    char nameStr[50];#ifdef _TTY_WIN_    strcpy(nameStr, "COM1");#elif defined(_TTY_IRIX_)    strcpy(nameStr, "/dev/ttyf1");#elif defined(_TTY_HPUX_)    strcpy(nameStr, "/dev/tty1p0");#elif defined(_TTY_SUN_)    strcpy(nameStr, "/dev/ttya");#elif defined(_TTY_DIGITAL_)    strcpy(nameStr, "/dev/tty01");#elif defined(_TTY_FREEBSD_)    strcpy(nameStr, "/dev/ttyd1");#else     strcpy(nameStr, "/dev/ttyS0");#endif    setName(nameStr);}/*!\fn QextSerialBase::QextSerialBase(const char* name)Construct a port and assign it to the device specified by the name parameter.*/QextSerialBase::QextSerialBase(const char* name):QIODevice() {    setName(name);}/*!\fn QextSerialBase::~QextSerialBase()Standard destructor.*/QextSerialBase::~QextSerialBase() {#ifdef QT_THREAD_SUPPORT    refCount--;    if (mutex && refCount==0) {        delete mutex;        mutex=NULL;    }#endif}/*!\fn void QextSerialBase::setName(const char* name)Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0".*/void QextSerialBase::setName(const char* name) {    memcpy(portName, name, MIN(strlen(name)+1, PORT_NAME_SIZE_LIMIT));}/*!\fn bool QextSerialBase::atEnd() constThis function will return true if the input buffer is empty (or on error), and false otherwise.Call QextSerialBase::lastError() for error information.*/bool QextSerialBase::atEnd() const {    if (size()) {        return true;         }    return false;}/*!\fn int QextSerialBase::readLine(char *data, uint maxlen)This function will read a line of buffered input from the port, stopping when either maxlen byteshave been read, the port has no more data available, or a newline is encountered.  The value returned is the length of the string that was read.  Thanks to Olivier Tubach for the original version of this function.*/int QextSerialBase::readLine(char *data, uint maxlen) {    int bytesAvail=(int)size();	    char* pCur=data;    /*if nothing waiting, return 0 length*/    if (bytesAvail<1) {	    return 0;    }    /*read a byte at a time for MIN(bytesAvail, maxlen) iterations, or until a newline*/    while (pCur<(data+bytesAvail) && --maxlen) {		    	readBlock(pCur, 1);        if (*pCur++ == '\n') {	        break;        }    }    *pCur++='\0';    /*return size of data read*/    return (pCur-data);}/*!\fn int QextSerialBase::ungetch(int)This function is included to implement the full QIODevice interface, and currently has no purpose within this class.  This function is meaningless on an unbuffered device and currentlyonly prints a warning message to that effect.*/int QextSerialBase::ungetch(int) {        /*meaningless on unbuffered sequential device - return error and print a warning*/    TTY_WARNING("QextSerialPort: ungetch() called on an unbuffered sequential device - operation is meaningless");    return -1;}/*!\fn FlowType QextSerialBase::flowControl() constReturns the type of flow control used by the port.  For a list of possible values returnedby this function, see the definition of the enum FlowType.*/FlowType QextSerialBase::flowControl() const {    return Settings.FlowControl;}/*!\fn ParityType QextSerialBase::parity() constReturns the type of parity used by the port.  For a list of possible values returned by this function, see the definition of the enum ParityType.*/ParityType QextSerialBase::parity() const {    return Settings.Parity;}/*!\fn DataBitsType QextSerialBase::dataBits() constReturns the number of data bits used by the port.  For a list of possible values returned by this function, see the definition of the enum DataBitsType.*/DataBitsType QextSerialBase::dataBits() const {    return Settings.DataBits;}/*!\fn StopBitsType QextSerialBase::stopBits() constReturns the number of stop bits used by the port.  For a list of possible return values, seethe definition of the enum StopBitsType.*/StopBitsType QextSerialBase::stopBits() const {    return Settings.StopBits;}/*!\fn BaudRateType QextSerialBase::baudRate(void) constReturns the baud rate of the serial port.  For a list of possible return values see the definition of the enum BaudRateType.*/BaudRateType QextSerialBase::baudRate(void) const {    return Settings.BaudRate;}/*!\fn bool QextSerialBase::isOpen(void) constReturns true if the port associated with the class is currently open, or false if it is not.*/bool QextSerialBase::isOpen(void) const {    return portOpen;}/*!\fn bool QextSerialBase::open(const char* name)Opens a serial port by name.  The string passed in the name parameter is associated with the object and subsequent calls to open() may use the no-parameter version.  This function has no effect if the port associated with the class is already open.  The port is also configured to the current settings, as stored in the Settings structure.*/bool QextSerialBase::open(const char* name) {    LOCK_MUTEX();    if (!portOpen) {        /*set serial port name, and call open()*/        setName(name);        UNLOCK_MUTEX();        return open();    }    UNLOCK_MUTEX();    return portOpen;}/*!\fn unsigned long QextSerialBase::lastError() constReturns the code for the last error encountered by the port, or E_NO_ERROR if the last port operation was successful.  Possible error codes are:\verbatimError                           Explanation---------------------------     -------------------------------------------------------------E_NO_ERROR                      No Error has occuredE_INVALID_FD                    Invalid file descriptor (port was not opened correctly)E_NO_MEMORY                     Unable to allocate memory tables (POSIX)E_CAUGHT_NON_BLOCKED_SIGNAL     Caught a non-blocked signal (POSIX)E_PORT_TIMEOUT                  Operation timed out (POSIX)E_INVALID_DEVICE                The file opened by the port is not a character device (POSIX)E_BREAK_CONDITION               The port detected a break conditionE_FRAMING_ERROR                 The port detected a framing error                                 (usually caused by incorrect baud rate settings)E_IO_ERROR                      There was an I/O error while communicating with the portE_BUFFER_OVERRUN                Character buffer overrunE_RECEIVE_OVERFLOW              Receive buffer overflowE_RECEIVE_PARITY_ERROR          The port detected a parity error in the received dataE_TRANSMIT_OVERFLOW             Transmit buffer overflowE_READ_FAILED                   General read operation failureE_WRITE_FAILED                  General write operation failure\endverbatim*/unsigned long QextSerialBase::lastError() const {    return lastErr;}/*!\fn const char* QextSerialBase::name() constReturns a pointer to a string containing the name of the device associated with the object*/const char* QextSerialBase::name() const {    return portName;}/*!\fn void QextSerialBase::construct(void)Common constructor function, called by all versions of Win_QextSerialPort::Win_QextSerialPort().Sets up default port settings (115200 8N1 Hardware flow control where supported, otherwise noflow control, and 500 ms timeout).*/void QextSerialBase::construct(void) {#ifdef QT_THREAD_SUPPORT    if (!mutex) {        mutex=new QMutex(TRUE);    }    refCount++;#endif    portOpen=false;}/*!\fn bool QextSerialBase::isOpen(void)Returns true if the port is currently open, false otherwise*/bool QextSerialBase::isOpen(void) {    return portOpen;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丁香六月综合激情| 国产成人av在线影院| 国产精品传媒视频| 国产色婷婷亚洲99精品小说| 久久婷婷国产综合精品青草| 日韩午夜在线影院| 精品国产百合女同互慰| 日韩一级完整毛片| 久久婷婷一区二区三区| 国产精品三级电影| 亚洲自拍偷拍图区| 日本欧美在线观看| 国产 欧美在线| 色噜噜久久综合| 欧美福利视频一区| 欧美大白屁股肥臀xxxxxx| 久久尤物电影视频在线观看| 国产日韩精品一区二区三区| 亚洲日本在线看| 亚洲高清视频的网址| 麻豆精品国产91久久久久久| 国产精品香蕉一区二区三区| 色综合久久中文字幕综合网 | 日本成人在线电影网| 美女性感视频久久| 99久久久无码国产精品| 欧洲一区在线观看| 精品三级av在线| 亚洲欧美影音先锋| 婷婷开心激情综合| 国产酒店精品激情| 91久久精品网| 精品不卡在线视频| 亚洲尤物在线视频观看| 国内精品伊人久久久久av影院| 不卡的电视剧免费网站有什么| 欧美人xxxx| 欧美极品aⅴ影院| 天天做天天摸天天爽国产一区| 国产毛片精品视频| 欧美日韩国产美女| 欧美国产欧美综合| 理论电影国产精品| 91成人在线观看喷潮| 国产亚洲精品资源在线26u| 亚洲网友自拍偷拍| 不卡影院免费观看| 精品久久久久久亚洲综合网 | 国产午夜精品一区二区三区视频| 亚洲欧美aⅴ...| 国产精品综合视频| 日韩手机在线导航| 亚洲成人自拍网| 91视视频在线观看入口直接观看www| 精品三级在线看| 视频一区在线视频| 欧洲生活片亚洲生活在线观看| 国产日韩欧美精品在线| 日本在线不卡一区| 欧美美女喷水视频| 亚洲最新在线观看| 91麻豆免费观看| 国产精品蜜臀av| 风流少妇一区二区| 久久久精品国产99久久精品芒果| 全国精品久久少妇| 91精品国产免费| 日韩精品亚洲专区| 欧美猛男gaygay网站| 亚洲bt欧美bt精品777| 色哟哟一区二区在线观看| 国产精品免费丝袜| 色悠久久久久综合欧美99| 亚洲欧美区自拍先锋| 99九九99九九九视频精品| 中文字幕av一区二区三区免费看| 国产成人av一区二区三区在线| 久久久综合视频| 粉嫩久久99精品久久久久久夜| 久久久亚洲综合| 国产福利精品导航| 国产精品久久久久9999吃药| 99久久综合色| 亚洲乱码国产乱码精品精的特点| 色呦呦国产精品| 亚洲综合自拍偷拍| 777a∨成人精品桃花网| 丝瓜av网站精品一区二区 | av激情综合网| 亚洲另类一区二区| 717成人午夜免费福利电影| 日本欧美在线看| 久久精品夜色噜噜亚洲aⅴ| 粉嫩高潮美女一区二区三区| 亚洲精品你懂的| 欧美一区二区三区视频免费播放| 狠狠色丁香久久婷婷综合丁香| 久久久久国色av免费看影院| 成人高清视频在线| 亚洲一级片在线观看| 欧美一区二区在线免费播放| 国产精品影音先锋| 亚洲精品久久久久久国产精华液| 欧美人动与zoxxxx乱| 国产盗摄一区二区三区| 亚洲国产一区二区在线播放| 日韩欧美国产高清| 色综合天天性综合| 另类欧美日韩国产在线| 亚洲视频小说图片| 91精品国产91久久综合桃花| 成人黄页毛片网站| 亚洲mv大片欧洲mv大片精品| 精品国产在天天线2019| 一本一道综合狠狠老| 老司机精品视频在线| 亚洲视频一二三| 久久女同互慰一区二区三区| 欧美羞羞免费网站| 国产一区在线看| 亚洲欧美一区二区三区孕妇| 欧美精品一区二区三区蜜桃视频| 99久免费精品视频在线观看| 久久er精品视频| 亚洲午夜精品网| 综合自拍亚洲综合图不卡区| 日韩欧美一级在线播放| 色婷婷激情久久| 国产91富婆露脸刺激对白| 久久精品99国产精品日本| 亚洲欧美一区二区不卡| 久久久亚洲高清| 欧美一区二区人人喊爽| 在线观看亚洲一区| 91视频你懂的| 成人免费高清视频在线观看| 国产一区二区三区黄视频 | 久久精品国产色蜜蜜麻豆| 亚洲日本欧美天堂| 国产亚洲欧美日韩俺去了| 欧美丰满高潮xxxx喷水动漫| 欧洲一区在线观看| 99精品欧美一区二区三区小说| 国产精品资源在线看| 蜜臀av一区二区在线观看 | 国产精品主播直播| 狠狠色综合色综合网络| 久久99九九99精品| 美女一区二区在线观看| 老汉av免费一区二区三区| 男人的天堂久久精品| 欧美aaaaa成人免费观看视频| 丝袜美腿高跟呻吟高潮一区| 午夜久久久久久久久| 亚洲国产中文字幕在线视频综合| 有码一区二区三区| 亚洲一区二区三区四区在线免费观看 | 亚洲综合久久av| 亚洲一卡二卡三卡四卡无卡久久| 亚洲午夜电影在线观看| 亚洲成人综合网站| 水蜜桃久久夜色精品一区的特点| 琪琪久久久久日韩精品| 狠狠色狠狠色合久久伊人| 丁香五精品蜜臀久久久久99网站| 懂色av中文字幕一区二区三区| 成人精品国产一区二区4080| 91免费看视频| 欧美日韩高清一区二区不卡| 日韩欧美三级在线| 国产欧美日韩激情| 一区二区三区国产| 免费观看一级欧美片| 国产乱国产乱300精品| 91在线视频免费91| 在线不卡免费av| 久久毛片高清国产| 亚洲老司机在线| 看国产成人h片视频| 99精品视频一区| 欧美一区二区三区播放老司机| 国产区在线观看成人精品| 一个色在线综合| 久久99久国产精品黄毛片色诱| 成人av电影在线观看| 欧美男人的天堂一二区| 中文字幕av一区二区三区高| 亚洲午夜在线视频| 国产精品99久久久久久有的能看| 日本道在线观看一区二区| 精品久久久久香蕉网| 一区二区三区毛片| 国产精品一卡二卡在线观看| 在线亚洲+欧美+日本专区| 精品不卡在线视频| 偷拍与自拍一区| 色综合久久久网| 国产精品人人做人人爽人人添| 麻豆91小视频| 91久久精品一区二区三|