doc: Removed the HTML template from the .qdocconf files

qt-module-defaults.qdocconf already contains the HTML template.

Change-Id: I831615cdfdb3d4df73393c6b6815fc837bc444d4
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Remove non-standard comma at the end of an enum

Change-Id: I69ca34c159a267855977bee9670836ce7a249782
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Fix cast from ASCII in library code

Must always declare the source encoding. QtSerialPort must still compile
with Qt 4, so #define QStringLiteral to be QLatin1String there (even
though QStringLiteral is supposed to be UTF-8).

Note: this code is bad. It's not thread-safe outside of GCC. It should
use Q_GLOBAL_STATIC.

Change-Id: I938c2f836f9c3c1d2beaade20e67ce5ef142741e
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Use the proper signature for the data error policy changed signal

Change-Id: Iaf6df920dfca65b80231bb702c0290bb5c0e00d9
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Use the ingroup/title/example properly without the module keyword

This also eliminates several documentation warnings when trying to build that.
Planning to add \brief and other fancy stuff later, but the main purpose of this
change is to eliminate the documentation warnings.

Change-Id: Ib4048d0af691bac9ea70f6ca907649dce0f650db
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Fix several documentation issues for the snippet qdoc keyword

As it can be seen in other submodule examples, the "example" prefix is
unnecessary, and it even causes warnings.

Change-Id: Id168108758cc7f6dbb0aebf753b757c4f67b3f47
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Fix a typo in the example qdoc to eliminate the warning

Change-Id: Ia241ea3198a1e9deb3501de07fb510eea8dfd77c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Remove the namespace doc as the namespace usage was removed

This file does not have any useful content either, and unlikely to have in a
foreseeable future.

Change-Id: I36da8a3599f308a42d5809168b0f48dc197df126
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Add CMake unit tests for QtSerialPort.

Change-Id: I406517f216e7c73c20439ca2f9a17e60709ef661
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Mentioning of Unbuffered mode in the open() method is removed

At present the Unbuffered mode isn't supported, therefore the
mentioning is deleted.

Change-Id: I399dd7ac79f6571a5d0738957120a046b2422fef
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
doc: Minor changes to qtserialport.qdocconf

Organizing the file a bit to make it match other qdocconf files.
Also, renaming \title Qt Serial Port to match other modules.

Change-Id: I65938cad5184ca886765272294ce07d117f77b5a
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Add further device filters on Linux without libudev

Added:

* ttyAMA filter for AMBA serial ports, e.g. see
http://lxr.free-electrons.com/source/drivers/tty/serial/amba-pl011.c

* ircomm filter for infrared serial devices, e.g. see
http://www.tldp.org/HOWTO/html_single/Infrared-HOWTO/

Change-Id: I9e1cd04513a937f080978a7ecc7139a906de40f0
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Refactor the Windows port enumeration from GUID classes to devinterfaces

Earlier enumeration of devices was made through GUID classes. But
MSDN says that this approach became outdated (since Windows 2000),
and instead of classes it is necessary to use GUID interfaces.

See:

* http://msdn.microsoft.com/en-us/library/windows/hardware/ff545036%28v=vs.85%29.aspx
* http://msdn.microsoft.com/en-us/library/windows/hardware/ff545046%28v=vs.85%29.aspx

Thus there was a changeover of:

* GUID_DEVCLASS_PORTS by GUID_DEVINTERFACE_COMPORT
* GUID_CLASS_MODEM by GUID_DEVINTERFACE_MODEM

Of course, flags for the SetupDiGetClassDevs() function changed also.

This approach decided the following:

* Use of newer API for enumeration
* There is no need GUID classes for non-standard "purely" the virtual
devices (like com0com and so forth)
* There is no need to check for name "LPT" existence, because
GUID_DEVINTERFACE_COMPORT belong only to serial ports devices (instead
of GUID_DEVCLASS_PORTS that include serial and parallel ports).

It is checked on devices:

* Built-in serial ports
* USB/Serial converters (PL, FTDI)
* USB Bluetooth serial ports (with standard MS stack)
* USB modems (ZTE MF180)
* Com0com virtual serial ports
* Eltima virtual serial ports
* Telit virtual serial ports

It is checked on OS: Windows XP/Vista/7/8

Change-Id: I9da51d815ac5081a95113659be2b38ebd31275a4
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Fix of errors of compilation on WinCE platform

Some previous commits entered regressions in compile process,
namely:

* sha1: 544f927c3724344d01d45d19151d236c143f8c83

After implementation of a new concept of internal architecture
of library, is entered regression for the indefinite eventMask
variable in the waitForReadOrWrite() method.

Solution - to define a variable into this method.

* sha1: 3ea635d74d4035c9036c2b7208b162620f51aa8b

Entered the name space regression for the class CommEventNotifier.

Solution - not to use a name space for this class.

Tested for target:

"-platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005"

Task-number: QTPLAYGROUND-13
Change-Id: I9dbcc0023f06c1b0e6d7b1b670828650382ab785
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Workaround for fix sending of data for WinCE platform

The commit

* sha1: 544f927c3724344d01d45d19151d236c143f8c83

entered regression of implementation of data writing to the
serial port.

Regression is that after data writing to the internal ring
buffer of a class these data really aren't transferred to
the serial port and remain in this buffer because no event
EV_TXEMPTY triggered. This event will occur only after the
serial port will transfer at least one byte of data and the
FIFO buffer of the driver becomes the free for transmission
of the next portion of data from ring buffer of class.

Thus the simplest decision is the forced call of WriteFile()
of function after each addition of the internal ring buffer
to trigger EV_TXEMPTY sequence. In this case we launch
WriteFile() implicitly through the notifyWrite() method with
the WriteChunkSize parameter (instead of one byte) to optimize
transmission for speed (theoretically).

WARNING: This decision is just a workaround and not a real fix,
shall be decided in the future in more correct and effective
way.

Tested for target:

"-platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005"

on standard Pocket PC WM5.0 Device Emulator.

Task-number: QTPLAYGROUND-13
Change-Id: I4b3a36fa064dee92406a7511eb2b98b2a55e5315
Reviewed-by: Laszlo Papp <lpapp@kde.org>
API change: setBreak -> setBreakEnabled

setBreak(false) to disable breaks are a bad idea. clearBreak(false) to
enable breaks are an even worse idea. So rename the function to
setBreakEnabled(), which follows existing Qt patterns.

Change-Id: I5f76afc3c9e7039b55be231f6be4d5d20ec2e537
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Eliminate the blocking terminal example notes as it still does not exist

Change-Id: I28986ada705996ada22b30d10877ea9eed0dba8f
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Revert "Refactor the Windows port enumeration from GUID classes to devinterfaces"

This reverts commit 3bfe998860e0bfd3ce48784188eaa0d58bf86da1.

Patch with enumerating of devices through interfaces GUID's enters many
regressions, breaks universality and complicates realization.

For example, it breaks enumeration of CDC ACM devices. Moreover, some devices
(like Nokia phones) has incorrect registration in Windows registry so
workaround will greatly complicates code.

Decision with use of GUID's interfaces was worse than the previous with use of
setup GUID's. Thus, was made the decision to roll away changes on really
working decision with Setup Class GUID's.

Now tested for devices:

* built-in serial port
* USB/Serial converter on PL2303 chip
* USB/Serial converter on FTDI chip
* USB/Bluetooth dongle with standard MS bluetooth stack
* USB/CDMA Modem ZTE MF180
* Com0com virtual serial ports
* Eltima virtual serial ports
* Telit virtual serial ports
* CDC ACM serial port on Motorola E398 phone
* CDC ACM (and modem) serial port on Nokia E95 phone

on Windows XP/7/8.

Task-number: QTPLAYGROUND-27
Change-Id: Icc893e9e54e51dbf78da2d132dab6db986d94e03
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Fix examples directory layout

Move examples into a dedicated 'serialport' directory. This is
in line with what the other modules do, and makes sure that
the examples show up  in a sensible place even for the 'combined'
source packages.

Task-number: QTBUG-30912
Change-Id: Iefa2b634df3d2eb34f655b34f6fb24a224b78869
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Update the documentation and internal setBreakEnabled API

The change 0add3b934b8405fc5b65efeba9f05cc1dc353e64 changed the API, and we had
a compromise in there to get the API changes in as soon as possible. This change
tries to address the suggested documentation and internal API changes.

Only tested on Linux with Qt 4.8.4 and Qt 5.1, so it might break on other
platforms.

Change-Id: I153e5a35d76beb26e04dbabf184bc9b90ef4b70b
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>