escl-sdk-ts-test
v1.0.0
Published
escl sdk by ts
Downloads
1
Readme
escl-sdk-ts
introduce
A Typescript implementation of the eScl protocol
The eSCL specification defines the interfaces, data types and overall behavioral model for driving a scanner engine from various classes of clients: Software, Cloud Services, Mobile Device, Embedded Web Server , this SDK is Mopria eSCL Specification
quick start
init a new Scanner
const { Scanner } = require('../index')
const ip = '192.168.0.134'
const port = '8080'
const scanner = new Scanner({ ip, port })
get scanner capabilities
scanner.ScannerCapabilities().then(res => {
console.log('scanner ScannerCapabilities', res)
}).catch(err => {
console.log('scanner ScannerCapabilities err', err)
})
send a scaner state
scanner.ScannerStatus().then(res => {
console.log('scanner ScannerStatus', res)
}).catch(err => {
console.log('scanner ScannerStatus err', err)
})
send a scan job
scanner.ScanJobs(scanOptions).then(res => {
console.log('scanner ScanJobs', res)
}).catch(err => {
console.log('scanner ScanJobs err', err)
})
send a scan job document
scanner.NextDocument().then(res => {
console.log('scanner NextDocument', res)
}).catch(err => {
console.log('scanner NextDocument err', err)
})