openUSB

2022-06-27 10:24 更新

獲取USB設(shè)備信息

openUSB(callback(ret, err))

callback(ret)

ret:

  • 類型:JSON對象
  • 內(nèi)部字段:status 布爾型
  • 內(nèi)部字段:deviceinfo JSON對象

{
    "deviceInfo": {
        "0": {
            "0": "Bus=0001 Vendor=80ee Product=cafe Version=0500 ",
            "1": "Name=\"VirtualBox mouse integration\" ",
            "2": "Phys= ",
            "3": "Sysfs=/devices/pci0000:00/0000:00:04.0/input/input3 ",
            "4": "Uniq= ",
            "5": "Handlers=event3 ",
            "6": "PROP=0 ",
            "7": "EV=b ",
            "8": "KEY=10000 0 0 0 0 0 0 0 0 ",
            "9": "ABS=3 ",
            "10": " "
        },
        "1": {
            "0": "Bus=0000 Vendor=dbdb Product=0002 Version=0001 ",
            "1": "Name=\"gpio\" ",
            "2": "Phys= ",
            "3": "Sysfs=/devices/virtual/input/input6 ",
            "4": "Uniq= ",
            "5": "Handlers=kbd event6 ",
            "6": "PROP=0 ",
            "7": "EV=23 ",
            "8": "KEY=c0000 0 0 0 ",
            "9": "SW=1 ",
            "10": " "
        }
    }
}

示例代碼

var demo = api.require('sunmiT1Printer');
demo.openUSB(function(ret, err) {
    alert(JSON.stringify(ret));
});

可用性

Android系統(tǒng)

可提供的1.0.0及更高版本

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號