Skip to content

Commit 4d4d5a2

Browse files
finger563SquaredPotato
authored andcommitted
chore: Update esp-nimble-cpp to latest v2.0 (esp-cpp#352)
* chore: Update esp-nimble-cpp to latest v2.0 * fix breaking change to NimBLEAddress constructor to specify address type
1 parent 5842cf4 commit 4d4d5a2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

components/ble_gatt_server/include/ble_gatt_server_menu.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,13 @@ class BleGattServerMenu {
336336
/// @param out The output stream to write to.
337337
/// @param duration_ms The duration to advertise for.
338338
/// @param directed_address The address to advertise to.
339+
/// @param addr_type The address type to advertise to.
339340
void start_advertising(std::ostream &out, uint32_t duration_ms,
340-
const std::string &directed_address = "") {
341+
const std::string &directed_address = "",
342+
uint8_t addr_type = BLE_ADDR_PUBLIC) {
341343
NimBLEAddress *addr = nullptr;
342344
if (directed_address.size() > 0) {
343-
addr = new NimBLEAddress(directed_address);
345+
addr = new NimBLEAddress(directed_address, addr_type);
344346
}
345347
server_.get().start_advertising(duration_ms, addr);
346348
out << "Started advertising\n";
@@ -374,8 +376,10 @@ class BleGattServerMenu {
374376
/// @brief Add an address to the whitelist.
375377
/// @param out The output stream to write to.
376378
/// @param address The address to add to the whitelist.
377-
void whitelist(std::ostream &out, const std::string &address) {
378-
NimBLEAddress addr(address);
379+
/// @param addr_type The address type to add to the whitelist.
380+
void whitelist(std::ostream &out, const std::string &address,
381+
uint8_t addr_type = BLE_ADDR_PUBLIC) {
382+
NimBLEAddress addr(address, addr_type);
379383
NimBLEDevice::whiteListAdd(addr);
380384
out << "Added " << address << " to the whitelist\n";
381385
}

components/esp-nimble-cpp

Submodule esp-nimble-cpp updated 129 files

0 commit comments

Comments
 (0)