summaryrefslogtreecommitdiffstats
path: root/qtserialbluetooth.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-09-29 21:12:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-29 17:46:19 -0400
commit57e83240ddb131d326d49afabc5b0ce208b6311d (patch)
tree50f019abd2de723507ead1852d659154abd47ea1 /qtserialbluetooth.cpp
parent65e9991501fc810497e102ab66bd8dd438cebcdc (diff)
downloadsubsurface-57e83240ddb131d326d49afabc5b0ce208b6311d.tar.gz
qtserialbluetooth: use QIODevice::Unbuffered io
This adds the QIODevice::Unbuffered flag to our rfcomm connections to bypass the buffering layer in QIODevice. This fixes so firmware upgrades work against the OSTC Sport. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qtserialbluetooth.cpp')
-rw-r--r--qtserialbluetooth.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qtserialbluetooth.cpp b/qtserialbluetooth.cpp
index 6a3360c7d..025ab8c34 100644
--- a/qtserialbluetooth.cpp
+++ b/qtserialbluetooth.cpp
@@ -114,7 +114,7 @@ static int qt_serial_open(serial_t **out, dc_context_t *context, const char* dev
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
// First try to connect on RFCOMM channel 1. This is the default channel for most devices
QBluetoothAddress remoteDeviceAddress(devaddr);
- serial_port->socket->connectToService(remoteDeviceAddress, 1);
+ serial_port->socket->connectToService(remoteDeviceAddress, 1, QIODevice::ReadWrite | QIODevice::Unbuffered);
timer.start(msec);
loop.exec();
@@ -126,7 +126,7 @@ static int qt_serial_open(serial_t **out, dc_context_t *context, const char* dev
} else if (serial_port->socket->state() == QBluetoothSocket::UnconnectedState) {
// Try to connect on channel number 5. Maybe this is a Shearwater Petrel2 device.
qDebug() << "Connection on channel 1 failed. Trying on channel number 5.";
- serial_port->socket->connectToService(remoteDeviceAddress, 5);
+ serial_port->socket->connectToService(remoteDeviceAddress, 5, QIODevice::ReadWrite | QIODevice::Unbuffered);
timer.start(msec);
loop.exec();