Discussion:
[Interest] Qt5.7 BLE advertising, contents added twice
Marco Trapanese
2016-08-26 13:00:21 UTC
Permalink
Hello!
With Qt5.7 under Linux Debian (kernel 4.4.11-v7+, bluez 5.40) I set up
my own GATT server.
QLowEnergyAdvertisingData advertisingData;
advertisingData.setDiscoverability(QLowEnergyAdvertisingData::DiscoverabilityGeneral);
advertisingData.setIncludePowerLevel(false);
advertisingData.setLocalName("0123456789");
leController->startAdvertising(QLowEnergyAdvertisingParameters(),
advertisingData, QLowEnergyAdvertisingData());
advertisingData.setServices(QList<QBluetoothUuid>() << [my-128-bit-uuid]);
qt.bluetooth.bluez: services data does not fit into advertising data
packet
inspecting the advertising data with the Android app from Nordic, I see
the LocalName is set 2 times! And I can't see my uuid.
Is this the correct behavior? Am I missing something?

Thanks!
Marco
Christian Kandeler
2016-08-26 15:39:29 UTC
Permalink
Post by Marco Trapanese
With Qt5.7 under Linux Debian (kernel 4.4.11-v7+, bluez 5.40) I set up
my own GATT server.
QLowEnergyAdvertisingData advertisingData;
As explained in the documentation of this class, advertising data is a
scarce resource: There are only 31 bytes available in such a packet.
Post by Marco Trapanese
advertisingData.setDiscoverability(QLowEnergyAdvertisingData::DiscoverabilityGeneral);
This information takes one byte plus two bytes of meta data. You have 28
bytes left.
Post by Marco Trapanese
advertisingData.setLocalName("0123456789");
This information takes 10 bytes plus two bytes of meta data. You have 16
bytes left.
Post by Marco Trapanese
advertisingData.setServices(QList<QBluetoothUuid>() <<
[my-128-bit-uuid]);

This information takes 16 bytes plus two bytes of meta data. You would
Post by Marco Trapanese
qt.bluetooth.bluez: services data does not fit into advertising data
packet
is correct.
Post by Marco Trapanese
inspecting the advertising data with the Android app from Nordic, I see
the LocalName is set 2 times!
Nah, whatever you see there is just an artifact of whatever the client
app does.
Post by Marco Trapanese
And I can't see my uuid.
Obviously not, as it could not be added on the server side.
Post by Marco Trapanese
Is this the correct behavior? Am I missing something?
Yes, it is. You need to shorten the local name to eight bytes or less.


Christian
Marco Trapanese
2016-08-27 12:19:39 UTC
Permalink
_______________________________________________
Interest mailing list
***@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Loading...