NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
qextserialenumerator.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (c) 2000-2003 Wayne Roth
3 ** Copyright (c) 2004-2007 Stefan Sander
4 ** Copyright (c) 2007 Michal Policht
5 ** Copyright (c) 2008 Brandon Fosdick
6 ** Copyright (c) 2009-2010 Liam Staskawicz
7 ** Copyright (c) 2011 Debao Zhang
8 ** All right reserved.
9 ** Web: http://code.google.com/p/qextserialport/
10 **
11 ** Permission is hereby granted, free of charge, to any person obtaining
12 ** a copy of this software and associated documentation files (the
13 ** "Software"), to deal in the Software without restriction, including
14 ** without limitation the rights to use, copy, modify, merge, publish,
15 ** distribute, sublicense, and/or sell copies of the Software, and to
16 ** permit persons to whom the Software is furnished to do so, subject to
17 ** the following conditions:
18 **
19 ** The above copyright notice and this permission notice shall be
20 ** included in all copies or substantial portions of the Software.
21 **
22 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 **
30 ****************************************************************************/
31 
32 #ifndef _QEXTSERIALENUMERATOR_H_
33 #define _QEXTSERIALENUMERATOR_H_
34 
35 #include <QtCore/QList>
36 #include <QtCore/QObject>
37 #include <QStringList>
38 #include "qextserialport_global.h"
39 
40 struct QextPortInfo {
41  QString portName;
42  QString physName;
43  QString friendName;
44  QString enumName;
45  int vendorID;
46  int productID;
47 };
48 
50 
52 {
53  Q_OBJECT
54  Q_DECLARE_PRIVATE(QextSerialEnumerator)
55 public:
56  QextSerialEnumerator(QObject * parent=0);
58 
59  static QList<QextPortInfo> getPorts();
60  void setUpNotifications();
61 
62 Q_SIGNALS:
63  void deviceDiscovered(const QextPortInfo & info);
64  void deviceRemoved(const QextPortInfo & info);
65 
66 private:
67  Q_DISABLE_COPY(QextSerialEnumerator)
69 };
70 
73 
78 
79 #endif /*_QEXTSERIALENUMERATOR_H_*/
QStringList QEXTSERIALPORT_EXPORT getAvailableSerialPorts(void)
This function enumerates the available serial ports based on QextSerialPort implementation.
Definition: qextserialenumerator.cxx:169
QString friendName
Friendly name.
Definition: qextserialenumerator.h:43
int productID
Product ID.
Definition: qextserialenumerator.h:46
QString enumName
Enumerator name.
Definition: qextserialenumerator.h:44
Private implementation of QextSerialEnumerator.
Definition: qextserialenumerator_p.h:73
QStringList QEXTSERIALPORT_EXPORT getAvailableSerialPortPaths(void)
This function enumerates the full paths of all available serial ports based on QextSerialPort impleme...
Definition: qextserialenumerator.cxx:191
The QextSerialEnumerator class provides list of ports available in the system.
Definition: qextserialenumerator.h:51
QString physName
Physical name.
Definition: qextserialenumerator.h:42
QString portName
Port name.
Definition: qextserialenumerator.h:41
int vendorID
Vendor ID.
Definition: qextserialenumerator.h:45
#define QEXTSERIALPORT_EXPORT
Definition: qextserialport_global.h:42
The QextPortInfo class containing port information.
Definition: qextserialenumerator.h:40