| // Copyright 2020 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. |
| |
| using fuchsia.usb; |
| |
| // The device must be a USB device. |
| fuchsia.BIND_PROTOCOL == fuchsia.usb.BIND_PROTOCOL.INTERFACE; |
| |
| if fuchsia.BIND_USB_VID == fuchsia.usb.BIND_USB_VID.INTEL { |
| // If the device's vendor is Intel, the device class must be audio. |
| fuchsia.BIND_USB_CLASS == fuchsia.usb.BIND_USB_CLASS.AUDIO; |
| } else if fuchsia.BIND_USB_VID == fuchsia.usb.BIND_USB_VID.REALTEK { |
| // If the device's vendor is Realtek, the device class must be one of the following values: |
| accept fuchsia.BIND_USB_CLASS { |
| fuchsia.usb.BIND_USB_CLASS.COMM, |
| fuchsia.usb.BIND_USB_CLASS.VIDEO, |
| } |
| } else { |
| // If the vendor is neither Intel or Realtek, do not bind. |
| false; |
| } |