mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-01-31 18:39:27 +01:00
feat(AdvDevice): Add convenience operator to NimBLEAddress
This commit is contained in:
@@ -780,6 +780,16 @@ bool NimBLEAdvertisedDevice::isLegacyAdvertisement() const {
|
||||
# endif
|
||||
} // 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.
|
||||
* @return The advertisement payload.
|
||||
|
||||
Reference in New Issue
Block a user