hid_writer_mac.h 772 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_MAC_H_
  5. #define DEVICE_GAMEPAD_HID_WRITER_MAC_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include <IOKit/hid/IOHIDManager.h>
  9. #include "base/containers/span.h"
  10. #include "device/gamepad/hid_writer.h"
  11. namespace device {
  12. class HidWriterMac final : public HidWriter {
  13. public:
  14. explicit HidWriterMac(IOHIDDeviceRef device_ref);
  15. ~HidWriterMac() override;
  16. // HidWriter implementation.
  17. size_t WriteOutputReport(base::span<const uint8_t> report) override;
  18. private:
  19. IOHIDDeviceRef device_ref_;
  20. };
  21. } // namespace device
  22. #endif // DEVICE_GAMEPAD_HID_WRITER_MAC_H_