@@ -59,14 +59,37 @@ BLEAddress::BLEAddress(std::string stringAddress) {
59
59
* @return True if the addresses are equal.
60
60
*/
61
61
bool 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 ;
63
63
} // equals
64
64
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
+ }
65
88
66
89
/* *
67
90
* @brief Return the native representation of the address.
68
91
* @return The native representation of the address.
69
- */
92
+ */
70
93
esp_bd_addr_t *BLEAddress::getNative () {
71
94
return &m_address;
72
95
} // getNative
0 commit comments