【问题标题】:node-hid not showing all USB devicesnode-hid 不显示所有 USB 设备
【发布时间】:2015-06-09 12:45:02
【问题描述】:

我在这个电话中使用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 Ltd 提供的 NFC/RFID 设备)。

所有连接到 Mac 的外围设备都列在System Report -> Hardware -> USB 下,这里是截图:

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

【问题讨论】:

    标签: node.js macos nfc hid acr122


    【解决方案1】:

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

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

    【讨论】:

    • 好的,我明白了。我需要在 JS 中读取该阅读器的数据,您知道我该如何实现或是否有任何库?
    • 没有,不知道有没有这样的库。
    • 我正在做一个项目,我也必须将 ACR123U 连接到 nodeJs。我通常做的是使用 C 来做脏东西,然后使用 unix 套接字与 nodejs 进行通信,我什至可以将 JSON 字符串从 C 发送到 nodejs
    猜你喜欢
    • 2012-05-10
    • 2011-11-02
    • 1970-01-01
    • 1970-01-01
    • 2016-10-28
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 2023-04-07
    相关资源
    最近更新 更多