#include "../common/BackendBase.h"
#include "CommonUtils.h"
#include "AdapterMac.h"
namespace SimpleBLE {
class BackendCoreBluetooth : public BackendBase {
public:
BackendCoreBluetooth() = default;
virtual ~BackendCoreBluetooth() = default;
virtual std::vector<std::shared_ptr<AdapterBase>> get_adapters() override;
virtual bool bluetooth_enabled() override;
virtual std::string name() const noexcept override;
};
std::shared_ptr<BackendBase> BACKEND_MACOS() { return std::make_shared<BackendCoreBluetooth>(); }
SharedPtrVector<AdapterBase> BackendCoreBluetooth::get_adapters() {
SharedPtrVector<AdapterBase> adapter_list;
adapter_list.push_back(std::make_shared<AdapterMac>());
return adapter_list;
}
bool BackendCoreBluetooth::bluetooth_enabled() {
AdapterMac adapter;
return adapter.bluetooth_enabled();
}
std::string BackendCoreBluetooth::name() const noexcept { return "CoreBluetooth"; }
}