26#ifndef BT_ADDRESS_HPP_
27#define BT_ADDRESS_HPP_
77 return static_cast<uint8_t
>(rhs);
320 std::size_t h = hash;
346 std::string
toString() const noexcept;
352 return lhs.address == rhs.address &&
353 lhs.type == rhs.type;
356 {
return !(lhs == rhs); }
374 return a.hash_code();
Unique Bluetooth EUI48 address and BDAddressType tuple.
bool matches(const BDAddressAndType &o) const noexcept
Returns true if both devices match, i.e.
constexpr bool isLEAddress() const noexcept
Returns true if the BDAddressType is a LE address type.
BLERandomAddressType getBLERandomAddressType() const noexcept
Returns the BLERandomAddressType.
constexpr bool isIdentityAddress() const noexcept
Returns true if this address and type refers to a public static identity address, which does not requ...
void clear()
Method clears the underlying byte array b and cached hash value.
constexpr BDAddressAndType() noexcept
constexpr bool isIdentityLEAddress() const noexcept
Returns true if this address and type refers to a static public LE identity address,...
constexpr BDAddressAndType & operator=(const BDAddressAndType &o) noexcept
std::size_t hash_code() const noexcept
Implementation uses a lock-free volatile cache.
static std::string getBLERandomAddressTypeString(const jau::EUI48 &address, const BDAddressType addressType, const std::string &prefix) noexcept
Returns the BLERandomAddressType std::string representation.
static const BDAddressAndType ANY_BREDR_DEVICE
Using EUI48::ANY_DEVICE and BDAddressType::BDADDR_BREDR to match any BREDR device.
constexpr bool isBREDRAddress() const noexcept
Returns true if the BDAddressType is a BREDR address type.
BDAddressAndType(const jau::EUI48 &address_, BDAddressType type_)
void clearHash()
Method clears the cached hash value.
static const BDAddressAndType ANY_DEVICE
Using EUI48::ANY_DEVICE and BDAddressType::BDADDR_UNDEFINED to match any device.
BDAddressAndType(const BDAddressAndType &o) noexcept
BDAddressAndType(BDAddressAndType &&o) noexcept
BDAddressAndType & operator=(BDAddressAndType &&o) noexcept
std::string toString() const noexcept
BLERandomAddressType
BT Core Spec v5.2: Vol 6 LE, Part B Link Layer Specification: 1.3 Device Address.
HCILEOwnAddressType to_HCILEOwnAddressType(const BDAddressType addrType, bool resolvable) noexcept
std::string to_string(const DiscoveryPolicy v) noexcept
HCILEPeerAddressType
HCI LE Address-Type is PUBLIC: 0x00, RANDOM: 0x01.
BDAddressType
BT Core Spec v5.2: Vol 3, Part C Generic Access Profile (GAP): 15.1.1.1 Public Bluetooth address.
bool operator!=(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
constexpr BDAddressType to_BDAddressType(const uint8_t v) noexcept
constexpr uint8_t number(const DiscoveryPolicy rhs) noexcept
@ UNDEFINED
Undefined, e.g.
@ RESOLVABLE_PRIVAT
Resolvable private random device address 0b01.
@ RESERVED
Reserved for future use 0b10.
@ UNRESOLVABLE_PRIVAT
Non-resolvable private random device address 0b00.
@ STATIC_PUBLIC
Static public 'random' device address 0b11.
@ RANDOM
Random Device Address.
@ PUBLIC_IDENTITY
Public Resolved Identity Address.
@ RANDOM_STATIC_IDENTITY
Resolved Random (Static) Identity Address.
@ PUBLIC
Public Device Address.
@ BDADDR_BREDR
Bluetooth BREDR address.
@ BDADDR_LE_RANDOM
Bluetooth LE random address, see BLERandomAddressType.
@ BDADDR_LE_PUBLIC
Bluetooth LE public address.
@ BDADDR_UNDEFINED
Undefined.
@ RESOLVABLE_OR_RANDOM
Controller Resolved Private Address or Random Address.
@ RESOLVABLE_OR_PUBLIC
Controller Resolved Private Address or Public Address.
A 48 bit EUI-48 sub-identifier, see EUI48.
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Med...
constexpr std::size_t hash_code() const noexcept
std::size_t operator()(direct_bt::BDAddressAndType const &a) const noexcept