hid_writer_linux.h 779 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef DEVICE_GAMEPAD_HID_WRITER_LINUX_H_
  5. #define DEVICE_GAMEPAD_HID_WRITER_LINUX_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include "base/containers/span.h"
  9. #include "base/files/scoped_file.h"
  10. #include "device/gamepad/hid_writer.h"
  11. namespace device {
  12. class HidWriterLinux final : public HidWriter {
  13. public:
  14. explicit HidWriterLinux(const base::ScopedFD& fd);
  15. ~HidWriterLinux() override;
  16. // HidWriter implementation.
  17. size_t WriteOutputReport(base::span<const uint8_t> report) override;
  18. private:
  19. // Not owned.
  20. int fd_;
  21. };
  22. } // namespace device
  23. #endif // DEVICE_GAMEPAD_HID_WRITER_LINUX_H_