diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-10-24 18:33:44 +0200 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-10-27 10:09:20 +0100 |
commit | 4bcbe5d5d51cdcd920bb48167f52dc09337d5cfb (patch) | |
tree | 46633eca2382758a9b200bd459a3c7db9117cb5d /src/bluetooth/qbluetoothsocket_osx.mm | |
parent | ec2cc1b88b0ba2ef20b1969d0a6a897f7f312d4c (diff) |
QBluetoothSocket - fix open mode on OS X
When a socket created (by server) from a notification (channel) - set
d_ptr's openMode (even with a given channel it happens that we receive
channel open callback asynchronously).
Change-Id: Ia2c461d4146645c661e25245871501012102f541
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_osx.mm')
-rw-r--r-- | src/bluetooth/qbluetoothsocket_osx.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm index 54c7e8b9..027c7e37 100644 --- a/src/bluetooth/qbluetoothsocket_osx.mm +++ b/src/bluetooth/qbluetoothsocket_osx.mm @@ -283,6 +283,7 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothRFCOMMChannel *channel) && state == QBluetoothSocket::UnconnectedState && !rfcommChannel && !l2capChannel, "QBluetoothSocketPrivate::setChannel()", "unexpected socket state"); + openMode = QIODevice::ReadWrite; rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this channel:channel]); if (rfcommChannel) {// We do not handle errors, up to an external user. q_ptr->setOpenMode(QIODevice::ReadWrite); @@ -306,6 +307,7 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel) && state == QBluetoothSocket::UnconnectedState && !l2capChannel && !rfcommChannel, "QBluetoothSocketPrivate::setChannel()", "unexpected socket state"); + openMode = QIODevice::ReadWrite; l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this channel:channel]); if (l2capChannel) {// We do not handle errors, up to an external user. q_ptr->setOpenMode(QIODevice::ReadWrite); |