diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-09-10 12:54:18 +0200 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-09-26 15:41:09 +0200 |
commit | d1d77c8210ecf7a89a81dad69d21b91e06bf129e (patch) | |
tree | 94d7b91c64478720eee9c9afd82acfc496c383e1 /src/bluetooth/qbluetoothservicediscoveryagent_osx.mm | |
parent | c1aabdba2e839ba525a4918eebfbf6fbbe96d34d (diff) |
Port QBluetoothSocket to OS X.
Implement QBluetoothSocket using IOBluetooth framework on OS X
(will implement Qt's API as close as possible with a given Apple's API).
Update 0: add (empty for now) delegate classes (L2CAP/RFCOMM).
Update 1: add service discovery (called doDeviceDiscovery though).
Update 2: implement the public class' logic (QBluetoothSocket, connectToService).
Update 3: more public logic implemented (since it's easy :) )
Update 4: L2CAP delegate - initial logic.
Update 5: connectToService - L2CAP "socket".
Update 6: fix pivate header files.
Update 7: fix dependency after the previous patch was merged.
Update 8: writeData - initial version for L2CAP.
Update 9: since RFCOM/L2CAP delegates have the same interface,
no need in duplicating the same class - add a "generic"
ChannelDelegate instead.
Update 10: more RFCOMM logic.
Update 11: function to build a service description from
QBluetoothServiceInfo (to be registered on SDP server).
Update 12: QBluetoothSocket::close/abort.
Update 13: Create a dictioinary out of QBluetoothServiceInfo to register a service.
Update 14: Add service registration.
Update 15: Convert attributes (sequences and 'scalars') from QBluetoothServiceInfor
into NSDictionary.
Update 16: Update QBluetoothServiceInfo with a real PSM/ChannelID
after a service was registered.
Update 17: Move a private class (bluetooth socket) into the separate private
header file (to make it visible for bluetooth_server_osx)
Update 18: Add an interface to create a bluetooth socket (private class)
from a channel, reported by a notification (found by a listening
server).
Update 19: Fix an invalid assert - any state (Inactive/ServiceDiscovery/DeviceDiscovery)
is possible, not only Inactive.
Implement the missing 'readData' and 'writeData' for RFCOMM.
Set SDP query as non-active after query finished.
Temporary (!) workaround - can not invokeMethod on a private socket (d_ptr).
Update 20: When creating a socket wrapper from an incoming notification/channel, set:
socket type + channel's delegate.
Change-Id: Idd6d5478597206ed759f49e282baed948d105ddf
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_osx.mm')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_osx.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm index 46e0c471..5bec4291 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm @@ -161,7 +161,9 @@ void QBluetoothServiceDiscoveryAgentPrivate::stopDeviceDiscovery() void QBluetoothServiceDiscoveryAgentPrivate::startServiceDiscovery() { - Q_ASSERT_X(state == Inactive, "startServiceDiscovery()", "invalid state"); + // Any of 'Inactive'/'DeviceDiscovery'/'ServiceDiscovery' states + // are possible. + Q_ASSERT_X(q_ptr, "startServiceDiscovery()", "invalid q_ptr (null)"); Q_ASSERT_X(error != QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapterError, "startServiceDiscovery()", "invalid bluetooth adapter"); |