I am trying to retrieve Service Data information from Bluetooth devices using QBluetoothDeviceInfo class (Qt 6.3), but when it contains bytes with 0 values it gets truncated.
For example I have the Service Data in my bluetooth device written as 0xFF2233000065: the problem is that serviceData() method of QBluetoothDeviceInfo returns a QByteArray that has only the first three bytes FF, 22, 33 and stops when it founds 00. Any of you has encountered such a similar issue?
Thank you in advance
edit: Here I paste excerpts from my code, trying to clarify my issue:
//...
discoveryAgent = new QBluetoothDeviceDiscoveryAgent();
connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered,
this, &BluetoothController::addDevice);
//...
void BluetoothController::addDevice(const QBluetoothDeviceInfo &device)
{
//...
QBluetoothUuid sId = device.serviceIds().front();
//Here is the problem: instead of having sData composed by 6 bytes
//as expected in my test (i.e 0xFF 0x22 0x33 0x00 0x00 0x65),
//sData has size = 3 and has only 0xFF 0x22 0x33
QByteArray sData = device.serviceData(sId);
//...
}