Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rieonke/cordova-plugin-laser-scanner

Cordova Laser Scanner for Speedata Industrial PDA devices
https://github.com/rieonke/cordova-plugin-laser-scanner

Last synced: 2 months ago
JSON representation

Cordova Laser Scanner for Speedata Industrial PDA devices

Awesome Lists containing this project

README

        

# cordova-plugin-laser-scanner
Cordova Laser Scanner for Speedata Industrial PDA devices

思必拓(Speedata)手持终端激光扫描器的Cordova接口

# Install 安装

```javascript

cordova plugin add cordova-plugin-laser-scanner

```

# Usages 用途

### 1.Call scan 调用扫描头扫描

```javascript
LaserScanner.scan();
// then the device will blink and read the barcode
// 此时设备会发出激光开始扫描二维码

```

### 2.Receive scan result from device 从设备获取扫描结果

```javascript

// when the barcode is decoded and result is returned by device
// both a window and document `barcodeReceived` event will be fired
// register a listener and you can get the data form `LaserScanner.result`

// 当二维码被解码完毕并且返回时
// 会触发 window 和 document 的 `barcodeReceived` 事件
// 监听这个事件并从`LaserScanner.result`中获取结果数据

window.addEventListener("barcodeReceived",function(){ //also document.addEventListener.....
var result = LaserScanner.result;
console.log("the result of this barcode is + " result);
},false)

```

# Demo Guide 示例使用

```shell

cd demo

# will automatically install the plugins (based on config.xml)
# 将会根据config.xml自动安装
cordova platform add android

# build android application
# 编译打包apk文件
cordova build android

```

# License

MIT