summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix subscription sharing for revised publishing intervalsv5.11.0-rc2v5.11.0Jannis Voelker2018-05-149-13/+122
| | | | | | | | | | | | | | | | | | | The current implementation uses an existing subscription for sharing if a subscription with the requested publishing interval exists. If the publishing interval of a subscription is revised by the server, the lookup for a second monitoring with the same requested interval fails and a new subscription is created. This patch adds a member variable which stores the last revised publishing interval to each backend. Requests with a publishing interval < last revised publishing interval are "revised" by the backend to ensure subscription sharing. A test case which checks for correct subscription sharing is added to tst_client.cpp. Change-Id: I5e433501f23bf99e841c5c41e750ed8631ea7162 Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
* Use QTEST_ENVIRONMENT to exclude freeopcua tests in the CIJannis Voelker2018-05-141-2/+1
| | | | | | | | QT_TEST_CI doesn't seem to be used anymore. Change-Id: Ib4b03f0fbf680b8e9f98ec7255767b7c2818dc0c Reviewed-by: Rainer Keller <Rainer.Keller@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* uacpp: Include SDK subfolder in include pathsRainer Keller2018-05-1411-24/+24
| | | | | | | | | This allows to use a single include path for the whole SDK as soon as the SDK headers itself are fixed. Change-Id: I39641b426277d1d2f7f1ee39d9f1e02613fb40e8 Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* uacpp: Fix style of project fileRainer Keller2018-05-141-4/+4
| | | | | | | | The load statement and plugin variables are supposed to be at the end of the file. Change-Id: I948b9426e2b194cdc9f4807f45ecbe2dbfde8c97 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix possible crash in the client state handlingJannis Voelker2018-05-092-4/+5
| | | | | | | | | | | | The client state change callback may be called after the QOpcUaClientImpl associated with the backend has been destroyed. The signal should not be emitted by directly calling the method of the QOpcUaClientImpl because the backend runs in a separate thread. Change-Id: I6417987bb438ffa3db3d8e68cbfcafe220e16c1c Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix memory leak for monitored item filters in the uacpp backendJannis Voelker2018-05-091-0/+4
| | | | | | | | | | The members of the elements of the monitored item create and modify requests are not freed automatically when the C++ request objects are destroyed. If a filter is set, the extension object data is leaked. Change-Id: Id78f70e1aac593260b46fa1747c98a0f7cccda5b Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
* Improve value display in opcuaviewerJannis Voelker2018-05-093-6/+94
| | | | | | | | | This patch adds string conversion for all Qt OPC UA types. Alternate row colors are enabled to improve the readability of array values. Change-Id: I6131c90ada787851d279f48b035af69bb6ce4aed Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
* tests: Use path of the test executable to find the server executableRainer Keller2018-05-081-1/+1
| | | | | | | | This allows to start the test independent of the current working directory. Change-Id: I7944d16b16033de82cbea4b6317349971c9c253b Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* examples: opcuaviewer: Set elide mode for item viewv5.11.0-rc1Rainer Keller2018-05-041-0/+2
| | | | | | | | This is needed because strings can be long. Change-Id: Ic051cc648a3d1377e621279697417ec0c1d00662 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
* Examples: Add a Qt based explorer for node treeRainer Keller2018-05-0415-0/+7017
| | | | | | Change-Id: I0aaf2fe7f43d51bce562412a2a7b5e30d340f8bc Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix crash when converting empty array variants (open62541)Jannis Voelker2018-05-045-5/+67
| | | | | | | | | If arrayLength is 0, the variant can contain a scalar value or an empty array. Empty arrays are indicated by setting data to 1. This must be checked before calling scalarToQVariant(). Change-Id: Ia62c4acf258fb0e080334504d105de1a898e3e6a Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix crash when receiving a DataChangeNotification without valueJannis Voelker2018-05-041-0/+7
| | | | | | | | | The value of a DataChangeNotification can be empty. This is indicated by setting the DataValue pointer to 0x1. This must be checked before the pointer is dereferenced. Change-Id: Ieca4c5341c10b99ceee82e18e75783b5ac441992 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix display of qtopcua examples in Qt CreatorJannis Voelker2018-05-024-12/+14
| | | | | | | | | | | | | The combination of exampledirs=../../../examples/opcua and examplesinstallpath=opcua generates the correct path. Adding an image to the example is also required for the example to be listed in Qt Creator. Task-number: QTBUG-67957 Change-Id: I4318f0facc70e3953904ca6589d5e78fd028afe9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix node creation in the freeopcua backendJannis Voelker2018-04-303-1/+105
| | | | | | | | | | | The internal string to node id converter in freeopcua does not support opaque node ids and guid conversion is case sensitive. This patch bypasses the internal node id conversion and adds a custom converter adapted from the open62541 implementation. Change-Id: I634ba91c3f3de6932c85acf3adc736c10a99c07f Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Return blob for all extension objects with binary or xml encodingJannis Voelker2018-04-221-35/+49
| | | | | | | | | | | | | The previous fix didn't take extension objects with types not residing in namespace 0 or with XML bodies into account. This patch returns a QByteArray for all encoded extension objects that can't be automatically decoded. Returning QOpcUa::QExtensionObject values with type and encoding information will be added on the dev branch. Change-Id: I5f130e7cea6433444e0fbc38ec76cb67381cefc8 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* doc: Fix API usageRainer Keller2018-04-161-1/+1
| | | | | | | | QOpcUaProvider does not have an isEmpty() member function. Change-Id: I27a5d66cca4bc0d3b5a42f72cd6733052d54a6f5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Return blob for unknown extension object typesv5.11.0-beta4Jannis Voelker2018-04-112-4/+6
| | | | | | | | | | Currently, unsupported extension objects are returned as an empty QVariant. Returning the raw data instead as it is done by the OPC UA SDKs allows the user to decode the value himself. Change-Id: I405bc6dbee7f3a91838548f8728da81f76952322 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix encoding and decoding of bool valuesJannis Voelker2018-04-112-0/+26
| | | | | | | | | | | According to part 6 of the OPC UA specification, a bool is encoded as a byte with value 0 for false and 1 for true. sizeof(bool) is not 1 on all platforms, a template specialization is required to avoid decoding errors. Change-Id: Ic39420f6bddabbaea14d821b6371b50473ddf776 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix use of monitoring parametersJannis Voelker2018-04-112-4/+5
| | | | | | | | | The filter used for monitored item creation must be stored or it will be unset in the next modifyMonitoredItems operation. Change-Id: Ifb615241eadff49c736ef22154687a45ee600584 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Disable the open62541 client state handler during connect and disconnectv5.11.0-beta3Jannis Voelker2018-04-052-0/+6
| | | | | | | | | | | | This prevents emitting duplicate signals when the disconnect state is reached. The destructor of OpcuaConnector in tst_client.cpp is extended to verify that no client error signals have been emitted (which is what happens if the client state handler and the disconnect method both emit a signal). Change-Id: I4aa03e63b402b09b497c4c482747b4ac258eecdb Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix client lifecycle in the open62541 backendJannis Voelker2018-04-051-6/+13
| | | | | | | | | | | - Don't leak the client when calling connectToEndpoint more than once. - Don't segfault when trying to disconnect without a client. This also removes the memory leaks in the test cases. Change-Id: I0405a86e9015465b86cc94facac6e8676b4039a7 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix client state handler in the qml exampleJannis Voelker2018-04-051-2/+4
| | | | | | | | | | clientStateHandler must be connected to the stateChanged signal only once. Failing to do so creates an additional connection for each connect which leads to the creation of useless nodes. Change-Id: I2f5ee1dbf1697722dfca3762551bfae80412fdae Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Initialize readWriteNode before checking the valueJannis Voelker2018-04-051-0/+1
| | | | | | | | | This makes the multipleClients test independent from the success of the dataChangeSubscription test. Change-Id: Iaa7b15d0746c8096db006d638c0601a9e6af0afa Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Use valueAttributeType in writeAttributes() in uacppJannis Voelker2018-04-051-1/+3
| | | | | | | | | | The uacpp backend does not use the valueAttributeType parameter in the backend which can lead to invalid conversions for some types. Change-Id: I89f8aec534e3f8cc212bf11cac32925fb89321b0 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Test usage of the valueAttributeType parameter in all backendsJannis Voelker2018-04-051-7/+5
| | | | | | | | | | | Some types require type information for correct conversion from the Qt type to the OPC UA type. This patch changes the writeMultipleAttributes() test to use a type which requires type information to make sure all backends use that parameter. Change-Id: I5df4ab1f673562288971477305f2ce98931ed631 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix docs for QOpcUaNode::attributeError()Jannis Voelker2018-04-051-1/+1
| | | | | | | | | Write operations also update the attribute error, as stated in the detailed description of QOpcUaNode. Change-Id: I77353471202fde53da5db9dcd597f20dea4263b7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Disable the freeopcua tests when running in the CIJannis Voelker2018-04-051-0/+6
| | | | | | | | | | | | | | The freeopcua tests randomly run into timeouts when there is high load on the CI. This makes the integration of changes almost impossible. As the previous solution to the timeouts stopped working a few weeks ago and no new solution has been found, the freeopcua tests are disabled for now. Change-Id: I9d16fa55d8c6b45c017de10cee3facd643c76dd5 Task-number: QTBUG-66704 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix possible crash in the open62541 backendJannis Voelker2018-04-032-1/+5
| | | | | | | | | | | | QOpen62541Node::enableMonitoring() passes the node id member of the node to the backend. If a string node id is used and the node is deleted while or before enableMonitoring in the backend is running, a crash occurs. Passing a copy of the node id to the backend fixes the issue. Change-Id: I0fca4150226c24182022afb95a72dab98f3d712a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix layout in the qml hmi for the water pump exampleJannis Voelker2018-04-033-28/+31
| | | | | | | | | | Adding the slider to Tank2Unit produces two tanks of different width. Putting the slider into a separate column and assigning the height of the first tank to Layout.preferredHeight fixes this. Change-Id: I716105963856f5a6727051e8fb6f261fb224a7de Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix browse and display name of method nodes in the simulation serverJannis Voelker2018-04-032-8/+8
| | | | | | | Don't use the node id but the name provided as parameter. Change-Id: I3e73012ee3ad348089c14a9992917765ab82a2ed Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix QOpcUaMonitoringParameters::setDataChangeFilter() docsJannis Voelker2018-04-031-1/+1
| | | | | | | | The qdoc tool shipped with Qt 5.10 requires the additional namespace to generate docs for setDataChangeFilter(). Change-Id: I10dd0be7a4352f2ae7a357d73ba73a1f2ac17a0e Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Update support table in the QOpcUaMonitoringParameters documentationJannis Voelker2018-04-031-1/+17
| | | | | | | | Open62541 now supports indexRange, the uacpp plugin was missing completely. Change-Id: I8d7957ba21efb59d323d9e9bcdb964d25e3ed8cc Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Remove subscriptions on timeout (open62541, freeopcua)Jannis Voelker2018-03-238-12/+92
| | | | | | | | | | | | If a subscription timeout is detected, the subscription is deleted and the associated monitored item information is removed from the backend to allow re-adding the item. A disableMonitoringFinished signal with BadTimeout is generated for each monitoring on the subscription. Change-Id: Ibe28873fec140faf24b1ebcd61a0ea5ef2eb6cea Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix mistakes in the documentationJannis Voelker2018-03-208-47/+75
| | | | | | Change-Id: I30272d6b52bbf4c16c1a312d6827386f8d767549 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make sure monitored items are created only onceJannis Voelker2018-03-205-11/+69
| | | | | | | | | | | The previous implementation did not check if a monitored item for an attribute exists. This allowed overwriting the client side monitored item information while leaving the monitored item on the server behind. Change-Id: Ic16c3c88580b0f675224699b82b53891873b3fdc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix DataChangeTrigger enumJannis Voelker2018-03-201-1/+1
| | | | | | | | The value of StatusValueTimestamp is 2, not 3. Change-Id: Ib16bb195c0899c218557f29e0b8c9cf97be353dc Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Add missing git configuration filesJani Heikkinen2018-03-202-0/+5
| | | | | | | | Task-number: QTBUG-66890 Change-Id: I9d133cdba7139067ef1434e6a7ea74949dd8f07f Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Update UA backendMaurice Kalinowski2018-03-164-110/+290
| | | | | | | | | | modifyMonitoredItem as well as DataChange filters have been added to the other backends in the meantime. Add these features to the ua backend as well. Change-Id: Ie9e83111e17e1d3435d333f828cd58a85bf2368c Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix and extend support for modifyMonitoring in open62541Jannis Voelker2018-03-167-112/+519
| | | | | | | | | The open62541 backend now supports all parameters enumerated in QOpcUaMonitoringParameters::Parameter. Change-Id: I04bc55b57661ec9dcbeceac87b68d3324bc22dec Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Simplify and clean up open62541 test serverJannis Voelker2018-03-165-649/+87
| | | | | | | | | | | This patch makes use of the open62541 value converter to replace the addVariable templates by a single addVariable method. The name used for browse and display name is now passed as parameter (the node id was used before). Change-Id: I13198f20be01de4aeae70b30d5ee11300803f1e9 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Add DataChangeFilter support to the open62541 backendJannis Voelker2018-03-145-0/+102
| | | | | | | | | | | | | | This patch enables the usage of deadband filters for data changes with the open62541 backend. The open62541 test server does not support data change filters, the test case is skipped. This patch has been tested using the Prosys simulation server. There is currently no filter support in freeopcua. Change-Id: I4f47780901fd75c97a858999fcc05b89e5cfda45 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Add Unified Automation plugin to documentationMaurice Kalinowski2018-03-141-1/+40
| | | | | | | | | | e6410a0fed4c7f43df28dfbf6e02e6db0e145971 introduced support for the Unified Automation C++ SDK, which needs to be reflected in the documentation. Change-Id: Ieb617392bf900a37b88ee124e56a3422f4e681e0 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
* Unify the designation of the unified automation pluginJannis Voelker2018-03-141-2/+2
| | | | | | | | | | QUACppPlugin and QUACppClient use different designations ("UnifiedAutomationCPPSDK" vs. "uacpp"). This patch changes the plugin metadata to use "uacpp". Change-Id: Iac5b2fdfb420517cb21a86a99e80737d2164ba4b Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Disable automatic reconnect in the uacpp backendJannis Voelker2018-03-142-2/+5
| | | | | | | | | Open62541 and freeopcua report the disconnect in a signal and require the user to reconnect manually, e. g. in the signal handler. This patch disables the default auto reconnect in the uacpp session. Change-Id: Ib032be5a0b8253f840003dc4806ed67d3026858e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* uacpp: Remove subscriptions when connection is closedMaurice Kalinowski2018-03-142-2/+14
| | | | | | | | | This fixed a potential reconnecting issue where subscriptions from a previous session are kept stored. Change-Id: If7e76d5988476fe9d8b113c766b89ae7ea1ff8e2 Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Use the client state callback in the open62541 backendJannis Voelker2018-03-142-27/+17
| | | | | | | | | This patch makes use of the new client state callback to replace the call to checkAndUpdateClientState() after every operation. Change-Id: I1bc64d452e00b2302df37fec7266049d88a34eac Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Simplify DemoServer for the water pump exampleJannis Voelker2018-03-143-63/+18
| | | | | | | | By using the open62541 value converter, nodes of all types supported by Qt OPC UA can be added using just one method. Change-Id: Ib02bd2d54d23de034737278479daa64d1d513d2e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Add server and source timestamp for read and data changeJannis Voelker2018-03-1417-29/+170
| | | | | | | | | | ServerTimestamp and SourceTimestamp from the last read or data change on an attribute can be accessed using QOpcUaNode::serverTimestamp(attr) and QOpcUaNode::sourceTimestamp(attr). Change-Id: I6e816c18338bfd269c8a4400270afdc97f9f98b6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Fix multipleClients testv5.11.0-beta2Jannis Voelker2018-03-081-8/+9
| | | | | | | | | | The multipleClients test is currently only run for the first plugin. This patch changes the test so it runs once for each plugin and creates two new clients from the same plugin. Change-Id: Icd3bb57d68bd697161e67f0d50122166d5ff0211 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
* Clean up connectToEndpoint in the open62541 backendJannis Voelker2018-03-081-9/+4
| | | | | | | | | This patch removes the use of temporary variables when connecting with user and password. Change-Id: Ia14ab7d630e82319ea95b346175937f42990170a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>