0

我正在尝试在 Google Chrome v.28.0.1500.71/MacOSX 10.8.4 上使用 USB api。FindDevices 方法找到我的设备(USB CCID 类),但是在执行 chrome.usb.listInterfaces(device,callback) 时出现错误

未捕获的类型错误:对象 # 没有方法“listInterfaces”。代码见下:

chrome.usb.findDevices( DEVICE_INFO, 
  function(devices) {
    if (!devices || !devices.length) {
      console.log('device not found');
      return;
    }
    console.log('Found device: ' + devices[0].handle);
    console.log(devices[0]);
    powerMateDevice = devices[0];

    console.log('listing ifcs...'); 
    chrome.usb.listInterfaces(powerMateDevice, function(ifcs){
        console.log('interfaces '+ifcs.length);
        console.log(ifcs);
    }); 

});

我的问题是,我是否以错误的方式使用此 API,或者 listInterfaces 尚未按照http://developer.chrome.com/apps/usb.html中的描述实现?

4

1 回答 1

0

listInterfaces 方法于 2013 年5 月 28 日添加。那是在 Chrome 28 的 5 月 6 日分支点之后。改用开发频道。如果您想为文档问题提交错误报告,您可以在 crbug.com 上提交。

于 2013-07-22T00:57:36.863 回答