From 22e3abf3661d7de42b3e6c738d8167718e3ca218 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 3 Jul 2020 15:27:31 +0200 Subject: DBTDevice (C++/Java) equality/identity requires its EUI48 address _and_ BDAddressType The BDAddressType is the magic 49th bit of the EUI48 address, as it specifies the semantics of its 2-high bits. --- api/direct_bt/DBTDevice.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api') diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp index 5dd8e9db..eda7a482 100644 --- a/api/direct_bt/DBTDevice.hpp +++ b/api/direct_bt/DBTDevice.hpp @@ -385,7 +385,7 @@ namespace direct_bt { { return lhs.address < rhs.address; } inline bool operator==(const DBTDevice& lhs, const DBTDevice& rhs) - { return lhs.address == rhs.address; } + { return lhs.address == rhs.address && lhs.addressType == rhs.addressType; } inline bool operator!=(const DBTDevice& lhs, const DBTDevice& rhs) { return !(lhs == rhs); } -- cgit v1.2.3