Use SPP's uuid to connect to a device on Apple platforms

Use the uuid of the Serial Port Profile service to connect to a remote
Bluetooth device on OS X (and iOS) platforms with a Qt version greater
than 5.5.0.

In the future the same section should be used for BT connectivity on
Linux platforms. Currently there is a problem with the SDP discovery
and it doesn't work as expected.

[Dirk Hohndel: modified OS check for consistency]

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Claudiu Olteanu 2015-07-18 23:14:00 +03:00 committed by Dirk Hohndel
parent 8d2b6142c6
commit 8c373f419d

View file

@ -80,7 +80,7 @@ static int qt_serial_open(serial_t **out, dc_context_t *context, const char* dev
loop.exec();
}
}
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) || (QT_VERSION >= 0x050500 && defined(Q_OS_MAC))
// Try to connect to the device using the uuid of the Serial Port Profile service
QBluetoothAddress remoteDeviceAddress(devaddr);
serial_port->socket->connectToService(remoteDeviceAddress, QBluetoothUuid(QBluetoothUuid::SerialPort));