[Interest] Bluetooth on Windows 10

maitai maitai at virtual-winds.org
Wed Jul 25 09:07:57 CEST 2018


Hi Olli

Yes it is better but still not perfect:

When I try the pingpong sample, it now works if I set Android as the 
server, and Windows as the client. But the opposite does not work, the 
paired Android device cannot find the server (no special message in the 
server console). Problem is that in my real case Windows will need to be 
the server of possibly several Android Wear devices. Good point though 
it is not a problem for me if the devices need to be paired before 
running the app.

Philippe

Le 25-07-2018 07:46, Oliver Wolff a écrit :
> Hi Philippe,
> 
> The current implementation requires the devices to be paired in order
> to use Bluetooth on Windows. There is a bug report about getting rid
> of that requirement (https://bugreports.qt.io/browse/QTBUG-58660) but
> that's the status quo atm.
> 
> Olli
> 
> 
> On 24/07/2018 16:59, maitai wrote:
>> Hi Oliver,
>> 
>> No the 2 machines are not paired with anything. I've tried pairing the 
>> Android Phone with the Windows machine just to check that the BT 
>> device is OK, that worked, but I have removed all connections after 
>> that.
>> 
>> Philippe.
>> 
>> Le 24-07-2018 14:00, Oliver Wolff a écrit :
>>> Hi Philippe,
>>> 
>>> are the two machines paired? Windows API does not allow pairing them,
>>> so the initial pairing has to be using the system UI.
>>> 
>>> Olli
>>> 
>>> 
>>> On 24/07/2018 10:32, maitai wrote:
>>>> Thanks Alex,
>>>> 
>>>> I have done that, but although it seems to do things, I cannot make 
>>>> it work on Windows (server or client). It works finally between a 
>>>> Mac and an Android device.
>>>> 
>>>> For instance if I run the BT discovery example I get:
>>>> 
>>>> qt.bluetooth.winrt: Worker started
>>>> qt.bluetooth.winrt: BT  scan completed
>>>> qt.bluetooth.winrt: BTLE  scan completed
>>>> qt.bluetooth.winrt: onBluetoothLEDeviceFound: No device given
>>>> 
>>>> And nothing is found (it actually finishes the scan almost 
>>>> immediately, which I believe is not a good sign).
>>>> 
>>>> For the pingpong example as a server it gives:
>>>> 
>>>> qt.bluetooth.winrt: Port 1 registered
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registering Uuid 
>>>> attribute with length 16
>>>> qt.bluetooth.winrt: Registering sequence attribute
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registering Uuid 
>>>> attribute with length 2 "{00001002-0000-1000-8000-00805f9b34fb}"
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registered sequence 
>>>> attribute with length 3
>>>> qt.bluetooth.winrt: Registering sequence attribute
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registering Uuid 
>>>> attribute with length 2 "{00001101-0000-1000-8000-00805f9b34fb}"
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registered sequence 
>>>> attribute with length 3
>>>> qt.bluetooth.winrt: bool __cdecl 
>>>> repairProfileDescriptorListIfNeeded(class 
>>>> Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> &) Repairing profile 
>>>> descriptor list
>>>> qt.bluetooth.winrt: class Microsoft::WRL::ComPtr<struct 
>>>> ABI::Windows::Storage::Streams::IBuffer> __cdecl 
>>>> bufferFromAttribute(const class QVariant &) Registering attribute of 
>>>> type QMetaType::QString
>>>> 
>>>> I tried with 2 windows machines, making sure they are discoverable, 
>>>> etc. The mac machine detects the Windows machine, but not the 
>>>> opposite.
>>>> 
>>>> Probably I am doing something wrong, still investigating.
>>>> Philippe
>>>> 
>>>> Le 24-07-2018 10:13, Alex Blasche a écrit :
>>>>> Adding
>>>>> 
>>>>> QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = 
>>>>> true"));
>>>>> 
>>>>> to your main() might help.
>>>>> 
>>>>> -- Alex
>>>>> 
>>>>> ________________________________________
>>>>> From: Interest
>>>>> <interest-bounces+alexander.blasche=qt.io at qt-project.org> on behalf 
>>>>> of
>>>>> maitai <maitai at virtual-winds.org>
>>>>> Sent: Monday, 23 July 2018 6:34:15 PM
>>>>> To: Interest at qt-project.org
>>>>> Subject: Re: [Interest] Bluetooth on Windows 10
>>>>> 
>>>>> Ok, thanks Alex for the clear answer, that is a great news.
>>>>> 
>>>>> I have tried the pingpong-bluetooth example and couldn't make it 
>>>>> work. I
>>>>> tried various machines (2 Windows 10/1803, 1 Windows/1 Android, 1 
>>>>> Mac/1
>>>>> Android, etc), I do not see any debug or strange messages but the 
>>>>> client
>>>>> never finds the server (Qt 5.11.1).
>>>>> 
>>>>> Now that I know that it should work I will dig deeper
>>>>> 
>>>>> Thanks again
>>>>> Philippe.
>>>>> 
>>>>> Le 23-07-2018 17:17, Alex Blasche a écrit :
>>>>>>> -----Original Message-----
>>>>>>> From: Interest
>>>>>>> <interest-bounces+alexander.blasche=qt.io at qt-project.org> On
>>>>>>> Behalf Of maitai
>>>>>> 
>>>>>>> I have already read many posts on this topic, but I cannot 
>>>>>>> understand
>>>>>>> the
>>>>>>> following statement in the documentation:
>>>>>>> 
>>>>>>> "Despite there not being a Win32 port yet, the WinRT backend is
>>>>>>> automatically
>>>>>>> used if the win32 target platform supports the required WinRT 
>>>>>>> APIs.
>>>>>>> Minimal
>>>>>>> requirement is Windows 10 version 1507 with slightly improved 
>>>>>>> service
>>>>>>> discovery
>>>>>>> since Windows 10 version 1607. Therefore Windows 7 and 8.x 
>>>>>>> targets are
>>>>>>> excluded."
>>>>>> 
>>>>>> The Win32 build will silently use WinRT-only API to enable this
>>>>>> feature. This works because we can assume that the relevant 
>>>>>> windows
>>>>>> builds have the required API. There is a runtime check that guards 
>>>>>> the
>>>>>> implementation.
>>>>>> 
>>>>>>> Does it mean QBluetooth (regular) will work on Windows 10 version 
>>>>>>> 1803
>>>>>>> out of
>>>>>>> the box?
>>>>>> 
>>>>>> Yes, it should.
>>>>>> 
>>>>>> -- Alex
>>>>>> 
>>>>>> _______________________________________________
>>>>>> Interest mailing list
>>>>>> Interest at qt-project.org
>>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>> _______________________________________________
>>>>> Interest mailing list
>>>>> Interest at qt-project.org
>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>> _______________________________________________
>>>> Interest mailing list
>>>> Interest at qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>> 
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list