forked from h2zero/esp-nimble-cpp
Add uint64_t cast of an address
This commit is contained in:
@ -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];
|
||||||
|
Reference in New Issue
Block a user