Skip to content

Commit d18018f

Browse files
committed
Release 1.2.0
1 parent 4e4197b commit d18018f

File tree

9 files changed

+88
-63
lines changed

9 files changed

+88
-63
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [Unreleased]
5+
## [1.2.0] - 2021-02-08
66

77
### Added
88
- `NimBLECharacteristic::getDescriptorByHandle`: Return the BLE Descriptor for the given handle.
@@ -47,11 +47,15 @@ Overloads to get a vector containing pointers to all the characteristics in a se
4747
- `haveTargetAddress/getTargetAddressCount/getTargetAddress(index)`: checks if a target address is present / gets a count of the addresses targeted / gets the address of the target at index.
4848

4949
### Changed
50+
- `nimconfig.h` (Arduino) is now easier to use.
51+
5052
- `NimBLEServer::getServiceByUUID` Now takes an extra parameter of instanceID to support multiple services with the same UUID.
5153

5254
- `NimBLEService::getCharacteristic` Now takes an extra parameter of instanceID to support multiple characteristics with the same UUID.
5355

54-
- `NimBLEAdvertising` Transmission power is no longer advertised by default and can be added to the advertisement by calling `NimBLEAdvertising::addTxPower`
56+
- `NimBLEAdvertising` Transmission power is no longer advertised by default and can be added to the advertisement by calling `NimBLEAdvertising::addTxPower`
57+
58+
- `NimBLEAdvertising` Custom scan response data can now be used without custom advertisment.
5559

5660
- `NimBLEScan` Now uses the controller duplicate filter.
5761

docs/Command_line_config.md

Lines changed: 72 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,117 @@
11
# Arduino command line and platformio config options
22

3-
`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED`
4-
5-
If defined, NimBLE Client functions will not be included.
6-
- Reduces flash size by approx. 7kB.
7-
<br>
8-
9-
`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED`
3+
`CONFIG_BT_NIMBLE_MAX_CONNECTIONS`
104

11-
If defined, NimBLE Scan functions will not be included.
12-
- Reduces flash size by approx. 26kB.
13-
<br>
5+
Sets the number of simultaneous connections (esp controller max is 9)
6+
- Default value is 3
7+
<br/>
148

15-
`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED`
9+
`CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU`
1610

17-
If defined NimBLE Server functions will not be included.
18-
- Reduces flash size by approx. 16kB.
19-
<br>
11+
Sets the default MTU size.
12+
- Default value is 255
13+
<br/>
2014

21-
`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED`
15+
`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME`
2216

23-
If defined, NimBLE Advertising functions will not be included.
24-
- Reduces flash size by approx. 5kB.
25-
<br>
17+
Set the default device name
18+
- Default value is "nimble"
19+
<br/>
2620

2721
`CONFIG_BT_NIMBLE_DEBUG`
2822

2923
If defined, enables debug log messages from the NimBLE host
3024
- Uses approx. 32kB of flash memory.
31-
<br>
25+
<br/>
3226

3327
`CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT`
3428

3529
If defined, NimBLE host return codes will be printed as text in debug log messages.
3630
- Uses approx. 7kB of flash memory.
37-
<br>
31+
<br/>
3832

3933
`CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT`
4034

4135
If defined, GAP event codes will be printed as text in debug log messages.
4236
- Uses approx. 1kB of flash memory.
43-
<br>
37+
<br/>
4438

4539
`CONFIG_NIMBLE_CPP_ENABLE_ADVERTISMENT_TYPE_TEXT`
4640

4741
If defined, advertisment types will be printed as text while scanning in debug log messages.
4842
- Uses approx. 250 bytes of flash memory.
49-
<br>
43+
<br/>
5044

51-
`CONFIG_BT_NIMBLE_PINNED_TO_CORE`
45+
`CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE`
5246

53-
Sets the core the NimBLE host stack will run on
54-
- Options: 0 or 1
55-
<br>
47+
Set the default appearance.
48+
- Default value is 0x00
49+
<br/>
5650

57-
`CONFIG_BT_NIMBLE_TASK_STACK_SIZE`
51+
`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED`
52+
53+
If defined, NimBLE Client functions will not be included.
54+
- Reduces flash size by approx. 7kB.
55+
<br/>
5856

59-
Set the task stack size for the NimBLE core.
60-
- Default is 4096
61-
<br>
57+
`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED`
6258

59+
If defined, NimBLE Scan functions will not be included.
60+
- Reduces flash size by approx. 26kB.
61+
<br/>
6362

64-
`CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL`
63+
`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED`
6564

66-
Sets the NimBLE stack to use external PSRAM will be loaded
67-
- Must be defined with a value of 1; Default is CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
68-
<br>
65+
If defined NimBLE Server functions will not be included.
66+
- Reduces flash size by approx. 16kB.
67+
<br/>
6968

70-
`CONFIG_BT_NIMBLE_MAX_CONNECTIONS`
69+
`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED`
7170

72-
Sets the number of simultaneous connections (esp controller max is 9)
73-
- Default value is 3
74-
<br>
75-
76-
`CONFIG_BT_NIMBLE_MAX_BONDS`
71+
If defined, NimBLE Advertising functions will not be included.
72+
- Reduces flash size by approx. 5kB.
73+
<br/>
74+
75+
`CONFIG_BT_NIMBLE_MAX_BONDS`
7776

7877
Sets the number of devices allowed to store/bond with
7978
- Default value is 3
80-
<br>
79+
<br/>
8180

82-
`CONFIG_BT_NIMBLE_MAX_CCCDS`
81+
`CONFIG_BT_NIMBLE_MAX_CCCDS`
8382

8483
Sets the maximum number of CCCD subscriptions to store
8584
- Default value is 8
86-
<br>
87-
88-
`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME`
85+
<br/>
8986

90-
Set the default device name
91-
- Default value is "nimble"
92-
<br>
87+
`CONFIG_BT_NIMBLE_RPA_TIMEOUT`
88+
89+
Sets the random address refresh time in seconds.
90+
- Default value is 900
91+
<br/>
92+
93+
`CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT`
94+
95+
Set the number of msys blocks For prepare write & prepare responses. This may need to be increased if
96+
you are sending large blocks of data with a low MTU. E.g: 512 bytes with 23 MTU will fail.
97+
- Default value is 12
98+
<br/>
99+
100+
`CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL`
101+
102+
Sets the NimBLE stack to use external PSRAM will be loaded
103+
- Must be defined with a value of 1; Default is CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
104+
<br/>
105+
106+
`CONFIG_BT_NIMBLE_PINNED_TO_CORE`
107+
108+
Sets the core the NimBLE host stack will run on
109+
- Options: 0 or 1
110+
<br/>
111+
112+
`CONFIG_BT_NIMBLE_TASK_STACK_SIZE`
113+
114+
Set the task stack size for the NimBLE core.
115+
- Default is 4096
116+
<br/>
93117

docs/Migration_guide.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ If you wish to advertise these parameters you can still do so manually via `BLEA
220220
<br/>
221221

222222
Calling `NimBLEAdvertising::setAdvertisementData` will entirely replace any data set with `NimBLEAdvertising::addServiceUUID`, or
223-
`NimBLEAdvertising::setAppearance`. You should set all the data you wish to advertise within the `NimBLEAdvertisementData` instead.
223+
`NimBLEAdvertising::setAppearance` or similar methods. You should set all the data you wish to advertise within the `NimBLEAdvertisementData` instead.
224224

225-
Calling `NimBLEAdvertising::setScanResponseData` without also calling `NimBLEAdvertising::setAdvertisementData` will have no effect.
226-
When using custom scan response data you must also use custom advertisement data.
225+
~~Calling `NimBLEAdvertising::setScanResponseData` without also calling `NimBLEAdvertising::setAdvertisementData` will have no effect.
226+
When using custom scan response data you must also use custom advertisement data.~~
227+
No longer true as of release 1.2.0 and above, custom scan response is now supported without custom advertisement data.
227228
<br/>
228229

229230
> BLEAdvertising::start (NimBLEAdvertising::start)

examples/NimBLE_Service_Data_Advertiser/NimBLE_Service_Data_Advertiser.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ void loop() {
3030
Serial.printf("Advertising count = %d\n", count);
3131
count++;
3232
delay(5000);
33-
}
33+
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=NimBLE-Arduino
2-
version=1.1.0
2+
version=1.2.0
33
author=h2zero
44
maintainer=h2zero <[email protected]>
55
sentence=Bluetooth low energy (BLE) library for arduino-esp32 based on NimBLE.

src/NimBLEAdvertising.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void NimBLEAdvertising::setName(const std::string &name) {
142142

143143
/**
144144
* @brief Set the advertised manufacturer data.
145-
* @param [in] name The data to advertise.
145+
* @param [in] data The data to advertise.
146146
*/
147147
void NimBLEAdvertising::setManufacturerData(const std::string &data) {
148148
m_mfgData.assign(data.begin(), data.end());
@@ -154,7 +154,7 @@ void NimBLEAdvertising::setManufacturerData(const std::string &data) {
154154

155155
/**
156156
* @brief Set the advertised URI.
157-
* @param [in] name The URI to advertise.
157+
* @param [in] uri The URI to advertise.
158158
*/
159159
void NimBLEAdvertising::setURI(const std::string &uri) {
160160
m_uri.assign(uri.begin(), uri.end());

src/NimBLECharacteristic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ NimBLEDescriptor* NimBLECharacteristic::getDescriptorByUUID(const NimBLEUUID &uu
126126

127127
/**
128128
* @brief Return the BLE Descriptor for the given handle.
129-
* @param [in] uuid The handle of the descriptor.
129+
* @param [in] handle The handle of the descriptor.
130130
* @return A pointer to the descriptor object or nullptr if not found.
131131
*/
132132
NimBLEDescriptor *NimBLECharacteristic::getDescriptorByHandle(uint16_t handle) {

src/NimBLEDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ void NimBLEDevice::stopAdvertising() {
403403

404404

405405
/**
406-
* @brief Set the duplicate filter mode for filtering scanned devices.
406+
* @brief Set the duplicate filter cache size for filtering scanned devices.
407407
* @param [in] cacheSize The number of advertisements filtered before the cache is reset.\n
408408
* Range is 10-1000, a larger value will reduce how often the same devices are reported.
409409
* @details Must only be called before calling NimBLEDevice::init.

src/esp-hci/src/esp_nimble_hci.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,6 @@ esp_err_t esp_nimble_hci_and_controller_init(void)
523523
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
524524

525525
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
526-
/* Added to ensure BLE only mode */
527-
bt_cfg.mode = ESP_BT_MODE_BLE;
528-
/* Added to set max connections from nimconfig */
529-
bt_cfg.ble_max_conn = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
530526

531527
if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) {
532528
return ret;

0 commit comments

Comments
 (0)