Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bluetooth Low Energy: Resetting serviceState without disconneting from the device
Forum Update on Monday, May 27th 2025

Bluetooth Low Energy: Resetting serviceState without disconneting from the device

Scheduled Pinned Locked Moved Unsolved General and Desktop
bluetooth low e
1 Posts 1 Posters 222 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SpaceToon
    wrote on 9 Jun 2020, 13:49 last edited by
    #1

    Hi,

    I am developing a GUI application that allows a user to connect to a Bluetooth Low Energy device, determine services and service details, and finally read the properties. After I have connected to a device and determined the services, I would like to call up the characteristics of a selected service with the button "Determine characteristics", like this:

    void Bluetooth::on_showCharacteristics_clicked()
    {
    
        /*delete object if it is not nullptr*/
        if(selectedService)
        {
            delete selectedService;
            selectedService = nullptr;
            qDebug()<< "selectedService deleted";
        }
    
        selectedService = lowEnergyController->createServiceObject(serviceUuid, this);
    
        connect(selectedService, &QLowEnergyService::stateChanged, this, &Bluetooth::serviceDetailsDiscoveredSlot);
        qDebug() << selectedService->state();
        selectedService->discoverDetails();
    }
    

    So when I call this function for the first time, the state ist firstly "QLowEnergyService::DiscoveryRequired" - it finally becomes "QLowEnergyService::ServiceDiscovered"
    When I call this function for the second time for the same service, the state is "QLowEnergyService::ServiceDiscovered" therefore the stateChanged signal is not being emitted. So is it possible, to "reset" the state of a service, without disconneting from the device?

    1 Reply Last reply
    0

    1/1

    9 Jun 2020, 13:49

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved