summaryrefslogtreecommitdiffstats
path: root/src/nfc
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-09-10 16:56:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-16 09:36:21 +0200
commit2c5400e0080e7574d048c10e12b308bb1fbade56 (patch)
tree7baad2f6ca0cb16f3a06fc851bd2b07763da5dac /src/nfc
parente31271a184fe06da8be6cd745a55a6950466d425 (diff)
Remove LLCP from the public API
QLLCPServer does not work properly yet on BlackBerry so I would want to wait committing to this API till we have a backend that is working properly. Change-Id: I62cbe9dae00ed47377086e4c8522298b4c9fa5a4 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/nfc')
-rw-r--r--src/nfc/nfc.pro8
-rw-r--r--src/nfc/qllcpserver.cpp5
-rw-r--r--src/nfc/qllcpserver_p.cpp2
-rw-r--r--src/nfc/qllcpserver_p.h42
-rw-r--r--src/nfc/qllcpserver_p_p.h (renamed from src/nfc/qllcpserver.h)33
-rw-r--r--src/nfc/qllcpserver_qnx_p.h2
-rw-r--r--src/nfc/qllcpserver_simulator_p.h2
-rw-r--r--src/nfc/qllcpsocket.cpp5
-rw-r--r--src/nfc/qllcpsocket_p.cpp2
-rw-r--r--src/nfc/qllcpsocket_p.h89
-rw-r--r--src/nfc/qllcpsocket_p_p.h (renamed from src/nfc/qllcpsocket.h)76
-rw-r--r--src/nfc/qllcpsocket_qnx_p.h2
-rw-r--r--src/nfc/qllcpsocket_simulator_p.h2
13 files changed, 147 insertions, 123 deletions
diff --git a/src/nfc/nfc.pro b/src/nfc/nfc.pro
index fcc4e6a4..1b4d6e24 100644
--- a/src/nfc/nfc.pro
+++ b/src/nfc/nfc.pro
@@ -15,12 +15,12 @@ PUBLIC_HEADERS += \
qndefmessage.h \
qndeffilter.h \
qndefnfcurirecord.h \
- qllcpsocket.h \
- qllcpserver.h \
qdeclarativendefrecord.h \
qndefnfcsmartposterrecord.h
PRIVATE_HEADERS += \
+ qllcpsocket_p.h \
+ qllcpserver_p.h \
qndefrecord_p.h \
qnearfieldtarget_p.h \
qnearfieldmanager_p.h \
@@ -93,8 +93,8 @@ isEmpty(NFC_BACKEND_AVAILABLE) {
message("Unsupported NFC platform, will not build a working QtNfc library.")
PRIVATE_HEADERS += \
- qllcpsocket_p.h \
- qllcpserver_p.h \
+ qllcpsocket_p_p.h \
+ qllcpserver_p_p.h \
qnearfieldmanagerimpl_p.h
SOURCES += \
diff --git a/src/nfc/qllcpserver.cpp b/src/nfc/qllcpserver.cpp
index 77215a1a..e7a2982d 100644
--- a/src/nfc/qllcpserver.cpp
+++ b/src/nfc/qllcpserver.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qllcpserver.h"
+#include "qllcpserver_p.h"
#if defined(QT_SIMULATOR)
#include "qllcpserver_simulator_p.h"
#elif defined(QNX_NFC)
#include "qllcpserver_qnx_p.h"
#else
-#include "qllcpserver_p.h"
+#include "qllcpserver_p_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QLlcpServer
\brief The QLlcpServer class provides an NFC LLCP socket based server.
+ \internal
\ingroup connectivity-nfc
\inmodule QtNfc
diff --git a/src/nfc/qllcpserver_p.cpp b/src/nfc/qllcpserver_p.cpp
index 7f2fd638..55d2a866 100644
--- a/src/nfc/qllcpserver_p.cpp
+++ b/src/nfc/qllcpserver_p.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qllcpserver_p.h"
+#include "qllcpserver_p_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/nfc/qllcpserver_p.h b/src/nfc/qllcpserver_p.h
index 00b4c3ac..5d72f558 100644
--- a/src/nfc/qllcpserver_p.h
+++ b/src/nfc/qllcpserver_p.h
@@ -39,22 +39,37 @@
**
****************************************************************************/
-#ifndef QLLCPSERVER_P_H
-#define QLLCPSERVER_P_H
+#ifndef QLLCPSERVER_H
+#define QLLCPSERVER_H
-#include "qnfcglobal.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
-#include "qllcpserver.h"
+#include <QtCore/QObject>
+#include <QtNfc/qnfcglobal.h>
+#include "qllcpsocket_p.h"
QT_BEGIN_NAMESPACE
-class QLlcpServerPrivate
+class QLlcpServerPrivate;
+
+class Q_NFC_EXPORT QLlcpServer : public QObject
{
- Q_DECLARE_PUBLIC(QLlcpServer)
+ Q_OBJECT
+
+ Q_DECLARE_PRIVATE(QLlcpServer)
public:
- QLlcpServerPrivate(QLlcpServer *q);
- ~QLlcpServerPrivate();
+ explicit QLlcpServer(QObject *parent = 0);
+ virtual ~QLlcpServer();
bool listen(const QString &serviceUri);
bool isListening() const;
@@ -64,15 +79,18 @@ public:
QString serviceUri() const;
quint8 serverPort() const;
- bool hasPendingConnections() const;
- QLlcpSocket *nextPendingConnection();
+ virtual bool hasPendingConnections() const;
+ virtual QLlcpSocket *nextPendingConnection();
QLlcpSocket::SocketError serverError() const;
+Q_SIGNALS:
+ void newConnection();
+
private:
- QLlcpServer *q_ptr;
+ QLlcpServerPrivate *d_ptr;
};
QT_END_NAMESPACE
-#endif // QLLCPSERVER_P_H
+#endif // QLLCPSERVER_H
diff --git a/src/nfc/qllcpserver.h b/src/nfc/qllcpserver_p_p.h
index 5798043e..488cbdfa 100644
--- a/src/nfc/qllcpserver.h
+++ b/src/nfc/qllcpserver_p_p.h
@@ -39,26 +39,22 @@
**
****************************************************************************/
-#ifndef QLLCPSERVER_H
-#define QLLCPSERVER_H
+#ifndef QLLCPSERVER_P_H
+#define QLLCPSERVER_P_H
-#include <QtCore/QObject>
-#include <QtNfc/qnfcglobal.h>
-#include <QtNfc/QLlcpSocket>
+#include "qnfcglobal.h"
-QT_BEGIN_NAMESPACE
+#include "qllcpserver_p.h"
-class QLlcpServerPrivate;
+QT_BEGIN_NAMESPACE
-class Q_NFC_EXPORT QLlcpServer : public QObject
+class QLlcpServerPrivate
{
- Q_OBJECT
-
- Q_DECLARE_PRIVATE(QLlcpServer)
+ Q_DECLARE_PUBLIC(QLlcpServer)
public:
- explicit QLlcpServer(QObject *parent = 0);
- virtual ~QLlcpServer();
+ QLlcpServerPrivate(QLlcpServer *q);
+ ~QLlcpServerPrivate();
bool listen(const QString &serviceUri);
bool isListening() const;
@@ -68,18 +64,15 @@ public:
QString serviceUri() const;
quint8 serverPort() const;
- virtual bool hasPendingConnections() const;
- virtual QLlcpSocket *nextPendingConnection();
+ bool hasPendingConnections() const;
+ QLlcpSocket *nextPendingConnection();
QLlcpSocket::SocketError serverError() const;
-Q_SIGNALS:
- void newConnection();
-
private:
- QLlcpServerPrivate *d_ptr;
+ QLlcpServer *q_ptr;
};
QT_END_NAMESPACE
-#endif // QLLCPSERVER_H
+#endif // QLLCPSERVER_P_H
diff --git a/src/nfc/qllcpserver_qnx_p.h b/src/nfc/qllcpserver_qnx_p.h
index e7764441..21fa5cf0 100644
--- a/src/nfc/qllcpserver_qnx_p.h
+++ b/src/nfc/qllcpserver_qnx_p.h
@@ -42,7 +42,7 @@
#ifndef QLLCPSERVER_QNX_P_H
#define QLLCPSERVER_QNX_P_H
-#include "qllcpserver.h"
+#include "qllcpserver_p.h"
#include "nfc/nfc.h"
QT_BEGIN_NAMESPACE
diff --git a/src/nfc/qllcpserver_simulator_p.h b/src/nfc/qllcpserver_simulator_p.h
index 93590a60..b976deff 100644
--- a/src/nfc/qllcpserver_simulator_p.h
+++ b/src/nfc/qllcpserver_simulator_p.h
@@ -44,7 +44,7 @@
#include <qconnectivityglobal.h>
-#include "qllcpserver.h"
+#include "qllcpserver_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/nfc/qllcpsocket.cpp b/src/nfc/qllcpsocket.cpp
index f9cacd24..2bf3e2c3 100644
--- a/src/nfc/qllcpsocket.cpp
+++ b/src/nfc/qllcpsocket.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qllcpsocket.h"
+#include "qllcpsocket_p.h"
#if defined(QT_SIMULATOR)
#include "qllcpsocket_simulator_p.h"
#elif defined(QNX_NFC)
#include "qllcpsocket_qnx_p.h"
#else
-#include "qllcpsocket_p.h"
+#include "qllcpsocket_p_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QLlcpSocket
\brief The QLlcpSocket class provides an NFC LLCP socket.
+ \internal
\ingroup connectivity-nfc
\inmodule QtNfc
diff --git a/src/nfc/qllcpsocket_p.cpp b/src/nfc/qllcpsocket_p.cpp
index 27418d12..4d076b9c 100644
--- a/src/nfc/qllcpsocket_p.cpp
+++ b/src/nfc/qllcpsocket_p.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qllcpsocket_p.h"
+#include "qllcpsocket_p_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/nfc/qllcpsocket_p.h b/src/nfc/qllcpsocket_p.h
index 7f741f14..6bda57be 100644
--- a/src/nfc/qllcpsocket_p.h
+++ b/src/nfc/qllcpsocket_p.h
@@ -39,27 +39,62 @@
**
****************************************************************************/
-#ifndef QLLCPSOCKET_P_H
-#define QLLCPSOCKET_P_H
-
-#include "qnfcglobal.h"
-
-#include "qllcpsocket.h"
+#ifndef QLLCPSOCKET_H
+#define QLLCPSOCKET_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QIODevice>
+#include <QtNetwork/QAbstractSocket>
+#include <QtNfc/qnfcglobal.h>
QT_BEGIN_NAMESPACE
-class QLlcpSocketPrivate
+class QNearFieldTarget;
+class QLlcpSocketPrivate;
+
+class Q_NFC_EXPORT QLlcpSocket : public QIODevice
{
- Q_DECLARE_PUBLIC(QLlcpSocket)
+ Q_OBJECT
+
+ Q_DECLARE_PRIVATE(QLlcpSocket)
+
+ friend class QLlcpServerPrivate;
public:
- QLlcpSocketPrivate(QLlcpSocket *q);
+ enum SocketState {
+ UnconnectedState = QAbstractSocket::UnconnectedState,
+ ConnectingState = QAbstractSocket::ConnectingState,
+ ConnectedState = QAbstractSocket::ConnectedState,
+ ClosingState = QAbstractSocket::ClosingState,
+ BoundState = QAbstractSocket::BoundState,
+ ListeningState = QAbstractSocket::ListeningState
+ };
+
+ enum SocketError {
+ UnknownSocketError = QAbstractSocket::UnknownSocketError,
+ RemoteHostClosedError = QAbstractSocket::RemoteHostClosedError,
+ SocketAccessError = QAbstractSocket::SocketAccessError,
+ SocketResourceError = QAbstractSocket::SocketResourceError
+ };
+
+ explicit QLlcpSocket(QObject *parent = 0);
+ ~QLlcpSocket();
- ~QLlcpSocketPrivate();
-
void connectToService(QNearFieldTarget *target, const QString &serviceUri);
void disconnectFromService();
+ void close();
+
bool bind(quint8 port);
bool hasPendingDatagrams() const;
@@ -74,24 +109,34 @@ public:
QNearFieldTarget *target, quint8 port);
qint64 writeDatagram(const QByteArray &datagram, QNearFieldTarget *target, quint8 port);
- QLlcpSocket::SocketError error() const;
- QLlcpSocket::SocketState state() const;
-
- qint64 readData(char *data, qint64 maxlen);
- qint64 writeData(const char *data, qint64 len);
+ SocketError error() const;
+ SocketState state() const;
qint64 bytesAvailable() const;
bool canReadLine() const;
- bool waitForReadyRead(int msecs);
- bool waitForBytesWritten(int msecs);
- bool waitForConnected(int msecs);
- bool waitForDisconnected(int msecs);
+ bool waitForReadyRead(int msecs = 30000);
+ bool waitForBytesWritten(int msecs = 30000);
+ virtual bool waitForConnected(int msecs = 30000);
+ virtual bool waitForDisconnected(int msecs = 30000);
+ bool isSequential() const;
+
+Q_SIGNALS:
+ void connected();
+ void disconnected();
+ void error(QLlcpSocket::SocketError socketError);
+ void stateChanged(QLlcpSocket::SocketState socketState);
+
+protected:
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 len);
private:
- QLlcpSocket *q_ptr;
+ QLlcpSocket(QLlcpSocketPrivate *d, QObject *parent);
+
+ QLlcpSocketPrivate *d_ptr;
};
QT_END_NAMESPACE
-#endif // QLLCPSOCKET_P_H
+#endif // QLLCPSOCKET_H
diff --git a/src/nfc/qllcpsocket.h b/src/nfc/qllcpsocket_p_p.h
index e3f914d8..03787c69 100644
--- a/src/nfc/qllcpsocket.h
+++ b/src/nfc/qllcpsocket_p_p.h
@@ -39,51 +39,27 @@
**
****************************************************************************/
-#ifndef QLLCPSOCKET_H
-#define QLLCPSOCKET_H
+#ifndef QLLCPSOCKET_P_H
+#define QLLCPSOCKET_P_H
-#include <QtCore/QIODevice>
-#include <QtNetwork/QAbstractSocket>
-#include <QtNfc/qnfcglobal.h>
+#include "qnfcglobal.h"
-QT_BEGIN_NAMESPACE
+#include "qllcpsocket_p.h"
-class QNearFieldTarget;
-class QLlcpSocketPrivate;
+QT_BEGIN_NAMESPACE
-class Q_NFC_EXPORT QLlcpSocket : public QIODevice
+class QLlcpSocketPrivate
{
- Q_OBJECT
-
- Q_DECLARE_PRIVATE(QLlcpSocket)
-
- friend class QLlcpServerPrivate;
+ Q_DECLARE_PUBLIC(QLlcpSocket)
public:
- enum SocketState {
- UnconnectedState = QAbstractSocket::UnconnectedState,
- ConnectingState = QAbstractSocket::ConnectingState,
- ConnectedState = QAbstractSocket::ConnectedState,
- ClosingState = QAbstractSocket::ClosingState,
- BoundState = QAbstractSocket::BoundState,
- ListeningState = QAbstractSocket::ListeningState
- };
-
- enum SocketError {
- UnknownSocketError = QAbstractSocket::UnknownSocketError,
- RemoteHostClosedError = QAbstractSocket::RemoteHostClosedError,
- SocketAccessError = QAbstractSocket::SocketAccessError,
- SocketResourceError = QAbstractSocket::SocketResourceError
- };
-
- explicit QLlcpSocket(QObject *parent = 0);
- ~QLlcpSocket();
+ QLlcpSocketPrivate(QLlcpSocket *q);
+
+ ~QLlcpSocketPrivate();
void connectToService(QNearFieldTarget *target, const QString &serviceUri);
void disconnectFromService();
- void close();
-
bool bind(quint8 port);
bool hasPendingDatagrams() const;
@@ -98,34 +74,24 @@ public:
QNearFieldTarget *target, quint8 port);
qint64 writeDatagram(const QByteArray &datagram, QNearFieldTarget *target, quint8 port);
- SocketError error() const;
- SocketState state() const;
+ QLlcpSocket::SocketError error() const;
+ QLlcpSocket::SocketState state() const;
+
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 len);
qint64 bytesAvailable() const;
bool canReadLine() const;
- bool waitForReadyRead(int msecs = 30000);
- bool waitForBytesWritten(int msecs = 30000);
- virtual bool waitForConnected(int msecs = 30000);
- virtual bool waitForDisconnected(int msecs = 30000);
- bool isSequential() const;
-
-Q_SIGNALS:
- void connected();
- void disconnected();
- void error(QLlcpSocket::SocketError socketError);
- void stateChanged(QLlcpSocket::SocketState socketState);
-
-protected:
- qint64 readData(char *data, qint64 maxlen);
- qint64 writeData(const char *data, qint64 len);
+ bool waitForReadyRead(int msecs);
+ bool waitForBytesWritten(int msecs);
+ bool waitForConnected(int msecs);
+ bool waitForDisconnected(int msecs);
private:
- QLlcpSocket(QLlcpSocketPrivate *d, QObject *parent);
-
- QLlcpSocketPrivate *d_ptr;
+ QLlcpSocket *q_ptr;
};
QT_END_NAMESPACE
-#endif // QLLCPSOCKET_H
+#endif // QLLCPSOCKET_P_H
diff --git a/src/nfc/qllcpsocket_qnx_p.h b/src/nfc/qllcpsocket_qnx_p.h
index fc39b07e..32968695 100644
--- a/src/nfc/qllcpsocket_qnx_p.h
+++ b/src/nfc/qllcpsocket_qnx_p.h
@@ -42,7 +42,7 @@
#ifndef QLLCPSOCKET_QNX_P_H
#define QLLCPSOCKET_QNX_P_H
-#include "qllcpsocket.h"
+#include "qllcpsocket_p.h"
#include "qnearfieldtarget_qnx_p.h"
diff --git a/src/nfc/qllcpsocket_simulator_p.h b/src/nfc/qllcpsocket_simulator_p.h
index 7d29c242..0867c05d 100644
--- a/src/nfc/qllcpsocket_simulator_p.h
+++ b/src/nfc/qllcpsocket_simulator_p.h
@@ -44,7 +44,7 @@
#include <qconnectivityglobal.h>
-#include "qllcpsocket.h"
+#include "qllcpsocket_p.h"
QT_BEGIN_NAMESPACE