Accessing different services with pc-ble driver

Hello,

I try to connect a BLE application with my PC by using an nRF52840 dongle and the PC-BLE driver. But I got stuck in the understanding of the driver, so I hope that someone can help me.

The ESP32 provides two additional services: 

  • A device information service
  • A battery service

I run a modified version of the BLE driver from a Qt application and the service discovery outputs three services

"Received service discovery response. Service count: 3"
" Service UUID: 0x1800"
" Service UUID: 0x1801"
" Service UUID: 0x180a"

But where is the fourth service? I only got the two common services and the device information service, but the battery service is missing.

How can I use multiple services with the BLE driver? I have figured out that I can store the handles of each service by looping through each service after the discovery. And I assume that I have to use each handle to access a discovered service?

And I´m looking for an example for reading / writing some values from the characteristics of a given service. Do you have an example?

Thank you for your help Slight smile

Parents Reply
  • Hi  ,

    sorry for the late response. I didn´t have checked the update...

    I don´t test the example, because I have to port the example to Qt and I don´t have the patience to do it till now. But I have checked the examples and tried to use them as a base for my code.

    I have appended the BLE class file to my answer. Please take a look at it. It is based on the examples from the pc-ble-driver. The service discovery ends in on_Service_Discovery_Response.

    qt_ble.cpp

Children
Related