节点:通过USB发送编码数据

时间:2019-07-27 00:05:23

标签: node.js usb encode hid

我希望遵循本教程: https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/

最后,Python能够通过USB发送编码数据。我应该使用node.js或某些库的等效项吗?

我希望“翻译”到节点的python函数:

def write_report(report):
    with open('/dev/hidg0', 'rb+') as fd:
        fd.write(report.encode())

其中hidg0实际上是另一台PC,并且此代码将在模拟HID设备(RPi)的设备上运行。

在此先感谢您提供所有帮助!

0 个答案:

没有答案