mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-04-17 07:05:50 +02:00
Compare commits
18 Commits
err-on-blo
...
release/2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec5600d40b | ||
|
|
bc3e342046 | ||
|
|
865ec9f760 | ||
|
|
e2de3f6268 | ||
|
|
bdb86274c9 | ||
|
|
8aa824ef32 | ||
|
|
cc7f97a37d | ||
|
|
8723121ff9 | ||
|
|
90b721ed55 | ||
|
|
d1ef98a4c8 | ||
|
|
70eee888eb | ||
|
|
80b61ffa3d | ||
|
|
ee895d386e | ||
|
|
5add3442e9 | ||
|
|
aea55ccda2 | ||
|
|
83e9919457 | ||
|
|
edeaf3977a | ||
|
|
4e80e1ee38 |
38
CHANGELOG.md
38
CHANGELOG.md
@@ -1,6 +1,44 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [2.2.1] 2025-02-28
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Added back `NimBLEClient::connect` overload with `NimBLEAdvertisedDevice` parameter to resolve connection error due to NULL address.
|
||||||
|
- Crash caused by returning invalid vector entry when retrieving remote descriptors.
|
||||||
|
|
||||||
|
## [2.2.0] 2025-02-24
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Crash when calling `NimBLEClient::DiscoverAttributes`.
|
||||||
|
|
||||||
|
## Added
|
||||||
|
- Conditional macros for logging.
|
||||||
|
- `NimBLEDeviceCallbacks` class with a callback for handling bond storage.
|
||||||
|
|
||||||
|
## [2.1.1] 2025-01-26
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- remote descriptor discovery error when no descriptors exist.
|
||||||
|
- scan filter settings not enabled for esp32s3/c3.
|
||||||
|
- remote descriptor discovery returning more than the desired descriptor.
|
||||||
|
|
||||||
|
## [2.1.0] 2025-01-12
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Crash when retrieving descriptors if more than one exists.
|
||||||
|
- Incorrect TX power value being advertised.
|
||||||
|
- New user guide code for 2.x
|
||||||
|
- Potential race condition if `NimBLEScan::clearResults1 is called from multiple tasks.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- If privacy is not enabled identity keys will not be shared.
|
||||||
|
- `NimBLEDevice::setPower` and `NimBLEDevice::getPower` now take an additional parameter `NimBLETxPowerType` to set/get the power level for different operations.
|
||||||
|
|
||||||
|
## Added
|
||||||
|
- Config option `CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER`, if defined will remove the ":" delimiter from the BLE address string.
|
||||||
|
- Config option `CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE` if defined will make the BLE address strings uppercase.
|
||||||
|
|
||||||
## [2.0.3] 2025-01-05
|
## [2.0.3] 2025-01-05
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|||||||
2
NOTICE
2
NOTICE
@@ -1,6 +1,6 @@
|
|||||||
esp-nimble-cpp
|
esp-nimble-cpp
|
||||||
NimBLE-Arduino
|
NimBLE-Arduino
|
||||||
Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
esp-nimble-cpp, NimBLE-Arduino contributors.
|
esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
|
|
||||||
The Initial Developer of some parts of this library, which are copied from,
|
The Initial Developer of some parts of this library, which are copied from,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ PROJECT_NAME = esp-nimble-cpp
|
|||||||
# 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 = 2.0.3
|
PROJECT_NUMBER = 2.2.1
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
## IDF Component Manager Manifest File
|
## IDF Component Manager Manifest File
|
||||||
version: "2.0.3"
|
version: "2.2.1"
|
||||||
license: "Apache-2.0"
|
license: "Apache-2.0"
|
||||||
description: "C++ wrapper for the NimBLE BLE stack"
|
description: "C++ wrapper for the NimBLE BLE stack"
|
||||||
url: "https://github.com/h2zero/esp-nimble-cpp"
|
url: "https://github.com/h2zero/esp-nimble-cpp"
|
||||||
@@ -16,7 +16,7 @@ dependencies:
|
|||||||
rules:
|
rules:
|
||||||
- if: "target in [esp32p4]"
|
- if: "target in [esp32p4]"
|
||||||
espressif/esp_wifi_remote:
|
espressif/esp_wifi_remote:
|
||||||
version: "*"
|
version: "<0.5.4"
|
||||||
rules:
|
rules:
|
||||||
- if: "target in [esp32p4]"
|
- if: "target in [esp32p4]"
|
||||||
idf:
|
idf:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "esp-nimble-cpp",
|
"name": "esp-nimble-cpp",
|
||||||
"version": "2.0.3",
|
"version": "2.2.1",
|
||||||
"description": "C++ wrapper for the NimBLE BLE stack",
|
"description": "C++ wrapper for the NimBLE BLE stack",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"BLE",
|
"BLE",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -68,7 +68,7 @@ class NimBLE2904 : public NimBLEDescriptor {
|
|||||||
static const uint8_t FORMAT_OPAQUE = 27;
|
static const uint8_t FORMAT_OPAQUE = 27;
|
||||||
static const uint8_t FORMAT_MEDASN1 = 28;
|
static const uint8_t FORMAT_MEDASN1 = 28;
|
||||||
|
|
||||||
void setDescription(uint16_t);
|
void setDescription(uint16_t description);
|
||||||
void setExponent(int8_t exponent);
|
void setExponent(int8_t exponent);
|
||||||
void setFormat(uint8_t format);
|
void setFormat(uint8_t format);
|
||||||
void setNamespace(uint8_t namespace_value);
|
void setNamespace(uint8_t namespace_value);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -780,6 +780,16 @@ bool NimBLEAdvertisedDevice::isLegacyAdvertisement() const {
|
|||||||
# endif
|
# endif
|
||||||
} // isLegacyAdvertisement
|
} // isLegacyAdvertisement
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Convenience operator to convert this NimBLEAdvertisedDevice to NimBLEAddress representation.
|
||||||
|
* @details This allows passing NimBLEAdvertisedDevice to functions
|
||||||
|
* that accept NimBLEAddress and/or or it's methods as a parameter.
|
||||||
|
*/
|
||||||
|
NimBLEAdvertisedDevice::operator NimBLEAddress() const {
|
||||||
|
NimBLEAddress address(getAddress());
|
||||||
|
return address;
|
||||||
|
} // operator NimBLEAddress
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the payload advertised by the device.
|
* @brief Get the payload advertised by the device.
|
||||||
* @return The advertisement payload.
|
* @return The advertisement payload.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -93,6 +93,7 @@ class NimBLEAdvertisedDevice {
|
|||||||
uint8_t getSecondaryPhy() const;
|
uint8_t getSecondaryPhy() const;
|
||||||
uint16_t getPeriodicInterval() const;
|
uint16_t getPeriodicInterval() const;
|
||||||
# endif
|
# endif
|
||||||
|
operator NimBLEAddress() const;
|
||||||
|
|
||||||
const std::vector<uint8_t>& getPayload() const;
|
const std::vector<uint8_t>& getPayload() const;
|
||||||
const std::vector<uint8_t>::const_iterator begin() const;
|
const std::vector<uint8_t>::const_iterator begin() const;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -38,7 +38,7 @@ class NimBLEAdvertisementData {
|
|||||||
bool addData(const uint8_t* data, size_t length);
|
bool addData(const uint8_t* data, size_t length);
|
||||||
bool addData(const std::vector<uint8_t>& data);
|
bool addData(const std::vector<uint8_t>& data);
|
||||||
bool setAppearance(uint16_t appearance);
|
bool setAppearance(uint16_t appearance);
|
||||||
bool setFlags(uint8_t);
|
bool setFlags(uint8_t flag);
|
||||||
bool addTxPower();
|
bool addTxPower();
|
||||||
bool setPreferredParams(uint16_t minInterval, uint16_t maxInterval);
|
bool setPreferredParams(uint16_t minInterval, uint16_t maxInterval);
|
||||||
bool addServiceUUID(const NimBLEUUID& serviceUUID);
|
bool addServiceUUID(const NimBLEUUID& serviceUUID);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -126,6 +126,22 @@ size_t NimBLEClient::deleteService(const NimBLEUUID& uuid) {
|
|||||||
return m_svcVec.size();
|
return m_svcVec.size();
|
||||||
} // deleteService
|
} // deleteService
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Connect to an advertising device.
|
||||||
|
* @param [in] pDevice A pointer to the advertised device instance to connect to.
|
||||||
|
* @param [in] deleteAttributes If true this will delete any attribute objects this client may already\n
|
||||||
|
* have created when last connected.
|
||||||
|
* @param [in] asyncConnect If true, the connection will be made asynchronously and this function will return immediately.\n
|
||||||
|
* If false, this function will block until the connection is established or the connection attempt times out.
|
||||||
|
* @param [in] exchangeMTU If true, the client will attempt to exchange MTU with the server after connection.\n
|
||||||
|
* If false, the client will use the default MTU size and the application will need to call exchangeMTU() later.
|
||||||
|
* @return true on success.
|
||||||
|
*/
|
||||||
|
bool NimBLEClient::connect(const NimBLEAdvertisedDevice* pDevice, bool deleteAttributes, bool asyncConnect, bool exchangeMTU) {
|
||||||
|
NimBLEAddress address(pDevice->getAddress());
|
||||||
|
return connect(address, deleteAttributes, asyncConnect, exchangeMTU);
|
||||||
|
} // connect
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Connect to the BLE Server using the address of the last connected device, or the address\n
|
* @brief Connect to the BLE Server using the address of the last connected device, or the address\n
|
||||||
* passed to the constructor.
|
* passed to the constructor.
|
||||||
@@ -141,22 +157,6 @@ bool NimBLEClient::connect(bool deleteAttributes, bool asyncConnect, bool exchan
|
|||||||
return connect(m_peerAddress, deleteAttributes, asyncConnect, exchangeMTU);
|
return connect(m_peerAddress, deleteAttributes, asyncConnect, exchangeMTU);
|
||||||
} // connect
|
} // connect
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Connect to an advertising device.
|
|
||||||
* @param [in] device The device to connect to.
|
|
||||||
* @param [in] deleteAttributes If true this will delete any attribute objects this client may already\n
|
|
||||||
* have created when last connected.
|
|
||||||
* @param [in] asyncConnect If true, the connection will be made asynchronously and this function will return immediately.\n
|
|
||||||
* If false, this function will block until the connection is established or the connection attempt times out.
|
|
||||||
* @param [in] exchangeMTU If true, the client will attempt to exchange MTU with the server after connection.\n
|
|
||||||
* If false, the client will use the default MTU size and the application will need to call exchangeMTU() later.
|
|
||||||
* @return true on success.
|
|
||||||
*/
|
|
||||||
bool NimBLEClient::connect(const NimBLEAdvertisedDevice* device, bool deleteAttributes, bool asyncConnect, bool exchangeMTU) {
|
|
||||||
NimBLEAddress address(device->getAddress());
|
|
||||||
return connect(address, deleteAttributes, asyncConnect, exchangeMTU);
|
|
||||||
} // connect
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Connect to a BLE Server by address.
|
* @brief Connect to a BLE Server by address.
|
||||||
* @param [in] address The address of the server.
|
* @param [in] address The address of the server.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -76,6 +76,9 @@ extern "C" void ble_store_config_init(void);
|
|||||||
/**
|
/**
|
||||||
* Singletons for the NimBLEDevice.
|
* Singletons for the NimBLEDevice.
|
||||||
*/
|
*/
|
||||||
|
NimBLEDeviceCallbacks NimBLEDevice::defaultDeviceCallbacks{};
|
||||||
|
NimBLEDeviceCallbacks* NimBLEDevice::m_pDeviceCallbacks = &defaultDeviceCallbacks;
|
||||||
|
|
||||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||||
NimBLEScan* NimBLEDevice::m_pScan = nullptr;
|
NimBLEScan* NimBLEDevice::m_pScan = nullptr;
|
||||||
# endif
|
# endif
|
||||||
@@ -900,7 +903,9 @@ bool NimBLEDevice::init(const std::string& deviceName) {
|
|||||||
// Setup callbacks for host events
|
// Setup callbacks for host events
|
||||||
ble_hs_cfg.reset_cb = NimBLEDevice::onReset;
|
ble_hs_cfg.reset_cb = NimBLEDevice::onReset;
|
||||||
ble_hs_cfg.sync_cb = NimBLEDevice::onSync;
|
ble_hs_cfg.sync_cb = NimBLEDevice::onSync;
|
||||||
ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /*TODO: Implement handler for this*/
|
ble_hs_cfg.store_status_cb = [](struct ble_store_status_event* event, void* arg) {
|
||||||
|
return m_pDeviceCallbacks->onStoreStatus(event, arg);
|
||||||
|
};
|
||||||
|
|
||||||
// Set initial security capabilities
|
// Set initial security capabilities
|
||||||
ble_hs_cfg.sm_io_cap = BLE_HS_IO_NO_INPUT_OUTPUT;
|
ble_hs_cfg.sm_io_cap = BLE_HS_IO_NO_INPUT_OUTPUT;
|
||||||
@@ -1262,4 +1267,13 @@ void nimble_cpp_assert(const char* file, unsigned line) {
|
|||||||
}
|
}
|
||||||
# endif // CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED
|
# endif // CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED
|
||||||
|
|
||||||
|
void NimBLEDevice::setDeviceCallbacks(NimBLEDeviceCallbacks* cb) {
|
||||||
|
m_pDeviceCallbacks = cb ? cb : &defaultDeviceCallbacks;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NimBLEDeviceCallbacks::onStoreStatus(struct ble_store_status_event* event, void* arg) {
|
||||||
|
NIMBLE_LOGD("NimBLEDeviceCallbacks", "onStoreStatus: default");
|
||||||
|
return ble_store_util_status_rr(event, arg);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // CONFIG_BT_ENABLED
|
#endif // CONFIG_BT_ENABLED
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -66,6 +66,7 @@ class NimBLEConnInfo;
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
class NimBLEAddress;
|
class NimBLEAddress;
|
||||||
|
class NimBLEDeviceCallbacks;
|
||||||
|
|
||||||
# define BLEDevice NimBLEDevice
|
# define BLEDevice NimBLEDevice
|
||||||
# define BLEClient NimBLEClient
|
# define BLEClient NimBLEClient
|
||||||
@@ -129,6 +130,7 @@ class NimBLEDevice {
|
|||||||
static bool setOwnAddrType(uint8_t type);
|
static bool setOwnAddrType(uint8_t type);
|
||||||
static bool setOwnAddr(const NimBLEAddress& addr);
|
static bool setOwnAddr(const NimBLEAddress& addr);
|
||||||
static bool setOwnAddr(const uint8_t* addr);
|
static bool setOwnAddr(const uint8_t* addr);
|
||||||
|
static void setDeviceCallbacks(NimBLEDeviceCallbacks* cb);
|
||||||
static void setScanDuplicateCacheSize(uint16_t cacheSize);
|
static void setScanDuplicateCacheSize(uint16_t cacheSize);
|
||||||
static void setScanFilterMode(uint8_t type);
|
static void setScanFilterMode(uint8_t type);
|
||||||
static bool setCustomGapHandler(gap_event_handler handler);
|
static bool setCustomGapHandler(gap_event_handler handler);
|
||||||
@@ -213,6 +215,8 @@ class NimBLEDevice {
|
|||||||
static ble_gap_event_listener m_listener;
|
static ble_gap_event_listener m_listener;
|
||||||
static uint8_t m_ownAddrType;
|
static uint8_t m_ownAddrType;
|
||||||
static std::vector<NimBLEAddress> m_whiteList;
|
static std::vector<NimBLEAddress> m_whiteList;
|
||||||
|
static NimBLEDeviceCallbacks* m_pDeviceCallbacks;
|
||||||
|
static NimBLEDeviceCallbacks defaultDeviceCallbacks;
|
||||||
|
|
||||||
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
|
||||||
static NimBLEScan* m_pScan;
|
static NimBLEScan* m_pScan;
|
||||||
@@ -295,5 +299,27 @@ class NimBLEDevice {
|
|||||||
|
|
||||||
# include "NimBLEUtils.h"
|
# include "NimBLEUtils.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Callbacks associated with a BLE device.
|
||||||
|
*/
|
||||||
|
class NimBLEDeviceCallbacks {
|
||||||
|
public:
|
||||||
|
virtual ~NimBLEDeviceCallbacks() {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Indicates an inability to perform a store operation.
|
||||||
|
* This callback should do one of two things:
|
||||||
|
* -Address the problem and return 0, indicating that the store operation
|
||||||
|
* should proceed.
|
||||||
|
* -Return nonzero to indicate that the store operation should be aborted.
|
||||||
|
* @param event Describes the store event being reported.
|
||||||
|
* BLE_STORE_EVENT_FULL; or
|
||||||
|
* BLE_STORE_EVENT_OVERFLOW
|
||||||
|
* @return 0 if the store operation should proceed;
|
||||||
|
* nonzero if the store operation should be aborted.
|
||||||
|
*/
|
||||||
|
virtual int onStoreStatus(struct ble_store_status_event* event, void* arg);
|
||||||
|
};
|
||||||
|
|
||||||
#endif // CONFIG_BT_ENABLED
|
#endif // CONFIG_BT_ENABLED
|
||||||
#endif // NIMBLE_CPP_DEVICE_H_
|
#endif // NIMBLE_CPP_DEVICE_H_
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -110,16 +110,16 @@
|
|||||||
|
|
||||||
# define NIMBLE_CPP_LOG_FORMAT(letter, format) NIMBLE_CPP_LOG_COLOR_##letter #letter " (%lu) %s: " format LOG_RESET_COLOR "\n"
|
# define NIMBLE_CPP_LOG_FORMAT(letter, format) NIMBLE_CPP_LOG_COLOR_##letter #letter " (%lu) %s: " format LOG_RESET_COLOR "\n"
|
||||||
|
|
||||||
# define NIMBLE_CPP_LOG_LEVEL_LOCAL(level, tag, format, ...) \
|
# define NIMBLE_CPP_LOG_LEVEL_LOCAL(level, tag, format, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (level==ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, NIMBLE_CPP_LOG_FORMAT(E, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
if (level==ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, NIMBLE_CPP_LOG_FORMAT(E, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
||||||
else if (level==ESP_LOG_WARN) { esp_log_write(ESP_LOG_WARN, tag, NIMBLE_CPP_LOG_FORMAT(W, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
else if (level==ESP_LOG_WARN) { esp_log_write(ESP_LOG_WARN, tag, NIMBLE_CPP_LOG_FORMAT(W, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
||||||
else if (level==ESP_LOG_INFO) { esp_log_write(ESP_LOG_INFO, tag, NIMBLE_CPP_LOG_FORMAT(I, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
else if (level==ESP_LOG_INFO) { esp_log_write(ESP_LOG_INFO, tag, NIMBLE_CPP_LOG_FORMAT(I, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
||||||
else { esp_log_write(ESP_LOG_DEBUG, tag, NIMBLE_CPP_LOG_FORMAT(D, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
else { esp_log_write(ESP_LOG_DEBUG, tag, NIMBLE_CPP_LOG_FORMAT(D, format), esp_log_timestamp(), tag __VA_OPT__(,) __VA_ARGS__); } \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
# define NIMBLE_CPP_LOG_PRINT(level, tag, format, ...) \
|
# define NIMBLE_CPP_LOG_PRINT(level, tag, format, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (CONFIG_NIMBLE_CPP_LOG_LEVEL >= level) NIMBLE_CPP_LOG_LEVEL_LOCAL(level, tag, format, ##__VA_ARGS__); \
|
if (CONFIG_NIMBLE_CPP_LOG_LEVEL >= level) NIMBLE_CPP_LOG_LEVEL_LOCAL(level, tag, format, ##__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -172,5 +172,12 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# endif /* CONFIG_NIMBLE_CPP_IDF */
|
# endif /* CONFIG_NIMBLE_CPP_IDF */
|
||||||
|
|
||||||
|
# define NIMBLE_LOGD_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGD(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGI_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGI(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGW_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGW(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGE_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGE(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGE_RC(rc, tag, format, ...) { if (rc) { NIMBLE_LOGE(tag, format "; rc=%d %s", ##__VA_ARGS__, rc, NimBLEUtils::returnCodeToString(rc)); }}
|
||||||
|
|
||||||
#endif /* CONFIG_BT_ENABLED */
|
#endif /* CONFIG_BT_ENABLED */
|
||||||
#endif /* NIMBLE_CPP_LOG_H_ */
|
#endif /* NIMBLE_CPP_LOG_H_ */
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -27,17 +27,18 @@
|
|||||||
|
|
||||||
# include <climits>
|
# include <climits>
|
||||||
|
|
||||||
typedef struct {
|
struct NimBLEDescriptorFilter {
|
||||||
const NimBLEUUID* uuid;
|
NimBLERemoteDescriptor* dsc;
|
||||||
void* task_data;
|
const NimBLEUUID* uuid;
|
||||||
} desc_filter_t;
|
void* taskData;
|
||||||
|
};
|
||||||
|
|
||||||
static const char* LOG_TAG = "NimBLERemoteCharacteristic";
|
static const char* LOG_TAG = "NimBLERemoteCharacteristic";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Constructor.
|
* @brief Constructor.
|
||||||
* @param [in] svc A pointer to the service this characteristic belongs to.
|
* @param [in] svc A pointer to the service this characteristic belongs to.
|
||||||
* @param [in] ble_gatt_chr struct defined as:
|
* @param [in] chr struct defined as:
|
||||||
* struct ble_gatt_chr {
|
* struct ble_gatt_chr {
|
||||||
* uint16_t def_handle;
|
* uint16_t def_handle;
|
||||||
* uint16_t val_handle;
|
* uint16_t val_handle;
|
||||||
@@ -63,66 +64,73 @@ NimBLERemoteCharacteristic::~NimBLERemoteCharacteristic() {
|
|||||||
* @brief Callback used by the API when a descriptor is discovered or search complete.
|
* @brief Callback used by the API when a descriptor is discovered or search complete.
|
||||||
*/
|
*/
|
||||||
int NimBLERemoteCharacteristic::descriptorDiscCB(
|
int NimBLERemoteCharacteristic::descriptorDiscCB(
|
||||||
uint16_t conn_handle, const ble_gatt_error* error, uint16_t chr_val_handle, const ble_gatt_dsc* dsc, void* arg) {
|
uint16_t connHandle, const ble_gatt_error* error, uint16_t chrHandle, const ble_gatt_dsc* dsc, void* arg) {
|
||||||
int rc = error->status;
|
int rc = error->status;
|
||||||
|
auto filter = (NimBLEDescriptorFilter*)arg;
|
||||||
|
auto pTaskData = (NimBLETaskData*)filter->taskData;
|
||||||
|
const auto pChr = (NimBLERemoteCharacteristic*)pTaskData->m_pInstance;
|
||||||
|
const auto uuid = filter->uuid; // UUID to filter for
|
||||||
NIMBLE_LOGD(LOG_TAG, "Descriptor Discovery >> status: %d handle: %d", rc, (rc == 0) ? dsc->handle : -1);
|
NIMBLE_LOGD(LOG_TAG, "Descriptor Discovery >> status: %d handle: %d", rc, (rc == 0) ? dsc->handle : -1);
|
||||||
|
|
||||||
auto filter = (desc_filter_t*)arg;
|
// Results for chrHandle added until rc != 0
|
||||||
auto pTaskData = (NimBLETaskData*)filter->task_data;
|
// Must find specified UUID if filter is used
|
||||||
const auto pChr = (NimBLERemoteCharacteristic*)pTaskData->m_pInstance;
|
if (rc == 0 && pChr->getHandle() == chrHandle && (!uuid || 0 == ble_uuid_cmp(uuid->getBase(), &dsc->uuid.u))) {
|
||||||
const NimBLEUUID* uuidFilter = filter->uuid;
|
// Return BLE_HS_EDONE if the descriptor was found, stop the search
|
||||||
|
|
||||||
if (pChr->getHandle() != chr_val_handle) {
|
|
||||||
return 0; // Descriptor not for this characteristic
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc == 0) {
|
|
||||||
if (uuidFilter != nullptr) {
|
|
||||||
if (ble_uuid_cmp(uuidFilter->getBase(), &dsc->uuid.u) == 0) {
|
|
||||||
rc = BLE_HS_EDONE; // Found the descriptor, stop the search
|
|
||||||
} else {
|
|
||||||
return 0; // Not the descriptor we are looking for
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pChr->m_vDescriptors.push_back(new NimBLERemoteDescriptor(pChr, dsc));
|
pChr->m_vDescriptors.push_back(new NimBLERemoteDescriptor(pChr, dsc));
|
||||||
return 0;
|
rc = !!uuid * BLE_HS_EDONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NimBLEUtils::taskRelease(*pTaskData, rc);
|
if (rc != 0) {
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< Descriptor Discovery");
|
NimBLEUtils::taskRelease(*pTaskData, rc);
|
||||||
|
NIMBLE_LOGD(LOG_TAG, "<< Descriptor Discovery");
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Populate the descriptors (if any) for this characteristic.
|
* @brief Populate the descriptors (if any) for this characteristic.
|
||||||
* @param [in] the end handle of the characteristic, or the service, whichever comes first.
|
* @param [in] pFilter Pointer to a filter containing pointers to descriptor, UUID, and task data.
|
||||||
|
* @return True if successfully retrieved, success = BLE_HS_EDONE.
|
||||||
*/
|
*/
|
||||||
bool NimBLERemoteCharacteristic::retrieveDescriptors(const NimBLEUUID* uuidFilter) const {
|
bool NimBLERemoteCharacteristic::retrieveDescriptors(NimBLEDescriptorFilter* pFilter) const {
|
||||||
NIMBLE_LOGD(LOG_TAG, ">> retrieveDescriptors() for characteristic: %s", getUUID().toString().c_str());
|
NIMBLE_LOGD(LOG_TAG, ">> retrieveDescriptors() for characteristic: %s", getUUID().toString().c_str());
|
||||||
|
|
||||||
NimBLETaskData taskData(const_cast<NimBLERemoteCharacteristic*>(this));
|
// If this is the last handle then there are no descriptors
|
||||||
desc_filter_t filter = {uuidFilter, &taskData};
|
if (getHandle() == getRemoteService()->getEndHandle()) {
|
||||||
|
NIMBLE_LOGD(LOG_TAG, "<< retrieveDescriptors(): found 0 descriptors.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
NimBLETaskData taskData(const_cast<NimBLERemoteCharacteristic*>(this));
|
||||||
|
NimBLEDescriptorFilter defaultFilter{nullptr, nullptr, &taskData};
|
||||||
|
if (pFilter == nullptr) {
|
||||||
|
pFilter = &defaultFilter;
|
||||||
|
}
|
||||||
|
|
||||||
int rc = ble_gattc_disc_all_dscs(getClient()->getConnHandle(),
|
int rc = ble_gattc_disc_all_dscs(getClient()->getConnHandle(),
|
||||||
getHandle(),
|
getHandle(),
|
||||||
getRemoteService()->getEndHandle(),
|
getRemoteService()->getEndHandle(),
|
||||||
NimBLERemoteCharacteristic::descriptorDiscCB,
|
NimBLERemoteCharacteristic::descriptorDiscCB,
|
||||||
&filter);
|
pFilter);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
NIMBLE_LOGE(LOG_TAG, "ble_gattc_disc_all_dscs: rc=%d %s", rc, NimBLEUtils::returnCodeToString(rc));
|
NIMBLE_LOGE(LOG_TAG, "ble_gattc_disc_all_dscs: rc=%d %s", rc, NimBLEUtils::returnCodeToString(rc));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NimBLEUtils::taskWait(taskData, BLE_NPL_TIME_FOREVER);
|
auto prevDscCount = m_vDescriptors.size();
|
||||||
rc = taskData.m_flags;
|
NimBLEUtils::taskWait(pFilter->taskData, BLE_NPL_TIME_FOREVER);
|
||||||
if (rc == 0 || rc == BLE_HS_EDONE) {
|
rc = ((NimBLETaskData*)pFilter->taskData)->m_flags;
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< retrieveDescriptors(): found %d descriptors.", m_vDescriptors.size());
|
if (rc != BLE_HS_EDONE) {
|
||||||
return true;
|
NIMBLE_LOGE(LOG_TAG, "<< retrieveDescriptors(): failed: rc=%d %s", rc, NimBLEUtils::returnCodeToString(rc));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NIMBLE_LOGE(LOG_TAG, "<< retrieveDescriptors(): failed: rc=%d %s", rc, NimBLEUtils::returnCodeToString(rc));
|
if (m_vDescriptors.size() > prevDscCount) {
|
||||||
return false;
|
pFilter->dsc = m_vDescriptors.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
NIMBLE_LOGD(LOG_TAG, "<< retrieveDescriptors(): found %d descriptors.", m_vDescriptors.size() - prevDscCount);
|
||||||
|
return true;
|
||||||
} // retrieveDescriptors
|
} // retrieveDescriptors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,51 +140,38 @@ bool NimBLERemoteCharacteristic::retrieveDescriptors(const NimBLEUUID* uuidFilte
|
|||||||
*/
|
*/
|
||||||
NimBLERemoteDescriptor* NimBLERemoteCharacteristic::getDescriptor(const NimBLEUUID& uuid) const {
|
NimBLERemoteDescriptor* NimBLERemoteCharacteristic::getDescriptor(const NimBLEUUID& uuid) const {
|
||||||
NIMBLE_LOGD(LOG_TAG, ">> getDescriptor: uuid: %s", uuid.toString().c_str());
|
NIMBLE_LOGD(LOG_TAG, ">> getDescriptor: uuid: %s", uuid.toString().c_str());
|
||||||
NimBLERemoteDescriptor* pDsc = nullptr;
|
NimBLEUUID uuidTmp{uuid};
|
||||||
size_t prev_size = m_vDescriptors.size();
|
NimBLETaskData taskData(const_cast<NimBLERemoteCharacteristic*>(this));
|
||||||
|
NimBLEDescriptorFilter filter{nullptr, &uuidTmp, &taskData};
|
||||||
|
|
||||||
for (const auto& it : m_vDescriptors) {
|
for (const auto& dsc : m_vDescriptors) {
|
||||||
if (it->getUUID() == uuid) {
|
if (dsc->getUUID() == uuid) {
|
||||||
pDsc = it;
|
filter.dsc = dsc;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retrieveDescriptors(&uuid)) {
|
if (!retrieveDescriptors(&filter) || filter.dsc) {
|
||||||
if (m_vDescriptors.size() > prev_size) {
|
goto Done;
|
||||||
pDsc = m_vDescriptors.back();
|
}
|
||||||
goto Done;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the request was successful but 16/32 bit uuid not found
|
// Try again with 128 bit uuid if request succeeded but no descriptor found.
|
||||||
// try again with the 128 bit uuid.
|
if (uuid.bitSize() != BLE_UUID_TYPE_128) {
|
||||||
if (uuid.bitSize() == BLE_UUID_TYPE_16 || uuid.bitSize() == BLE_UUID_TYPE_32) {
|
uuidTmp.to128();
|
||||||
NimBLEUUID uuid128(uuid);
|
retrieveDescriptors(&filter);
|
||||||
uuid128.to128();
|
goto Done;
|
||||||
if (retrieveDescriptors(&uuid128)) {
|
}
|
||||||
if (m_vDescriptors.size() > prev_size) {
|
|
||||||
pDsc = m_vDescriptors.back();
|
// If the uuid was 128 bit, try again with 16 bit uuid.
|
||||||
}
|
uuidTmp.to16();
|
||||||
}
|
if (uuidTmp.bitSize() == BLE_UUID_TYPE_16) {
|
||||||
} else {
|
filter.uuid = &uuidTmp;
|
||||||
// If the request was successful but the 128 bit uuid not found
|
retrieveDescriptors(&filter);
|
||||||
// try again with the 16 bit uuid.
|
|
||||||
NimBLEUUID uuid16(uuid);
|
|
||||||
uuid16.to16();
|
|
||||||
// if the uuid was 128 bit but not of the BLE base type this check will fail
|
|
||||||
if (uuid16.bitSize() == BLE_UUID_TYPE_16) {
|
|
||||||
if (retrieveDescriptors(&uuid16)) {
|
|
||||||
if (m_vDescriptors.size() > prev_size) {
|
|
||||||
pDsc = m_vDescriptors.back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< getDescriptor: %sfound", pDsc ? "" : "not ");
|
NIMBLE_LOGD(LOG_TAG, "<< getDescriptor: %sfound", filter.dsc ? "" : "not ");
|
||||||
return pDsc;
|
return filter.dsc;
|
||||||
} // getDescriptor
|
} // getDescriptor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -305,7 +300,7 @@ size_t NimBLERemoteCharacteristic::deleteDescriptor(const NimBLEUUID& uuid) cons
|
|||||||
* @return True if supported.
|
* @return True if supported.
|
||||||
*/
|
*/
|
||||||
bool NimBLERemoteCharacteristic::canBroadcast() const {
|
bool NimBLERemoteCharacteristic::canBroadcast() const {
|
||||||
return (m_properties & BLE_GATT_CHR_PROP_BROADCAST) != 0;
|
return (m_properties & BLE_GATT_CHR_PROP_BROADCAST);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@@ -25,8 +25,10 @@
|
|||||||
# include <vector>
|
# include <vector>
|
||||||
# include <functional>
|
# include <functional>
|
||||||
|
|
||||||
|
class NimBLEUUID;
|
||||||
class NimBLERemoteService;
|
class NimBLERemoteService;
|
||||||
class NimBLERemoteDescriptor;
|
class NimBLERemoteDescriptor;
|
||||||
|
struct NimBLEDescriptorFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A model of a remote BLE characteristic.
|
* @brief A model of a remote BLE characteristic.
|
||||||
@@ -65,10 +67,10 @@ class NimBLERemoteCharacteristic : public NimBLERemoteValueAttribute {
|
|||||||
~NimBLERemoteCharacteristic();
|
~NimBLERemoteCharacteristic();
|
||||||
|
|
||||||
bool setNotify(uint16_t val, notify_callback notifyCallback = nullptr, bool response = true) const;
|
bool setNotify(uint16_t val, notify_callback notifyCallback = nullptr, bool response = true) const;
|
||||||
bool retrieveDescriptors(const NimBLEUUID* uuidFilter = nullptr) const;
|
bool retrieveDescriptors(NimBLEDescriptorFilter* pFilter = nullptr) const;
|
||||||
|
|
||||||
static int descriptorDiscCB(
|
static int descriptorDiscCB(
|
||||||
uint16_t conn_handle, const ble_gatt_error* error, uint16_t chr_val_handle, const ble_gatt_dsc* dsc, void* arg);
|
uint16_t connHandle, const ble_gatt_error* error, uint16_t chrHandle, const ble_gatt_dsc* dsc, void* arg);
|
||||||
|
|
||||||
const NimBLERemoteService* m_pRemoteService{nullptr};
|
const NimBLERemoteService* m_pRemoteService{nullptr};
|
||||||
uint8_t m_properties{0};
|
uint8_t m_properties{0};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
|
* Copyright 2020-2025 Ryan Powell <ryan@nable-embedded.io> and
|
||||||
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
* esp-nimble-cpp, NimBLE-Arduino contributors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -63,3 +63,19 @@
|
|||||||
#if defined(CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE) && !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN)
|
#if defined(CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE) && !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN)
|
||||||
#define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE
|
#define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CONFIG_BTDM_BLE_SCAN_DUPL) && defined(CONFIG_BT_CTRL_BLE_SCAN_DUPL)
|
||||||
|
#define CONFIG_BTDM_BLE_SCAN_DUPL CONFIG_BT_CTRL_BLE_SCAN_DUPL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE) && defined(CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE)
|
||||||
|
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CONFIG_BTDM_SCAN_DUPL_TYPE_DATA) && defined(CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA)
|
||||||
|
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE) && defined(CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE)
|
||||||
|
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user