summaryrefslogtreecommitdiff
path: root/src/serialport/qserialport_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Use C++11 member class initializationDenis Shienkov2017-10-121-28/+28
| | | | | | Change-Id: I427b993a3a71f199029a8956cdf0dc2c98f0e444 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Port QWinOverlappedIoNotifier to QDeadlineTimerThiago Macieira2017-08-151-1/+2
| | | | | Change-Id: Ib57b52598e2f452985e9fffd1459eb18587c99e3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Improve read performance when the buffer size is limitedAlex Trotsenko2017-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | Read notifications should be enabled all the time while the device is opened unless the buffer size limit is reached. To enable the read notifier again, the user needs to read the data or enlarge the buffer with a setReadBufferSize() call. According to that scenario, it's very likely that the device will toggle the state of notifier twice (on->off->on) in one notification cycle. This patch prevents this unnecessary toggling by: - unconditionally setting the notifier's state in setReadBufferSize()/ readData(); - deferring the notification disabling in readNotification() on Unix and in completeAsyncRead() on Windows to the next notification cycle. Change-Id: I97fc041bb705c034a7e73d1437e64b9b34dc2c18 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Increase buffer chunk sizesDenis Shienkov2017-04-261-5/+4
| | | | | | | | | | | This reduces the number of syscalls and thus the CPU load when dealing with fast ports. And 32KiB seems still small enough to be no concern on modern hardware even if it's excessive for a given port. Change-Id: I4749e4255627d3abf2393323216e01ac6436413b Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of originalEventMask memberDenis Shienkov2017-04-091-3/+2
| | | | | | | | | The event mask variable is used only once in process of initialization, so we do not need to keep this variable as the class member. Change-Id: I1f97a312cc92345d435dee821fefb8c2de33665e Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Move settingFromBaudRate() function into common Q_OS_UNIX guardDenis Shienkov2017-04-091-4/+2
| | | | | | Change-Id: Ia9b0851ea7259bc4bc1aa709992b5eb215144a77 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove unused QThread forward declarationDenis Shienkov2017-04-091-1/+0
| | | | | | Change-Id: I0dc20fa836888d3caa678fd8f5b620625e00ec92 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-021-1/+1
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/serialport/qserialport.cpp Change-Id: I858fec6e426f5fd867b7eda7b1db69a2d447b357
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/serialport/qserialport_win.cpp Change-Id: I8f3403d448ef2e51cf2870b331c61ab808393e34
| | * Detach buffer's segment for asynchronous write operationDenis Shienkov2016-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRingBuffer does not guarantee that the read pointer which is returned by QRingBuffer::readPointer() will stay valid after calling QRingBuffer::reserve() or QRingBuffer::append(). Thus, we need to detach the buffer's segment and pass it to the WriteFile() function to ensure it stays unmodified for the whole time of the asynchronous operation. Change-Id: I5a42086b4339a050a4df57c39348864502be2c74 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | Reuse QIODevice's write bufferAlex Trotsenko2016-07-191-2/+0
|/ / | | | | | | | | | | Change-Id: Ieda6cd8452391a1fd3276a35c9854cf764dbb679 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-0/+2
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6a4c3e446633e6f142b87c268096b1bdc1598a62
| * Fix reading of data remainder with CDC USB device on WindowsDenis Shienkov2016-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases the WaitCommEvent function does not triggered, even if the input driver's queue has an unread bytes. Most likely this happens if a bytes has been arrived between calls of ReadFile and WaitCommEvent. Thus, it can be avoided by means of ClearCommError function which should be called in end of ReadFile to require amount of bytes that has been arrived but still are unread. If it returns more than zero, then we start reading again, without calling of WaitCommEvent. Task-number: QTBUG-48677 Change-Id: I054975971a7c1823f7de879669c3d97f31348ed8 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Drop the Win CE supportDenis Shienkov2016-05-021-26/+2
| | | | | | | | | | | | | | | | | | | | | | Now we can drop the WinCE (5/6) support, because its compilers do not support the C++11 features, that lead to the further API limitations and so on. Change-Id: I2431d15b1361f1e093fc09ff7fbe824daeac3984 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Unify license header usageAntti Kokko2016-02-021-13/+19
|/ | | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I1b17b6f798ee521d2e3bd8c37024df7cd65ee0c4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Get rid of QSPP::updateCommTimeouts() methodDenis Shienkov2016-01-111-2/+0
| | | | | | | | | | This method is used only once when initializing of a device. Thus its code can be moved to an initialization place, and this method can be removed then. Change-Id: Ie9a40da1d6a2980829327f66830893ad7179bd57 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Do not use settingFromBaudRate() on Windowsv5.6.0-beta1Denis Shienkov2015-12-131-0/+2
| | | | | | | | This function makes sense only on *nix platforms. Change-Id: Ia1d107e1b0d9095f4f20e1aa472798aa0af11f0f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use qt_subtract_from_timeout() to reduce a code duplicationDenis Shienkov2015-10-101-2/+0
| | | | | | | | | | Commit qtbase/ed0c0070f9b05c647019270dfc42073d071c830a introduces a new helper function qt_subtract_from_timeout() which can be used to reduce a code duplication. Change-Id: I5c4941360f524225c14eac8c308fb16a546c802f Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Remove unused QSPP::baudRateFromSetting() methodDenis Shienkov2015-10-061-1/+0
| | | | | | Change-Id: Ida5f8f8b3374d52b6e20e560aff97cbdc1fe8776 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Cleanup remainders of code relating to data error policy handlingDenis Shienkov2015-09-241-8/+0
| | | | | | | | | | | | | | | | | | | It is impossible to implement all these features on all platforms, and particular drivers may not support them, too. Consequently, the user should handle such errors themselves by applying platform-specific ioctls on the device descriptor and/or parsing the stream's byte-stuffing. This commit also deprecates ParityError, FramingError, and BreakConditionError. Tested on Windows and Linux with the virtual and the USB serial ports. Change-Id: I4ffc2f067787bc304a83326acb2a2421b428f986 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of stored termios structureDenis Shienkov2015-09-081-2/+2
| | | | | | | | | | | It is better to read the current termios structure each time before changing, than to have stored it locally. Tested with the USB serial ports. Change-Id: I63e0c2c1c320ee4b98c8423963d78396f72eb3c2 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of stored DCB structureDenis Shienkov2015-09-071-2/+2
| | | | | | | | | It is better to read the current DCB structure each time before changing, than to have stored it locally. Change-Id: I487931469112d657c12d99a74aa577921c042f35 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor the speed configuration for *nixDenis Shienkov2015-09-071-6/+2
| | | | | | | | | | | | | | | | | | | | The internal implementation of this is a little tangled. It is reasonable to simplify it: 1. Remove the setBaudRate_helper() method, as it is equivalent to setStandardBaudRate() method. 2. Now the setStandardBaudRate() and the setCustomBaudRate() are self-sufficient methods (can setup a speed and an error codes internally) and return a boolean values. Also added the "loopback" test for check of different speeds. Tested with the on-board and the USB serial ports. Change-Id: I4320c2e29ad42a394e07753cbaea804d0faf6b78 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unify common error strings in QSerialPortErrorInfoDenis Shienkov2015-08-281-6/+2
| | | | | | Change-Id: I1275e80988274e2409455217d5ffb03014962604 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Avoid to start of communication notifier if it already is activeDenis Shienkov2015-08-271-0/+1
| | | | | | | | | | | | This happens in the QSP::clear() method, where the WaitCommEvent() function returns with an error "The parameter is incorrect", because it calls when the waiting already is active. Tested with the virtual com0com and on-board serial ports. Change-Id: I351a336f2d3c05852a654e7bccc3ff84d7aba025 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve the processing of errorsDenis Shienkov2015-07-081-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | Sometimes the error string would contain a wrong description which did not correspond to the system error code. The reason was qt_error_string() being called too late, when the system error might have already been overwritten. The error processing is now in QSPP::getSystemError(), which returns both the error code and the error description as soon as possible. * Now the QSPP::getSystemError() returns the new class QSerialPortErrorInfo which contains all necessary fields. * The new method QSPP::setError() which accepts the QSerialPortErrorInfo as input parameter is used. * The old private method QSP::setError() is removed, because it is not used anywhere. Change-Id: Ia7e4d617b863e2131175c52812cdf426ed963795 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of QSPP::bytesToWrite()Denis Shienkov2015-07-011-1/+0
| | | | | | | | | It is not worth to spread the platform-specifics over multiple files, as the difference are actually tiny and much better expressed with an ifdef. Change-Id: I5279e05d52ce5243ad3d0655c6353e1fb18891a1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Get rid of QSPP::readData()Denis Shienkov2015-06-301-2/+0
| | | | | | | | | | | | | | Because we now (in the Qt 5.5 branch) use QIODevicePrivate's internal read buffer directly, there is no need to call buffer.read() in QSP::readData(). There is also no point in keeping the platform-specific implementations of QSPP::readData(), so remove them. Tested on Windows using the virtual com0com serial ports, and on Linux usig the virtual tty0tty serial ports. Change-Id: I136c6d10708cc6fc99a77c351c3945470530845d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
* Do not use the queued connection to handle an I/O events on WindowsDenis Shienkov2015-06-231-1/+0
| | | | | | | | | | | | | | ... that simplifies the code of waitForXX() methods. In this case we do not need to call the completion methods, because it does the _q_notified() slot automatically even without an event loop. Tested with the virtual com0com serial ports, using auto tests and examples. Change-Id: I33d6c91d1842fd3eff1673d60e8413d471725f74 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove unused readyReadEmitted variableDenis Shienkov2015-04-191-1/+0
| | | | | | Change-Id: I2313bd6160ffe18766b50257957b2cc66834290d Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove space between "if/elif defined" macro and its bracketDenis Shienkov2015-03-121-8/+8
| | | | | | | | It is the recommended coding-style which is used in the Qt core. Change-Id: Id2efc3b2276b2d86d75fe0b7240077dbb61286f0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Make QSP::timeoutValue() as staticDenis Shienkov2015-03-121-1/+1
| | | | | | Change-Id: I9f11be6f1de66af70e84a00943d8cc75909e4956 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of C-style's SERIALPORT_BUFFERSIZE macroDenis Shienkov2015-03-121-5/+2
| | | | | | | | It is reasonable make it as enum and part of QSP class. Change-Id: I13d4561568b2688f7d1a054073455c23a64c1b94 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add the missed PORT_UNKNOWN macro for Android OSDenis Shienkov2015-02-271-0/+1
| | | | | | | | | This macro was missed in 5.5 branch, this causes a break of building. Change-Id: I0e79e6c6cb6c347356c449959b1cf14755a42eb1 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-251-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/serialport/qserialport_unix.cpp src/serialport/qserialport_unix_p.h src/serialport/qserialport_win.cpp src/serialport/qserialport_win_p.h src/serialport/qserialport_wince.cpp src/serialport/qserialport_wince_p.h Change-Id: Ibb917652b132e66fbb90f437bf762c1094911dc0
| * Do not use internal pre-cached RTS and DTR variablesDenis Shienkov2014-12-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices do not support these signals, and returns an errors when attempt to query it. But the QSP::open() always requests a status of these lines. In this case the QSP::open() will return true, but also will setup an error code (for example, QSP::UnsupportedOperationError for socat's devices in Linux). That is unexpected behavior for the user. It is reasonable do not query a state of these signals when opening. Also we do not need to use of appropriate internal variables, and we can remove it. Change-Id: I277110014c20c1f2c3fdaed20c4582d1356897b9 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Update copyright headersJani Heikkinen2015-02-131-6/+6
| | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I35f551de8408a2eb6a0f39df1f09d90c8084a7c0 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Improve usage of the break state for the Tx lineDenis Shienkov2015-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Now the sendBreak() method is deprecated since it is blocking and impossible to implement same behavior on different platforms using their API's. Besides, this method can be implemented via setBreakEnabled() and QTimer. 2. Introduced the new property named as "breakEnabled" which consist of setBreakEnabled() and isBreakEnabled() methods and the signal breakEnabledChanged(). Note: After opening, the port always is in non-break state. Task-number: QTBUG-36571 Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Use QWinOverlappedIoNotifier instead of QWinEventNotifierDenis Shienkov2014-11-271-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reasons of this change are following: 1) Implementation of QEventDispatcherWin32 has restrictions to maximum quantity of QWinEvenNotifier instances in one thread. Method QEventDispatcherWin32::registerEventNotifier() registers the [MAXIMUM_WAIT_OBJECTS - 2] numbers of notifiers only. Where the MAXIMUM_WAIT_OBJECTS that is equal to 64, since it is a part of "Multiple-object Wait Functions" API: http://msdn.microsoft.com/en-us/library/windows/desktop/ms687069%28v=vs.85%29.aspx 2) There is need to have three instances of QWinEventNotifier to watch I/O events of each serial port. It has limits to the maximum number of used serial ports and it is [(MAXIMUM_WAIT_OBJECTS - 2) / 3] = 20 for the one thread. 3) Attempting to move or to resize a window of GUI application lead to suspending of I/O events from serial port. A long suspension can lead to overflowing of FIFO of device, so the data can be lost. All these shortcomings are resolved with QWinOverlappedIoNotifier, which uses the "I/O Completion Ports" API: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365198%28v=vs.85%29.aspx Tested on Windows 8 with the virtual (com0com), on-board and the USB (PL2303) serial ports. Task-number: QTBUG-34946 Change-Id: I879d939f86c8dcde0fe21a8d6267e81152822aa4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Use internal read buffer of QIODeviceDenis Shienkov2014-11-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is reasonable to use the internal read buffer of QIODevice instead of additional QRingBuffer which currently are used. It will allow to reduce an overhead when copying data as now there is not an excess chain with QRingBuffer. Besides, the majority of I/O classes from QtCore (except QProcess) also use the internal QIODevice buffer which are optimized for this purpoze. Tested on Windows 8 and Linux with the virtual com0com and on-board serial ports. Change-Id: I6c3d4b84593940ccfef8c15c9fbef16bddcd002f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Use QIODevicePrivate for PIMPLDenis Shienkov2014-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | It is reasonable to get rid of excess D/Q pointers and to use their equivalents from QIODevicePrivate. Also in the future it will allow to use the internal read buffer of QIODevicePrivate. Tested on Windows 8 and Linux with the on-board and com0com serial ports. Change-Id: I9d0923c6f9adc5981dc49dacea163b286620ed5c Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Create notifiers inside of startAsyncXX() methods when requiredDenis Shienkov2014-11-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | It is reasonable to move creation of notifiers from the constructor to the specific separate methods. In this case notifiers are created in startAsyncXXX() methods if necessary for concrete I/O operation. Also it allows to return an error in case a notifier is failed. Tested on Windows 8 with virtual com0com serial ports. Change-Id: I351a4c54214c84455150d0fc157a99108280cc12 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Move all platform-specific declarations into one QSPPrivateDenis Shienkov2014-11-141-2/+219
|/ | | | | | | | | | This is near to the internal Qt PIMPL style. Also it will allow to use QIODevicePrivate is more smoothly in next patches. Tested on Windows 8, Linux, OSX 10.9 with on-board serial port. Change-Id: Ieef4b05d0bf11cf2da6420e58629bea1818108f9 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Update license headers and add new license filesAntti Kokko2014-09-091-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I08685205169cdd4b49a651ed98f36ba1e6c1bb29 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add missing private headers warningsSamuel Gaist2014-08-181-0/+11
| | | | | Change-Id: Ia60bf0d020d98a6fda8f689d631bb8681950d15f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Rename the flow to flowControl for consistencyLaszlo Papp2014-03-011-1/+1
| | | | | Change-Id: Ida3c4ff049f21bd96fd64b41c66787b3961ada5e Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Reimplement low level data sendingDenis Shienkov2013-12-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | A feature of writing of the buffer by chunks of 512 bytes (by default) was introduced earlier as the developers option in order that it was possible to regulate load of the CPU and quantity of emitted signals of bytesWritten() just change WriteChunkSize value in source code. As shows of the practice, the most optimal mode is writing of whole content of the buffer without division into chunks. It reduces load of CPU (because reduces a quantity of the events triggers) and also simplifies the source code. But potentially there can be negative consequences of writing of whole buffer directly in case of broken driver: * A kernel panic (or BSOD) in case of writing a data large than driver's internal queue. * Can be transferred not all data from the buffer, but only their part. Change-Id: I0fcac1ccf3c752579978b4745771accbf8274267 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Eliminate the ifdef in the code for imported headers (qt4support)Laszlo Papp2013-10-091-4/+0
| | | | | | | | | | | | | | | | | | | As I previously wrote on Gerrit, this idea of resembling the include hiearchy inside qt4support has two advantages: 1) The includes are well-separated for Qt 4 that are imported. 2) The code is less complex due to the non-existence of ifdefs for major Qt variants. The only disadvantage is that the build system got one additional line, but the benefits outweigh that. This has been (only build!) tested on Linux (Arch) with Qt 4 and then 5. Change-Id: Ic33632cd0e569693a65af094479dac0a02b1a7f7 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the unnecessary Q_DECLARE_PUBLIC from the data classLaszlo Papp2013-07-271-1/+0
| | | | | | Change-Id: I8293dfc6d492bac59fa830d499902cabdc8d95dd Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Revert "Add property to set exclusivity"Laszlo Papp2013-07-081-1/+0
| | | | | | | | | | | | | | | | | | | This reverts commit 4c67500e5d14e561e37b4bdc056f059d3eefdfa4. "dev: unfrozen branch, containing alpha-quality code that is ready to go into beta testing at any time" ... from: http://qt-project.org/wiki/Branch-Guidelines Please respect the basic principles. In doubts, do not approve changes yourself, but ask for help. Besides the illegit nature of this change, it has fundamental documentation issues as well. It is summer, and this can wait until 5.2, so please do /not/ rush with approvals. Change-Id: Ic2763394035c776088cb28f9c04086920cedb3a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>