diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-05-18 10:38:52 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-05-18 09:38:37 +0000 |
commit | 014df77d92fb0070b2d95b9747a1a988e654355f (patch) | |
tree | d40b587d6323404ce92f6652b64ec33127e0fd80 /src | |
parent | 2011b61dcb93fe0069869eb558a15db22c2845b0 (diff) |
Zero out the advertising parameters data before setting the fields.
While I did not find anything in the spec that requires unused fields to
be zero, some controllers seem to require that.
Task-number: QTBUG-53224
Change-Id: I5ab05a6689f2632a1d60ee0f259cbdd792467729
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qleadvertiser_bluez.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bluetooth/qleadvertiser_bluez.cpp b/src/bluetooth/qleadvertiser_bluez.cpp index 52f4dd73..c1b38acb 100644 --- a/src/bluetooth/qleadvertiser_bluez.cpp +++ b/src/bluetooth/qleadvertiser_bluez.cpp @@ -162,6 +162,8 @@ void QLeAdvertiserBluez::setAdvertisingParams() // Spec v4.2, Vol 2, Part E, 7.8.5 AdvParams params; static_assert(sizeof params == 15, "unexpected struct size"); + using namespace std; + memset(¶ms, 0, sizeof params); setAdvertisingInterval(params); params.type = parameters().mode(); params.filterPolicy = parameters().filterPolicy(); |