@@ -336,11 +336,13 @@ class BleGattServerMenu {
336
336
// / @param out The output stream to write to.
337
337
// / @param duration_ms The duration to advertise for.
338
338
// / @param directed_address The address to advertise to.
339
+ // / @param addr_type The address type to advertise to.
339
340
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) {
341
343
NimBLEAddress *addr = nullptr ;
342
344
if (directed_address.size () > 0 ) {
343
- addr = new NimBLEAddress (directed_address);
345
+ addr = new NimBLEAddress (directed_address, addr_type );
344
346
}
345
347
server_.get ().start_advertising (duration_ms, addr);
346
348
out << " Started advertising\n " ;
@@ -374,8 +376,10 @@ class BleGattServerMenu {
374
376
// / @brief Add an address to the whitelist.
375
377
// / @param out The output stream to write to.
376
378
// / @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);
379
383
NimBLEDevice::whiteListAdd (addr);
380
384
out << " Added " << address << " to the whitelist\n " ;
381
385
}
0 commit comments