@@ -178,6 +178,9 @@ void NimBLEAdvertising::setScanFilter(bool scanRequestWhitelistOnly, bool connec
178178/* *
179179 * @brief Set the advertisement data that is to be published in a regular advertisement.
180180 * @param [in] advertisementData The data to be advertised.
181+ * @details The use of this function will replace any data set with addServiceUUID\n
182+ * or setAppearance. If you wish for these to be advertised you must include them\n
183+ * in the advertisementData parameter sent.
181184 */
182185
183186void NimBLEAdvertising::setAdvertisementData (NimBLEAdvertisementData& advertisementData) {
@@ -196,6 +199,8 @@ void NimBLEAdvertising::setAdvertisementData(NimBLEAdvertisementData& advertisem
196199/* *
197200 * @brief Set the advertisement data that is to be published in a scan response.
198201 * @param [in] advertisementData The data to be advertised.
202+ * @details Calling this without also using setAdvertisementData will have no effect.\n
203+ * When using custom scan response data you must also use custom advertisement data.
199204 */
200205void NimBLEAdvertising::setScanResponseData (NimBLEAdvertisementData& advertisementData) {
201206 NIMBLE_LOGD (LOG_TAG, " >> setScanResponseData" );
@@ -227,11 +232,6 @@ void NimBLEAdvertising::start() {
227232 if (pServer != nullptr ) {
228233 if (!pServer->m_gattsStarted ){
229234 pServer->start ();
230- // When the server instance is created it resets GATT which
231- // seems to put the controller in a sleep loop? This causes a delay when
232- // advertising is started the first time. To avoid this we call ble_gap_adv_stop
233- // to get the controller ready.
234- ble_gap_adv_stop ();
235235 } else if (pServer->getConnectedCount () >= NIMBLE_MAX_CONNECTIONS) {
236236 NIMBLE_LOGW (LOG_TAG, " Max connections reached - not advertising" );
237237 return ;
0 commit comments