[Interest] QBluetooth connection/pairing issue
Scott Bloom
scott at towel42.com
Thu Apr 10 07:07:28 CEST 2025
Thanks for the hint.. Its close. But not quite there.
In Qt5, there were 2 or 3 call back signals for handling authentication, and one slot to be called when finished.
Those are missing in Qt6, and I don’t see anyway to set the pin for an authorized connection.
Scott
-----Original Message-----
From: Juha Vuolle <juvuolle at gmail.com>
Sent: Tuesday, April 8, 2025 23:09
To: Scott Bloom <scott at towel42.com>
Cc: Interest at qt-project.org
Subject: Re: [Interest] QBluetooth connection/pairing issue
Hi,
> It works fine, if I have paired it outside of the app. How do I pair it inside the app?
QBluetoothLocalDevice might be useful for you, see https://doc.qt.io/qt-6/qbluetoothlocaldevice.html#requestPairing
On Wed, 9 Apr 2025 at 05:22, Scott Bloom <scott at towel42.com> wrote:
>
> I am working on a tool that connects to a BT serial port device on
> windows 11
>
>
>
> I have the scan working, and can select the device, giving me a
> QBluetoothServiceInfo
>
>
>
> I can get the address via QBluetoothServiceInfo::device().address();
>
>
>
> I can save this value to the registry, and reconnect on the startup of the tool.
>
>
>
> However, I can’t figure out for the life of me how to “pair” the device.
>
>
>
> I turned on all the Bluetooth logging, hoping to see something, via
>
> QLoggingCategory::setFilterRules( QStringLiteral( "qt.bluetooth* =
> true" ) );
>
>
>
> But that didn’t help.
>
>
>
> I construct the socket via
>
> socket = new QBluetoothSocket( QBluetoothServiceInfo::RfcommProtocol);
>
>
>
> I connect to all the socket signals, and never see a request or failure due to not being paired.
>
>
>
> I then use
>
>
>
> Socket->connectToService( address,
> Socket->QBluetoothUuid::ServiceClassUuid::SerialPort )
>
>
>
> It works fine, if I have paired it outside of the app. How do I pair it inside the app?
>
> TIA,
>
>
> Scott
>
>
>
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
More information about the Interest
mailing list