I'm trying to find out how to detect if a BLE device is connected in Qt. The setup is as follows;

- Linux 4.12
- Bluez 5.43
- Qt 5.9.2
- One USB BLE 4.1 adapter
- Two or more BLE devices built around nRF52 (custom design)

There are multiple Qt-programs (clients) spawned to connect to each BLE device. Each spawned client locate a free device and connects. However, i can't find any way to decide what devices that are already connected. In the example below (from bluetootctl), the first client have connected to the first device. Note that the first device is connected and the second is not connected.

Qt Code:
  1. [EnvSens]# info C5:C4:62:E9:9E:C8
  2. Device C5:C4:62:E9:9E:C8
  3. Name: EnvSens
  4. Alias: EnvSens
  5. Paired: no
  6. Trusted: no
  7. Blocked: no
  8. Connected: yes <=========
  9. LegacyPairing: no
  10. UUID: Vendor specific (0000f00d-1212-efde-1523-785fef13d123)
  11. [EnvSens]# info DE:AB:25:04:9F:D9
  12. Device DE:AB:25:04:9F:D9
  13. Name: EnvSens
  14. Alias: EnvSens
  15. Paired: no
  16. Trusted: no
  17. Blocked: no
  18. Connected: no <=========
  19. LegacyPairing: no
  20. UUID: Vendor specific (0000f00d-1212-efde-1523-785fef13d123)
To copy to clipboard, switch view to plain text mode 

When i spawn the second client QBluetoothDeviceDiscoveryAgent finds both devices, and tries to connect to the first (already connected) device and breaks connection for the first client and then fails to connect with the message "Cannot connect due to pending active LE connections".

I have looked through all classes that potentially could indicate if a device is connected but can't find any method that does, though, I might be blind.

Any help most welcome!

Thanks in advance,
Mike