本文整理匯總了TypeScript中usb.Device.interface方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Device.interface方法的具體用法?TypeScript Device.interface怎麽用?TypeScript Device.interface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類usb.Device
的用法示例。
在下文中一共展示了Device.interface方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Buffer
device.deviceDescriptor = deviceDesc;
const configDesc: usb.ConfigDescriptor = new usb.ConfigDescriptor();
configDesc.bLength = 1;
configDesc.bDescriptorType = 1;
configDesc.wTotalLength = 1;
configDesc.bNumInterfaces = 1;
configDesc.bConfigurationValue = 1;
configDesc.iConfiguration = 1;
configDesc.bmAttributes = 1;
configDesc.bMaxPower = 1;
configDesc.extra = new Buffer([]);
const deviceInterface: usb.Interface = device.interface(1);
device.interfaces = [deviceInterface];
const iface = new usb.Interface(device, 1);
iface.claim();
iface.release((error: string) => null, (error: string) => null);
const kernelActive: boolean = iface.isKernelDriverActive();
const detachKernel: number = iface.detachKernelDriver();
const attachKernel: number = iface.attachKernelDriver();
iface.setAltSetting(1, (error: string) => null);
const endpointDesc: usb.EndpointDescriptor = new usb.EndpointDescriptor();
endpointDesc.bLength = 1;