Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cannot receive data from ble 5.2 using QLowEnergyService ?

Cannot receive data from ble 5.2 using QLowEnergyService ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 223 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.
  • Z Offline
    Z Offline
    ZINE
    wrote on last edited by
    #1

    Hi,

    I am developing an android app using Qt 5.12.3, android-26, jdk1.8.0_211, and NDK Version: 19.2.5345600.
    The app works as follow :

    • First, it sends data using QLowEnergyService and the function writeCharacteristic.
    • Then, it receives character 'O' from the peripheral ble, using a SLOT that is connected to the signal characteristicChanged(QLowEnergyCharacteristic,QByteArray).

    The app works fine when it is used with the ble module HM-11 which uses ble version 4.0.

    When I use the new ble module BC805M which uses ble version 5.2, the app sends data successfully. However, It cannot be notified when the BC805M sends 'O' character (an MCU sends 'O' for BC805M through its UART) . After debugging my code, I noticed that the slot that is connected to signal characteristicChanged(QLowEnergyCharacteristic,QByteArray) is never called in my app, although I enabled notification using the code:

    if(c.properties() & QLowEnergyCharacteristic::Notify)
    {
    m_notificationDesc = c.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
    if (m_notificationDesc.isValid())
    {
    BLE_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0100"));
    }
    }

    Why my app cannot be notified when the ble 5.2 module sends data to my app?

    Below is the custom service of ble module BC805M that I used.

    d85a7c97-9770-4eb8-a45e-078d61150b39-Screenshot_20210909_232719_com.macdom.ble.blescanner.jpg

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I don't have an answer, but I do have a small hint: try it out on several different Android phones. In my experience, BLE support varies wildly between different phones. There are always weird edge-cases, often even with "official" devices like Pixel phones.

      (Z(:^

      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