[Interest] [Qt BLE] multiple devices connected to an app

Simon FEUTRIER sfeutrier at bluegriot.com
Mon Dec 14 16:36:30 CET 2020


I don't really have something useful to share and my code is quite big.
Moreover it is mainly inspired by the lowEnergyScanner example.

Here is my algorithm for BLE :
-> MainWindow initiates a class called "apiComBluetooth".
-> Then MainWindow calls ApiComBluetooth.startDiscovery() which is just
QBluetoothDeviceDiscoveryAgent.startDiscovery()
-> After 5 seconds, the ApiComBluetooth receives the signal of
discoveryFinished. It sorts devices that I want and stores them in a list
of BleDevice (bluetooth device class like in the lowEnergyScanner example).
-> Then the (only) service that I use starts to be discovered for each
BleDevice created.
-> To write or read to a specific device, MainWindow just accesses the
right device in the BleDevice list using an index. "WriteCharacteristic" or
messages received in the FIFO are managed directly in the BleDevice class
of the device.

I don't know if this information can help you, thank you !

Best regards,

Simon Feutrier


Le lun. 14 déc. 2020 à 16:05, Andreas Buhr <andreas.buhr at qt.io> a écrit :

> Hi Simon,
>
> On 14.12.20 15:25, Simon FEUTRIER wrote:
> > But when I write in the characteristic of the second remote device, the
> > connection with this device is immediately lost (Invalid service : loss
> > of connection with the underlying device)
>
> Would you be able to share more information? Could you share your code?
>
> best,
> Andreas
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201214/575ee718/attachment.html>


More information about the Interest mailing list