summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket.cpp
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-09-18 11:28:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 15:27:20 +0200
commit25222f75d0ff5da0b39c77250510bc0aab0daf73 (patch)
tree63580c8afd76791f6ec6f3617e883a90e5b6b36d /src/bluetooth/qbluetoothsocket.cpp
parente071e7157797caf99a8cac990fc4066fcb6589ca (diff)
QNX: Take socketType and serverType into account
Also add a serverType member function in QBluetoothServer Change-Id: I107f73b3943dc84f5c4d2afcb00e303567a67b5d Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket.cpp')
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index 2eaabe84..0f2471f9 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
@@ -113,6 +114,8 @@ QT_BEGIN_NAMESPACE
\value HostNotFoundError Could not find the remote host.
\value ServiceNotFoundError Could not find the service UUID on remote host.
\value NetworkError Attempt to read or write from socket returned an error
+ \value UnsupportedSocketTypeError The \l {QBluetoothSocket::SocketType}{SocketType} is not
+ supported on this platform.
*/
/*!
@@ -305,6 +308,12 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op
setOpenMode(openMode);
#ifdef QT_QNX_BLUETOOTH
+ if (socketType() == L2capSocket) {
+ d->socketError = QBluetoothSocket::UnsupportedSocketTypeError;
+ d->errorString = tr("Socket type not supported");
+ Q_EMIT error(d->socketError);
+ return;
+ }
d->connectToService(service.device().address(), service.serviceUuid(), openMode);
#else
if (service.protocolServiceMultiplexer() > 0) {
@@ -352,6 +361,12 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const
{
#ifdef QT_QNX_BLUETOOTH
Q_D(QBluetoothSocket);
+ if (socketType() == L2capSocket) {
+ d->socketError = QBluetoothSocket::UnsupportedSocketTypeError;
+ d->errorString = tr("Socket type not supported");
+ Q_EMIT error(d->socketError)
+ return;
+ }
d->connectToService(address, uuid, openMode);
#else
QBluetoothServiceInfo service;
@@ -383,7 +398,10 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, quint1
Q_UNUSED(port);
Q_UNUSED(openMode);
Q_UNUSED(address);
- qWarning("Connecting to port is not supported on QNX");
+ d->socketError = QBluetoothSocket::ServiceNotFoundError;
+ d->errorString = tr("Connecting to port is not supported on QNX");
+ Q_EMIT error(d->socketError)
+ qWarning("Connecting to port is not supported");
#else
Q_D(QBluetoothSocket);
setOpenMode(openMode);