本文整理匯總了TypeScript中usb.Interface.release方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Interface.release方法的具體用法?TypeScript Interface.release怎麽用?TypeScript Interface.release使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類usb.Interface
的用法示例。
在下文中一共展示了Interface.release方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Buffer
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;
endpointDesc.bDescriptorType = 1;
endpointDesc.bEndpointAddress = 1;
endpointDesc.bmAttributes = 1;
endpointDesc.wMaxPacketSize = 1;
endpointDesc.bInterval = 1;
endpointDesc.bRefresh = 1;
endpointDesc.bSynchAddress = 1;
示例2: Buffer
configDesc.bMaxPower = 1;
configDesc.extra = new Buffer([]);
const deviceInterface: usb.Interface = device.interface(1);
device.interfaces = [deviceInterface];
device.parent = device;
device.configDescriptor = configDesc;
device.allConfigDescriptors = [configDesc];
const iface = new usb.Interface(device, 1);
iface.interfaceNumber = 1;
iface.altSetting = 0;
iface.claim();
iface.release((error: string) => null);
iface.release(false, (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 ifaceDesc: usb.InterfaceDescriptor = new usb.InterfaceDescriptor();
ifaceDesc.bLength = 1;
ifaceDesc.bDescriptorType = 1;
ifaceDesc.bInterfaceNumber = 1;
ifaceDesc.bAlternateSetting = 1;
ifaceDesc.bNumEndpoints = 1;
ifaceDesc.bInterfaceClass = 1;
ifaceDesc.bInterfaceSubClass = 1;