diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-03-01 11:07:03 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-03-04 10:06:47 +0000 |
commit | 5aad7c5de78c4768ee5c731f4a1dc686dbc3abd5 (patch) | |
tree | 6ea280fb73ca1f8f29f4937c260d8d0e4e4c6adc | |
parent | 5237ff0cb86a713845019ffd98d6066af00f71f7 (diff) |
BLE: Write the whole 31 bytes of advertising data to the controller.v5.7.0-alpha1
The specification says: "Only the significant part of the Advertising
Data is transmitted in the advertising packets". This seems to refer to
the data that is actually sent by the hardware and not to the data used
in the HCI command, as our original implementation assumed. At least
there seem to be controllers who won't accept such "short" packets.
Change-Id: I732cfc1e05fc135fd336d832e725d969c98b60cf
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r-- | src/bluetooth/qleadvertiser_bluez.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bluetooth/qleadvertiser_bluez.cpp b/src/bluetooth/qleadvertiser_bluez.cpp index d4494bc0..52f4dd73 100644 --- a/src/bluetooth/qleadvertiser_bluez.cpp +++ b/src/bluetooth/qleadvertiser_bluez.cpp @@ -353,7 +353,9 @@ void QLeAdvertiserBluez::setData(bool isScanResponseData) setManufacturerData(sourceData, theData); } - const QByteArray dataToSend = byteArrayFromStruct(theData, 1 + theData.length); + std::memset(theData.data + theData.length, 0, sizeof theData.data - theData.length); + const QByteArray dataToSend = byteArrayFromStruct(theData); + if (!isScanResponseData) { qCDebug(QT_BT_BLUEZ) << "advertising data:" << dataToSend.toHex(); queueCommand(OcfLeSetAdvData, dataToSend); |