update close dev
This commit is contained in:
parent
49037058b4
commit
1df34c0946
@ -74,8 +74,14 @@ function printString(str){
|
|||||||
printer.cut(true, 8)
|
printer.cut(true, 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
process.on('SIGINT', ()=>{
|
process.on('SIGINT', async ()=>{
|
||||||
device.close()
|
await new Promise((resolve, reject) => {
|
||||||
|
device.close(()=>{
|
||||||
|
console.log('serial device close')
|
||||||
|
resolve(null)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
process.exit(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports = DataCharacteristic
|
module.exports = DataCharacteristic
|
||||||
|
Loading…
Reference in New Issue
Block a user