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

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

?? qextserialbase.cpp

?? 一個虛擬串口的例子代碼
?? CPP
字號:
#include "qextserialbase.h"

#include <string.h>

#include <stdio.h>

/*!
\class QextSerialBase
\version 0.70 (pre-alpha)
\author Wayne Roth

A common base class for Win_QextSerialBase, Posix_QextSerialBase and QextSerialPort.  
*/
#ifdef QT_THREAD_SUPPORT
QMutex* QextSerialBase::mutex=NULL;
unsigned long QextSerialBase::refCount=0;
#endif

/*!
\fn QextSerialBase::QextSerialBase()
Default constructor.
*/
QextSerialBase::QextSerialBase() {
    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");

#else 
    strcpy(nameStr, "/dev/ttyS0");
#endif

    setName(nameStr);
    construct();
}

/*!
\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) {
    setName(name);
    construct();
}

/*!
\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() const
This 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 bytes
have 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, unsigned int 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 (int)(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 currently
only 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() const
Returns the type of flow control used by the port.  For a list of possible values returned
by this function, see the definition of the enum FlowType.
*/
FlowType QextSerialBase::flowControl() const {
    return Settings.FlowControl;
}

/*!
\fn ParityType QextSerialBase::parity() const
Returns 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() const
Returns 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() const
Returns the number of stop bits used by the port.  For a list of possible return values, see
the definition of the enum StopBitsType.
*/
StopBitsType QextSerialBase::stopBits() const {
    return Settings.StopBits;
}

/*!
\fn BaudRateType QextSerialBase::baudRate(void) const
Returns 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) const
Returns 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() const
Returns 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:

\verbatim
Error                           Explanation
---------------------------     -------------------------------------------------------------
E_NO_ERROR                      No Error has occured
E_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 condition
E_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 port
E_BUFFER_OVERRUN                Character buffer overrun
E_RECEIVE_OVERFLOW              Receive buffer overflow
E_RECEIVE_PARITY_ERROR          The port detected a parity error in the received data
E_TRANSMIT_OVERFLOW             Transmit buffer overflow
E_READ_FAILED                   General read operation failure
E_WRITE_FAILED                  General write operation failure
\endverbatim
*/
unsigned long QextSerialBase::lastError() const {
    return lastErr;
}

/*!
\fn const char* QextSerialBase::name() const
Returns 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 no
flow 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一区二区三区免费野_久草精品视频
国产亚洲精品精华液| 极品销魂美女一区二区三区| 在线中文字幕一区二区| 亚洲一区二区三区四区在线| 91精品啪在线观看国产60岁| 国产精品一区在线观看你懂的| 国产精品久久午夜| 欧洲色大大久久| 国产美女精品一区二区三区| 亚洲欧美日韩国产一区二区三区| 色成年激情久久综合| 精品一区二区三区不卡| 亚洲综合网站在线观看| 久久精品一区二区三区四区| 欧美色电影在线| 91精品办公室少妇高潮对白| 欧美一三区三区四区免费在线看| 福利电影一区二区三区| 亚洲视频免费在线观看| 亚洲国产精品av| 制服丝袜激情欧洲亚洲| 91高清视频在线| 91黄色激情网站| 91影院在线免费观看| 国产乱码精品一区二区三区忘忧草| 亚州成人在线电影| 亚洲大片一区二区三区| 中文字幕中文乱码欧美一区二区| 欧美tk—视频vk| 欧美一级黄色录像| 欧美影院一区二区| 欧美日韩大陆一区二区| 欧美美女激情18p| 欧美一区二视频| 日韩欧美另类在线| 欧美一区二区播放| 国产三级一区二区| 中文字幕在线不卡视频| 亚洲国产精品久久人人爱蜜臀| 一级女性全黄久久生活片免费| 亚洲一区在线观看视频| 麻豆91免费看| av成人免费在线| 51午夜精品国产| 久久久av毛片精品| 亚洲综合在线第一页| 久久精品久久99精品久久| 懂色av中文字幕一区二区三区| 91久久线看在观草草青青| 欧美一级专区免费大片| 亚洲精品视频在线观看网站| 免费在线视频一区| 欧美性大战久久久| 欧美激情在线一区二区三区| 视频一区视频二区中文| 成人黄动漫网站免费app| 3d成人h动漫网站入口| 亚洲欧洲成人精品av97| 日韩电影在线看| 在线观看视频一区二区| 亚洲天堂av一区| 成人动漫视频在线| 中文字幕第一区二区| 一区在线观看免费| 国产制服丝袜一区| 亚洲精品一区二区三区四区高清| 奇米综合一区二区三区精品视频| 欧美专区亚洲专区| 亚洲一区二区欧美| 欧美视频日韩视频在线观看| 亚洲激情在线激情| 欧美性受极品xxxx喷水| 亚洲一区二区精品3399| 精品视频全国免费看| 视频在线观看一区二区三区| 欧美嫩在线观看| 久久国产精品72免费观看| 精品国产伦一区二区三区观看体验 | 色哟哟日韩精品| 一区二区三区欧美亚洲| 在线不卡的av| 国产综合久久久久久鬼色| 国产精品国产精品国产专区不蜜 | 在线视频亚洲一区| 午夜久久福利影院| 精品国产百合女同互慰| 成人免费av网站| 日韩国产一区二| 国产精品第一页第二页第三页| av电影在线观看不卡| 香港成人在线视频| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲丝袜精品丝袜在线| 欧美老女人在线| 成人在线视频一区二区| 午夜精品久久久久久不卡8050| 欧美成人aa大片| 色香蕉久久蜜桃| 99这里都是精品| 国产一区二区看久久| 亚洲小说春色综合另类电影| 国产精品久久久久毛片软件| 欧美成人精品1314www| 在线观看日韩av先锋影音电影院| 激情五月播播久久久精品| 一区二区三区国产豹纹内裤在线| 欧美国产精品一区二区| 久久综合色之久久综合| 精品嫩草影院久久| 欧美一级黄色大片| 精品国产乱码久久久久久久| 91精品国产aⅴ一区二区| 色噜噜夜夜夜综合网| 在线一区二区三区做爰视频网站| 国产一区二区精品久久91| 久久精品二区亚洲w码| 麻豆成人久久精品二区三区红| 午夜视频在线观看一区二区三区 | 日韩1区2区日韩1区2区| 七七婷婷婷婷精品国产| 国产很黄免费观看久久| 97精品电影院| 亚洲主播在线观看| 精品精品欲导航| 久久青草国产手机看片福利盒子| 久久久久久久久99精品| 一区二区三区在线视频观看58| 亚洲免费高清视频在线| 免费av成人在线| av一本久道久久综合久久鬼色| 在线免费观看视频一区| 日韩免费福利电影在线观看| 中文字幕亚洲区| 美女视频一区在线观看| 99免费精品在线| 亚洲精品在线一区二区| 亚洲成人精品一区| 不卡视频在线看| 久久无码av三级| 五月激情综合网| 一本到不卡免费一区二区| 久久综合色一综合色88| 免费高清不卡av| 欧美一区二区三区男人的天堂| 1024国产精品| 风流少妇一区二区| 国产色产综合色产在线视频| 日本最新不卡在线| 日韩一区二区电影| 午夜精品久久久久久不卡8050| 色综合中文字幕国产 | 亚洲成人一区二区| 欧美亚洲图片小说| 亚洲一区二区免费视频| 欧美性大战xxxxx久久久| 亚洲成人动漫精品| 日韩欧美在线网站| 国产伦精一区二区三区| 26uuu国产电影一区二区| 乱中年女人伦av一区二区| 精品国产在天天线2019| 懂色av一区二区夜夜嗨| 亚洲欧洲色图综合| 色婷婷综合久久久中文一区二区| 夜夜揉揉日日人人青青一国产精品| 色综合天天综合狠狠| 亚洲国产精品一区二区www在线 | 2020国产成人综合网| 成人av免费在线观看| 天天色综合天天| 精品久久久网站| 欧美日韩在线观看一区二区 | 日韩av电影免费观看高清完整版 | 欧美喷潮久久久xxxxx| 九一九一国产精品| 专区另类欧美日韩| 91精品在线一区二区| 91在线高清观看| 激情久久五月天| 一区二区三区精品| 久久精品水蜜桃av综合天堂| 在线观看网站黄不卡| 成人av综合在线| 久久99国产精品成人| 亚洲黄色小视频| 国产精品久99| 国产精品丝袜一区| 国产午夜精品久久| 久久蜜臀精品av| 亚洲精品在线一区二区| 欧美大白屁股肥臀xxxxxx| 欧美日韩情趣电影| 欧美剧情电影在线观看完整版免费励志电影| 国产麻豆精品theporn| 国产原创一区二区三区| 久久99热这里只有精品| 韩国视频一区二区| 国产精品一线二线三线| 韩国欧美国产一区| 不卡高清视频专区|