命令行接口.DOC

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
命令行接口

用于 Node.JS的 HYPERLINK \l usb-library-for-nodejs USB库 : HYPERLINK /nonolith/node-usb Windows: HYPERLINK /project/kevinmehall/node-usb/branch/master 用于在 javascript/coffeescript中与USB设备通信的Node.JS 库。 这是klein的 HYPERLINK /schakko/node-usb 节点的重构/重写。 API不兼容( 希望你能发现) 。 它完全基于for的异步,为连续流数据或者事件提供一个流 API 。 HYPERLINK \l installation 安装 Libusb作为一个子模块被包含。 在Linux上,你需要libudev来构建 libusb 。 在 ubuntu/debian上: sudo apt-get install build-essential libudev-dev 然后,只要 npm install usb 从npm安装。有关从 git checkout 构建的说明,请参阅本页的底部。 HYPERLINK \l windows Windows 使用 HYPERLINK /projects/libwdi/files/zadig/ 为你的USB设备安装WinUSB驱动器。 否则,在尝试打开设备时,你将获得 LIBUSB_ERROR_NOT_SUPPORTED 。 HYPERLINK \l api API var usb = require(usb) HYPERLINK \l usb usb 顶层对象。 HYPERLINK \l usbgetdevicelist usb.getDeviceList( ) 返回连接到系统的USB设备的Device 对象列表。 HYPERLINK \l usbfindbyidsvid-pid usb.findByIds(vid, pid ) 使用指定的VID和PID获取第一个设备的便捷方法,如果没有这样的设备,则为 undefined 。 HYPERLINK \l usblibusb_ usb 。libusb_* libusb中的常量属性 HYPERLINK \l usbsetdebuglevellevel--int setdebuglevel ( 级别:int ) 设置libusb调试级别( 0和 4之间) HYPERLINK \l device 设备 表示USB设备。 HYPERLINK \l busnumber 。busnumber 整数USB设备号 HYPERLINK \l deviceaddress 。deviceaddress 整数USB设备地址 HYPERLINK \l portnumbers 。portnumbers 包含USB设备端口号的array,如果在这里平台上不支持,则为 undefined 。 HYPERLINK \l devicedescriptor 。DeviceDescriptor 具有设备描述符字段的属性的对象: bLength bDescriptorType bcdUSB bDeviceClass bDeviceSubClass bDeviceProtocol bMaxPacketSize0 idVendor idProduct bcdDevice iManufacturer iProduct iSerialNumber bNumConfigurations HYPERLINK \l configdescriptor 。configdescriptor 具有配置描述符字段的属性的对象: bLength bDescriptorType wTotalLength bNumInterfaces bConfigurationValue iConfiguration bmAttributes bMaxPower 额外的( 包含任何额外数据或者附加描述符的缓冲区) HYPERLINK \l allconfigdescriptors 。allconfigdescriptors Contains all config descriptors of the device (same structure as. configDescriptor above) HYPERLINK \l parent 。父对象 Contains the parent of the device, such as a hub. If there is no parent this property is set to `null`. HYPERLINK

文档评论(0)

xiaozu + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档