Adding access to two semi-private methods

- These methods are required for a workaround for interface claiming
that must be run on Mac.

See https://github.com/nonolith/node-usb/issues/61#issuecomment-69195175
This commit is contained in:
Eric Brody
2016-08-01 14:49:54 -04:00
parent 308d576c8e
commit e700347ea6
2 changed files with 6 additions and 0 deletions

View File

@@ -9,6 +9,9 @@ device.busNumber = 1;
device.deviceAddress = 1;
device.portNumbers = [1, 2, 3];
device.__open();
device.__claimInterface(0);
device.open(true);
device.close();
const xferDevice: usb.Device = device.controlTransfer(1, 1, 1, 1, 1, (error: string, buf: Buffer): usb.Device => new usb.Device());

View File

@@ -16,6 +16,9 @@ declare module "usb" {
public configDescriptor: ConfigDescriptor;
public interfaces: Array<Interface>;
__open(): void;
__claimInterface(addr: number): void;
open(defaultConfig?: boolean): void;
close(): void;
interface(addr: number): Interface;