| // Copyright 2019 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. |
| |
| library fuchsia.hardware.hidctl; |
| |
| using zx; |
| |
| const uint32 MAX_RPT_DESC_LEN = 8196; |
| |
| [ForDeprecatedCBindings] |
| struct HidCtlConfig { |
| /// The device number. This is used in print statements to identify the device. Can be set to |
| /// any value. |
| uint8 dev_num; |
| /// If this is set to true, the hid driver will force the device to use either the boot mouse or |
| /// boot keyboard report descriptor. |
| bool boot_device; |
| /// This sets the device class of the HID device. A list of device classes can be found in |
| /// hidbus.banjo in the HidDeviceClass enum. |
| uint8 dev_class; |
| }; |
| |
| /// Interface for creating a fake HID device. |
| /// |
| /// The device is controlled through a socket that can Read/Write HID reports. When the socket |
| /// is closed the device will remove itself from the system. |
| [ForDeprecatedCBindings] |
| protocol Device { |
| /// Create a fake HID device with a given report descriptor. Returns a |
| /// socket that can Read/Write HID reports. |
| MakeHidDevice(HidCtlConfig config, vector<uint8>:MAX_RPT_DESC_LEN rpt_desc) -> (zx.handle:SOCKET report_socket); |
| }; |