#ifndef DEVICE_BLUETOOTH_FLOSS_FLOSS_LOGGING_CLIENT_H_
#define DEVICE_BLUETOOTH_FLOSS_FLOSS_LOGGING_CLIENT_H_
#include <memory>
#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/floss/floss_dbus_client.h"
namespace floss {
class DEVICE_BLUETOOTH_EXPORT FlossLoggingClient : public FlossDBusClient {
public:
static std::unique_ptr<FlossLoggingClient> Create();
FlossLoggingClient(const FlossLoggingClient&) = delete;
FlossLoggingClient& operator=(const FlossLoggingClient&) = delete;
FlossLoggingClient();
~FlossLoggingClient() override;
virtual void IsDebugEnabled(ResponseCallback<bool> callback);
virtual void SetDebugLogging(ResponseCallback<Void> callback, bool enabled);
void Init(dbus::Bus* bus,
const std::string& service_name,
const int adapter_index,
base::Version version,
base::OnceClosure on_ready) override;
protected:
raw_ptr<dbus::Bus> bus_ = nullptr;
dbus::ObjectPath logging_path_;
std::string service_name_;
private:
template <typename R, typename... Args>
void CallAdapterLoggingMethod(ResponseCallback<R> callback,
const char* member,
Args... args) {
CallMethod(std::move(callback), bus_, service_name_,
kAdapterLoggingInterface, logging_path_, member, args...);
}
base::WeakPtrFactory<FlossLoggingClient> weak_ptr_factory_{this};
};
}
#endif