summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothserver_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothserver_p.h')
-rw-r--r--src/bluetooth/qbluetoothserver_p.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothserver_p.h b/src/bluetooth/qbluetoothserver_p.h
index 8797cebd..4abadc72 100644
--- a/src/bluetooth/qbluetoothserver_p.h
+++ b/src/bluetooth/qbluetoothserver_p.h
@@ -57,7 +57,7 @@
#include "qbluetoothserver.h"
#include "qbluetooth.h"
-#ifdef QT_BLUEZ_BLUETOOTH
+#if QT_CONFIG(bluez)
QT_FORWARD_DECLARE_CLASS(QSocketNotifier)
#endif
@@ -69,6 +69,12 @@ QT_FORWARD_DECLARE_CLASS(QSocketNotifier)
class ServerAcceptanceThread;
#endif
+#ifdef QT_WINRT_BLUETOOTH
+#include <wrl.h>
+// No forward declares because QBluetoothServerPrivate::listener does not work with them
+#include <windows.networking.sockets.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QBluetoothAddress;
@@ -86,7 +92,7 @@ public:
QBluetoothServerPrivate(QBluetoothServiceInfo::Protocol serverType);
~QBluetoothServerPrivate();
-#ifdef QT_BLUEZ_BLUETOOTH
+#if QT_CONFIG(bluez)
void _q_newConnection();
void setSocketSecurityLevel(QBluetooth::SecurityFlags requestedSecLevel, int *errnoCode);
QBluetooth::SecurityFlags socketSecurityLevel() const;
@@ -104,7 +110,7 @@ protected:
private:
QBluetoothServer::Error m_lastError;
-#if defined(QT_BLUEZ_BLUETOOTH)
+#if QT_CONFIG(bluez)
QSocketNotifier *socketNotifier;
#elif defined(QT_ANDROID_BLUETOOTH)
ServerAcceptanceThread *thread;
@@ -114,7 +120,21 @@ public:
bool isListening() const;
bool initiateActiveListening(const QBluetoothUuid& uuid, const QString &serviceName);
bool deactivateActiveListening();
+#elif defined(QT_WINRT_BLUETOOTH)
+ EventRegistrationToken connectionToken {-1};
+
+ mutable QMutex pendingConnectionsMutex;
+ QVector<Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocket>> pendingConnections;
+
+ Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> socketListener;
+ HRESULT handleClientConnection(ABI::Windows::Networking::Sockets::IStreamSocketListener *listener,
+ ABI::Windows::Networking::Sockets::IStreamSocketListenerConnectionReceivedEventArgs *args);
+public:
+ bool isListening() const;
+ Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> listener() { return socketListener; }
+ bool initiateActiveListening(const QString &serviceName);
+ bool deactivateActiveListening();
#endif
};