aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-03-29 10:34:36 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2019-03-29 12:32:43 +0000
commit6473d2e8072d34039537546d59fd02e3347dba29 (patch)
tree3f5ba9dc77748ac0e3e224e543e2728f57e96bf2 /src
parent64b696e5176b9672a03f0d2f47cc47236b3551ed (diff)
Add parameter for specifying the port for multicast discovery
Change-Id: I75db1a9fc3bf17df87a834a90d0e5bb5150ccc1c Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/coap/qcoapclient.cpp11
-rw-r--r--src/coap/qcoapclient.h1
2 files changed, 7 insertions, 5 deletions
diff --git a/src/coap/qcoapclient.cpp b/src/coap/qcoapclient.cpp
index 2f880a1..5ae92a5 100644
--- a/src/coap/qcoapclient.cpp
+++ b/src/coap/qcoapclient.cpp
@@ -382,10 +382,10 @@ QCoapReply *QCoapClient::deleteResource(const QUrl &url)
\overload
Discovers the resources available at the endpoints which have joined
- the \a group. Returns a new QCoapDiscoveryReply object which emits the
- \l QCoapDiscoveryReply::discovered() signal whenever a response arrives.
- The \a group is one of the CoAP multicast group addresses and defaults to
- QtCoap::AllCoapNodesIPv4.
+ the \a group at the given \a port. Returns a new QCoapDiscoveryReply
+ object which emits the \l QCoapDiscoveryReply::discovered() signal whenever
+ a response arrives. The \a group is one of the CoAP multicast group addresses
+ and defaults to QtCoap::AllCoapNodesIPv4.
Discovery path defaults to "/.well-known/core", but can be changed
by passing a different path to \a discoveryPath. Discovery is described in
@@ -393,7 +393,7 @@ QCoapReply *QCoapClient::deleteResource(const QUrl &url)
\sa get(), post(), put(), deleteResource(), observe()
*/
-QCoapDiscoveryReply *QCoapClient::discover(QtCoap::MulticastGroup group,
+QCoapDiscoveryReply *QCoapClient::discover(QtCoap::MulticastGroup group, int port,
const QString &discoveryPath)
{
Q_D(QCoapClient);
@@ -414,6 +414,7 @@ QCoapDiscoveryReply *QCoapClient::discover(QtCoap::MulticastGroup group,
QUrl discoveryUrl;
discoveryUrl.setHost(base);
discoveryUrl.setPath(discoveryPath);
+ discoveryUrl.setPort(port);
QCoapRequest request(discoveryUrl);
request.setMethod(QtCoap::Get);
diff --git a/src/coap/qcoapclient.h b/src/coap/qcoapclient.h
index f11388a..e230579 100644
--- a/src/coap/qcoapclient.h
+++ b/src/coap/qcoapclient.h
@@ -74,6 +74,7 @@ public:
void cancelObserve(const QUrl &url);
QCoapDiscoveryReply *discover(QtCoap::MulticastGroup group = QtCoap::AllCoapNodesIPv4,
+ int port = QtCoap::DefaultPort,
const QString &discoveryPath = QLatin1String("/.well-known/core"));
QCoapDiscoveryReply *discover(const QUrl &baseUrl,
const QString &discoveryPath = QLatin1String("/.well-known/core"));