summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket_osx.mm
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-20 03:01:37 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-20 03:01:43 +0200
commit9aca6982435eb5acb69b95b17f33bc454a94487b (patch)
tree33c06184cc8a6bac011ccd8a4cfd0abee0d86a12 /src/bluetooth/qbluetoothsocket_osx.mm
parent1a645c5a9b7d8b3f2f1448a95a3f37eb2f0c5a5d (diff)
parentf90878c456e10c4c3a091891bbe0dbc9e8fc48d7 (diff)
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_osx.mm')
-rw-r--r--src/bluetooth/qbluetoothsocket_osx.mm26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm
index 7f630146..2a856092 100644
--- a/src/bluetooth/qbluetoothsocket_osx.mm
+++ b/src/bluetooth/qbluetoothsocket_osx.mm
@@ -101,13 +101,13 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this]);
- if (rfcommChannel)
+ if (rfcommChannel.data())
status = [rfcommChannel connectAsyncToDevice:address withChannelID:port];
else
status = kIOReturnNoMemory;
} else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this]);
- if (l2capChannel)
+ if (l2capChannel.data())
status = [l2capChannel connectAsyncToDevice:address withPSM:port];
else
status = kIOReturnNoMemory;
@@ -181,10 +181,10 @@ QString QBluetoothSocketPrivate::peerName() const
NSString *nsName = nil;
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
- if (rfcommChannel)
+ if (rfcommChannel.data())
nsName = [rfcommChannel peerName];
} else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
- if (l2capChannel)
+ if (l2capChannel.data())
nsName = [l2capChannel peerName];
}
@@ -198,10 +198,10 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
{
BluetoothDeviceAddress addr = {};
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
- if (rfcommChannel)
+ if (rfcommChannel.data())
addr = [rfcommChannel peerAddress];
} else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
- if (l2capChannel)
+ if (l2capChannel.data())
addr = [l2capChannel peerAddress];
}
@@ -211,10 +211,10 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
quint16 QBluetoothSocketPrivate::peerPort() const
{
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
- if (rfcommChannel)
+ if (rfcommChannel.data())
return [rfcommChannel getChannelID];
} else if (socketType == QBluetoothServiceInfo::L2capProtocol) {
- if (l2capChannel)
+ if (l2capChannel.data())
return [l2capChannel getPSM];
}
@@ -231,7 +231,7 @@ void QBluetoothSocketPrivate::_q_writeNotify()
Q_ASSERT_X(socketType == QBluetoothServiceInfo::L2capProtocol
|| socketType == QBluetoothServiceInfo::RfcommProtocol,
Q_FUNC_INFO, "invalid socket type");
- Q_ASSERT_X(l2capChannel || rfcommChannel, Q_FUNC_INFO,
+ Q_ASSERT_X(l2capChannel.data() || rfcommChannel.data(), Q_FUNC_INFO,
"invalid socket (no open channel)");
Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
@@ -275,13 +275,13 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothRFCOMMChannel *channel)
openMode = QIODevice::ReadWrite;
rfcommChannel.reset([[ObjCRFCOMMChannel alloc] initWithDelegate:this channel:channel]);
- if (rfcommChannel) {// We do not handle errors, up to an external user.
+ if (rfcommChannel.data()) {// We do not handle errors, up to an external user.
q_ptr->setOpenMode(QIODevice::ReadWrite);
state = QBluetoothSocket::ConnectedState;
socketType = QBluetoothServiceInfo::RfcommProtocol;
}
- return rfcommChannel;
+ return rfcommChannel.data();
}
bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel)
@@ -299,13 +299,13 @@ bool QBluetoothSocketPrivate::setChannel(IOBluetoothL2CAPChannel *channel)
openMode = QIODevice::ReadWrite;
l2capChannel.reset([[ObjCL2CAPChannel alloc] initWithDelegate:this channel:channel]);
- if (l2capChannel) {// We do not handle errors, up to an external user.
+ if (l2capChannel.data()) {// We do not handle errors, up to an external user.
q_ptr->setOpenMode(QIODevice::ReadWrite);
state = QBluetoothSocket::ConnectedState;
socketType = QBluetoothServiceInfo::L2capProtocol;
}
- return l2capChannel;
+ return l2capChannel.data();
}