Commit ae8ffd0c authored by Don Gagne's avatar Don Gagne

Switch Firmware Upgrade to qextserialport

QSerialPort buffering too slow on Windows.
parent ef726502
syntax: glob
*.pro.user*
*.app
*.moc
*.prl
Makefile*
doc/html/
*.framework/
*.xcodeproj/
debug/
release/
qtc-gdbmacros/
*.rej
*.orig
*.obj
*.swp
*.dll
*.exp
*.ilk
*.pdb
*.lib
Thumbs.db
moc_*.cpp
qrc_*.cpp
*.o
*.so.*
*.so
*.pdb
ui_*.h
*~
.qmake.cache
extserialport.prf
lib/*
*.orig
*.exe
*.vcproj
*.vcproj.*.user
*_resource.rc
*.sln
*.idb
*.ncb
*.suo
examples/enumerator/enumerator
examples/event/event
examples/qespta/qespta
examples/uartassistant/uartassistant
object_script.*
This diff is collapsed.
From QextSerialPort 1.2-beta on, we use MIT license for QextSerialPort project.
== License ==
Copyright (c) 2000-2003 Wayne Roth
Copyright (c) 2004-2007 Stefan Sander
Copyright (c) 2007 Michal Policht
Copyright (c) 2008 Brandon Fosdick
Copyright (c) 2009-2010 Liam Staskawicz
Copyright (c) 2011 Debao Zhang
Web: http://code.google.com/p/qextserialport/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
== Why license needed? ==
Many users complains that, without a proper licence they can not use this library.
* http://groups.google.com/group/qextserialport/browse_thread/thread/0e8756920b01da82
Hi,
we are considering using a modified version of QExtSerialPort in one of our
projects (Qt Creator, http://qt.gitorious.org/qt-creator).
Would it be possible to add license header information or a license file to the
QExtSerialPort code base? - This would make re-use of the code base easier.
If that is not possible, could we redistribute the source code with BSD-
license headers manually added?
And
I am also considering packaging the software for Debian, but I
couldn't do it yet just because of the license.
* http://code.google.com/p/qextserialport/issues/detail?id=8
Questions:
Can I use qextserialport in a commercial product?
If yes, how?
Compile it in? I guess no.
If I can use it as a library, how should the README be formulated?
Is the "MIT license" from 2008 appropriate?
== Why can we use MIT? ==
Form the history of [http://lists.trolltech.com/qt-interest/2004-12/msg01022.html qt-interest mail list]
* Wayne Roth, the original author of the project, had said that:
the code is in the public domain. Do whatever you like with it. Right
now I have too many other things to do to put any serious time into
fixing it. Trolltech should be aware of this already; they asked
about a license when they offered to host the tarball.
* Stefan Sander, the maintainer of qextserialport on sourceforge, said that
Hello,
My project registration at !SourceForge have been approved.
http://www.sf.net/projects/qextserialport
I thought an initial licence of Public Domain would be best solution.
Someone wrote: - Because its public domain, some could fork it under different licenses -
And from [http://groups.google.com/group/qextserialport/browse_thread/thread/fbcddbfb4a0b5a51?pli=1 this thread] on qesp mail list, we can see that, current maintainers and users agree with a MIT licence.
* Brandon Fosdick,
I would vote for BSD or MIT :)
* Liam Staskawicz,
That works for me - let's call it MIT and go for it :)
And from [[https://groups.google.com/forum/?fromgroups#!topic/qextserialport/P_5TrNHBICE this other thread]] on the same mailing list:
* Michal Policht,
I agree to license.
= About QextSerialPort =
QextSerialPort provides an interface to old fashioned serial ports for Qt-based applications. It currently supports Mac OS X, Windows, Linux, FreeBSD.
http://code.google.com/p/qextserialport/
== How to use (1) ==
* Download the source code.
* Put the source code in any directory you like. For example, 3rdparty:
|-- project.pro
|-- ....
|-- 3rdparty\
| |-- qextserialport\
| |
* Add following line to your qmake project file:
include(3rdparty/qextserialport/src/qextserialport.pri)
* Using QextSerialPort in your code. Enjoy it!
#include "qextserialport.h"
....
QextSerialPort * port = new QextSerialPort();
....
== How to use (2) ==
It's very easy to compile QextSerialPort directly into your application
(see above section), however, we would prefer to use it as a shared library.
* Download the source code, and put it in any location you like.
* Run following command to generate library.
qmake
make (or nmake)
sudo make install (or nmake install)
* Add following line to your project's file
CONFIG += extserialport
* Using QextSerialPort in your code. Enjoy it!
#include "qextserialport.h"
....
QextSerialPort * port = new QextSerialPort();
....
== Build Documents ==
* Run
qmake
make docs
* Note: More information can be found in doc/readme.txt
== Build examples ==
* Goto examples directory, then run
qmake (or qmake -r)
make (or nmake)
OTHER_FILES += $$PWD/qextserialport.qdocconf
#name of qdoc3 has been changed to qdoc under Qt5
QESP_QDOC = qdoc
lessThan(QT_MAJOR_VERSION, 5):QESP_QDOC = qdoc3
docs_target.target = docs
docs_target.commands = $$QESP_QDOC $$PWD/qextserialport.qdocconf
QMAKE_EXTRA_TARGETS = docs_target
QMAKE_CLEAN += "-r $$PWD/html"
/*!
\example examples/enumerator
\title enumerator Demo
The example demonstrates how to use QextSerialEnumerator.
Include the proper header file
\snippet examples/enumerator/main.cpp 0
Get available ports in the system.
\snippet examples/enumerator/main.cpp 1
Output
\snippet examples/enumerator/main.cpp 2
*/
/*!
\example examples/qespta
\title qespta Demo
The example demonstrates how to use QextSerialPort.
*/
/*!
\example examples/uartassistant
\title UartAssistant Demo
The example demonstrates how to use QextSerialPort.
Initialze UI element.
\snippet examples/uartassistant/dialog.cpp 0
Initialize serial port
\snippet examples/uartassistant/dialog.cpp 1
port Settings
\snippet examples/uartassistant/dialog.cpp 2
Open or Close the port.
\snippet examples/uartassistant/dialog.cpp 3
Read from or Write to the port
\snippet examples/uartassistant/dialog.cpp 4
\image uartassistant.png
*/
/*!
\page index.html
\title QextSerialPort Manual
\section1 Overview
QextSerialPort provides an interface to old fashioned serial ports for
Qt-based applications. It currently supports Mac OS X, Windows, Linux, FreeBSD.
From QextSerialPort 1.2-beta on, license of the project has been changed to MIT.
\list
\o Revision 0.9.x is Qt 2 & 3 compatible.
\o Revision 1.x.x is Qt 4 compatible.
\o From revision 1.2beta1 on, Qt 5 support is added.
\endlist
\section1 Classes
\list
\o \l QextSerialPort encapsulates a serial port on both POSIX and Windows systems.
\o \l QextSerialEnumerator enumerates ports currently available in the system.
\endlist
\section1 Getting Started
\section2 Usage(1): Source Code Only
The package contains a qextserialport.pri file that allows you to integrate the component into programs that use qmake for the build step.
Download the source code.
Put the source code in any directory you like. For example, 3rdparty:
\code
|-- project.pro
|-- ....
|-- 3rdparty\
| |-- qextserialport\
| |
\endcode
Add following line to your qmake project file:
\code
include(pathToPri/qextserialport.pri)
\endcode
Then, using QextSerialPort in your code
\code
#include "qextserialport.h"
...
MyClass::MyClass()
{
port = new QextSerialPort("COM1");
connect(port, SIGNAL(readyRead()), this, SLOT(onDataAvailable()));
port->open();
}
void MyClass::onDataAvailable()
{
QByteArray data = port->readAll();
processNewData(usbdata);
}
\endcode
\section2 Usage(2): shared library
Although QextSerialPort can be directly compiled into your application, You may prefer
to use QextSerailPort as an library, which is very easy too.
1. Download the source code, and put it in any location you like.
2. Goto the top level directory ,run following command to generate library.
\code
qmake
sudo make install (or nmake install)
\endcode
3. Add following line to your project's file
\code
CONFIG += extserialport
\endcode
4. Using QextSerialPort in your code. Enjoy it!
\code
#include "qextserialport.h"
....
QextSerialPort * port = new QextSerialPort();
....
\endcode
\section2 Usage(3): Static library
Someone prefer to use QextSerailPort as static library.
Open the project file: qextserialport.pro, add uncomment follow line
\code
# CONFIG += qesp_static
\endcode
Then follow the same steps as shared library
\code
qmake
sudo make install
\endcode
The static library, the header files, and the feature file will be installed to your system.
Add following line to your qmake's project file:
\code
CONFIG += extserialport
\endcode
\section1 Platform Special
\section2 For MacX: Build as framework
Open the project file: *qextserialport.pro*, and uncomment follow line
\code
# CONFIG += qesp_mac_framework
\endcode
Then follow the same steps as shared library, Goto the top level directory , and run
\code
qmake
sudo make install
\endcode
The framework which includes libraries and the header files, and the feature file will be installed to your system.
Add following line to your qmake's project file:
\code
CONFIG += extserialport
\endcode
\section2 For Linux: Enable udev
Open the project file: *qextserialport.pro*, uncomment follow line
\code
#linux*:CONFIG += qesp_linux_udev
\endcode
Note, If you are using the usage(1), Add following line before include the qextserialport.pri file.
\code
CONFIG += qesp_linux_udev
\endcode
\section2 Build documents
\code
make docs
\endcode
\section1 Examples
\list
\o \l examples/enumerator
\o \l examples/qespta
\o \l examples/uartassistant
\endlist
\section1 Resources
\section2 Nokia(Trolltech)
\list
\o \l {http://doc.trolltech.com/qq/qq12-iodevice.html} {Writing a Custom I/O Device}
\o \l {http://doc.trolltech.com/3.3/qiodevice.html} {Qt 3.3: QIODevice Class Reference}
\o \l {http://doc.trolltech.com/4.7/qiodevice.html} {Qt 4.7: QIODevice Class Reference}
\endlist
\section2 MSDN
\list
\o \l {http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_resources.asp} {Communications Resources}
\o \l {http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/about_communications_resources.asp} {About Communications Resources}
\o \l {http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/using_communications_resources.asp}{Using Communications Resources}
\o \l {http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_functions.asp} {Communications Functions}
\o \l {http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_structures.asp} {Communications Structures}
\endlist
\section2 TLDP
\list
\o \l {http://www.tldp.org/HOWTO/Serial-HOWTO.html}{Serial HOWTO}
\o \l {http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/}{Serial Programming HOWTO}
\endlist
\section2 Other
\list
\o \l {http://www.easysw.com/~mike/serial/serial.html} {Serial Programming Guide for POSIX Operating Systems}
\endlist
*/
/*!
\page classes.html
\generatelist annotatedclasses
*/
# Run qdoc3 from the directory that contains this file.
project = qesp
description = QextSerialPort Reference Documentation
url = http://code.google.com/p/qextserialport
outputencoding = UTF-8
language = Cpp
#Paths are relative to the location of this file
headerdirs = . ../src
sourcedirs = . ../src
exampledirs = ../examples ..
imagedirs = ./examples/images images
Cpp.ignoretokens = QEXTSERIALPORT_EXPORT
indexes = $QTDIR/doc/html/qt.index
qhp.projects = qesp
qhp.qesp.file = qesp.qhp
qhp.qesp.namespace = com.google.code.qextserialport.120
qhp.qesp.virtualFolder = qdoc
qhp.qesp.indexTitle = QextSerialPort Reference Documentation
qhp.qesp.indexRoot =
qhp.qesp.extraFiles = style/style.css
#------------------------------------------------------------------
outputdir = html
outputformats = HTML
headers.fileextensions = "*.h"
sources.fileextensions = "*.cpp *.qdoc"
HTML.templatedir = .
HTML.stylesheets = style/style.css
HTML.headerstyles = " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n"
HTML.endheader = "</head>\n"
HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n" \
"<tr>\n" \
"<td class=\"postheader\" valign=\"center\">" \
"<a href=\"index.html\">Home</a> &middot;" \
" <a href=\"classes.html\">All Classes</a> &middot;" \
"</td></tr></table>"
HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"40%\" align=\"left\">Copyright &copy; 2000-2012</td>\n" \
"<td width=\"20%\" align=\"center\"><a href=\"http://code.google.com/p/qextserialport\">QextSerialPort Project</a></td>\n" \
"<td width=\"40%\" align=\"right\"><div align=\"right\">QextSerialPort Manual</div></td>\n" \
"</tr></table></div></address>"
Note:
If you are using qextserialport-XXX.tar.gz, the qesp.qch and
html files have been provided.
Open the file "html/index.html" using your web browser.
Or integrated the "html/qesp.qch" into your QtCreator.
== How to generate help files? ==
Simply run following commands at toplevel directory.
qmake
make docs
Or run the following command at this directory
qdoc3 qextserialport.qdocconf
Then a folder called "html" will be generated.
Open the file "html/index.html" using your web browser.
== How to integrated into Qt Creator or Qt Assistant? ==
Once the html files are generated. run following commands
cd doc/html
qhelpgenerator qesp.qhp
A file called "qesp.qch" will be generated.
For Qt Assistant:
Edit ==> Preferences ==> Documentations ==> Add...
For Qt Creator
Tools ==> Options ==> Help ==> Documentations ==> Add...
a:link, a:visited {
color: #00732F;
text-decoration: none;
font-weight: bold;
}
body {
font: normal 400 14px/1.2 Arial;
margin-top: 85px;
}
h1 {
margin: 0;
}
h2 {
font: 500 20px/1.2 Arial;
}
h3.fn, span.fn {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
word-spacing: 3px;
padding: 3px 5px;
}
table, pre {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
font-size: 12px;
line-height: 1.2;
margin-bottom: 25px;
margin-left: 15px;
}
table td {
padding: 3px 15px 3px 20px;
}
table tr.even {
background-color: white;
color: #66666E;
}
table tr.odd {
background-color: #F6F6F6;
color: #66666E;
}
li {
margin-bottom: 10px;
padding-left: 12px;
}
.cpp {
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.footer {
margin-top: 50px;
}
.memItemLeft {
padding-right: 3px;
}
.memItemRight {
padding: 3px 15px 3px 0;
}
.qml {
display: block;
margin: 10;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
padding: 20px 0 20px 0;
}
.qmldefault {
padding-left: 5px;
float: right;
color: red;
}
.qmlreadonly {
padding-left: 5px;
float: right;
color: #254117;
}
.rightAlign {
padding: 3px 5px 3px 10px;
text-align: right;
}
.title {
background-color: white;
color: #44A51C;
font-family: Verdana;
font-size: 35px;
font-weight: normal;
left: 0;
padding-bottom: 5px;
padding-left: 16px;
padding-top: 20px;
position: absolute;
right: 0;
top: 0;
}
.toc {
float: right;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #DDD;
margin: 0 20px 10px 10px;
padding: 20px 15px 20px 20px;
height: auto;
width: 200px;
}
TEMPLATE = app
DEPENDPATH += .
CONFIG += console
include(../../src/qextserialport.pri)
SOURCES += main.cpp
/**
* @file main.cpp
* @brief Main file.
* @author Micha? Policht
*/
//! [0]
#include "qextserialenumerator.h"
//! [0]
#include <QtCore/QList>
#include <QtCore/QDebug>
int main()
{
//! [1]
QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
//! [1]
qDebug() << "List of ports:";
//! [2]
foreach (QextPortInfo info, ports) {
qDebug() << "port name:" << info.portName;
qDebug() << "friendly name:" << info.friendName;
qDebug() << "physical name:" << info.physName;
qDebug() << "enumerator name:" << info.enumName;