Skip to content

Commit 1a52245

Browse files
committed
Update documentation.
* typo fix
1 parent 8add6e8 commit 1a52245

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

docs/Migration_guide.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,19 @@ This can be changed to use passkey authentication or numeric comparison. See [Se
209209

210210
<a name="advertising-api"></a>
211211
## Advertising API
212-
Advertising works the same as the original API except with the removal of:
212+
Advertising works the same as the original API except:
213213
> BLEAdvertising::setMinPreferred
214214
> BLEAdvertising::setMaxPreferred
215215
216216
These methods were found to not provide useful functionality and consumed valuable advertising space (6 bytes of 31) if used unknowingly.
217-
If you wish to advertise these parameters you can still do so manually via `NimBLEAdvertisementData::addData`.
217+
If you wish to advertise these parameters you can still do so manually via `BLEAdvertisementData::addData` (`NimBLEAdvertisementData::addData`).
218+
<br/>
219+
220+
Calling `NimBLEAdvertising::setAdvertisementData` will entirely replace any data set with `NimBLEAdvertising::addServiceUUID`, or
221+
`NimBLEAdvertising::setAppearance`. You should set all the data you wish to advertise within the `NimBLEAdvertisementData` instead.
222+
223+
Calling `NimBLEAdvertising::setScanResponseData` without also calling `NimBLEAdvertising::setAdvertisementData` will have no effect.
224+
When using custom scan response data you must also use custom advertisement data.
218225
<br/>
219226

220227
<a name="client-api"></a>

src/NimBLEAdvertising.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

183186
void 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
*/
200205
void 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;

src/NimBLEAdvertising.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class NimBLEAdvertising {
8484
void setMaxInterval(uint16_t maxinterval);
8585
void setMinInterval(uint16_t mininterval);
8686
void setAdvertisementData(NimBLEAdvertisementData& advertisementData);
87-
void setScanFilter(bool scanRequertWhitelistOnly, bool connectWhitelistOnly);
87+
void setScanFilter(bool scanRequestWhitelistOnly, bool connectWhitelistOnly);
8888
void setScanResponseData(NimBLEAdvertisementData& advertisementData);
8989
void setScanResponse(bool);
9090

src/nimconfig.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,7 @@
101101
*/
102102
#define CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
103103

104-
/**
105-
* @brief Sets the number of simultaneous connections (esp controller max is 9)
106-
* @details To increase max connections in Arduino it is also required to change the
107-
* controller max connections defined in sdkconfig.h.\n
108-
*
109-
* This is located in your Arduino/hardware/espressif/esp32/tools/sdk/include/config folder.\n\n
110-
*
111-
* The values in sdkconfig.h you will need to change are:\n\n
112-
* `CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN 3`\n
113-
* `CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3`
114-
*/
104+
/** @brief Sets the number of simultaneous connections (esp controller max is 9) */
115105
#define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 3
116106

117107
/** @brief Sets the number of devices allowed to store/bond with */

0 commit comments

Comments
 (0)