aboutsummaryrefslogtreecommitdiffstats
path: root/src/coap/qcoapprotocol_p.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-05-10 09:58:21 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-05-14 15:14:39 +0000
commitae8d1fef58fa6df1408b9b11cf4b99dc7815255f (patch)
tree43f7a6541dd644d0289095f1f35ca65055d73d17 /src/coap/qcoapprotocol_p.h
parent804b10f3297822f4b12a4b971633f78965b756b0 (diff)
Hide the API of QCoapProtocol
No need to keep this class public, there is no public API for accessing it anyway. Change-Id: I231a560becb5799667819c30eca6372282adeb41 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/coap/qcoapprotocol_p.h')
-rw-r--r--src/coap/qcoapprotocol_p.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/src/coap/qcoapprotocol_p.h b/src/coap/qcoapprotocol_p.h
index 602ef73..b50453f 100644
--- a/src/coap/qcoapprotocol_p.h
+++ b/src/coap/qcoapprotocol_p.h
@@ -31,10 +31,13 @@
#ifndef QCOAPPROTOCOL_P_H
#define QCOAPPROTOCOL_P_H
-#include <QtCoap/qcoapprotocol.h>
+#include <QtCoap/qcoapglobal.h>
+#include <QtCoap/qcoapreply.h>
+#include <QtCoap/qcoapresource.h>
#include <QtCore/qvector.h>
#include <QtCore/qqueue.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qobject.h>
#include <private/qobject_p.h>
//
@@ -50,6 +53,55 @@
QT_BEGIN_NAMESPACE
+class QCoapInternalRequest;
+class QCoapInternalReply;
+class QCoapProtocolPrivate;
+class QCoapConnection;
+class Q_AUTOTEST_EXPORT QCoapProtocol : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QCoapProtocol(QObject *parent = nullptr);
+ ~QCoapProtocol();
+
+ uint ackTimeout() const;
+ double ackRandomFactor() const;
+ uint maxRetransmit() const;
+ quint16 blockSize() const;
+ uint maxTransmitSpan() const;
+ uint maxTransmitWait() const;
+ static constexpr uint maxLatency();
+
+ uint minTimeout() const;
+ uint maxTimeout() const;
+
+ uint nonConfirmLifetime() const;
+ uint maxServerResponseDelay() const;
+
+Q_SIGNALS:
+ void finished(QCoapReply *reply);
+ void responseToMulticastReceived(QCoapReply *reply, const QCoapMessage &message,
+ const QHostAddress &sender);
+ void error(QCoapReply *reply, QtCoap::Error error);
+
+public:
+ Q_INVOKABLE void setAckTimeout(uint ackTimeout);
+ Q_INVOKABLE void setAckRandomFactor(double ackRandomFactor);
+ Q_INVOKABLE void setMaxRetransmit(uint maxRetransmit);
+ Q_INVOKABLE void setBlockSize(quint16 blockSize);
+ Q_INVOKABLE void setMaxServerResponseDelay(uint responseDelay);
+
+private:
+ Q_INVOKABLE void sendRequest(QPointer<QCoapReply> reply, QCoapConnection *connection);
+ Q_INVOKABLE void cancelObserve(QPointer<QCoapReply> reply) const;
+ Q_INVOKABLE void cancelObserve(const QUrl &url) const;
+
+private:
+ Q_DECLARE_PRIVATE(QCoapProtocol)
+
+ friend class QCoapClient;
+};
+
struct CoapExchangeData {
QPointer<QCoapReply> userReply;
QSharedPointer<QCoapInternalRequest> request;
@@ -115,4 +167,6 @@ public:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QHostAddress)
+
#endif // QCOAPPROTOCOL_P_H