@@ -59,14 +59,37 @@ BLEAddress::BLEAddress(std::string stringAddress) {
5959 * @return True if the addresses are equal.
6060 */
6161bool BLEAddress::equals (BLEAddress otherAddress) {
62- return memcmp (otherAddress.getNative (), m_address, 6 ) == 0 ;
62+ return memcmp (otherAddress.getNative (), m_address, ESP_BD_ADDR_LEN ) == 0 ;
6363} // equals
6464
65+ bool BLEAddress::operator ==(const BLEAddress& otherAddress) const {
66+ return memcmp (otherAddress.m_address , m_address, ESP_BD_ADDR_LEN) == 0 ;
67+ }
68+
69+ bool BLEAddress::operator !=(const BLEAddress& otherAddress) const {
70+ return !(*this == otherAddress);
71+ }
72+
73+ bool BLEAddress::operator <(const BLEAddress& otherAddress) const {
74+ return memcmp (otherAddress.m_address , m_address, ESP_BD_ADDR_LEN) < 0 ;
75+ }
76+
77+ bool BLEAddress::operator <=(const BLEAddress& otherAddress) const {
78+ return !(*this > otherAddress);
79+ }
80+
81+ bool BLEAddress::operator >=(const BLEAddress& otherAddress) const {
82+ return !(*this < otherAddress);
83+ }
84+
85+ bool BLEAddress::operator >(const BLEAddress& otherAddress) const {
86+ return memcmp (otherAddress.m_address , m_address, ESP_BD_ADDR_LEN) > 0 ;
87+ }
6588
6689/* *
6790 * @brief Return the native representation of the address.
6891 * @return The native representation of the address.
69- */
92+ */
7093esp_bd_addr_t *BLEAddress::getNative () {
7194return &m_address;
7295} // getNative
0 commit comments