From 263bf98117f0c7c2fa85977600b0e6db0435e664 Mon Sep 17 00:00:00 2001 From: Juan I Carrano Date: Sat, 7 Dec 2024 00:31:58 +0100 Subject: [PATCH] fixup macos II --- simpleble/src/backends/macos/AdapterMac.h | 3 +++ simpleble/src/backends/macos/AdapterMac.mm | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/simpleble/src/backends/macos/AdapterMac.h b/simpleble/src/backends/macos/AdapterMac.h index 9f719b45..45c0e3b7 100644 --- a/simpleble/src/backends/macos/AdapterMac.h +++ b/simpleble/src/backends/macos/AdapterMac.h @@ -76,6 +76,9 @@ class AdapterMac : public AdapterBase { */ std::map> peripherals_; std::map> seen_peripherals_; + + private: + BluetoothAddress address() const; }; } // namespace SimpleBLE diff --git a/simpleble/src/backends/macos/AdapterMac.mm b/simpleble/src/backends/macos/AdapterMac.mm index ac34954a..bb2c9e99 100644 --- a/simpleble/src/backends/macos/AdapterMac.mm +++ b/simpleble/src/backends/macos/AdapterMac.mm @@ -42,12 +42,14 @@ std::string AdapterMac::identifier() const { return fmt::format("Default Adapter [{}]", this->address()); } -BluetoothAddress AdapterMac::address() { +BluetoothAddress AdapterMac::address() const { AdapterBaseMacOS* internal = (__bridge AdapterBaseMacOS*)opaque_internal_; return [[internal address] UTF8String]; } +BluetoothAddress AdapterMac::address() { return const_cast(this)->address(); } + void AdapterMac::scan_start() { this->seen_peripherals_.clear();