• 大小: 233KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: 其他
  • 标签:

资源简介

qextserialport-1.2win-alpha,QT串口编程第三方库,适合于windows、linux下的QT串口编程

资源截图

代码片段和文件信息


/*!
\class Posix_QextSerialPort
\version 1.0.0
\author Stefan Sander
\author Michal Policht

A cross-platform serial port class.
This class encapsulates the POSIX portion of QextSerialPort.  The user will be notified of errors
and possible portability conflicts at run-time by default - this behavior can be turned off by
defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off portability
warnings) in the project.  Note that _TTY_NOWARN_ will also turn off portability warnings.
*/

#include 
#include “posix_qextserialport.h“

/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort()
Default constructor.  Note that the name of the device used by a QextSerialPort constructed with
this constructor will be determined by #defined constants or lack thereof - the default behavior
is the same as _TTY_LINUX_.  Possible naming conventions and their associated constants are:

\verbatim

Constant         Used By         Naming Convention
----------       -------------   ------------------------
_TTY_WIN_        Windows         COM1 COM2
_TTY_IRIX_       SGI/IRIX        /dev/ttyf1 /dev/ttyf2
_TTY_HPUX_       HP-UX           /dev/tty1p0 /dev/tty2p0
_TTY_SUN_        SunOS/Solaris   /dev/ttya /dev/ttyb
_TTY_DIGITAL_    Digital UNIX    /dev/tty01 /dev/tty02
_TTY_FREEBSD_    FreeBSD         /dev/ttyd0 /dev/ttyd1
_TTY_LINUX_      Linux           /dev/ttyS0 /dev/ttyS1
           Linux           /dev/ttyS0 /dev/ttyS1
\endverbatim

This constructor assigns the device name to the name of the first port on the specified system.
See the other constructors if you need to open a different port.
*/
Posix_QextSerialPort::Posix_QextSerialPort()
: QextSerialbase()
{
    Posix_File=new QFile();
}

/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort&)
Copy constructor.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const Posix_QextSerialPort& s)
 : QextSerialbase(s.port)
{
setOpenMode(s.openMode());
    port = s.port;
    Settings.BaudRate=s.Settings.BaudRate;
    Settings.DataBits=s.Settings.DataBits;
    Settings.Parity=s.Settings.Parity;
    Settings.StopBits=s.Settings.StopBits;
    Settings.FlowControl=s.Settings.FlowControl;
    lastErr=s.lastErr;

    Posix_File=new QFile();
    Posix_File=s.Posix_File;
    memcpy(&Posix_Timeout &s.Posix_Timeout sizeof(struct timeval));
    memcpy(&Posix_Copy_Timeout &s.Posix_Copy_Timeout sizeof(struct timeval));
    memcpy(&Posix_CommConfig &s.Posix_CommConfig sizeof(struct termios));
}

/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const QString & name)
Constructs a serial port attached to the port specified by name.
name is the name of the device which is windowsystem-specific
e.g.“COM1“ or “/dev/ttyS0“.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const QString & name QextSerialbase::QueryMode mode)
 : QextSerialbase(name)
{
    Posix_File=new QFile();
    setQueryMode(mod

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12568  2007-09-06 02:16  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\CHANGES

     文件        344  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\doc\mainpage.dox

     文件        304  2007-05-28 16:20  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\doc\qextbasetype.dox

     文件       6392  2007-03-25 00:26  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\doc\qiodevice.tag

     文件       8761  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\Doxyfile

     文件        551  2007-08-13 11:41  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\enumerator\enumerator.pro

     文件        704  2007-08-13 11:41  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\enumerator\main.cpp

     文件        605  2007-09-06 00:54  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\event\event.pro

     文件       2328  2007-09-06 00:54  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\event\main.cpp

     文件       1354  2007-09-06 00:54  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\event\PortListener.cpp

     文件        869  2007-09-06 00:54  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\event\PortListener.h

     文件        334  2007-05-28 15:15  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\defs.h

     文件        509  2007-05-28 15:15  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\main.cpp

     文件       1808  2007-03-25 00:36  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\MainWindow.cpp

     文件        853  2007-03-25 00:36  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\MainWindow.h

     文件       5383  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\Makefile

     文件       6531  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\Makefile.Debug

     文件       6561  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\Makefile.Release

     文件       3108  2007-05-28 15:15  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\MessageWindow.cpp

     文件       2057  2007-08-13 11:41  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\MessageWindow.h

     文件        699  2007-08-13 11:41  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\QESPTA.pro

     文件       3067  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\QespTest.cpp

     文件        591  2007-03-25 00:36  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\QespTest.h

     文件        120  2007-03-25 00:36  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\examples\qespta\README

     文件       2653  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\annotated.html

     文件       3150  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\classes.html

     文件      24148  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\classPosix__QextSerialPort-members.html

     文件     200894  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\classPosix__QextSerialPort.html

     文件        852  2007-03-25 03:53  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\classPosix__QextSerialPort.png

     文件      47368  2007-09-06 00:47  qextserialport-1.2win-alpha\qextserialport-1.2win-alpha\html\classQextbaseType-members.html

............此处省略75个文件信息

评论

共有 条评论

相关资源