Add isRpa method to NimBLEAddress.

This provides and easy way to check if the peer address is a Resolvable Private Address.
This commit is contained in:
h2zero
2024-06-12 09:30:16 -06:00
committed by h2zero
parent ef90a8aa95
commit c156b0202c
2 changed files with 10 additions and 0 deletions

View File

@@ -138,6 +138,15 @@ uint8_t NimBLEAddress::getType() const {
} // getType
/**
* @brief Determine if this address is a Resolvable Private Address.
* @return True if the address is a RPA.
*/
bool NimBLEAddress::isRpa() const {
return (m_addrType && ((m_address[5] & 0xc0) == 0x40));
} // isRpa
/**
* @brief Convert a BLE address to a string.
*