mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-22 19:10:46 +01:00
Add uint64_t cast of an address
This commit is contained in:
parent
f624deacb5
commit
afb2f8d4c7
2 changed files with 7 additions and 0 deletions
|
@ -142,4 +142,10 @@ NimBLEAddress::operator std::string() const {
|
|||
return std::string(buffer);
|
||||
}
|
||||
|
||||
NimBLEAddress::operator uint64_t() const {
|
||||
uint64_t address = 0;
|
||||
memcpy(&address, m_address, sizeof m_address);
|
||||
return address;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
bool operator ==(const NimBLEAddress & rhs) const;
|
||||
bool operator !=(const NimBLEAddress & rhs) const;
|
||||
operator std::string() const;
|
||||
operator uint64_t() const;
|
||||
|
||||
private:
|
||||
uint8_t m_address[6];
|
||||
|
|
Loading…
Reference in a new issue