Trade equipment common library. 1.0.0
tserialport.h
1/****************************************************************************
2** $Id: tserialport.h,v 1.5 2006/06/21 12:04:17 red75 Exp $
3**
4** Trade equipment common portable library project
5**
6** Copyright (C) 1999-2006 Leader InfoTech. All rights reserved.
7**
8** This file is part of the Library of the Ananas
9** automation accounting system.
10**
11** This file may be distributed and/or modified under the terms of the
12** GNU General Public License version 2 as published by the Free Software
13** Foundation and appearing in the file LICENSE.GPL included in the
14** packaging of this file.
15**
16** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18**
19** See http://www.leaderit.ru/ or email sales@leaderit.ru
20**
21** Contact org@leaderit.ru if any conditions of this licensing are
22** not clear to you.
23**
24**********************************************************************/
25
26/*
27
28 TSerialPort v.1.1b
29
31
32 Multiplatform Serial Port Extension
33 based on Wayne Roth's QExtSerialPort
34
35 (c) Racheengel 2004-2005
36
37*/
38
39#ifndef _TSERIALPORT_H_
40#define _TSERIALPORT_H_
41
42#include <qobject.h>
43#include <qvaluelist.h>
44#include <qstringlist.h>
45#include <qcstring.h>
46#include <qextserialport.h>
47#include <teglobal.h>
48
49#ifdef _WINDOWS
50#define _TTY_WIN_
51#endif
52#ifdef WIN32
53#define _TTY_WIN_
54#endif
55
56class LIB_EXPORT TSerialPort : public QextSerialPort
57{
58 typedef QextSerialPort superclass;
59public:
60 TSerialPort(const QString &portName = QString::null, const PortSettings *settings = 0);
61 virtual ~TSerialPort();
62
63 bool setupPort(const QString &portName = QString::null, const PortSettings *settings = 0);
64 void getPortSettings(QString *portName = 0, PortSettings *settings = 0);
65
66// virtual bool open(int mode=0);
67 Q_ULONG customBaudRate();
68 void setCustomBaudRate( Q_ULONG baudrate );
69
70 virtual void setBaudRate(BaudRateType);
71
72 virtual bool open(int mode=0);
73
74 static const QStringList& portList() { return m_ports; }
75 static const QStringList& generatePortList();
76 static QString portName(int iPortNum);
77 static QValueList<int> generatePortNumberList();
78
79protected:
80 static QStringList m_ports;
81 Q_ULONG vBaudRate;
82};
83
84#endif
QextSerialPort()
Definition qextserialport.cpp:46