Skip to content

Commit 6fe1c4c

Browse files
Correct less- and greater-than operators (espressif#6521)
Lets Manufacturer ranges in bluetooth address space be filtered correctly
1 parent 5d6b9d0 commit 6fe1c4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/BLE/src/BLEAddress.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool BLEAddress::operator!=(const BLEAddress& otherAddress) const {
7171
}
7272

7373
bool BLEAddress::operator<(const BLEAddress& otherAddress) const {
74-
return memcmp(otherAddress.m_address, m_address, ESP_BD_ADDR_LEN) < 0;
74+
return memcmp(m_address, otherAddress.m_address, ESP_BD_ADDR_LEN) < 0;
7575
}
7676

7777
bool BLEAddress::operator<=(const BLEAddress& otherAddress) const {
@@ -83,7 +83,7 @@ bool BLEAddress::operator>=(const BLEAddress& otherAddress) const {
8383
}
8484

8585
bool BLEAddress::operator>(const BLEAddress& otherAddress) const {
86-
return memcmp(otherAddress.m_address, m_address, ESP_BD_ADDR_LEN) > 0;
86+
return memcmp(m_address, otherAddress.m_address, ESP_BD_ADDR_LEN) > 0;
8787
}
8888

8989
/**

0 commit comments

Comments
 (0)