blob: d515cd21be59f9594e5eaa31a7b8299227d65e0f [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FUCHSIA_SDK_EXAMPLES_CC_EXAMPLE_DRIVER_H_
#define FUCHSIA_SDK_EXAMPLES_CC_EXAMPLE_DRIVER_H_
#include <lib/driver/compat/cpp/compat.h>
#include <lib/driver/compat/cpp/context.h>
#include <lib/driver/component/cpp/driver_cpp.h>
namespace example_driver {
class ExampleDriver : public driver::DriverBase {
public:
ExampleDriver(driver::DriverStartArgs start_args, fdf::UnownedDispatcher driver_dispatcher)
: driver::DriverBase("example-driver", std::move(start_args), std::move(driver_dispatcher)) {}
virtual ~ExampleDriver() = default;
zx::result<> Start() override;
private:
void InitializeCompatService(zx::result<std::shared_ptr<compat::Context>> result);
std::optional<compat::DeviceServer> child_;
std::shared_ptr<compat::Context> compat_context_;
};
} // namespace example_driver
#endif