feat(AdvDevice): Add convenience operator to NimBLEAddress

This commit is contained in:
thekurtovic
2025-01-26 11:21:36 -05:00
committed by Ryan Powell
parent 784e6f30fa
commit 052c0a0455
4 changed files with 11 additions and 20 deletions

View File

@@ -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.