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. Unable to receive huge data from Peripheral in BLE transfer, with QT 5.14 on Ubuntu 18.04

Unable to receive huge data from Peripheral in BLE transfer, with QT 5.14 on Ubuntu 18.04

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 278 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.
  • A Offline
    A Offline
    ankursaxena
    wrote on last edited by ankursaxena
    #1

    Brief: When receive large data in various chunk. SIGNAL QLowEnergyService::characteristicChanged is not emitting after receiving few chunks of data. Therefore, i am unable to receive full data. Following is the details:

    Scenario:
    Central and Peripheral case [I am looking after central code].
    Peripheral is an IOS/Android based mobile device.
    Central is a Linux Laptop. [Bluetooth HCI version 4.2]
    Central has subscribed a Characteristic (Property: Notify) of Peripheral.
    Total size of data to be transfer is 171520 bytes(approx) from Peripheral.
    Data Packet size is 91 [1 byte of Header, 90 bytes of Data].

    Facing Issue:
    Peripheral is updating its characteristic with small data.
    Central is receiving the data packets.
    So after receiving few data packets (sometimes 30, 50 or 100) from Peripheral,
    Client is not receiving all the data packets from it.

    Problem in QT:

    	/*-------------------------------------
    	          CLIENT SIDE CODE SNIPPET
    	 --------------------------------------*/
    
    	/*
    	 *  Device: a Class, which handles BLE communication.
    	 *  m_service: is pointer of type QLowEnergyService
    	 */
    --> connect(m_service, &QLowEnergyService::characteristicChanged, this, &Device::CharatValueUpdated);
    
    
    	/*
    	 *  This function gets called when, Peripheral sends data
    	 */
    --> void Device::CharatValueUpdated(const QLowEnergyCharacteristic &c, const QByteArray &value)
    	{
    		// Do nothing to avoid overhead
    		// ...................
    		// ...................
    	}
    		  
    fn CharatValueUpdated( QLowEnergyCharacteristic&, QByteArray& ) 
    is my callback/slot function, 
    when Peripheral updates its Characteristic, this function gets called 
    and client receives the updated data in parameter "value".
    

    ISSUE: after getting called for few times, fn "CharatValueUpdated()" does not get called.
    its upto QT which calls this fn, when it receives data from peripheral side.

       The "QLowEnergyService::characteristicChanged" signal triggers randomly sometime 30 or 50 or 150,
       and suddenly stop emmiting this signal without complete data transfer.	   
    

    Note: The same source code works fine on QT Windows 10.

    A 1 Reply Last reply
    0
    • A ankursaxena

      Brief: When receive large data in various chunk. SIGNAL QLowEnergyService::characteristicChanged is not emitting after receiving few chunks of data. Therefore, i am unable to receive full data. Following is the details:

      Scenario:
      Central and Peripheral case [I am looking after central code].
      Peripheral is an IOS/Android based mobile device.
      Central is a Linux Laptop. [Bluetooth HCI version 4.2]
      Central has subscribed a Characteristic (Property: Notify) of Peripheral.
      Total size of data to be transfer is 171520 bytes(approx) from Peripheral.
      Data Packet size is 91 [1 byte of Header, 90 bytes of Data].

      Facing Issue:
      Peripheral is updating its characteristic with small data.
      Central is receiving the data packets.
      So after receiving few data packets (sometimes 30, 50 or 100) from Peripheral,
      Client is not receiving all the data packets from it.

      Problem in QT:

      	/*-------------------------------------
      	          CLIENT SIDE CODE SNIPPET
      	 --------------------------------------*/
      
      	/*
      	 *  Device: a Class, which handles BLE communication.
      	 *  m_service: is pointer of type QLowEnergyService
      	 */
      --> connect(m_service, &QLowEnergyService::characteristicChanged, this, &Device::CharatValueUpdated);
      
      
      	/*
      	 *  This function gets called when, Peripheral sends data
      	 */
      --> void Device::CharatValueUpdated(const QLowEnergyCharacteristic &c, const QByteArray &value)
      	{
      		// Do nothing to avoid overhead
      		// ...................
      		// ...................
      	}
      		  
      fn CharatValueUpdated( QLowEnergyCharacteristic&, QByteArray& ) 
      is my callback/slot function, 
      when Peripheral updates its Characteristic, this function gets called 
      and client receives the updated data in parameter "value".
      

      ISSUE: after getting called for few times, fn "CharatValueUpdated()" does not get called.
      its upto QT which calls this fn, when it receives data from peripheral side.

         The "QLowEnergyService::characteristicChanged" signal triggers randomly sometime 30 or 50 or 150,
         and suddenly stop emmiting this signal without complete data transfer.	   
      

      Note: The same source code works fine on QT Windows 10.

      A Offline
      A Offline
      ankursaxena
      wrote on last edited by
      #2

      It is resolved. Issue is related to hardware. When i changed my laptop, and got latest configuration related to bluetooth. My problem is resolved.

      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