From 5629f4d3e98c34183087a49095a17efd4039fbb8 Mon Sep 17 00:00:00 2001 From: h2zero Date: Wed, 13 Jan 2021 18:21:23 -0700 Subject: [PATCH] Initialize duration member variable in NimBLEAdvertising constructor. m_duration member variable was not set previously which could trigger advertising to start if the host was reset prior to the application calling start. --- src/NimBLEAdvertising.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NimBLEAdvertising.cpp b/src/NimBLEAdvertising.cpp index 894a6c0..b38ed16 100644 --- a/src/NimBLEAdvertising.cpp +++ b/src/NimBLEAdvertising.cpp @@ -63,6 +63,8 @@ NimBLEAdvertising::NimBLEAdvertising() : m_slaveItvl() { m_customScanResponseData = false; m_scanResp = true; m_advDataSet = false; + // Set this to non-zero to prevent auto start if host reset before started by app. + m_duration = BLE_HS_FOREVER; } // NimBLEAdvertising