mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-22 05:00:55 +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);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NimBLEAddress::operator uint64_t() const {
|
||||||
|
uint64_t address = 0;
|
||||||
|
memcpy(&address, m_address, sizeof m_address);
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
bool operator ==(const NimBLEAddress & rhs) const;
|
bool operator ==(const NimBLEAddress & rhs) const;
|
||||||
bool operator !=(const NimBLEAddress & rhs) const;
|
bool operator !=(const NimBLEAddress & rhs) const;
|
||||||
operator std::string() const;
|
operator std::string() const;
|
||||||
|
operator uint64_t() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t m_address[6];
|
uint8_t m_address[6];
|
||||||
|
|
Loading…
Reference in a new issue