From e700347ea604ab9f878ab347f47ff4e01d971486 Mon Sep 17 00:00:00 2001 From: Eric Brody Date: Mon, 1 Aug 2016 14:49:54 -0400 Subject: [PATCH] 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 --- node-usb/node-usb-tests.ts | 3 +++ node-usb/node-usb.d.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/node-usb/node-usb-tests.ts b/node-usb/node-usb-tests.ts index 8ae22cf0cc..9abef86ee8 100644 --- a/node-usb/node-usb-tests.ts +++ b/node-usb/node-usb-tests.ts @@ -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()); diff --git a/node-usb/node-usb.d.ts b/node-usb/node-usb.d.ts index 0a52bdf127..b8d1611a51 100644 --- a/node-usb/node-usb.d.ts +++ b/node-usb/node-usb.d.ts @@ -16,6 +16,9 @@ declare module "usb" { public configDescriptor: ConfigDescriptor; public interfaces: Array; + __open(): void; + __claimInterface(addr: number): void; + open(defaultConfig?: boolean): void; close(): void; interface(addr: number): Interface;