<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hello,</p>
<p><br>
</p>
<p>> <font size="2"><span style="font-size:10pt">Excellent. So we can bug him for both iOS and Mac? :-)</span></font></p>
<p><br>
</p>
<p>Yes <span>😊</span></p>
<p><br>
</p>
<p>> <font size="2"><span style="font-size:10pt">That's one of the things that puzzle me. It says the same about macOS in the documentation, yet we do get Bluetooth addresses on macOS - just not 100% reliably.</span></font><br>
</p>
<p><br>
</p>
<p>Apple has two frameworks actually - IOBluetooth (to deal with Bluetooth 'classic') and more recent CoreBluetooth (BLE).
<br>
</p>
<p>CoreBluetooth works with UUIDs, but IOBluetooth - indeed exposes addresses.</p>
<p><br>
</p>
<p>Best regards,</p>
<p>    Timur.<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Dirk Hohndel <dirk@hohndel.org><br>
<b>Sent:</b> Tuesday, July 18, 2017 3:34:50 PM<br>
<b>To:</b> Alex Blasche<br>
<b>Cc:</b> Subsurface; Timur Pocheptsov<br>
<b>Subject:</b> Re: BLE on iOS</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Alex, Timur,<br>
<br>
> On Jul 18, 2017, at 4:09 AM, Alex Blasche <alexander.blasche@qt.io> wrote:<br>
>> Nor sure if you are the right person for this on iOS - but if not, maybe you can<br>
>> point me to the right person.<br>
> <br>
> Timur (in cc) is the Apple master for QtBluetooth.<br>
<br>
Excellent. So we can bug him for both iOS and Mac? :-)<br>
<br>
>> When compiling Subsurface-mobile for iOS with BT_SUPPORT enabled, we don't<br>
>> appear to get a valid QBluetoothLocalDevice at all. Asking for isValid() returns<br>
>> false, asking for allDevices() returns an empty list.<br>
>> I tried powerOn() but as expected that doesn't work, either.<br>
> <br>
> QBluetoothLocalDevice is not possible on iOS. Apple does not expose this information to app developers. The classes implementation is a dummy only. The same is true for QBluetoothServer, QBluetoothSocket, QBluetoothServiceDiscoveryAgent. Only the straight
 path to QLowEnergyController (BTLE use cases) are supported. That means that only the following class chain works:<br>
> <br>
> QBluetoothDeviceDiscoveryAgent -> QBluetoothDeviceInfo -> QLowEnergyController <br>
<br>
I don't want to sound like a downer... but I must have missed that explanation in the documentation. It would be kinda neat if the classes had a little warning that said "this doesn't work on iOS - implementation is a dummy". Looking at
<a href="http://doc.qt.io/qt-5/qbluetoothlocaldevice.html">http://doc.qt.io/qt-5/qbluetoothlocaldevice.html</a> I can't find any indication that I wouldn't be able to start with this...<br>
<br>
Let's start a new #ifdef'ed path with the class chain you suggest.<br>
<br>
> Also note, that iOS does not expose Bluetooth addresses. The platform generates uuid's as id's for devices.<br>
<br>
That's one of the things that puzzle me. It says the same about macOS in the documentation, yet we do get Bluetooth addresses on macOS - just not 100% reliably.<br>
<br>
Anyway, I'll worry about macOS next, right now I'd love to see some sign of life on iOS...<br>
<br>
Thanks for the help - I can virtually assure you that I'll be back with more questions. I assume that the documentation is maintained in git somewhere as well. As I work through this, should I try to propose changes to the docs? Where would I start to create
 pull requests for that?<br>
<br>
/D</div>
</span></font>
</body>
</html>