Skip to content

Commit

Permalink
fixup macos II
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarrano committed Dec 6, 2024
1 parent 46d7238 commit 263bf98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions simpleble/src/backends/macos/AdapterMac.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class AdapterMac : public AdapterBase {
*/
std::map<void*, std::shared_ptr<PeripheralMac>> peripherals_;
std::map<void*, std::shared_ptr<PeripheralMac>> seen_peripherals_;

private:
BluetoothAddress address() const;
};

} // namespace SimpleBLE
4 changes: 3 additions & 1 deletion simpleble/src/backends/macos/AdapterMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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<const AdapterMac*>(this)->address(); }

void AdapterMac::scan_start() {
this->seen_peripherals_.clear();

Expand Down

0 comments on commit 263bf98

Please sign in to comment.