@@ -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 }
0 commit comments