summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket_p.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-07-23 15:19:04 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-07-24 16:26:54 +0200
commitde6e3732ab6884e8f650cbbf99380800dd305636 (patch)
treea68a5f23ccd7a7732e38ccf831cf1c2ae48a8c4b /src/bluetooth/qbluetoothsocket_p.h
parentd3298bd60f7580a22b95d34120cf57270a7c5888 (diff)
Move socket workaround into own fctn and fix possible channel mismatch
Previously the remote rfcomm channel was fixed to 1 which may not always match the correct rfcomm port. At the end of the day this is still a workaround for failure to connect when socket creation via UUID fails. We assume that the remote rfcomm service can be reached via the channel number. There is the remote chance that we connect to the wrong remote channel because getServiceChannel() fails and we attempt to connect to the hardcoded channel 1. However the workaround significantly reduces the chance of failure as a few devices (especially on the low end margin) cannot successfully connect via the UUID. The patch improves code readability and formatting too. Task-number: QTBUG-40172 Change-Id: Iae90252c877ca13953a81ea1ed83cc2c73abdf2a Reviewed-by: firatagdas <firatagdas@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_p.h')
-rw-r--r--src/bluetooth/qbluetoothsocket_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothsocket_p.h b/src/bluetooth/qbluetoothsocket_p.h
index cde9d33b..bef11327 100644
--- a/src/bluetooth/qbluetoothsocket_p.h
+++ b/src/bluetooth/qbluetoothsocket_p.h
@@ -98,12 +98,15 @@ public:
#if defined(QT_QNX_BLUETOOTH)
void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode openMode);
#elif defined(QT_ANDROID_BLUETOOTH)
- void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
+ void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
+ QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
+ bool fallBackConnect(QAndroidJniObject uuid, int channel);
#else
void connectToService(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode openMode);
#endif
#ifdef QT_ANDROID_BLUETOOTH
- void connectToServiceConc(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
+ void connectToServiceConc(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
+ QIODevice::OpenMode openMode, int fallbackServiceChannel = 1);
#endif