Files
nearby/internal/platform/implementation/linux/bluetooth_adapter.h
T
2023-08-03 17:14:03 +05:30

36 lines
968 B
C++

#ifndef PLATFORM_IMPL_LINUX_BLUETOOTH_ADAPTER_H_
#define PLATFORM_IMPL_LINUX_BLUETOOTH_ADAPTER_H_
#include <string>
#include "absl/strings/string_view.h"
#include "internal/platform/implementation/bluetooth_adapter.h"
#include <systemd/sd-bus.h>
namespace nearby {
namespace linux {
class BluetoothAdapter : public api::BluetoothAdapter {
public:
BluetoothAdapter(sd_bus *bus) { system_bus_ = bus; }
~BluetoothAdapter() override { sd_bus_unref(system_bus_); };
bool SetStatus(Status status) override;
bool IsEnabled() const override;
ScanMode GetScanMode() const override;
bool SetScanMode(ScanMode scan_mode) override;
std::string GetName() const override;
bool SetName(absl::string_view name) override;
bool SetName(absl::string_view name, bool persist) override;
std::string GetMacAddress() const override;
private:
sd_bus *system_bus_;
};
} // namespace linux
} // namespace nearby
#endif // PLATFORM_IMPL_LINUX_BLUETOOTH_ADAPTER_H_