And use an updated coin instruction file.
Change-Id: I852d38febe9ecaa86c516b7f4a0451d0f80d8011
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Some test servers might have different configurations.
For instance, mosquitto broker provides a different
default value for topic aliases.
Change-Id: I00bc9c6b27d06358a352f9c0adb04e4044666aac
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
mosquitto MQTT5 support seems to wait longer to send
will messages.
Change-Id: I2c13609e228319ce8fefc5e79d4f99bbfe0b061b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
In certain scenarios, a user wants to manually handle the keepAlive.
Introduce autoKeepAlive as a property. If set to false, then the user
needs to handle the keepAlive by invoking requestPing.
The default for this property is true and keeps the current behavior.
Task-number: QTBUG-76782
Change-Id: I073874e6bdacf3c8d128c20431606affe1d9eeb1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
A will message is allowed to be empty. Hence, check whether a will topic
exists to identify incorporating the last will to the connect message.
Task-number: QTBUG-76783
Change-Id: Ifb7f5467e8e7e70c6d9c050b36a35df2419f4171
Reviewed-by: hjk <hjk@qt.io>
For MQTT 5 the fake server did not send any property information. Hence,
the client (potentially) read among the buffer.
Change-Id: I58c7d1b4a1f15a0803c04495c82537f648c8a642
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
As agreed on the review process, using sharedSubscription(Name) is more
verbose and descriptive.
Change-Id: I81fa5d9f74ecd12d3b90d485f67b52dfb4f70bf5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Before failed with:
.../qtmqtt/tests/auto/cmake/build/module_includes/main.cpp:4:16: fatal error: QMqtt: No such file or directory
#include <QMqtt>
^~~~~~~
Task-number: QTBUG-68343
Change-Id: I1000f533b2b29558f3c2b0d23c64c2c621e641e5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
A user might be interested in knowing the exact state of a message while
publishing or when a message is received.
Task-number: QTPM-1453
Task-number: QTBUG-66599
Change-Id: Ibf977f76ba6078b5b525ba00b6988d4b69960176
Reviewed-by: hjk <hjk@qt.io>
VerneMQ does not send any server connection properties at all and relies
on the default values set by the standard. All other implementations
behave differently so far, mostly to set lower limits (i.e. max packet
size).
Change-Id: I01824640021651cfe752523803b9797aed197fc9
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The standard did not mention it explicitly to be a list. However,
quoting "Multiple Subscription Identifiers will be included if the
publication is the result of a match to more than one subscription, in
this case their order is not significant" clearly indicates that
multiple subscription ids can be part of a publish message.
Change-Id: I1a45564a719847020e24aec7d0385807f3be3aa4
Reviewed-by: hjk <hjk@qt.io>
Certain properties cannot be changed while connected and hence this
should be reflected in the behavior.
Task-number: QTBUG-67176
Change-Id: Ib9baafa1ac8d99d7a071839c892187efb51491e0
Reviewed-by: hjk <hjk@qt.io>
The scheme to create a shared subscription is $share/sharename/
topicfilter. During QMqttSubscription creation, the topic gets split and
shareName is a newly introduced property to verify whether a
subscription has been shared.
Task-number: QTPM-1452
Change-Id: I99c1aa9bb3bf8db2a930ce031c1a0a4882f01bcd
Reviewed-by: hjk <hjk@qt.io>
While removing a subscription, properties can be passed. V5.0 only
specifies user properties.
Task-number: QTPM-1454
Change-Id: Id068875c1947c9479175f6e5458713e038f7454f
Reviewed-by: hjk <hjk@qt.io>
qWarning could potentially quit an application while it is easily
possible to recover from an error state. Hence avoid usage of qWarning
inside the module.
Task-number: QTBUG-69544
Change-Id: I7340f38d80e6716450fbcd0918226e9435d37daa
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
When a client connects without a client id, the server might decide to
assign one to the client. The test was disabled so far, but
QMqttServerConnectionProperties handles this properly now.
Change-Id: If013ba67aa1f08c8842b872a6125e7d2bfa6430d
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: hjk <hjk@qt.io>
The PayloadFormatIndicator is used on multiple places.
Consequently, avoid duplication of this enum and move it to
a module namespace. It is not sufficient to have it inside QMqttClient.
Change-Id: I1113de55e69a5f548cdf4feba435b806949a8153
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Signed/unsigned comparison and an unused argument.
Change-Id: Iec452f058d6e40d24dc66261cb221b45cc89d59a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Always use a prefix for topics inside a test class. Otherwise running
multiple tests concurrently can cause failures as test data is shared
among the broker and behavior becomes unreliable.
Task-number: QTBUG-69549
Change-Id: Ia9886826f65e8e40826fcd9a83bb8ec5a1a8e850
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
With this patch it is possible to set the version to MQTT5 and
use the same features as against version 3.1.1. No MQTT5 specific
features are enabled.
Change-Id: I129ff8a2c996d7bcc582565fccda9e38edc48c62
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Prefer QTRY_ instead of using wait and VERIFY.
Change-Id: I4699dd6e7865b2043534d624875071b0882cce45
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Some test brokers require credentials to allow a connection. To be able
to verify the module against those, add a mean to pass those to the
client and run the auto tests without modification.
Change-Id: I10b8e2343f7fc66199d70f5f238f69b07665110a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
In case a transport is handed over to QMqttClient which is based on
QIODevice and already opened, the implementation was not sending a
CONNECT request and hence the broker never got informed about a new
client establishing connection. Hence manually send the connect
statement.
For QAbstractSocket based transports this was done already.
Task-number: QTBUG-66955
Change-Id: I50cba1b6dd03d0af561d4e39a3b57af5b2161a4b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The QTcpServer did not get deleted on destruction.
Change-Id: I525b6d4602aaf23dde193ef2d0dc49bc30898741
Reviewed-by: Andrew O'Doherty <andrew.odoherty@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
In case a connection fails due to a transport error, the client must be
able to try to reconnect. Hence, reset the error state when
connectToHost is called. Furthermore the socket needs to be re-created
if it has been instantiated by QMqttClient previously.
Task-number: QTBUG-65726
Change-Id: Id54e5f91a8ca4d0c7be6f51f1ad79e090c681584
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When a client reconnects with a cleanSession, all previous subscriptions
need to be disabled due to not being valid anymore. Furthermore, a
broker can decide to not restore a session even though cleanSession was
false. Take this into account by disabling existing subscriptions in
that case as well.
Task-number: QTBUG-64042
Change-Id: I618bc1fe4bb30651a34d70ec9d9e95e48b1c25d5
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
For "topics" the standard defines topic names and topic filters with
specific characteristics. QMqttTopicName and QMqttTopicFilter implement
this requirements.
[ChangeLog][General] Added QMqttTopicName and QMqttTopicFilter
Change-Id: Ie2b6851ec9249f20d05c4b8df3c2f27afc2be4b9
Reviewed-by: hjk <hjk@qt.io>
Using QByteArray::append(const char*) checks for \0 and stops copying
into the payload. Instead use the QByteArray version, which ideally just
shares the data or uses the explicit size of the data, ignoring the
content of the data.
Change-Id: Ifdabd7508c738fbd9b3967a745904f1cc95dfb7d
Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This reverts commit ca21591cdb.
Provisioning scripts should be done now and tests be able to run
on Windows and Linux.
Change-Id: I04eeb12ebcf6486902fa624f55fed0f4728c473d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Currently updating the provisioning scripts is not possible. Hence, the
paho test broker cannot be installed on test machines and tests not be
run.
Change-Id: I3ba2c5453101dc52378c96684e5324a3c06367a8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of returning a QSharedPointer, return the same pointer. This
improves readability as well as using the subscription from a user
perspective.
The ownership has to stay with the client though, otherwise behavior
is unexpected.
Change-Id: I72d3c15a12faf45c9575af8b3a790dfff1a30c2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>