Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Questions about Qt bluetooth notifications



  • Hello everybody, I am developing a program to read some characteristics from a smart watch (heart rate, battery level, humidity and temperature).
    To doing this, I am following the heart rate game example. From this example I am able to get notifications about heart rate from a simulator on my smartphone, but for the other parameters I am not able to get the values.
    For example, for heart rate I'm doing this:

    if (uuid == QBluetoothUuid(QBluetoothUuid::HeartRate)) {
                const QLowEnergyCharacteristic hrChar = m_service->characteristic(QBluetoothUuid(QBluetoothUuid::HeartRateMeasurement));
                m_notificationDesc = hrChar.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
                m_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0100"));
    

    If i run my program, it finds the device and connect to it and I get correctly the new heart rate value everytime I push "notify" button on the simulator.

    For the other services I don't have the equivalent of HeartRateMeasurment.
    For the battery I tried to use BatteryService and then BatteryLevel as characteristic but my program does not read the values while standing still (but not blocked).
    Which services and characteristics should I use to get the same result I get with heart rate?
    Thank you very much for all the help.


Log in to reply