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. how to read bluetooth low energy value

how to read bluetooth low energy value

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 293 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
    SherifOmran
    wrote on last edited by SherifOmran
    #1

    hello
    i am trying to read bluetooth low energy value for a temperature sensor
    but i have the following questions

    when i studied the heartrate-game example it uses the following to get the updated value from notification

    connect(m_service, &QLowEnergyService::characteristicChanged, this, &DeviceHandler::updateHeartRateValue);
    
    void DeviceHandler::updateHeartRateValue(const QLowEnergyCharacteristic &c, const QByteArray &value)
       auto data = reinterpret_cast<const quint8 *>(value.constData());
       quint8 flags = *data;
       qDebug() << "Data Byte" << &value ;
    
    
    but the low energy scanner example uses 
       qDebug() << "c.value " << c.value().toHex();
    

    my first question:
    what is the difference between value and c.value.hex ?

    when i print them i get the following

    c.value "00c70f00fe"
    Data Byte 0x282855280

    c.value "00d10f00fe"
    Data Byte 0x282848bf0

    c.value "00db0f00fe"
    Data Byte 0x282848660

    c.value "00e50f00fe"
    Data Byte 0x282848c30

    c.value "00ef0f00fe"
    Data Byte 0x282848bf0

    c.value "00f90f00fe"
    Data Byte 0x282848370

    which one is what ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SherifOmran
      wrote on last edited by
      #2

      i found the solution, they should be the same, now i can see it. it was printing the adress.

      qDebug() << "Data Byte" << value.toHex() ;
      
      1 Reply Last reply
      0
      • N Offline
        N Offline
        niruc
        Banned
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0

        • Login

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