blob: 41a6ab952b9ddd757bf0981a05a572dd61bec6c5 [file] [log] [blame]
// Copyright 2022 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_INPUT_SAMPLE_H_
#define FUCHSIA_SDK_EXAMPLES_CC_INPUT_SAMPLE_H_
#include <lib/driver2/driver2_cpp.h>
#include "input_server.h"
namespace input_sample {
// Sample driver for a virtual input device that generates input reports.
class InputSampleDriver : public driver::DriverBase {
static constexpr std::string_view kName = "input-sample";
public:
InputSampleDriver(driver::DriverStartArgs start_args, fdf::UnownedDispatcher driver_dispatcher)
: driver::DriverBase(kName, std::move(start_args), std::move(driver_dispatcher)) {}
virtual ~InputSampleDriver() = default;
zx::status<> Start() override;
private:
void SendFakeReport();
std::shared_ptr<input_report_reader::InputReportReaderManager<SampleInputReport>>
input_report_readers_;
SampleInputReport report_;
};
} // namespace input_sample
#endif // FUCHSIA_SDK_EXAMPLES_CC_INPUT_SAMPLE_H_