node-hid没有显示所有USB设备

时间:2015-06-09 12:45:03

标签: node.js macos nfc hid acr122

我正在使用node-hid进行此调用:

HID.devices()

我应该将所有连接的USB设备列表listed here in the guide

结果我得到了这个设备列表:

[ { vendorId: 1452,
  productId: 33346,
  path: 'USB_05ac_8242_6500000',
  serialNumber: '',
  manufacturer: 'Apple Computer, Inc.',
  product: 'Apple IR',
  release: 22,
  interface: -1 },
{ vendorId: 1452,
  productId: 567,
  path: 'USB_05ac_0237_6300000',
  serialNumber: '',
  manufacturer: 'Apple Inc.',
  product: 'Apple Internal Keyboard / Trackpad',
  release: 144,
  interface: -1 },
{ vendorId: 1452,
  productId: 567,
  path: 'USB_05ac_0237_6300000',
  serialNumber: '',
  manufacturer: 'Apple Inc.',
  product: 'Apple Internal Keyboard / Trackpad',
  release: 144,
  interface: -1 },
{ vendorId: 0,
  productId: 0,
  path: '',
  serialNumber: '',
  manufacturer: '',
  product: 'Apple Mikey HID Driver',
  release: 0,
  interface: -1 },
{ vendorId: 1452,
  productId: 567,
  path: 'USB_05ac_0237_6300000',
  serialNumber: '',
  manufacturer: 'Apple Inc.',
  product: 'Apple Internal Keyboard / Trackpad',
  release: 144,
  interface: -1 },
{ vendorId: 1452,
  productId: 567,
  path: 'USB_05ac_0237_6300000',
  serialNumber: '',
  manufacturer: 'Apple Inc.',
  product: 'Apple Internal Keyboard / Trackpad',
  release: 144,
  interface: -1 } ]

不包括通过USB连接到我的Mac的ACR122U-A9设备(ACS有限公司提供的NFC / RFID设备)。

连接到Mac的所有外围设备都列在System Report -> Hardware -> USB下,此处为屏幕截图:ACR122U connected to the Mac

你能弄清楚如何解决这个问题吗?

1 个答案:

答案 0 :(得分:4)

node-hid是一个从node.js访问USB HID设备的库。因此,HID.devices()只列出USB HID 设备,而不仅仅列出任何USB设备。

ACR122U是 CCID (智能卡读卡器的USB类),而不是HID(人机接口设备的USB类)设备。因此,它不能由node-hid列出。