mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +00:00
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>
This commit is contained in:
parent
65e9991501
commit
57e83240dd
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue