@@ -62,34 +62,34 @@ bool BLEAddress::equals(BLEAddress otherAddress) {
62
62
return memcmp (otherAddress.getNative (), m_address, ESP_BD_ADDR_LEN) == 0 ;
63
63
} // equals
64
64
65
- bool BLEAddress::operator ==(BLEAddress otherAddress) {
66
- return equals (otherAddress) ;
65
+ bool BLEAddress::operator ==(const BLEAddress& otherAddress) const {
66
+ return memcmp (otherAddress. m_address , m_address, ESP_BD_ADDR_LEN) == 0 ;
67
67
}
68
68
69
- bool BLEAddress::operator !=(BLEAddress otherAddress) {
70
- return ! this == otherAddress;
69
+ bool BLEAddress::operator !=(const BLEAddress& otherAddress) const {
70
+ return !(* this == otherAddress) ;
71
71
}
72
72
73
- bool BLEAddress::operator <(BLEAddress otherAddress) {
74
- return memcmp (otherAddress.getNative () , m_address, ESP_BD_ADDR_LEN) < 0 ;
73
+ bool BLEAddress::operator <(const BLEAddress& otherAddress) const {
74
+ return memcmp (otherAddress.m_address , m_address, ESP_BD_ADDR_LEN) < 0 ;
75
75
}
76
76
77
- bool BLEAddress::operator <=(BLEAddress otherAddress) {
78
- return !this > otherAddress;
77
+ bool BLEAddress::operator <=(const BLEAddress& otherAddress) const {
78
+ return !(* this > otherAddress) ;
79
79
}
80
80
81
- bool BLEAddress::operator >=(BLEAddress otherAddress) {
82
- return !this < otherAddress;
81
+ bool BLEAddress::operator >=(const BLEAddress& otherAddress) const {
82
+ return !(* this < otherAddress) ;
83
83
}
84
84
85
- bool BLEAddress::operator >(BLEAddress otherAddress) {
86
- return memcmp (otherAddress.getNative () , m_address, ESP_BD_ADDR_LEN) > 0 ;
85
+ bool BLEAddress::operator >(const BLEAddress& otherAddress) const {
86
+ return memcmp (otherAddress.m_address , m_address, ESP_BD_ADDR_LEN) > 0 ;
87
87
}
88
88
89
89
/* *
90
90
* @brief Return the native representation of the address.
91
91
* @return The native representation of the address.
92
- */
92
+ */
93
93
esp_bd_addr_t *BLEAddress::getNative () {
94
94
return &m_address;
95
95
} // getNative
0 commit comments