summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_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>
* 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>
* | | QtBluetooth - get rid of outdated Q_FUNC_INFO use patternTimur Pocheptsov2016-06-031-14/+7
|/ / | | | | | | | | | | | | 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>
* Don't register meta types during static init time5.5Alex Blasche2015-11-301-0/+2
| | | | | | | | | | The QMetaType register my not be up and running by the time we attempt these meta type registration. Change-Id: I1a857a936a24b4b00a49574fac311c08c09b3d5a Task-number: QTBUG-49455 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@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>
* QBluetoothLocalDevice - cleanup (OS X)Timur Pocheptsov2014-12-181-57/+39
| | | | | | | Replace hand-written 'function signatures' with Q_FUNC_INFO. Change-Id: I0c05d9fa76d120b5626420cadafb1a9fe1227b95 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QBluetoothLocalDevice - isValid, tests (OS X and iOS)Timur Pocheptsov2014-12-031-5/+1
| | | | | | | | | | | Cancel the previous modification - even if BT is off, the device is valid unless we create it with some address (in the 'OFF' state I can not verify any address and the device is considered invalid). Enable (back) auto-test - if BT is off we just skip the test (as it's done in other test functions). Change-Id: I8b013af6a73eab9699a91834e197716836b00e78 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QBluetoothLocalDevice - bug on OS X (isValid)Timur Pocheptsov2014-12-011-1/+5
| | | | | | | | | | | If BT adapter is off local device is invalid on OS X: no way to access information like address/name, no way to turn the device on, all operations fail. Considering it's valid breaks the logic: you can pass any address to such a device (invalid non-null address) and device can not check if it's valid or not. Change-Id: I25f70723d566d4de8f993fc9c9a9e6867f936b7f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QBluetoothLocalDevice - bug fix for OS X.Timur Pocheptsov2014-09-301-1/+9
| | | | | | | | | | It was a very stupid idea to compare a string from IOBluetooth with QString, representing Bluetooth address - IOBluetooth uses '-' as a separator + the hex digits can be in lower case :) - making strings not equal :) Compare two QBluetoothAddresses instead. Change-Id: If4a43d254f766efd9f935a7633a4274aa6708e59 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Port QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent to OS X.Timur Pocheptsov2014-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Port QBluetoothLocalDevice and QBluetoothDeviceDiscoveryAgent to OS X.Timur Pocheptsov2014-09-161-0/+499
QBluetoothLocalDevice and QBluetoothDeviceDiscoveryAgent for OS X - Bluetooth Classic (the implementation based on IOBluetooth). + a very simple non-gui test (requires QApplication to work though). Update 0: style issues reported by Qt-Bot + fix a test. Update 1: QBluetoothLocalDevice - display confirmation Update 2: Device discovery agent - follow the expected logic and apply suggested fixes. Update 3: started/finished delegate methods seems to be synchronous and immediately follow start/stop calls on an inquiry. Update 4: remove unused function and redundant error message. Update 5: the first attempt to fix pairingStatus/requestPairing on a local device. Update 6: on OS X it's impossible (with a given public API) to request 'Unpaired'. I was only able to find some quite terrible hacks with private APIs or even worse - playing with SystemConfiguration frameworks and changing System Preferencies programmatically (requires authorization and looks like a total hack, since it has nothing to do with Bluetooth framework). Update 7: A very limited support for deviceConnected and connectedDevices. Update 8: Fix an invalid invokeMethod's argument. Update 9: Subject changed. Update 10: fixes in a documentation. Update 11: asserts in a coding convetion/style. Update 12: "fix" asserts + emit errors if a start/stop failed. Update 13: deviceDisconnected implemented. Update 14: use not only paired && connected devices (QBluetoothLocalDevice::connectedDevices), but also devices discovered by the connection monitor. Update 15: remove a test, not required (there are 'auto' tests). Update 16: fix private headers - they MUST have _p suffix :( Update 17: tests are known to fail (at the moment) - IOBluetooth requires adjustment (QApplication instead of QCoreApplication, lack of ability to power on/off a device (not possible on Mac) + other things). Change-Id: Iea1c8a98f1fd719f4560ec8920d00cc07eaa8146 Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>