Merge branch 'master' of https://git.trj.tw/mtfos/ble-server
This commit is contained in:
commit
49037058b4
@ -1,8 +1,8 @@
|
|||||||
const bleno = require('bleno')
|
const bleno = require('bleno')
|
||||||
const config = require('./config.json')
|
const config = require('./config.json')
|
||||||
const escpos = require('escpos')
|
const escpos = require('escpos')
|
||||||
const device = escpos.Serial(config.printer.serial)
|
const device = new escpos.Serial(config.printer.serial)
|
||||||
const printer = escpos.Printer(device)
|
const printer = new escpos.Printer(device)
|
||||||
let isOpen = false
|
let isOpen = false
|
||||||
|
|
||||||
device.open(()=>{
|
device.open(()=>{
|
||||||
@ -74,4 +74,8 @@ function printString(str){
|
|||||||
printer.cut(true, 8)
|
printer.cut(true, 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
process.on('SIGINT', ()=>{
|
||||||
|
device.close()
|
||||||
|
})
|
||||||
|
|
||||||
module.exports = DataCharacteristic
|
module.exports = DataCharacteristic
|
||||||
|
Loading…
Reference in New Issue
Block a user