2

I'm writing a Qt 5.5.0 app that communicates with a BLE peripheral LinkitONE. The peripheral is pre-programmed in such a way that to read or change a variable first I have to write the variable name into a specific characteristic and then either read or write the data from another characteristic.

I write with QLowEnergyService::writeCharacteristic and read with QLowEnergyService::readCharacteristic. It all works well unless I have to read or write anything longer than 20 bytes in which case the data is cut at the end. Is there any way to either increase the write buffer size or specify the offset for writing?

WereWind
  • 69
  • 1
  • 10
  • What platform are you on (I see implementations for bluez, android and OS X)? And what is error() (http://doc.qt.io/qt-5/qlowenergyservice.html#error) returning? Might well be a bug or limitation of the implementation in Qt. – Frank Osterfeld Jun 01 '15 at 19:11
  • Looking at the bluez impl of QLowEnergyControllerPrivate::writeCharacteristic() in qtconnectivity/src/bluetooth/qlowenergycontroller_bluez.cpp it takes another codepath exactly at the 20 character boundary... – Frank Osterfeld Jun 01 '15 at 19:17
  • Yes, I program for bluez. The error returns 0 and I've just discovered that if I attempt to write more than 20 bytes it severs the connection to the device(service state becomes InvalidService instead of ServiceDiscovered) – WereWind Jun 02 '15 at 12:02
  • However the QLowEnergyController::Error returns NetworkError after failing to write – WereWind Jun 02 '15 at 13:18
  • Have a look at this http://stackoverflow.com/questions/24135682/android-sending-data-20-bytes-by-ble – Gawhary Mar 17 '16 at 19:57

0 Answers0