summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
Commit message (Collapse)AuthorAgeFilesLines
* IOBluetooth: warn about incorrent thread/runloopTimur Pocheptsov2017-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | IOBluetooth is heavily based on CFRunLoops. An attempt to use it on a thread, that does not properly run CFRunLoop results in callbacks never firing and thus QBluetooth classes never finishing their jobs, including: - device discovery - service discovery - RFCOMM/LCAP2 - Bluetooth server - Bluetooth socket etc. While we cannot fix the core problem until we have a properly working CoreFoundation event dispatcher, we can at least issue a warning so that people do not waste their time debugging this well-known limitation. Task-number: QTBUG-63630 Change-Id: Iefa4d675ea0962167bdfede640d2087dbdf37b18 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Apple: Do Classic dev discovery inside QBluetoothServiceDiscoveryAgentAlex Blasche2017-06-151-1/+1
| | | | | | | This was missed when doing the same change for the non-Apple platforms. Change-Id: Ib1ef55acc82d98def4e1fc1ca228dabe6a13f241 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'gerrit/5.7' into 5.8v5.8.0-beta1Alex Blasche2016-10-121-2/+1
|\ | | | | | | | | | | | | | | Conflicts: src/bluetooth/osx/osxbtledeviceinquiry.mm src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm Change-Id: I7dc75c187af73917f31c28b9edfaf8bcf9652a3e
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-2/+1
| |\ | | | | | | | | | Change-Id: Iff285e35cdca30fee28c7927bc01498d70f9de9e
| | * CoreBluetooth - fix broken builds (macOS, iOS, tvOS, watchOS)Timur Pocheptsov2016-10-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - With recent SDK changes CoreBluetooth is not in IOBluetooth anymore. This makes corebluetoothwrapper_p.h even uglier, now we have to care about v != 10.9 && v < 10.12; v == 10.9; v >= 10.12. - Using osxbluetooth_p.h we can get rid of forward declarations (for Obj-C classes) and weird includes like <IOBluetooth/IOBluetoothRFCOMChannel.h> - use osxbluetooth_p.h instead (and it will correctly include IOBluetooth/IOBluetooth.h etc.). Change-Id: Ia85ef2e2cc1ac7b15a58864ed25d85a0772e5c86 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'gerrit/5.7' into devAlex Blasche2016-06-091-7/+9
|\| | | | | | | | | | | Change-Id: I7d51a0fab65a0cb1206609ff3a58c7f0ef0661b6
| * | Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-06-091-7/+9
| |\| | | | | | | | | | Change-Id: Id8dffff9bb75db396aabf6da2a3acb78505a6476
| | * QBluetoothServiceDiscoveryAgent: set q_ptr in d_ptr's constructor.Edward Welbourne2016-06-021-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The agent class constructors were initializing the q_ptr member of their d_ptr; it is cleaner to pass this down to the d_ptr's constructor and let it do this itself. This also lets Coverity know that initialization actually does happen (CID 22330). In particular, it makes sure we can't leave it uninitialized, if an agent implementation happens to neglect to do so. Change-Id: Ie01046a5a113b5669e8e63c6a22f692cd3943ac0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | QtBluetooth - get rid of outdated Q_FUNC_INFO use patternTimur Pocheptsov2016-06-031-1/+1
|/ / | | | | | | | | | | | | No Q_FUNC_INFO in qCDebug/Warning/Critical needed anymore. Change-Id: I0e47ccc7ffa971b8277b8d742e00319f4acef2f7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* / Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove QNX/BlackBerry implementation for QtBluetoothAlex Blasche2015-06-171-3/+0
| | | | | | | | | [ChangeLog][QtBluetooth][Platform Specific Changes] Removed support for Blackberry 10. Change-Id: I431c4f34bb10aa3668542df7a8b3403b61bf4705 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Bluetooth (classic) service discovery - skip LE devices (OS X)Timur Pocheptsov2015-03-241-0/+7
| | | | | | | | | LE scan on OS X can find LE devices, but CoreBluetooth does not expose hardware addresses and as a result we can not run (and should not) SDP scan on such devices - just skip them. Change-Id: Iaa5c47e1d317c39918d13830c9c6eeab398bc7a5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Shift all OSX & iOS translations into C++ filev5.5.0-alpha1Alex Blasche2015-03-061-5/+6
| | | | | | | | | | | lupdate cannot parse .mm files. Therefore tr markup must be inside of C++ files. Some error strings where slightly modified to make use of already existing translations for other backends such as Bluez and QNX. Change-Id: I97fe6cfe2227e32fdbc61edd253080a1cd68edc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-22/+14
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* QBluetoothServiceDiscoveryAgent - cleanup (OS X)Timur Pocheptsov2014-12-181-30/+23
| | | | | | | Use Q_FUNC_INFO in asserts/messages. Change-Id: I2d9429cff0b1cd5d28a04fe50328289a891d04f5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bluetooth - service discovery bugfix/test update on OS XTimur Pocheptsov2014-11-051-3/+13
| | | | | | | | | | SDP inquiry either fails to start, or ends with an error. The failure at start was not handled correctly (probably messing with failing tests as a result). Print the original IOKit return code, set an error (thus emitting signal) + also make a test case verbose to see these error codes. Change-Id: Ica3cc5681b91f02a6b7f7e2681a653b5a9dbfd46 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix qdoc warnings & adds missing changelog entry for recent API changeAlex Blasche2014-10-301-4/+4
| | | | | | | | | | | | | | 1.) Duplicated class documentation in service discovery agent code 2.) Added missing reference to "\a uuid" parameter in new QBluetoothDeviceInfo::setDeviceUuid() [ChangeLog][QtBluetooth][QBluetoothDeviceInfo] New deviceUuid attribute added to QBluetoothDeviceInfo Change-Id: I7f87d7b95e28b435cb646d284eb447dbdccf0c90 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Port QBluetoothTransferReply to OS X.Timur Pocheptsov2014-10-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Implement file transfer using IOBluetoothOBEXSession. - Add OBEX session class and session delegate. - Implement OBEX connect operation. - Aux. function to convert OBEX data into Qt's data types. - Start implementing OBEX put. - Extract a connection ID from response headers (if any?). - OBEX Put (without response/event handler yet). - OBEX Put completed - send the remaining chunks of data (if any). Change the unicode string encoding - byte order. - OBEX change error handling - there can be real errors (OBEX event type == error_type) but also response code can be not something good - handle them both. - Emit all signals and make Qt' btfiletransfer really working now. - Protect a service discovery against the early stop (can be a result of emit serviceDiscovered). - After a file transfer finished (either success or a failure) - disconnect (if connected) OBEX session - to make it possible to send more files. - Implement OBEXPutError + isFinished/isRunning and signals on error. - Add proper 'abort' and 'start' slots. Also emit finished on errors. - If we do not have a file, but just an input stream, generate a _really_ random and unique name, not 'XXXXX' template. Change-Id: Ib6fb35d8e0eb07d71ccd2d7b565bba226bef119c Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* QBluetoothServiceDiscoveryAgent - bugfix for OS X.Timur Pocheptsov2014-09-301-0/+4
| | | | | | | | | | startServiceDiscovery should set a state into inactive, if all devices were scanned already, otherwise, it's not possible to start a discovery again after it's finished once. performMinimalDiscovery should apply a filter (if any) Change-Id: I5bb635a381be6e612c80ce14cb9ceeb509439fdb Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Port QBluetoothSocket to OS X.Timur Pocheptsov2014-09-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Port QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent to OS X.Timur Pocheptsov2014-09-161-0/+570
QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent - version for OS X (IOBluetooth-based). Update 0: initial dummy version + mods to enable this new classes to be built with qtconnectivity. Update 1: SDP query + initial implementation of a services discovery agent. Update 2: aux functions to "parse" a service records once I got it. Update 3: extract services UUIDs on a discovered device, if any. Update 4: refactor Update 5: "fix" asserts Update 6: more asserts fixed. Update 7: add the ability to stop SDP query (to be tested!!!) Update 8: mods as suggested in review. Update 9: no reason to check the size of discoveredDevices after 'clear' call. Update 10: set an error and error description only if it's a 'singleDevice'. Update 11: fix private header (_p suffix). Update 12: on 10.7 (with quite old clang) there is no 'subscript operator' syntax for NSDictionary. Change-Id: Ib3b07b49e3ed6381af75fb8b1e29cdf1e7a11237 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>