summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Port from deprecated std::is_pod to is_trivial + is_standard_layoutMarc Mutz2020-03-061-3/+6
| | | | | | | | The std::is_pod trait is deprecated in C++20; is_trivial and is_standard_layout exist since C++11. Change-Id: I81610c85df059d398b1f7094a037c4e28dfcc41f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* VirtualCAN: Remove superfluous setting to closing stateAndre Hartmann2019-11-151-1/+1
| | | | | | | | | | | | | Because that is already done in QCanBusDevice::disconnectDevice() before calling this private implementation. Add a logging entry instead. Change-Id: I4b7e4ba31a49e2a80d92e8dc0f24a8065d465f3a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* VirtualCAN: Fix disconnecting from busAndre Hartmann2019-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | While the client sent a disconnect command to the server, this was not handled on server side. Thus, the client was never really Unconnected and in turn it was not possible to connect again. Fix that by closing the socket, that leads to VirtualCanBackend::clientDisconnected() being called and that sets the plugin to Unconnected. In any case, the server keeps running until the plugin is unloaded, even after the last client is disconnected. [ChangeLog][VirtualCAN] Fixed that the plugin stayed forever in closing state and subsequent connect calls always failed. Change-Id: I7a490c55a3cb6bd193ba4783b48d1385aa85bcde Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Fix documentation warningsTopi Reinio2019-11-132-6/+6
| | | | | | | | | Fix several instances of incorrect parameter documentation, and one incorrect \sa link. Fixes: QTBUG-79831 Change-Id: Idefb514488adb3909e09d624a5b84b579fd4e71b Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-263-20/+20
|\ | | | | | | Change-Id: I49240ebad0b08b728783a4e5137f12799cb5080c
| * Avoid conflicting class names if the plugins are linked staticallyAndy Shaw2019-10-223-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | QtSerialBus is already using QtSerialPort which has a WriteNotifier and ReadNotifier class in place. Therefore it is possible that if these were linked in together into one application that there would be multiple instances of the same class name which caused problems as it would think that the WriteNotifier in QtSerialPort was a QTimer and not a QSocketNotifier. So keep the names unique to be on the safe side. Change-Id: I8667e3d4230b316d47e266ad1b4319cf5e74444b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-248-8/+8
|\| | | | | | | Change-Id: I35dad8a57ea003c7d70f03651aa0604141c8b2db
| * CAN: Avoid symbol clashes on static buildsAndre Hartmann2019-09-238-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the same function name in a global namespace can lead the linker to pick an arbitrary one instead the right one. [ChangeLog] Fixed problems on static builds where an arbitrary version of resolveSymbol() was used instead the correct one. Fixes: QTBUG-78546 Change-Id: I0ff9bc3e5905b3b9694dfe9d446b2a52700f213f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | Fix the last Clazy level 2 warningsAndre Hartmann2019-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | ./qtserialbus/src/tools/canbusutil/readtask.cpp line 71: view = QString::fromLatin1("%1.%2 ") => QString::fromLatin1() being passed a literal line 77: QString flags = QLatin1String("- - "); => QString(QLatin1String) being called Change-Id: I69a655a2fe58652aa54fd706706400663a40e997 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CanBusUtil: Fix crash on listening without argumentsAndre Hartmann2019-09-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The listening option expects two parameters: plugin and device. But it was possible to call the program without or with only one parameter, which lead to a crash in util.start(args.at(0), args.at(1), data). Fix that by always checking the argument size first. Change-Id: I7c49bfc875f99286e1f04d1d4ef23b7971577363 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusDevice: Make Filter comparison functions non-member friendsAndre Hartmann2019-09-102-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symmetric operators, such as op== and op!=, shouldn't be members, because member functions do not allow for implicit conversions on the LHS argument, which introduces an asymmetry in how the RHS and LHS arguments are handled by the compiler. We could add the operators as non-member non-friend free functions, but since Filter is a nested class, there's a lot of code between the definiton of Filter and the point where we can lexically declare the operators for the first time (after the definition of the outer class). Code between these points does not see the operators and thus behaves different from code that follows the the definition of the outer class. This is subtle and while in the present case, there's no indication that Filter may get an implicit conversion to some other type which does have an equality operator, there's always the possibility that such a thing might be added later, in which case code using lhsfilter == rhsfilter in the body of QCanBusDevice would call a different operator== than code outside it. It's just safer to declare the operators as soon as possible, which means as non-member friends. Change-Id: Iadd097a9d64d0b1c912b750d6d89431b42def313 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QCanBusDevice: Undo source-incompatible changeAndre Hartmann2019-09-061-1/+0
| | | | | | | | | | | | | | Introduced in eca5edf45a8043 Change-Id: If1586d0b62b0544feee5b07289503966efa0f16d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusDevice: Improve callback register functionsAndre Hartmann2019-09-052-6/+6
| | | | | | | | | | Change-Id: I9c2b985768be34308580940c4013448d027fc75b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix \since for QIODevice *device() constAndre Hartmann2019-09-041-1/+1
| | | | | | | | | | Change-Id: I62f90b793fd5bcd64c727619f4064fa5f0cbed6d Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | Add missing \since to new membersAndre Hartmann2019-09-041-0/+2
| | | | | | | | | | Change-Id: If35c526887b32c06b25f2b59d2b43e09b0fcb248 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | Remove usages of deprecated APIsSona Kurazyan2019-08-062-3/+2
| | | | | | | | | | | | | | | | | | Replace QSerialPort::error(QSerialPort::SerialPortError) with QSerialPort::errorOccurred(QSerialPort::SerialPortError). Task-number: QTBUG-76491 Change-Id: Ic1d0a9ff89d346eca6cd2fd448cc02360c5e8783 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusDevice: Enter QScopedValueRollback laterAndre Hartmann2019-08-011-6/+6
| | | | | | | | | | | | | | | | | | ... in waitForFramesReceived() and waitForFramesWritten(). Change-Id: Iadfe569de989f6bdc3aa6fae81a12b6a3ac2ee9c Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | QCanBusDevice: More error codes and messages on failuresAndre Hartmann2019-07-312-17/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More error messages can now be logged with the logging framework or directly accessed with the errorOccurred() signal. The new error codes QCanBusDevice::OperationError and QCanBusDevice::TimeoutError were introduced to signal situations where the device is not able to perform a specific operation respectively when an operation timed out. [ChangeLog][QCanBusDevice] Added the QCanBusDevice::OperationError and QCanBusDevice::TimeoutError codes to signal wrong operation respectively timeout errors. Task-number: QTBUG-70449 Change-Id: Ifa0831bd0947b624579ae8662df10a2a9ce38714 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-302-5/+26
|\| | | | | | | Change-Id: Ia8b553317dcf3365d85b15c0ee89b098dd73585b
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-232-5/+26
| |\ | | | | | | | | | Change-Id: I50f4404ea6cf077069ebd1f1494e3c4c0633d92c
| | * Doc: Add precision to QCanBusFrame::setFrameId descriptionPaul Wicking2019-07-221-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Done-with: Jochen Bauer Fixes: QTBUG-75502 Change-Id: I3a91c9b0c52985f5fe3ea357c8813c27ddbfd28d Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| | * PeakCAN: Update documentation for added CAN FD functionsAndre Hartmann2019-07-181-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding the CAN FD functions to the PeakCAN plugin in ac8509d992f4, the documentation was not updated properly. This patch catches up on that. Change-Id: Ib3d05d4aa8405226ede9616bd56ead1a8f98ea88 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QCanBusDevice: Rewrap documentationAndre Hartmann2019-07-291-3/+4
| | | | | | | | | | | | | | | | | | Change-Id: I615a9113db1fcc2f787950dac70847d852d06a1d Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | SocketCAN: Allow specifying the protocol to useAndre Hartmann2019-07-245-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, only CAN_RAW was allowed, but there might be cases where other protocols are useful too. The default value is still CAN_RAW, so all existing applications will continue working. [ChangeLog][SocketCAN] Added the configuration parameter QCanBusDevice::ProtocolKey to use another protocol inside the protocol family PF_CAN. Fixes: QTBUG-75204 Change-Id: I8323ab8d77a569f51d3cd8c296b433352a3f5609 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-231-0/+1
|\| | | | | | | | | | | Change-Id: If26de70aa60d2a033b0422feabfa0a0275e048bc
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-161-0/+1
| |\| | | | | | | | | | Change-Id: Ica2fb988735520ed1bacacd72eeda24428aec981
| | * SocketCAN: Fix compiler error "‘SIOCGSTAMP’ was not declared"Andre Hartmann2019-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-76957 Change-Id: I8c4c86aa23137d67f5d20eedfe1c46a241c0632b Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | QModBusPdu: Fix old-style and downcast compiler warningsAndre Hartmann2019-07-222-10/+10
| | | | | | | | | | | | | | | Change-Id: I08beed3bef1e4c96216c5b56a569207587ce0408 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | | Add QCanBusDevice::busStatus()Andre Hartmann2019-07-1720-0/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original terminology is Error active, Error warning, Error Passive and Bus Off. We map them to GoodStatus, WarningStatus, ErrorStatus and BusOffStatus here. [ChangeLog][QCanBusDevice] Added the function busStatus() to query the CAN bus status from the CAN bus device. Fixes: QTBUG-70766 Change-Id: I22b99e2a02a6b22509005dd177796b861d536281 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | CanBusUtil: Add local echo to flags columnAndre Hartmann2019-07-165-17/+22
| | | | | | | | | | | | | | | | | | Change-Id: Id2a94cced2bf847e4ce0615e2b9e30523accec23 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Systec: Fix some compiler and code model cast warningsAndre Hartmann2019-07-162-6/+6
| | | | | | | | | | | | | | | | | | Change-Id: If47df4e9d62b5ca95ce14ddf8b4346ef14e4cf42 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-161-0/+1
|\| | | | | | | | | | | Change-Id: I8f4606fc94af2eb44aac626df13d90359e49171e
| * | Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-07-091-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-74391 Change-Id: I41a247ea55cf27151222d775aed16464aae4d4f9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Modbus: Use QOverload instead home-brewed castingAndre Hartmann2019-07-032-6/+5
| | | | | | | | | | | | | | | | | | Change-Id: I44fa85864552143f82b34594d13ca3584f316680 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | Fix Qt6 buildSona Kurazyan2019-06-247-26/+26
| | | | | | | | | | | | | | | | | | | | | Added 'Qt::' prefixes where missing. Change-Id: I97d5d9fa78d7c1feaef4caae72b735ea0625a081 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Deprecate the 'UserParameter' enum valueKarsten Heimrich2019-06-073-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no way to properly set the parameters on the underlying QIODevice, so it makes no sense to store these values without being able to ever use them. Task-number: QTBUG-76232 Change-Id: I9665af8392b844ada6d595b58641cbb13a259689 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Expose the underling QIODevice used for Modbus communicationKarsten Heimrich2019-06-077-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes it is necessary to get the device to set some special option on the device, like setting the HW flow control (RTS/CTS) parameters on the QSerialPort etc. Task-number: QTBUG-75405 Task-number: QTBUG-76232 Change-Id: I20e4824dcb8bde7020972607c6a76a01a5d01fc1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-181-1/+1
|\| | | | | | | | | | | Change-Id: Ifcd9571289c4f2f415ee28f892e08f7f0581a08d
| * | QModBusReply: Fix typo in documentationAndre Hartmann2019-05-151-1/+1
| | | | | | | | | | | | | | | Change-Id: Ide2b1759bed6b099e5f2cbcf04e388e7e6abccee Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-041-2/+2
|\| | | | | | | | | | | Change-Id: I563668f100ffd7e39e94f109642b7d51b6b9a135
| * | Reduce minimal Modbus response timeout to 10msAlex Blasche2019-04-301-2/+2
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-75461 Change-Id: Id5aed512cc9f163dc719cae0b121b9c65e0f232a Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | | Add QCanBusDevice::resetController() for CAN controller resetAndre Hartmann2019-05-0218-4/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently missing: * VectorCAN: no information in the documentation found * PassthroughCAN: no documentation [ChangeLog][QCanBus][QCanBusDevice] Added the function QCanBusDevice::resetController() to reset a CAN controller from bus off state, as far as supported by the various plugins. Fixes: QTBUG-54943 Change-Id: Ic098054b012726c0c69970c0ae84f434c2b3964a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | | Add error logging to QCanBusDevice::connectDeviceAndre Hartmann2019-04-301-2/+4
| | | | | | | | | | | | | | | Change-Id: I4fca0fb1e05abc7e6c5ea826b5df61e48ccfa9fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | PeakCAN: Improve documentation and fix a typoAndre Hartmann2019-04-291-2/+2
| | | | | | | | | | | | | | | Change-Id: I80ce9909774c24834060dd37a5201ec413e37647 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | PeakCAN: Skip data bitrate after device opening tooAndre Hartmann2019-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some configuration parameters must be changed before the device is opened, like bitrate and data bitrate. Both bitrates are already set in PeakCanBackendPrivate::open(), which is called some lines above. So skip the data bitrate here, like already done for the (arbitration) bitrate. Amends ac8509d992f4 Change-Id: Ib2ee99a8c969eeae96a8978401987c4fde273743 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | PeakCAN: Add more logging outputAndre Hartmann2019-04-291-15/+43
| | | | | | | | | | | | | | | | | | | | | That should make it easier to debug problems and bug reports. Change-Id: I31367a3a46df9dcca6dc8282cf1cb9c9e189e2ca Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | CAN: Port qCritical in Tiny and Vector pluging to qCCriticalAndre Hartmann2019-04-292-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Seems we missed them when porting all other debug and warning messages. Change-Id: I3f083de2ed0c4d9bf73842a7e0c2e09f3883a3bb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-1611-259/+330
|\| | | | | | | | | | | | | | | | | | | | Conflicts: examples/serialbus/modbus/adueditor/modbustcpclient_p.h Change-Id: I620bfce752a957fdcd068c44ff039d84b7502edc
| * | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta3Qt Forward Merge Bot2019-04-131-3/+3
| |\| | | | | | | | | | Change-Id: I345178003443aabe5c60c31b091d105f4639914a
| | * Systec: Fix error message "Cannot configure TxEcho for open device"Andre Hartmann2019-04-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the QCanBusDevice::ReceiveOwnKey, it has to be applied before the device is opened. While this already correctly happened in SystecCanBackendPrivate::open(), the parameter was applied again in SystecCanBackendPrivate::setConfigurationParameter() which led to the error message. Solution is to skip ReceiveOwnKey when applying all configuration parameters in SystecCanBackend::open(), like already done there for BitRateKey. [ChangeLog][SystecCAN] Fixed the error message "Cannot configure TxEcho for open device" when QCanBusDevice::ReceiveOwnKey was used. Change-Id: I37c1732798a3ce205a65ca803a99b5b7b9306d2a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>