| using fuchsia.usb; | |
| // The device must be a USB device. | |
| fuchsia.BIND_PROTOCOL == fuchsia.usb.BIND_PROTOCOL.DEVICE; | |
| 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. | |
| abort; | |
| } |