Release 1.2.0

This commit is contained in:
h2zero 2021-02-08 11:46:11 -07:00
parent 1210772332
commit 7bec9c240a
8 changed files with 88 additions and 57 deletions

View file

@ -2,7 +2,7 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [1.2.0] - 2021-02-08
### Added ### Added
- `NimBLECharacteristic::getDescriptorByHandle`: Return the BLE Descriptor for the given handle. - `NimBLECharacteristic::getDescriptorByHandle`: Return the BLE Descriptor for the given handle.
@ -47,12 +47,16 @@ Overloads to get a vector containing pointers to all the characteristics in a se
- `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. - `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.
### Changed ### Changed
- `nimconfig.h` (Arduino) is now easier to use.
- `NimBLEServer::getServiceByUUID` Now takes an extra parameter of instanceID to support multiple services with the same UUID. - `NimBLEServer::getServiceByUUID` Now takes an extra parameter of instanceID to support multiple services with the same UUID.
- `NimBLEService::getCharacteristic` Now takes an extra parameter of instanceID to support multiple characteristics with the same UUID. - `NimBLEService::getCharacteristic` Now takes an extra parameter of instanceID to support multiple characteristics with the same UUID.
- `NimBLEAdvertising` Transmission power is no longer advertised by default and can be added to the advertisement by calling `NimBLEAdvertising::addTxPower` - `NimBLEAdvertising` Transmission power is no longer advertised by default and can be added to the advertisement by calling `NimBLEAdvertising::addTxPower`
- `NimBLEAdvertising` Custom scan response data can now be used without custom advertisment.
- `NimBLEScan` Now uses the controller duplicate filter. - `NimBLEScan` Now uses the controller duplicate filter.
- `NimBLEAdvertisedDevice` Has been refactored to store the complete advertisement payload and no longer parses the data from each advertisement. - `NimBLEAdvertisedDevice` Has been refactored to store the complete advertisement payload and no longer parses the data from each advertisement.

View file

@ -17,6 +17,7 @@ set(COMPONENT_SRCS
"src/NimBLEDevice.cpp" "src/NimBLEDevice.cpp"
"src/NimBLEEddystoneTLM.cpp" "src/NimBLEEddystoneTLM.cpp"
"src/NimBLEEddystoneURL.cpp" "src/NimBLEEddystoneURL.cpp"
"src/NimBLEHIDDevice.cpp"
"src/NimBLERemoteCharacteristic.cpp" "src/NimBLERemoteCharacteristic.cpp"
"src/NimBLERemoteDescriptor.cpp" "src/NimBLERemoteDescriptor.cpp"
"src/NimBLERemoteService.cpp" "src/NimBLERemoteService.cpp"

View file

@ -1,27 +1,21 @@
# Arduino command line and platformio config options # Arduino command line and platformio config options
`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED` `CONFIG_BT_NIMBLE_MAX_CONNECTIONS`
If defined, NimBLE Client functions will not be included. Sets the number of simultaneous connections (esp controller max is 9)
- Reduces flash size by approx. 7kB. - Default value is 3
<br/> <br/>
`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED` `CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU`
If defined, NimBLE Scan functions will not be included. Sets the default MTU size.
- Reduces flash size by approx. 26kB. - Default value is 255
<br/> <br/>
`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED` `CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME`
If defined NimBLE Server functions will not be included. Set the default device name
- Reduces flash size by approx. 16kB. - Default value is "nimble"
<br/>
`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED`
If defined, NimBLE Advertising functions will not be included.
- Reduces flash size by approx. 5kB.
<br/> <br/>
`CONFIG_BT_NIMBLE_DEBUG` `CONFIG_BT_NIMBLE_DEBUG`
@ -48,28 +42,34 @@ If defined, advertisment types will be printed as text while scanning in debug l
- Uses approx. 250 bytes of flash memory. - Uses approx. 250 bytes of flash memory.
<br/> <br/>
`CONFIG_BT_NIMBLE_PINNED_TO_CORE` `CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE`
Sets the core the NimBLE host stack will run on Set the default appearance.
- Options: 0 or 1 - Default value is 0x00
<br/> <br/>
`CONFIG_BT_NIMBLE_TASK_STACK_SIZE` `CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED`
Set the task stack size for the NimBLE core. If defined, NimBLE Client functions will not be included.
- Default is 4096 - Reduces flash size by approx. 7kB.
<br/> <br/>
`CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL` `CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED`
Sets the NimBLE stack to use external PSRAM will be loaded If defined, NimBLE Scan functions will not be included.
- Must be defined with a value of 1; Default is CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1 - Reduces flash size by approx. 26kB.
<br/> <br/>
`CONFIG_BT_NIMBLE_MAX_CONNECTIONS` `CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED`
Sets the number of simultaneous connections (esp controller max is 9) If defined NimBLE Server functions will not be included.
- Default value is 3 - Reduces flash size by approx. 16kB.
<br/>
`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED`
If defined, NimBLE Advertising functions will not be included.
- Reduces flash size by approx. 5kB.
<br/> <br/>
`CONFIG_BT_NIMBLE_MAX_BONDS` `CONFIG_BT_NIMBLE_MAX_BONDS`
@ -84,9 +84,34 @@ Sets the maximum number of CCCD subscriptions to store
- Default value is 8 - Default value is 8
<br/> <br/>
`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME` `CONFIG_BT_NIMBLE_RPA_TIMEOUT`
Set the default device name Sets the random address refresh time in seconds.
- Default value is "nimble" - Default value is 900
<br/>
`CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT`
Set the number of msys blocks For prepare write & prepare responses. This may need to be increased if
you are sending large blocks of data with a low MTU. E.g: 512 bytes with 23 MTU will fail.
- Default value is 12
<br/>
`CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL`
Sets the NimBLE stack to use external PSRAM will be loaded
- Must be defined with a value of 1; Default is CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
<br/>
`CONFIG_BT_NIMBLE_PINNED_TO_CORE`
Sets the core the NimBLE host stack will run on
- Options: 0 or 1
<br/>
`CONFIG_BT_NIMBLE_TASK_STACK_SIZE`
Set the task stack size for the NimBLE core.
- Default is 4096
<br/> <br/>

View file

@ -38,7 +38,7 @@ PROJECT_NAME = "esp-nimble-cpp / NimBLE-Arduino"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = 1.1.0 PROJECT_NUMBER = 1.2.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

View file

@ -220,10 +220,11 @@ If you wish to advertise these parameters you can still do so manually via `BLEA
<br/> <br/>
Calling `NimBLEAdvertising::setAdvertisementData` will entirely replace any data set with `NimBLEAdvertising::addServiceUUID`, or Calling `NimBLEAdvertising::setAdvertisementData` will entirely replace any data set with `NimBLEAdvertising::addServiceUUID`, or
`NimBLEAdvertising::setAppearance`. You should set all the data you wish to advertise within the `NimBLEAdvertisementData` instead. `NimBLEAdvertising::setAppearance` or similar methods. You should set all the data you wish to advertise within the `NimBLEAdvertisementData` instead.
Calling `NimBLEAdvertising::setScanResponseData` without also calling `NimBLEAdvertising::setAdvertisementData` will have no effect. ~~Calling `NimBLEAdvertising::setScanResponseData` without also calling `NimBLEAdvertising::setAdvertisementData` will have no effect.
When using custom scan response data you must also use custom advertisement data. When using custom scan response data you must also use custom advertisement data.~~
No longer true as of release 1.2.0 and above, custom scan response is now supported without custom advertisement data.
<br/> <br/>
> BLEAdvertising::start (NimBLEAdvertising::start) > BLEAdvertising::start (NimBLEAdvertising::start)

View file

@ -142,7 +142,7 @@ void NimBLEAdvertising::setName(const std::string &name) {
/** /**
* @brief Set the advertised manufacturer data. * @brief Set the advertised manufacturer data.
* @param [in] name The data to advertise. * @param [in] data The data to advertise.
*/ */
void NimBLEAdvertising::setManufacturerData(const std::string &data) { void NimBLEAdvertising::setManufacturerData(const std::string &data) {
m_mfgData.assign(data.begin(), data.end()); m_mfgData.assign(data.begin(), data.end());
@ -154,7 +154,7 @@ void NimBLEAdvertising::setManufacturerData(const std::string &data) {
/** /**
* @brief Set the advertised URI. * @brief Set the advertised URI.
* @param [in] name The URI to advertise. * @param [in] uri The URI to advertise.
*/ */
void NimBLEAdvertising::setURI(const std::string &uri) { void NimBLEAdvertising::setURI(const std::string &uri) {
m_uri.assign(uri.begin(), uri.end()); m_uri.assign(uri.begin(), uri.end());

View file

@ -126,7 +126,7 @@ NimBLEDescriptor* NimBLECharacteristic::getDescriptorByUUID(const NimBLEUUID &uu
/** /**
* @brief Return the BLE Descriptor for the given handle. * @brief Return the BLE Descriptor for the given handle.
* @param [in] uuid The handle of the descriptor. * @param [in] handle The handle of the descriptor.
* @return A pointer to the descriptor object or nullptr if not found. * @return A pointer to the descriptor object or nullptr if not found.
*/ */
NimBLEDescriptor *NimBLECharacteristic::getDescriptorByHandle(uint16_t handle) { NimBLEDescriptor *NimBLECharacteristic::getDescriptorByHandle(uint16_t handle) {

View file

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