[Interest] [Qt BLE] multiple devices connected to an app
Simon FEUTRIER
sfeutrier at bluegriot.com
Tue Dec 15 09:26:27 CET 2020
Hello Oliver,
I developed a remote device which has a u-blox BLE module (this module has
an embedded nordic nrf chip if you know it). Thus, I communicate with this
module with AT commands and I don't have a lot of information.
Some more information I can give you :
Here are the messages I got from the Bluetooth stack when I try to send the
first message to the second remote device (the first one is already
connected) :
> internal\sdk\inc\wil\opensource/wil/winrt.h(1587)\Windows.Devices.Bluetooth.dll!00007FFEE636E54B:
> (caller: 00007FFEE639262E) Exception(1) tid(3a08) 80004004 Opération
> abandonnée
> Exception at 0x7fff0a413b29, code: 0xe06d7363: C++ exception, flags=0x1
> (execution cannot be continued) (first chance) in Windows_Devices_Bluetooth
> Exception at 0x7fff0a413b29, code: 0xe06d7363: C++ exception, flags=0x1
> (execution cannot be continued) (first chance) in Windows_Devices_Bluetooth
> onecoreuap\drivers\wdm\bluetooth\user\winrt\gatt\gattcharacteristic.cpp(1119)\Windows.Devices.Bluetooth.dll!00007FFEE643DD9B:
> (caller: 00007FFEE638FB90) ReturnHr(73) tid(3a08) 80004004 Opération
> abandonnée
> onecoreuap\drivers\wdm\bluetooth\user\winrt\gatt\gattcharacteristic.cpp(368)\Windows.Devices.Bluetooth.dll!00007FFEE638FC9B:
> (caller: 00007FFEE63993EC) ReturnHr(74) tid(3a08) 80004004 Opération
> abandonnée
PS : "Opération abandonnée" just means Abandoned, aborted operation, in
french ^^'
Moreover, I can confirm that I can write in the descriptor of both devices
(descriptorWritten signal is emitted) :
*m_pFifoService->writeDescriptor(notificationDesc,
QByteArray::fromHex("0100"));*
Best,
Simon Feutrier
Le mar. 15 déc. 2020 à 08:19, Oliver Wolff <oliver.wolff at qt.io> a écrit :
> Hi Simon,
>
> On 14/12/2020 16:36, Simon FEUTRIER wrote:
> > 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.
>
> My experience with BLE on Windows is, that everything is really
> sensitive when it comes to devices/BLE dongles and drivers. Can you give
> more information on the hardware you are using?
>
> Windows API does not have the concept of connecting to a BLE device, so
> what we do behind the scenes is reading a characteristic if the device
> is not connected. This will trigger a connect that is initiated by the
> operating system. So the influence we have on the connection behavior
> itself is quite limited. Perhaps the hardware you are using at least
> gives some input.
>
> Cheers, Olli
>
> >
> > 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
> > <mailto: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 <mailto:Interest at qt-project.org>
> > https://lists.qt-project.org/listinfo/interest
> > <https://lists.qt-project.org/listinfo/interest>
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > https://lists.qt-project.org/listinfo/interest
> >
> _______________________________________________
> 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/20201215/7df4a5a6/attachment.html>
More information about the Interest
mailing list