N
N
naso4ek2021-01-28 23:15:27
Bluetooth
naso4ek, 2021-01-28 23:15:27

QT 5.15.2 BLE how to fix QLowEnergyService::UnknownError on Windows?

Experience with Qt is only about a week, I tried to write a program to work with a BLE device (LYWSD02MMC clock from Xiaomi) and ran into a problem reading the service.

I wrote a program based on Qt examples that run and work fine (in particular, LowEnergyScanner), but it is my program that refuses to work. I googled the problem, and it turned out that maybe the problem is in Windows, and indeed, I installed Ubuntu 20.10, the program starts there and reads the service normally.
And the bug on Windows is that it throws the error "the process cannot access the file because it is being used by another process". Although the same error occurs even if you restart the computer (well, suddenly the process is stuck somehow).

Header - https://pastebin.com/04mnYQZr
Code -https://pastebin.com/ufRefgxE

Trying to read service
60131b3116ec2180264497.png

File is in use by another process
60131b3c0e03b431940838.png

Running on Ubuntu
60131b57a95b6070621156.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2021-01-29
@Zifix

Try starting the system in safe mode so that unnecessary software is not loaded from autorun, perhaps some utility from the manufacturer of your Bluetooth adapter is interfering. And Qt has nothing to do with it, most likely, if this code works on Linux.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question