diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b05629..a76ef59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [1.2.0] - 2021-02-08 ### Added - `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 - `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 +- `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. - `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. diff --git a/CMakeLists.txt b/CMakeLists.txt index df4576c..650f323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(COMPONENT_SRCS "src/NimBLEDevice.cpp" "src/NimBLEEddystoneTLM.cpp" "src/NimBLEEddystoneURL.cpp" + "src/NimBLEHIDDevice.cpp" "src/NimBLERemoteCharacteristic.cpp" "src/NimBLERemoteDescriptor.cpp" "src/NimBLERemoteService.cpp" diff --git a/docs/Command_line_config.md b/docs/Command_line_config.md index b6ab72f..c22565f 100644 --- a/docs/Command_line_config.md +++ b/docs/Command_line_config.md @@ -1,27 +1,21 @@ # Arduino command line and platformio config options -`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED` - - If defined, NimBLE Client functions will not be included. -- Reduces flash size by approx. 7kB. +`CONFIG_BT_NIMBLE_MAX_CONNECTIONS` + +Sets the number of simultaneous connections (esp controller max is 9) +- Default value is 3
-`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED` +`CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU` -If defined, NimBLE Scan functions will not be included. -- Reduces flash size by approx. 26kB. +Sets the default MTU size. +- Default value is 255
-`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED` +`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME` -If defined NimBLE Server functions will not be included. -- Reduces flash size by approx. 16kB. -
- -`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED` - -If defined, NimBLE Advertising functions will not be included. -- Reduces flash size by approx. 5kB. +Set the default device name +- Default value is "nimble"
`CONFIG_BT_NIMBLE_DEBUG` @@ -48,6 +42,67 @@ If defined, advertisment types will be printed as text while scanning in debug l - Uses approx. 250 bytes of flash memory.
+`CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE` + +Set the default appearance. +- Default value is 0x00 +
+ +`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED` + +If defined, NimBLE Client functions will not be included. +- Reduces flash size by approx. 7kB. +
+ +`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED` + +If defined, NimBLE Scan functions will not be included. +- Reduces flash size by approx. 26kB. +
+ +`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED` + +If defined NimBLE Server functions will not be included. +- Reduces flash size by approx. 16kB. +
+ +`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED` + +If defined, NimBLE Advertising functions will not be included. +- Reduces flash size by approx. 5kB. +
+ +`CONFIG_BT_NIMBLE_MAX_BONDS` + +Sets the number of devices allowed to store/bond with +- Default value is 3 +
+ +`CONFIG_BT_NIMBLE_MAX_CCCDS` + +Sets the maximum number of CCCD subscriptions to store +- Default value is 8 +
+ +`CONFIG_BT_NIMBLE_RPA_TIMEOUT` + +Sets the random address refresh time in seconds. +- Default value is 900 +
+ +`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 +
+ +`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 +
+ `CONFIG_BT_NIMBLE_PINNED_TO_CORE` Sets the core the NimBLE host stack will run on @@ -56,37 +111,7 @@ Sets the core the NimBLE host stack will run on `CONFIG_BT_NIMBLE_TASK_STACK_SIZE` -Set the task stack size for the NimBLE core. +Set the task stack size for the NimBLE core. - Default is 4096
-`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 -
- -`CONFIG_BT_NIMBLE_MAX_CONNECTIONS` - -Sets the number of simultaneous connections (esp controller max is 9) -- Default value is 3 -
- -`CONFIG_BT_NIMBLE_MAX_BONDS` - -Sets the number of devices allowed to store/bond with -- Default value is 3 -
- -`CONFIG_BT_NIMBLE_MAX_CCCDS` - -Sets the maximum number of CCCD subscriptions to store -- Default value is 8 -
- -`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME` - -Set the default device name -- Default value is "nimble" -
- diff --git a/docs/Doxyfile b/docs/Doxyfile index bf43050..25b457c 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "esp-nimble-cpp / NimBLE-Arduino" # could be handy for archiving the generated documentation or if some version # 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 # for a project that appears at the top of each page and should give viewer a diff --git a/docs/Migration_guide.md b/docs/Migration_guide.md index ca11884..59854e5 100644 --- a/docs/Migration_guide.md +++ b/docs/Migration_guide.md @@ -220,10 +220,11 @@ If you wish to advertise these parameters you can still do so manually via `BLEA
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. -When using custom scan response data you must also use custom advertisement data. +~~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.~~ +No longer true as of release 1.2.0 and above, custom scan response is now supported without custom advertisement data.
> BLEAdvertising::start (NimBLEAdvertising::start) diff --git a/src/NimBLEAdvertising.cpp b/src/NimBLEAdvertising.cpp index 08493d1..3e9ae4a 100644 --- a/src/NimBLEAdvertising.cpp +++ b/src/NimBLEAdvertising.cpp @@ -142,7 +142,7 @@ void NimBLEAdvertising::setName(const std::string &name) { /** * @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) { m_mfgData.assign(data.begin(), data.end()); @@ -154,7 +154,7 @@ void NimBLEAdvertising::setManufacturerData(const std::string &data) { /** * @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) { m_uri.assign(uri.begin(), uri.end()); diff --git a/src/NimBLECharacteristic.cpp b/src/NimBLECharacteristic.cpp index c820b2b..0ffa9fb 100644 --- a/src/NimBLECharacteristic.cpp +++ b/src/NimBLECharacteristic.cpp @@ -126,7 +126,7 @@ NimBLEDescriptor* NimBLECharacteristic::getDescriptorByUUID(const NimBLEUUID &uu /** * @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. */ NimBLEDescriptor *NimBLECharacteristic::getDescriptorByHandle(uint16_t handle) { diff --git a/src/NimBLEDevice.cpp b/src/NimBLEDevice.cpp index a90f929..dc9caf3 100644 --- a/src/NimBLEDevice.cpp +++ b/src/NimBLEDevice.cpp @@ -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 * 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.